simulate.ppgam {ppgam}R Documentation

Simulations from a fitted ppgam object

Description

Simulations from a fitted ppgam object

Usage

## S3 method for class 'ppgam'
simulate(object, nsim = 1, seed = NULL, newdata, type = "link", ...)

Arguments

object

a fitted ppgam object

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 predict.ppgam

...

arguments to be passed to predict.ppgam

Value

Simulations of parameters

See Also

predict.ppgam

Examples


# Times of landfalling US hurricanes
data(USlandfall)

# convert dates to years, as a continuous variable
year <- as.integer(format(USlandfall$date, "%Y"))
day <- as.integer(format(USlandfall$date, "%j"))
USlandfall$year <- year + pmin(day / 365, 1)
hits <- subset(USlandfall, landfall == 1)

# this creates nodes in the default way
m1 <- ppgam( ~ s(year), hits)
simulate(m1)
simulate(m1, type = "response")
simulate(m1, newdata = data.frame(year = c(2000, 2001)))


[Package ppgam version 1.0.2 Index]