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

Description Usage Arguments Value Examples

View source: R/circGLMClassFunctions.R

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

1
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

1
2
3
4
5
6
7
dat <- generateCircGLMData()
m   <- circGLM(th ~ ., dat)
predfun <- predict_function.circGLM(m)
newd <- generateCircGLMData()

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

circglmbayes documentation built on Jan. 22, 2021, 5:09 p.m.