I want to find the coordinates of the tangent point between a convex curve and a line that passes from a point with known coordinates (0,b)
("efficient portfolio" in finance). My problem is that the curve formula ("efficient frontier") is not known, hence it can only be inferred from a set of pre-calculated points. Important points.
1) I am only interested in the upper part of the curve starting from the left-most point.
2) The tangent point is unique.
3) Quadratic Fit
did not work (please see below) since it failed at the more convex part on the left (the curve may appear flat).
The output should ideally be a set of coordinates (x,y) or a set of rules.
I provide a dataset for the curve in a DropBox link here...
...a plot of the quadratic Fit
curve in blue together with the plotted data in red ("efficient frontier") and a general drawing of the solution.
bill = Fit[data, {1, x, x^2}, x]
Show[ListLinePlot[data, PlotRange -> {{0, 0.1}, {0, 0.05}},
PlotStyle -> Red], Plot[bill, {x, 0, 0.1}]]
I know there are many similar topics, but all the ones I found refer to tangents where the equation is known. I include a toy code that produces a solution based on MarcoB's answer here for b=2
but I don't know how meaningful it is since the curve function is known.
y[x_] := a x + 2
f[x_] := 3 x^2 - 2 x + 5
sol = List@ToRules@Reduce[{y[x1] == f[x1], y'[x1] == f'[x1]}, {x1}]
Plot[{f[x], y[x] /. sol}, {x, -2, 2},
Epilog -> {PointSize[0.015], Point[{x1, f[x1]}] //. sol}]
{{a -> -8, x1 -> (2 + a)/6}, {a -> 4, x1 -> (2 + a)/6}}