sklars.omega.bayes: Do Bayesian inference for Sklar's Omega.

View source: R/sklarsomega.R

sklars.omega.bayesR Documentation

Do Bayesian inference for Sklar's Omega.

Description

Do Bayesian inference for Sklar's Omega.

Usage

sklars.omega.bayes(
  data,
  level = c("amount", "balance", "percentage"),
  verbose = FALSE,
  control = list()
)

Arguments

data

a matrix of scores. Each row corresponds to a unit, each column a coder. The columns must be named appropriately so that the correct copula correlation matrix can be constructed. See build.R for details regarding column naming.

level

the level of measurement, either "amount" or "balance" or "percentage".

verbose

logical; if TRUE, various messages are printed to the console.

control

a list of control parameters.

dist

when level = "balance", one of "gaussian", "laplace", "t"; when level = "amount", "gamma"; when level = "percentage", one of "beta" or "kumaraswamy".

minit

the minimum sample size. This should be large enough to permit accurate estimation of Monte Carlo standard errors. The default is 1,000.

maxit

the maximum sample size. Sampling from the posterior terminates when all estimated coefficients of variation are smaller than tol or when maxit samples have been drawn, whichever happens first. The default is 10,000.

sigma.1

the proposal standard deviation for the first marginal parameter. Defaults to 0.1.

sigma.2

the proposal standard deviation for the second marginal parameter. Defaults to 0.1.

sigma.omega

a vector of proposal standard deviations for the parameters of the copula correlation matrix. These default to 0.1.

tol

a tolerance. If all estimated coefficients of variation are smaller than tol, no more samples are drawn from the posterior. The default value is 0.1.

Details

This function does MCMC for Bayesian inference for continuous scores.

Control parameter dist must be used to select a marginal distribution from among "gaussian", "laplace", "t", and "gamma" (for balances or amounts), or from among "beta" or "kumaraswamy" (for percentages).

Details regarding prior distributions and sampling are provided in the package vignette.

Value

Function sklars.omega.bayes returns an object of class "sklarsomega", which is a list comprising the following elements.

accept

a vector of acceptance rates.

DIC

the value of DIC for the fit.

call

the matched call.

coefficients

a named vector of parameter estimates.

control

the list of control parameters.

data

the matrix of scores, perhaps altered to remove rows (units) containing fewer than two scores.

iter

the number of posterior samples that were drawn.

level

the level of measurement.

mcse

a vector of Monte Carlo standard errors.

method

always equal to "Bayesian" for this function.

mpar

the number of marginal parameters.

npar

the total number of parameters.

R

the initial value of the copula correlation matrix.

R.hat

the estimated value of the copula correlation matrix.

residuals

the residuals.

root.R.hat

a square root of the estimated copula correlation matrix. This is used for simulation and to compute the residuals.

samples

the posterior samples.

verbose

the value of argument verbose.

y

the scores as a vector, perhaps altered to remove rows (units) containing fewer than two scores.

References

Hughes, J. (2018). Sklar's Omega: A Gaussian copula-based framework for assessing agreement. ArXiv e-prints, March.

Nissi, M. J., Mortazavi, S., Hughes, J., Morgan, P., and Ellermann, J. (2015). T2* relaxation time of acetabular and femoral cartilage with and without intra-articular Gd-DTPA2 in patients with femoroacetabular impingement. American Journal of Roentgenology, 204(6), W695.

Examples


# Fit a subset of the cartilage data, assuming a Laplace marginal distribution. Compute
# 95% HPD intervals. Show the acceptance rates for the three parameters.

data(cartilage)
data = as.matrix(cartilage)[1:100, ]
colnames(data) = c("c.1.1", "c.2.1")
set.seed(111111)
fit1 = sklars.omega.bayes(data, level = "balance", verbose = FALSE,
                          control = list(dist = "laplace", minit = 1000, maxit = 5000, tol = 0.01,
                                         sigma.1 = 1, sigma.2 = 0.1, sigma.omega = 0.2))
summary(fit1)
fit1$accept

# Now assume a noncentral t marginal distribution.

set.seed(4565)
fit2 = sklars.omega.bayes(data, level = "balance", verbose = FALSE,
                          control = list(dist = "t", minit = 1000, maxit = 5000, tol = 0.01,
                                         sigma.1 = 0.2, sigma.2 = 2, sigma.omega = 0.2))
summary(fit2)
fit2$accept


sklarsomega documentation built on April 4, 2023, 5:15 p.m.