Clear Filters
Clear Filters

Determine confidence band csaps

1 view (last 30 days)
jakob ekwall
jakob ekwall on 4 Feb 2016
Edited: jakob ekwall on 4 Feb 2016
Hi!
I've found an answer to problem which is similar to mine on crossvalidated (Link http://goo.gl/NSGLs5). However the solution to the problem is written for R and I'm trying to translate it to Matlab but I've run in to some trouble.
What I've done is to fit a curve to my data using csaps and now I'm trying to determine the confidence band for this fit. The following code is the thing I'm trying to replicate in Matlab. However I'm not sure how to get a hold of the leverage values (lev) which is provided when one fits the curve using R.
res <- (sp$yin - sp$y)/(1-sp$lev) # Get jacknife residual at each data point
sigma <- sqrt(var(res)) # Calculate stddev of jackknife residuals
upper <- sp$y + 5.0*sigma*sqrt(sp$lev) # Create confidence bands
lower <- sp$y - 5.0*sigma*sqrt(sp$lev)
csaps in Matlab and the smooth.spline function in R doesn't seem to work in exactly the same way. Is there another way to replicate the code above in Matlab?
(Link to documentation on R smoothing function http://goo.gl/JiyQS2) Thanks!

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!