Description Usage Arguments Value Author(s) Examples
This method can be used to simulate vectors of responses from a gamObject.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
object |
the output of a |
nsim |
the number of simulated vectors of responses. A positive integer. |
seed |
numeric; a random seed for the simulations. |
method |
the method used for the simulation. If set to "rd" then |
newdata |
Optional new data frame or list to be passed to predict.gam. |
u |
a matrix where each row is a vector of uniform random variables in (0, 1). This will be used to simulate responses only if |
w |
vector of prior weights to be used in the simulations. If |
offset |
numeric vector of offsets. For GAMs with multiple linear predictor (see eg gaulss) it must be a list of vectors. NB: if |
trans |
function used to transform or summarize each vector of simulated responses. It must take a vector as argument, but it can output a vector or a scalar. Potentially useful for saving storage (e.g. by transforming each simulated vector to a scalar). If left to |
... |
currently not used. |
A matrix where each column is a vector of simulated responses. The number of rows is equal to the number of responses in the fitted object.
based on mgcViz::simulate.gam by Matteo Fasiolo
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.