Learn R Programming

bpnreg (version 1.0.3)

residuals.bpnr: Residuals for a Bayesian circular regression model

Description

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

Usage

# S3 method for 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

Run this code
# NOT RUN {
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")

# }

Run the code above in your browser using DataLab