predict_function.circGLM: Obtain a prediction function from a circGLM object

View source: R/circGLMClassFunctions.R

predict_function.circGLMR Documentation

Obtain a prediction function from a circGLM object

Description

This functions creates and returns a new prediction function that takes in new data, and returns their predicted values. The prediction function is based on the posterior estimates.

Usage

predict_function.circGLM(object, linkfun = function(x) atanLF(x, 2))

Arguments

object

A circGLM object.

linkfun

A link function to use in the analysis. Should be the same as the link function.

Value

A function that takes newdata as an argument, which must be a data frame with predictors. The predictors must be the same as used in the circGLM object and must have the same column names.

Examples

dat <- generateCircGLMData()
m   <- circGLM(th ~ ., dat)
predfun <- predict_function.circGLM(m)
newd <- generateCircGLMData()

# Predicted values of the new data.
predfun(newd)

keesmulder/circglmbayes documentation built on July 24, 2022, 6:39 a.m.