An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060227/dbfe7957/attachment.pl
how to use the basis matrix of "ns" in R? really confused by multi-dim spline filtering?
3 messages · Michael, vito muggeo
Dear Micheal, > the output of the "ns" function in R is "basis matrix", but then Yes you are right, the output of the ns(x, df) is the basis matrix of a natural cubic spline with df degrees of freedom. See ?ns (in package splines) on how to specify df or knots or .. Fitting y~ns(x,df) yields a smooth curve given by a linear combination of the basis functions (the single colums of the basis matrix) by the estimated coefficients (returned by the fitted model). As far as I know, a tensor product is usually employed to multidimensional smoothing and the multidimensional basis is formed via the kronecker product of the marginal bases. Finally, last but not least: Probably you need some statistical backaground on spline fitting.. Please, read some statistical papers/books on such topic (for instance see references in packages splines, mgcv) best, vito
Michael wrote:
Hi all, Could anybody recommend some easy-to-understand and example based notes/tutorials on how to use cubic splines to do filtering on multi-dimension data? I am confused by the 1-dimensional case, and more confused by multi-dimensional case. I found all the books suddenly become very abstract when it comes to this subject. They don't provide examples in R or Splus at all. Specifically, I don't know how to provide data "x" to the "ns" function in R, and I don't understand what should be the output matrix, and how to use the output matrix to "filter" data? Books mention about basis matrix, design matrix, model matrix, data matrix, etc. I got lost. I presume the output of the "ns" function in R is "basis matrix", but then how do I use it? How to form tensor-product? I don't understand it at all. Please help me! Thank you very much! [[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
==================================== Vito M.R. Muggeo Dip.to Sc Statist e Matem `Vianelli' Universit?? di Palermo viale delle Scienze, edificio 13 90128 Palermo - ITALY tel: 091 6626240 fax: 091 485726/485612
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060227/256d2575/attachment.pl