similar to: Seasonal smoothing of data with large gaps (mgcv)

Displaying 20 results from an estimated 4000 matches similar to: "Seasonal smoothing of data with large gaps (mgcv)"

2013 Aug 23
1
Setting up 3D tensor product interactions in mgcv
Hi, I am trying to fit a smoothing model where there are three dimensions over which I can smooth (x,y,z). I expect interactions between some, or all, of these terms, and so I have set up my model as mdl <- gam(PA ~ s(x) + s(y) + s(z) + te(x,y) + te(x,z) + te(y,z) + te(x,y,z),...) I have recently read about the ti(), "tensor product interaction smoother", which takes care of these
2018 May 24
0
Problem with adding a raster and a brick
On Thu, 24 May 2018 at 18:41 Mark R Payne <markpayneatwork at gmail.com> wrote: Hi, I seem to be having a problem adding the following two raster objects together - one is a rasterLayer, the other is a rasterBrick. The extent, resolution, and origin are the same, so according to my understand it should work. The objects look like so: > obs.clim class : RasterLayer dimensions : 60, 200,
2018 May 24
2
Problem with adding a raster and a brick
Hi, I seem to be having a problem adding the following two raster objects together - one is a rasterLayer, the other is a rasterBrick. The extent, resolution, and origin are the same, so according to my understand it should work. The objects look like so: > obs.clim class : RasterLayer dimensions : 60, 200, 12000 (nrow, ncol, ncell) resolution : 0.5, 0.5 (x, y) extent : -70,
2018 Jun 01
0
Problem with adding a raster and a brick
This is now fixed in development on RForge, you can try it out by installing from there, or from the Github mirror with devtools::install_github("rforge/raster/pkg/raster"). (To get fixes into raster email the maintainer directly - you might not get a response but it'll be addressed). Cheers, Mike. On Thu, 24 May 2018 at 20:08 Michael Sumner <mdsumner at gmail.com> wrote:
2013 Apr 20
0
Calculate confidence intervals in mgcv for unconditional on the, smoothing parameters
Dear R-Help members, I am using Simon Wood`s mgcv package version1.7-22and R version 3.0.0 (2013-04-03) for fitting a GAM-Model to the LIDAR Data contained in the "SemiPar" package. Here is the code for fitting the model and for plotting the result: data("lidar") attach(lidar) ### # mgcv fitting ### gam_fit <- gam(logratio ~ s(range, k = 40, bs = "cr"), gamma
2012 Feb 23
1
mgcv: Smoothing matrix
Dear All, I would like to extract the smoothing matrix of the fitted GAM, \hat{y} = Sy. I can't seem to find the function or am I missing something? Thanks, any help is greatly appreciated Man Zhang [[alternative HTML version deleted]]
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
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
2003 Apr 07
1
filtering ts with arima
Hi, I have the following code from Splus that I'd like to migrate to R. So far, the only problem is the arima.filt function. This function allows me to filter an existing time-series through a previously estimated arima model, and obtain the residuals for further use. Here's the Splus code: # x is the estimation time series, new.infl is a timeseries that contains new information # a.mle
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
2018 Apr 18
0
mgcv::gamm error when combining random smooths and correlation/autoregressive term
I am having difficulty fitting a mgcv::gamm model that includes both a random smooth term (i.e. 'fs' smooth) and autoregressive errors. Standard smooth terms with a factor interaction using the 'by=' option work fine. Both on my actual data and a toy example (below) I am getting the same error so am inclined to wonder if this is either a bug or a model that gamm is simply unable
2010 May 19
1
Displaying smooth bases - mgcv package
Dear all, for demonstration purposes I want to display the basis functions used by a thin plate regression spline in a gamm model. I've been searching the help files, but I can't really figure out how to get the plots of the basis functions. Anybody an idea? Some toy code : require(mgcv) require(nlme) x1 <- 1:1000 x2 <- runif(1000,10,500) fx1 <- -4*sin(x1/50) fx2 <-
2013 Jul 19
0
mgcv: Impose monotonicity constraint on single or more smooth terms
Dear R help list, This is a long post so apologies in advance. I am estimating a model with the mgcv package, which has several covariates both linear and smooth terms. For 1 or 2 of these smooth terms, I "know" that the truth is monotonic and downward sloping. I am aware that a new package "scam" exists for this kind of thing, but I am in the unfortunate situation that I am
2008 Jun 09
0
Fwd: mgcv 1.4 on CRAN
mgcv 1.4 is now on CRAN. It includes new features to allow mgcv::gam to fit almost any (quadratically) penalized GLM, plus some extra smoother classes. New gam features ------------------------- * Linear functionals of smooths can be included in the gam linear predictor, allowing, e.g., functional generalized linear models/signal regression, smooths of interval data, etc. * The parametric
2008 Jun 09
0
Fwd: mgcv 1.4 on CRAN
mgcv 1.4 is now on CRAN. It includes new features to allow mgcv::gam to fit almost any (quadratically) penalized GLM, plus some extra smoother classes. New gam features ------------------------- * Linear functionals of smooths can be included in the gam linear predictor, allowing, e.g., functional generalized linear models/signal regression, smooths of interval data, etc. * The parametric
2005 Apr 13
0
GAMM in mgcv - significance of smooth terms
In the summary of the gam object produced by gamm, the "Approximate significance of smooth terms" appears to be a test of the improvement in fit over a linear model, rather than a test of the significance of the overall effect of x on y: test.gamm<-gamm(y~te(x, bs="cr"), random=list(grp=~1)) summary(test.gamm$gam) . . . Approximate significance of smooth terms:
2003 Nov 22
0
: how to plot smooth function estimate from gam (mgcv package) in other program
Hi all, I would like to export the smooth function estimate I got from gam to plot it in another graphics software. In S-plus I use the function preplot() for that, but it seems not to work in R. Has somebody an idea how to solve that? Thanks Stephanie ******************************** Stephanie von Klot Institut f?r Epidemiologie GSF - Forschungszentrum f?r Umwelt und Gesundheit Ingolst?dter
2013 Mar 21
1
[mgcv][gam] Odd error: Error in PredictMat(object$smooth[[k]], data) : , `by' variable must be same dimension as smooth arguments
Dear List, I'm getting an error in mgcv, and I can't figure out where it comes from. The setup is the following: I've got a fitted GAM object called "MI", and a vector of "prediction data" (with default values for predictors). I feed this into predict.gam(object, newdata = whatever) via the following function: makepred = function(varstochange,val){ for
2018 Jan 17
1
mgcv::gam is it possible to have a 'simple' product of 1-d smooths?
I am trying to test out several mgcv::gam models in a scalar-on-function regression analysis. The following is the 'hierarchy' of models I would like to test: (1) Y_i = a + integral[ X_i(t)*Beta(t) dt ] (2) Y_i = a + integral[ F{X_i(t)}*Beta(t) dt ] (3) Y_i = a + integral[ F{X_i(t),t} dt ] equivalents for discrete data might be: 1) Y_i = a + sum_t[ L_t * X_it * Beta_t ] (2) Y_i
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)