predict.walker_fit: Predictions for walker object

View source: R/predict.R

predict.walker_fitR Documentation

Predictions for walker object

Description

Given the new covariate data and output from walker, obtain samples from posterior predictive distribution for future time points.

Usage

## S3 method for class 'walker_fit'
predict(
  object,
  newdata,
  u,
  type = ifelse(object$distribution == "gaussian", "response", "mean"),
  ...
)

Arguments

object

An output from walker or walker_glm.

newdata

A data.frame containing covariates used for prediction.

u

For Poisson model, a vector of future exposures i.e. E(y) = u*exp(x*beta). For binomial, a vector containing the number of trials for future time points. Defaults 1.

type

If "response" (default for Gaussian model), predictions are on the response level (e.g., number of successes for Binomial case, and for Gaussian case the observational level noise is added to the mean predictions). If "mean" (default for non-Gaussian case), predict means (e.g., success probabilities in Binomial case). If "link", predictions for non-Gaussian models are returned before applying the inverse of the link-function.

...

Ignored.

Value

A list containing samples from posterior predictive distribution.

See Also

plot_predict for example.


walker documentation built on Sept. 11, 2023, 5:10 p.m.