similar to: Basis functions of cubic regression spline in mgcv

Displaying 20 results from an estimated 4000 matches similar to: "Basis functions of cubic regression spline in mgcv"

2013 Mar 11
1
Use pcls in "mgcv" package to achieve constrained cubic spline
Hello everyone,          Dr. wood told me that I can adapting his example to force cubic spline to pass through certain point.          I still have no idea how to achieve this. Suppose we want to force the cubic spline to pass (1,1), how can I achieve this by adapting the following code? # Penalized example: monotonic penalized regression spline ..... # Generate data from a monotonic truth.
2011 Aug 16
0
Cubic splines in package "mgcv"
re: Cubic splines in package "mgcv" I don't have access to Gu (2002) but clearly the function R(x,z) defined on p126 of Simon Wood's book is piecewise quartic, not piecewise cubic. Like Kunio Takezawa (below) I was puzzled by the word "cubic" on p126. As Simon Wood writes, this basis is not actually used by mgcv when specifying bs="cr". Maybe the point is
2007 Dec 26
1
Cubic splines in package "mgcv"
R-users E-mail: r-help@r-project.org My understanding is that package "mgcv" is based on "Generalized Additive Models: An Introduction with R (by Simon N. Wood)". On the page 126 of this book, eq(3.4) looks a quartic equation with respect to "x", not a cubic equation. I am wondering if all routines which uses cubic splines in mgcv are based on this quartic
2008 Apr 09
1
mgcv::predict.gam lpmatrix for prediction outside of R
This is in regards to the suggested use of type="lpmatrix" in the documentation for mgcv::predict.gam. Could one not get the same result more simply by using type="terms" and interpolating each term directly? What is the advantage of the lpmatrix approach for prediction outside R? Thanks. -- View this message in context:
2011 Oct 27
1
Fitting Maximums of data series with cubic spline
Hi Users, I want to fit the maximums of a data series with a cubic spline. How do I go about this in R. I failed to figure out how I can use the mgcv library to do this. Thanks ---------------------------- ZABLONE
2013 Mar 06
1
Constrained cubic smoothing spline
Hello everone,            Anyone who knows how to force a cubic smoothing spline to pass through a particular point?            I found on website  someone said that we can use "cobs package" to force the spline pass through certain points or impose shape           constraints (increasing, decreasing). However,  this package is using  B-spline and can only do linear and quadratic
2013 Nov 01
0
Impose constraint on first order derivative at a point for cubic smoothing spline
Hello,        Dr. Simon Wood told me how to force a cubic spline passing through a point. The code is as following. Anyone  who knows how I can change the code to force the first derivative to be certain value. For example, the first derivative of the constrained cubic spline equals 2 at point (0, 0.6).        I really appreciate your help!        Thanks!                 Best             Victor   
2011 Aug 06
1
How to estimate confidential intervals for the derivatives of cubic smoothing spline
Dear all, I want to use smooth.spline to construct a cubic smoothing spline and its first derivative to my data. However, the predict.smooth.spline does not seem to provide a SE for both the fitted values and their derivatives. How should I calculate it? Thank you very much, Bingzhang
2007 May 21
2
comparing fit of cubic spline
I want to compare the fit of a quadratic model to continuous data, with that of a cubic spline fit. Is there a way of computing AIC from for e.g. a GAM with a smoothing spine, and comparing this to AIC from a quadratic model? Cheers ****************************************** Tom Reed PhD Student Institute of Evolutionary Biology 102 Ashworth Laboratories Kings Buildings University of
2009 Mar 31
2
How to generate natural cubic spline in R?
Suppose I have two var x and y,now I want to fits a natural cubic spline in x to y,at the same time create new var containing the smoothed values of y. How can I get it?
2010 Jun 04
1
package mgcv inconsistency in help files? cyclic P-spline "cs" not cyclic?
Dear all, I'm a bit stunned by the behaviour of a gam model using cyclic P-spline smoothers. I cannot provide the data, as I have about 61.000 observations from a time series. I use the following model : testgam <- gam(NO~s(x)+s(y,bs="cs")+s(DD,bs="cs")+s(TT),data=Final) The problem lies with the cyclic smoother I use for seasonal trends. The variable Final$y is a
2012 May 23
1
mgcv: How to calculate a confidence interval of a ratio
Dear R-Users, Dr. Wood replied to a similar topic before where confidence intervals were for a ratio of two treatments ( https://stat.ethz.ch/pipermail/r-help/2011-June/282190.html). But my question is more complicated than that one. In my case, log(E(y)) = s(x) where y is a smooth function of x. What I want is the confidence interval of a ratio of log[(E(y2))/E(y1)] given two fixed x values of
2007 Jun 25
1
gam function in the mgcv library
I would like to fit a logistic regression using a smothing spline, where the spline is a piecewise cubic polynomial. Is the knots option used to define the subintervals for each piece of the cubic spline? If yes and there are k knots, then why does the coefficients field in the returned object from gam only list k coefficients? Shouldn't there be 4k -4 coefficients? Sincerely, Bill
2010 Apr 14
1
Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)
Hi, I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can select the order of the derivative penalty. For my particular problem the order of the penalty (parameter "m" inside the "s" terms of the formula argument) appears to have a larger effect on the AIC/deviance of the estimated model than the
2010 May 18
1
A problem in allocation of vector of size
Hi, r-users I happen to a problem in allocation of vector of size. When I run my R script, an error appears: Error: cannot allocate vector of size 450 Mb Could anyone happen to the same problem? Thank you for your help. Lee [[alternative HTML version deleted]]
2009 Oct 13
2
How to choose a proper smoothing spline in GAM of mgcv package?
Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. I used "cr" in one covariate, but it can only smooth w.r.t 1 covariate. Can anyone give me some suggestion about how to choose a proper smoothing spline
2006 Feb 27
3
how to use the basis matrix of "ns" in R? really confused by multi-dim spline filtering?
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,
2010 Apr 09
1
How to get the penalty matrix for natural cubic spline?
Hi, all I am trying to get the basis matrix and penalty matrix for natural cubic splines. In the "splines" package of R,"ns" can generate the B-spline basis matrix for a natural cubic spline. How can I get the basis matrix and penalty matrix for natural cubic spline. Thanks a lot! Lee [[alternative HTML version deleted]]
2012 Dec 01
3
cubic spline
Hallo, I'm facing a problem and I would really appreciate your support. I have to translate some Matalb code in R that I don't know very well but I would like to. I have to interpolate 5 point with a cubic spline function and then I expect my function returns the Y value as output a specific X value inside the evaluation range. Let's suppose that: 1- *X = [-10, -5, 0, 5, 10]* 2
2012 Feb 13
3
mgcv: increasing basis dimension
hi Using a ts or tprs basis, I expected gcv to decrease when increasing the basis dimension, as I thought this would minimise gcv over a larger subspace. But gcv increased. Here's an example. thanks for any comments. greg #simulate some data set.seed(0) x1<-runif(500) x2<-rnorm(500) x3<-rpois(500,3) d<-runif(500) linp<--1+x1+0.5*x2+0.3*exp(-2*d)*sin(10*d)*x3