Learn R Programming

catenary (version 1.1.2)

getFunctionEnvelopeCat: Function to return function envelope for catenary

Description

Use bootstrap to get bands of possible fits to data using catenary

Usage

getFunctionEnvelopeCat(data, R = 1000, initial, x)

Arguments

data

data frame with columns x and y

initial

vector of starting values (c1,c2,lambda)

Value

data frame with x, lwr and upr

Examples

Run this code
# NOT RUN {
x <- runif(100,-2,2)
y <- f(x=x,c1=1,c2=2,lambda=3) + rnorm(100)
df <- data.frame(x=x,y=y)
plot(y~x,data=df,pch=16,cex=0.5)
bounds <- getFunctionEnvelopeCat(data=df,initial=c(1,2,3),x=seq(-2,2,l=100))
lines(bounds$x,bounds$lwr)
lines(bounds$x,bounds$upr)
# }

Run the code above in your browser using DataLab