similar to: Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)

Displaying 20 results from an estimated 8000 matches similar to: "Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)"

2003 Jan 09
2
GAM with Thin plate splines
Hello, I'm a student at the University of Klagenfurt / Austria and I need some help ! I have to predict 24 daily load-values. Therefor I got a dataset with following colums: 24 past daily load-values 6 past daily temperature-values My goal is to find a model (GAM with thin plate splines) in R. I found the function "gam" in the R-library "mgcv", but it just fits
2005 Nov 23
1
1st derivative {mgcv} gam smooth
Dear R-hep, I'm trying to get the first derivative of a smooth from a gam model like: model<-gam(y~s(x,bs="cr", k=5)+z) and need the derivative: ds(x)/dx. Since coef(model) give me all the parameters, including the parameters of the basis, I just need the 1st derivative of the basis s(x).1, s(x).2, s(x).3, s(x).4. If the basis were generated with the function
2009 Feb 07
1
paraPen in gam [mgcv 1.4-1.1] and centering constraints
Dear Mr. Simon Wood, dear list members, I am trying to fit a similar model with gam from mgcv compared to what I did with BayesX, and have discovered the relatively new possibility of incorporating user-defined matrices for quadratic penalties on parametric terms using the "paraPen" argument. This was really a very good idea! However, I would like to constraint the coefficients
2011 Mar 14
1
Help- Fitting a Thin Plate Spline
Hi Everyone, I'm a pretty useless r-er but have data that SPSS etc doesn't like. I've managed to do GLMs for my data, but now need to fit a thin plate spline for my data (arcsine.success~date.num:clutch.size) If anyone has a bit of spare time and could come up with a bit of code I'd be very grateful- I just don't get R language! Thanks Rach -- View this message in context:
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
2010 Jun 11
1
Documentation of B-spline function
Goodmorning, This is a documentation related question about the B-spline function in R. In the help file it is stated that: "df degrees of freedom; one can specify df rather than knots; bs() then chooses df-degree-1 knots at suitable quantiles of x (which will ignore missing values)." So if one were to specify a spline with 6 degrees of freedom (and no intercept) then a basis
2006 Dec 15
1
DF for GAM function (mgcv package)
For summary(GAM) in the mgcv package smooth the degrees of freedom for the F value for test of smooth terms are the rank of covariance matrix of \hat{beta} and the residuals df. I've noticed that in a lot of GAMs I've fit the rank of the covariance turns out to be 9. In Simon Wood's book, the rank of covariance matrix is usually either 9 or 99 (pages 239-230 and 259). Can anyone
2007 Jun 22
1
two basic question regarding model selection in GAM
Qusetion #1 ********* Model selection in GAM can be done by using: 1. step.gam {gam} : A directional stepwise search 2. gam {mgcv} : Smoothness estimation using GCV or UBRE/AIC criterion Suppose my model starts with a additive model (linear part + spline part). Using gam() {mgcv} i got estimated degrees of freedom(edf) for the smoothing splines. Now I want to use the functional form of my model
2013 Apr 17
1
mgcv: how select significant predictor vars when using gam(...select=TRUE) using automatic optimization
I have 11 possible predictor variables and use them to model quite a few target variables. In search for a consistent manner and possibly non-manual manner to identify the significant predictor vars out of the eleven I thought the option "select=T" might do. Example: (here only 4 pedictors) first is vanilla with "select=F" >
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
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.
2012 May 08
2
mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?
Dear useRs, I am using mgcv version 1.7-16. When I create a model with a few non-linear terms and a random intercept for (in my case) country using s(Country,bs="re"), the representative line in my model (i.e. approximate significance of smooth terms) for the random intercept reads: edf Ref.df F p-value s(Country) 36.127 58.551 0.644
2010 Oct 27
1
GAM function in mgcv package
Hi R-users I am trying to use the GAM function of the mgcv package. But I am having problem trying to specify the k parameter. Although I managed to run some models by giving to the parameter some (random) value, and it is explained by Wood (2006) that it does not seem to "really" affect the final result, I would like to grasp better its meaning. I understand that is the
2013 Jun 16
1
trying to fit a thin plate spline to a triangular plot
Hi Has anyone tried to fit a thin plate spine to a triangular plot before? I'm having trouble working out a piece of code to make it possible with three axes. I have done it before with two axes. I've found a package I prefer that makes triangular plots (plotrix) using the triax.plot() function. An example of some data and the plot follows: graph.data<-data.frame(a=c(9,6.2,
2011 Dec 03
1
problems using the thin plate spline method
Dear R users, I am a beginner in R trying to apply the thin plate spline method to my climate data. I used the example in R to do so, and the lines seem to run fine ( I am not getting errors) but I am not getting any output in the form of graph or anything. I got a warning message saying that 'surface extends beyond box'. Any help is much appreciated. thanks minti
2005 Oct 05
3
testing non-linear component in mgcv:gam
Hi, I need further help with my GAMs. Most models I test are very obviously non-linear. Yet, to be on the safe side, I report the significance of the smooth (default output of mgcv's summary.gam) and confirm it deviates significantly from linearity. I do the latter by fitting a second model where the same predictor is entered without the s(), and then use anova.gam to compare the
2008 May 06
1
mgcv::gam shrinkage of smooths
In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be useful to shrink a single smooth by adding S=S+epsilon*I to the penalty matrix S. The context was the need to be able to shrink the term to zero if appropriate. I'd like to do this in order to shrink the coefficients towards zero (irrespective of the penalty for "wiggliness") - but not necessarily all the
2012 Oct 27
0
[gam] [mgcv] Question in integrating a eiker-white "sandwich" VCV estimator into GAM
Dear List, I'm just teaching myself semi-parametric techniques. Apologies in advance for the long post. I've got observational data and a longitudinal, semi-parametric model that I want to fit in GAM (or potentially something equivalent), and I'm not sure how to do it. I'm posting this to ask whether it is possible to do what I want to do using "canned" commands
2011 Apr 11
0
Question about GAM (mgcv)
Dear list, i'm using the GAM function from mgcv package. I'm using this syntax: model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x3)+s(x4)+s(5),family=quasipoisson,data=data) and I'm sequentially dropping the single term with the highest non-significant p-value from the model and re-fitting until all term are significant. Now I have: