penaltyplot | R Documentation |
The routine gives a graphical representation of the univariate approximate posterior distribution of the (log-)penalty parameters for objects of class coxlps, curelps, amlps and gamlps.
penaltyplot(object, dimension, ...)
object |
An object of class |
dimension |
For objects of class |
... |
Further arguments to be passed to the routine. |
When q, the number of smooth term in a (generalized) additive model is smaller than five, the exploration of the posterior penalty space is based on a grid strategy. In particular, the multivariate grid of dimension q is constructed by taking the Cartesian product of univariate grids in each dimension j = 1,...q. These univariate grids are obtained from a skew-normal fit to the conditional posterior p(vj|vmap[-j]),D), where vj is the (log-)penalty value associated to the jth smooth function and vmap[-j] is the posterior maximum of the (log-)penalty vector omitting the jth dimension. The routine displays the latter skew-normal distributions. When q>=5, inference is based on vmap and the grid is omitted to avoid computational overflow. In that case, the posterior distribution of the (log-)posterior penalty vector v is approximated by a multivariate Gaussian and the routine shows the marginal distributions.
Oswaldo Gressani oswaldo_gressani@hotmail.fr.
### Classic simulated data example (with simgamdata) set.seed(123) sim.data <- simgamdata(setting = 2, n = 250, dist = "gaussian", scale = 0.25) plot(sim.data) # Scatter plot of response data <- sim.data$data # Simulated data frame # Fit model fit <- amlps(y ~ z1 + z2 + sm(x1) + sm(x2), data = data, K = 15) fit # Penalty plot opar <- par(no.readonly = TRUE) par(mfrow = c(1, 2)) penaltyplot(fit, dimension = c(1, 2)) par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.