predict.ppgam {ppgam}R Documentation

Predictions from a fitted ppgam object

Description

Predictions from a fitted ppgam object

Usage

## S3 method for class 'ppgam'
predict(object, newdata, type = "link", se.fit = FALSE, ...)

Arguments

object

a fitted ppgam object

newdata

a data frame

type

a character string giving the type of prediction sought; see Details. Defaults to "link"

se.fit

a logical: should estimated standard errors be returned? Defaults to FALSE

...

passed to mgcv::predict()

Details

This calls predict.gam and gives predictions of the intensity function of the Poisson process on the original scale if type = "response", on log scale if type = "link" (default), and of the design matrix if type = "lpmatrix".

Value

A data frame or list of predictions

References

Youngman, B. D., & Economou, T. (2017). Generalised additive point process models for natural hazard occurrence. Environmetrics, 28(4), e2444.

See Also

predict.gam

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)
predict(m1)
predict(m1, type = "response")
predict(m1, type = "lpmatrix")
predict(m1, newdata = data.frame(year = c(2000, 2001)))
predict(m1, se.fit = TRUE)


[Package ppgam version 1.0.2 Index]