inv_func {lazy.stat} | R Documentation |
Inverse Functioin of y=f(x)
inv_func(y, xy, method = "linear", plot = 0)
y |
The value of y to which inv_f(y) is calculated. |
xy |
A matrix containing a table of x and y. |
method |
= "spline" | "linear" |
plot |
= 1 to plot the interpolation |
Function f must be monotonic.
If y < xy[1,2] then x=xy[1,1].
If y > xy[n,2] then x=xy[n,1].
x The value at y
x=c(0,seq(0.05,1, len=21)) y=x^2 xy=cbind(x,y) y=seq(0,1, 0.05) res=inv_func( y, xy, plot=3 ) dif=res-sqrt(y) Print(y,res, dif, max(abs(dif)))