inv_func {lazy.stat}R Documentation

Inverse Functioin of y=f(x)

Description

Inverse Functioin of y=f(x)

Usage

inv_func(y, xy, method = "linear", plot = 0)

Arguments

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

Details

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].

Value

x The value at y

Examples

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)))


[Package lazy.stat version 0.1.4 Index]