Learn R Programming

bpnreg (version 1.0.3)

residuals.bpnme: Residuals for a Bayesian circular mixed-effects model

Description

Outputs residuals for a Bayesian circular mixed-effects model for each iteration of the MCMC sampler.

Usage

# S3 method for bpnme
residuals(object, type = "arc", ...)

Arguments

object

a bpnme object obtained from the function bpnme.

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

Run this code
# NOT RUN {
library(bpnreg)
fit.Maps <- bpnme(pred.I = Error.rad ~ Maze + Trial.type + L.c + (1|Subject),
data = Maps,
its = 100, burn = 1, n.lag = 1)
residuals(fit.Maps)
residuals(fit.Maps, type = "cos")

# }

Run the code above in your browser using DataLab