simulate.evgam | R Documentation |
evgam
objectSimulations from a fitted evgam
object
## S3 method for class 'evgam' simulate( object, nsim = 1000, seed = NULL, newdata, type = "link", probs = NULL, threshold = 0, marginal = TRUE, ... )
object |
a fitted |
nsim |
an integer giving the number of simulations |
seed |
an integer giving the seed for simulations |
newdata |
a data frame |
type |
a character string, as in |
probs |
a scalar or vector of probabilities for quantiles; defaults to NULL |
threshold |
a scalar, vector or matrix, which is added to each simulation if |
marginal |
a logical: should simulations integrate out smoothing parameter uncertainty? Defaults to TRUE |
... |
arguments to be passed to |
Simulations of parameters or quantiles
predict.evgam
data(fremantle) fmla_gev <- list(SeaLevel ~ s(Year, k=5, bs="cr"), ~ 1, ~ 1) m_gev <- evgam(fmla_gev, fremantle, family = "gev") # simulations of link GEV parameters for fremantle data simulate(m_gev, nsim=5) # simulations for Year 1989 y1989 <- data.frame(Year = 1989) # link GEV parameter simulations simulate(m_gev, nsim=5, newdata = y1989) # GEV parameter simulations simulate(m_gev, nsim=5, newdata = y1989, type = "response") # 10-year return level simulations simulate(m_gev, nsim=5, newdata = y1989, type= "quantile", prob = .9) # 10- and 100-year return level simulations simulate(m_gev, nsim=5, newdata = y1989, type= "quantile", prob = c(.9, .99))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.