simgamdata | R Documentation |
Simulation of a data set that can be used to illustrate the
amlps
or gamlps
routines to fit
(generalized) additive models with the Laplace-P-spline methodology.
simgamdata(setting = 1, n, dist = "gaussian", scale = 0.5, info = TRUE)
setting |
The simulation setting. The default is |
n |
The sample size to simulate. |
dist |
A character string to specify the response distribution. The
default is |
scale |
Used to tune the noise level for Gaussian and Poisson distributions. |
info |
Should information regarding the simulation be printed? Default is true. |
The simulation settings contain two covariates in the linear part of the predictor, namely z1 ~ Bern(0.5) and z2 ~ N(0,1). The smooth additive terms are inspired from Antoniadis et al. (2012). For Binomial data, the number of trials is fixed to 15.
An object of class simgam. Plot of a simgam object yields a scatter plot of the generated response values.
data |
A data frame. |
f |
The true smooth functions. |
betas |
The regression coefficients of the linear part. The first term is the intercept. |
dist |
The distribution of the response. |
Oswaldo Gressani oswaldo_gressani@hotmail.fr.
Antoniadis, A., Gijbels, I., and Verhasselt, A. (2012). Variable selection in additive models using P-splines. Technometrics 54(4): 425-438.
set.seed(10) sim <- simgamdata(n = 150, dist = "poisson", scale = 0.3) plot(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.