Learn R Programming

catenary (version 1.1.2)

getFunctionEnvelopePara: Function to return function envelope for parabola

Description

Use boostrap to get bands of possible fits to data using quadratic

Usage

getFunctionEnvelopePara(data, R = 1000, x)

Arguments

data

data frame with columns x and y

Value

data frame with x, lwr and upr

Examples

Run this code
# NOT RUN {
x <- runif(100,0,10)
y <- x^2 + 2*x + 3 + rnorm(100,sd=20)
df <- data.frame(x=x,y=y)
plot(y~x,data=df,pch=16,cex=0.5)
bounds <- getFunctionEnvelopePara(data=df,x=seq(0,10,l=100))
lines(bounds$x,bounds$lwr)
lines(bounds$x,bounds$upr)
# }

Run the code above in your browser using DataLab