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)An object of class simgam. Plot of a simgam object yields a scatter plot of the generated response values.
A data frame.
The true smooth functions.
The regression coefficients of the linear part. The first term is the intercept.
The distribution of the response.
The simulation setting. The default is setting = 1
for a setting with three smooth terms, while setting = 2 is another
setting with only two smooth terms. The coefficients of the linear part
of the predictor are also different in the two settings.
The sample size to simulate.
A character string to specify the response distribution. The
default is "gaussian". Other distributions can be "poisson",
"bernoulli" and "binomial".
Used to tune the noise level for Gaussian and Poisson distributions.
Should information regarding the simulation be printed? Default is true.
Oswaldo Gressani oswaldo_gressani@hotmail.fr.
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.
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)
Run the code above in your browser using DataLab