residuals.bpnr: Residuals for a Bayesian circular regression model

Description Usage Arguments Value Examples

View source: R/classfunctions.R

Description

Outputs residuals for a Bayesian circular regression model for each iteration of the MCMC sampler.

Usage

1
2
## S3 method for class 'bpnr'
residuals(object, type = "arc", ...)

Arguments

object

a bpnr object obtained from the function bpnr.

type

the type of residuals, one of c("arc", "cos"). The "arc" residuals are based on a computation of the circular arc length between predicted value and original outcome. The "cos" residuals are based on the cosine of the difference between predicted value and original outcome.

...

further arguments passed to or from other methods.

Value

a matrix (rows = N, columns = iterations) containing residuals for each iteration of the MCMC sampler.

Examples

1
2
3
4
5
library(bpnreg)
fit.Motor <- bpnr(pred.I = Phaserad ~ 1 + Cond, data = Motor,
its = 100, burn = 10, n.lag = 3)
residuals(fit.Motor)
residuals(fit.Motor, type = "cos")

bpnreg documentation built on May 2, 2019, 6:37 a.m.