Determine confidence band csaps

2 Ansichten (letzte 30 Tage)
jakob ekwall
jakob ekwall am 4 Feb. 2016
Bearbeitet: jakob ekwall am 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!

Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by