powered by
Fit a smoothing spline to a matrix of responses, single x.
mspline(x, y, w, df = 5, lambda, thresh = 1e-04, …)
x variable (numeric vector).
response matrix.
optional weight vector, defaults to a vector of ones.
requested degrees of freedom, as in smooth.spline.
smooth.spline
can provide penalty instead of df.
convergence threshold for df inversion (to lambda).
holdall for other arguments.
A list is returned, with a number of components, only some of which are of interest. These are
The value of lambda used (in case df was supplied)
The df used (in case lambda was supplied)
A matrix like y of smoothed responses
y
Self influences (diagonal of smoother matrix)
This function is based on the ingredients of smooth.spline, and allows for simultaneous smoothing of multiple responses
# NOT RUN { x=rnorm(100) y=matrix(rnorm(100*10),100,10) fit=mspline(x,y,df=5) # }
Run the code above in your browser using DataLab