generalized-additive-models | A document | Machine Learning library
kandi X-RAY | generalized-additive-models Summary
kandi X-RAY | generalized-additive-models Summary
A document introducing generalized additive models.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of generalized-additive-models
generalized-additive-models Key Features
generalized-additive-models Examples and Code Snippets
Community Discussions
Trending Discussions on generalized-additive-models
QUESTION
I am now using the package mgcv
to build a GAMM in R, and my questions are:
- First, how can we know if the random effect is statistically significant or not?
- Second, how can we extract the random intercept values in the model?
- Third, what does the "offset" mean in
gamm
? I have checked the R help, but I am still confused about the "offset" term in the function? Thanks for any help.
The example is taken from the book Generalized additive models: an introduction with R
...ANSWER
Answered 2019-Jan-22 at 19:37Note that for this model it might make more sense to use a Tweedie response via family tw
with gam()
and bam()
, which can't be used with gamm()
. In fact, Simon Wood and Matteo Fasiolo fit these data with a location scale Tweedie GAM (wherein they model the mean, variance and power parameters of the Tweedie distribution each with a separate linear predictor [model]).
At @BenBolker's suggestion: I wouldn't even bother testing the random effect in this model specifically, and often I don't care if it is significant or not. It depends on the question or hypothesis I am working on. Often I want it in the model due to some clustering in the data that I want included in the model regardless of the significance.
However, I'm not convinced that the theory of the (Generalized) likelihood ratio test (GLRT) doesn't apply to the use of quasi-likelihood in this instance. Simon Wood presents derivations in Appendix A of the 2nd edition of his textbook on GAMS that show that the previously-derived results for maximum likelihood estimation (which include results for the GLRT) hold if we replace the log likelihood with the log quasi likelihood. This, at least Simon seems to be arguing, would suggest that the interpretation of the test I mention below and which is implemented in summary.gam()
for random effects, is as reliable as if it were based on a proper likelihood.
Unless I really needed to, I'd fit this model with gam()
or bam()
and then gamm4()
(the latter from the gamm4 package), before gamm()
, especially for non-Gaussian models, as the gamm()
function has to fit this model as a mixed effects model using penalised quasi likelihood, which is not necessarily the best way of estimating these models.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install generalized-additive-models
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page