similar to: Gam with mrf smoother (mgcv)

Displaying 20 results from an estimated 800 matches similar to: "Gam with mrf smoother (mgcv)"

2018 Jan 27
0
GAM: mismatch between nb/polys supplied area names and data area names
Hello, I am new to R and running R version 3.4.3 (2017-11-30), x86_64-apple-darwin15.6.0 (64-bit), macOS High Sierra 10.13.2. I am running the gam package to model disease incidence (negative binomial distribution) as a function of two covariates, and wish to incorporate spatial correlation among areal neighbors, n = 50 polygons, identified by "id". For data observed over discrete
2017 Jul 11
0
Multivariate random forests in R - how to obtain variance explained for multiple responses in randomForestSRC package - or other package
Hello, I am wanting to use MRF to do multivariate regression. We are testing whether acoustic indices can predict structure (relative abundances) of vocalising avian community in UK and Ecuador. There are 26 acoustic indices, 65 UK species and 95 Ecuadorian species. I want to build a model for each ecozone (UK/ EC) using all species (relative abundance) as response matrix, and acoustic indices as
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
2005 Apr 21
1
.Fortran() again
Hi, First ,please excuse my poor English. Can someone help me on reading fortran binary object under R? I was trying to read mm5 data under R. However, I seem to stuck at reading fortran binary file storing met. data array. At the beginning, I used readBin() to read mm5 output directly with the following command. #mmout is a mmout file generated with mm5
2010 Jul 27
0
gam (package gam) - diagonal of smoother matrix
Dear R-list members, Once a gam (package gam) model has been fitted with family=poisson, is there some R function that could extract the diagonal elements of the smoother matrix S, to be used in a cross-validation for the selection of the best smoothing parameter, following equation 3.19 on page 48 of the book T.J. Hastie and R.J. Tibshirani, Generalized Additive Models, Chapman and Hall/CRC,
2010 Dec 03
1
mgcv package plot superimposing smoothers
Dear R help list, I'm fitting a 'variable coefficient model' in the MGCV package and I want to plot the different smoothers I get for each factor level in one graph. So, I do something like this to fit the gam: Mtest <- gam(outcome ~ s(age, by=as.numeric(gender==0)) + s(age,by=as.numeric(gender==1))+factor(Gender)) Then I can plot the smoother for gender=0: plot(Mtest,select=1)
2011 Mar 07
0
Conflict between gam::gam and mgcv::gam
I am trying to compare and contrast the smoothing in the {mgcv} version of gam vs. the {gam} version of gam but I get a strange side effects when I try to alternate calls to these routines, even though I detach and unload namespaces. Specifically when I start up R the following code runs successfully until the last line i.e. plot(g4,se=TRUE) when I get "Error in dim(data) <- dim :
2008 Jun 11
1
mgcv::gam error message for predict.gam
Sometimes, for specific models, I get this error from predict.gam in library mgcv: Error in complete.cases(object) : negative length vectors are not allowed Here's an example: model.calibrate <- gam(meansalesw ~ s(tscore,bs="cs",k=4), data=toplot, weights=weight, gam.method="perf.magic") > test <- predict(model.calibrate,newdata) Error in
2008 Aug 19
0
gam.check in gam (mgcv)
Hallo I need some help with the output provided by gam.check after a gam fit (using the package mgcv). To give a brief description of my data, I have claims: a vector of values, which include NA's and one large negative value - otherwise all positive (55 values in total that are not NA). origin: a factor with 10 levels j : taking the values 1, 2, ...., 10 I have fitted a gam, with: >
2001 Dec 26
1
ESS 5.1.19 w/Xemacs 21.4.6
Probably wrong group for this, but a quick question. I've just switched from emacs to Xemacs. In reinstalling ESS 5.1.19 I keep getting the following error when loading Xemacs: "Error in init file: Symbol's function definition is void: w32-using-nt" I've debugged the ess-site.el file, which is where the error originates from. The line causing the difficulty is:
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
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:
2008 Apr 06
0
mgcv::gam prediction using lpmatrix
The documentation for predict.gam in library mgcv gives an example of using an "lpmatrix" to do approximate prediction via interpolation. However, the code is specific to the example wrt the number of smooth terms, df's for each,etc. (which is entirely appropriate for an example) Has anyone generalized this to directly generate code from a gam object (eg SAS or C code)? I wanted to
2012 Jan 16
0
choosing a proper knot in GAM mgcv package
hi I want to choose proper knot for the following formula formula = y~ s(x1) + s(x2) + s(x3) + s(x4) + s(x5) + s(x6) +s(x7) + s(x8) gam(fromula,data=dat) if i run the error is Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : A term has fewer unique covariate combinations than specified maximum degrees of freedom how to find k and rectify this error ----- Thanks in
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
2007 Oct 24
1
GAM vs. MGCV packages
Hi all, I am a new R- user and I am going through the R-manuals, but I could not find an answer for my question. I am confused about when to use the GAM package and when to use the MGCV package?? My Model is a GAM model of continuous outcome and many non-linear continuous predictors (using the "s" function) as well as categorical predictors. Thanks in advance for your help and
2008 Jul 26
0
gam() of package "mgcv" and anova()
R-users E-mail: r-help@r-project.org Hi! R-users. A simple object as below was created to see how gam() of package "mgcv" and anova() work. function() { library(mgcv) set.seed(12) nd <- 100 xx1 <- runif(nd, min=1, max=10) xx1 <- sort(xx1) yy <- sin(xx1)+rnorm(nd, mean=5, sd=5) data1 <- data.frame(x1=xx1, y=yy) fit1 <- gam(y~s(x1, k=5),
2011 Jun 09
0
Fwd: Re: residual checking for GAM (mgcv)
The plots look reasonable to me. The plot of residuals against linear predictor always looks scary when many of the fitted values are very close to zero, so I tend to look at residuals against sqrt(fitted) in such cases. I don't think that the presence of the zero curve is a reason to reject the model --- it's easy to produce such plots by fitting a completely correct model to simulated
2010 Apr 13
0
Help in gam() in MGCV
Hello, We have a question about how to retrieve the nonparametric curve in gam() function. Now, we get the estimates and draw the fitted curve using the following code. You can see that our fitted curve is parallel to the output from gam() function but differs by a constant shift. However, the magnitude of the shift is not the intercept term. Also, gam's estimate appears more close to the
2008 Aug 21
0
endogenous variables in gam (mgcv)
Hello, I have a question. Suppose that I have a function to estimate with gam (in the mgcv package), y=s(x1)+s(x2)+XB where X is a vector of exogenous variables and x1 and x2 are explanatory variables assumed parametric linear functions of X and other exogenous variables Z. Is there a way to evaluate this equation with gam, allowing for endogeneity? If not, is there another