similar to: Prediction interval with GAM?

Displaying 20 results from an estimated 6000 matches similar to: "Prediction interval with GAM?"

2012 Jul 30
2
mgcv 1.7-19, vis.gam(): "invalid 'z' limits'
Hi everyone, I ran a binomial GAM consisting of a tensor product of two continuous variables, a continuous parametric term and crossed random intercepts on a data set with 13,042 rows. When trying to plot the tensor product with vis.gam(), I get the following error message: Error in persp.default(m1, m2, z, col = col, zlim = c(min.z, max.z), xlab = view[1], : invalid 'z' limits In
2011 Feb 16
1
retrieving partial residuals of gam fit (mgcv)
Dear list, does anybody know whether there is a way to easily retrieve the so called "partial residuals" of a gam fit with package mgcv? The partial residuals are the residuals you would get if you would "leave out" a particular predictor and are the dots in the plots created by plot(gam.object,residuals=TRUE) residuals.gam() gives me whole model residuals and
2012 Sep 11
1
plotting smoother function on raw data
Hi, I have used the mgcv library to generate a simple additive model. I want to know how to plot the function on the raw data with confidence intervals whan I have TWO variables in the model. I get it to work with one variable but not with two. I am on the limit for what I understand in R, so be gentle. I have read the help file on predict.gam, but did not get any help out of it. #My model:
2009 Feb 25
1
monotonic GAM with more than one term
Hi, Does anyone know how to fit a GAM where one or more smooth terms are constrained to be monotonic, in the presence of "by" variables or other terms? I looked at the example in ?pcls but so far have not been able to adapt it to the case where there is more than one predictor. For example, require(mgcv) set.seed(0) n<-100 # Generate data from a monotonic truth.
2006 Mar 15
3
GAM using R tutorials?
Hi all, I am trying to use GAM to work on some data... Are there any resources providing hands-on tutorial/guide on how to do GAM on data in R? Specifically, I am not sure about which model to choose, and smooth models with which effective degree-of-freedom shall I use... I knew there is a book titled: GAM: an introduction using R. Unfornately our local library does not have it... so that's
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.
2005 Mar 24
1
Prediction using GAM
Recently I was using GAM and couldn't help noticing the following incoherence in prediction: > data(gam.data) > data(gam.newdata) > gam.object <- gam(y ~ s(x,6) + z, data=gam.data) > predict(gam.object)[1] 1 0.8017407 > predict(gam.object,data.frame(x=gam.data$x[1],z=gam.data$z[1])) 1 0.1668452 I would expect that using two types of predict arguments
2007 Sep 10
1
MLE Function
I am just trying to teach myself how to use the mle function in R because it is much better than what is provided in MATLAB. I am following tutorial material from the internet, however, it gives the following errors, does anybody know what is happening to cause such errors, or does anybody know any better tutorial material on this particular subject. >
2007 Aug 08
1
prediction using gam
I am fitting a two dimensional smoother in gam, say junk = gam(y~s(x1,x2)), to a response variable y that is always positive and pretty well behaved, both x1 and x2 are contained within [0,1]. I then create a new dataset for prediction with values of (x1,x2) within the range of the original data. predict(junk,newdata,type="response") My predicted values are a bit strange
2005 Feb 27
1
prediction, gam, mgcv
I fitted a GAM model with Poisson distribution using the function gam() in the mgcv package. My model is of the form: mod<-gam(y~s(x0)+s(x1)+s(x2),family=poisson). To extract estimates at a specified set of covariate values I used the gam `predict' method. But I want to get estimate and standard error of the difference of two fitted values. Can someone explain what should I do? Thank
2011 Jun 28
2
gam confidence interval (package mgcv)
Dear R-helpers, I am trying to construct a confidence interval on a prediction of a gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant but I am not able to apply that to this, different, problem. Any help is appreciated! Basically I have a function Y = f(X) for two different treatments A and B. I am interested in the treatment ratios : Y(treatment = B) / Y(treatment = A) as
2008 Nov 14
1
negative prediction by gam (mgcv package)
Hi Gam in mgcv package is predicting negative values which should not be the case despite all the predictors and response variables are positive. Tried to use log link function but it did not help. Please help sunil -- View this message in context: http://www.nabble.com/negative-prediction-by-gam-%28mgcv-package%29-tp20494965p20494965.html Sent from the R help mailing list archive at
2009 Sep 03
3
goodness of "prediction" using a model (lm, glm, gam, brt, regression tree .... )
Dear R-friends, How do you test the goodness of prediction of a model, when you predict on a set of data DIFFERENT from the training set? I explain myself: you train your model M (e.g. glm,gam,regression tree, brt) on a set of data A with a response variable Y. You then predict the value of that same response variable Y on a different set of data B (e.g. predict.glm, predict.gam and so on).
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:
2004 Dec 22
2
GAM: Getting standard errors from the parametric terms in a GAM model
I am new to R. I'm using the function GAM and wanted to get standard errors and p-values for the parametric terms (I fitted a semi-parametric models). Using the function anova() on the object from GAM, I only get p-values for the nonparametric terms. Does anyone know if and how to get standard errors for the parametric terms? Thanks. Jean G. Orelien
2008 Nov 19
1
F-Tests in generalized linear mixed models (GLMM)
Hi! I would like to perform an F-Test over more than one variable within a generalized mixed model with Gamma-distribution and log-link function. For this purpose, I use the package mgcv. Similar tests may be done using the function "anova", as for example in the case of a normal distributed response. However, if I do so, the error message "error in eval(expr, envir, enclos) :
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
2008 Aug 03
1
output components of GAM
I would like to request help with the following: I am trying to use a Generalized Additive Model (gam) to examine the density distribution of fish as a function of latitude and longitude as continuous variables, and year as a categorical variable. The model is written as:   gam.out   <-  gam(Density ~ s(Lat) + s(Lon) + as.factor(Year))   The fitted model prediction of the link function is
2007 Oct 05
2
question about predict.gam
I'm fitting a Poisson gam model, say model<-gam(a65tm~as.factor(day.week )+as.factor(week)+offset(log(pop65))+s(time,k=10,bs="cr",fx=FALSE,by=NA,m=1),sp=c( 0.001),data=dati1,family=poisson) Currently I've difficulties in obtaining right predictions by using gam.predict function with MGCV package in R version 2.2.1 (see below my syntax).
2003 Sep 16
2
gam and concurvity
Hello, in the paper "Avoiding the effects of concurvity in GAM's .." of Figueiras et al. (2003) it is mentioned that in GLM collinearity is taken into account in the calc of se but not in GAM (-> results in confidence interval too narrow, p-value understated, GAM S-Plus version). I haven't found any references to GAM and concurvity or collinearity on the R page. And I