cpcbayeslm: Bayesian linear models for cardinal paired comparison data

View source: R/cpcbayeslm.R

cpcbayeslmR Documentation

Bayesian linear models for cardinal paired comparison data

Description

This function performs Bayesian inference for cardinal paired comparison data. The methodology allows for doing Bayesian analysis on restricted parameter space

Usage

cpcbayeslm(
  noitems,
  nocompars,
  scores,
  vars = 1,
  xmu = zeros(noitems, 1),
  xvar = vars * diag(noitems),
  a0 = 2,
  b0 = 1,
  Edges = c(1, 2, 1, 3, 2, 3),
  data = NULL,
  datatype = "simulated",
  prior = "conju",
  tol = 1e-08
)

Arguments

noitems

The number of items for the paired comparison.

nocompars

A vector of the number of pairwise comparisons among noitems.

scores

The true scores or merits of noitems

vars

The constant variance of scores; default is 1.

xmu

The normal prior mean of noitems; default is zero vector of length noitems.

xvar

The prior covariance matrix of noitems; default is identity matrix of dimension noitems.

a0

The prior shape of inverse gamma distribution; default is 2.

b0

The prior scale of inverse gamma distribution; default is 1.

Edges

The edge set of noitems in the graph; default is edgeset of three items.

data

The data containing the comparison outcomes; defalut is NULL.

datatype

The type of data to analyze: "simulated" (the default) for simulated data, "real" for a given real dataset.

prior

The type of prior: "conju" (default) for conjugate prior, "semi-conju" for semi-conjugate prior, "flat" for flat prior, and "ref" for reference prior

tol

The tolerance value to control near zero eigen values; default is 1e-08.

Value

The Bayesian posterior mean and variance together with the least squares estimates.

Author(s)

Prince P. Osei and Ori Davidov

References

Osei, P. P. and Davidov, O. (2022). Bayesian linear models for cardinal paired comparison data. Comp. Stat and Data Analysis Vol 172, 107481.

Examples

K = 3 # number of items
paircompars <- rep(3,3) # number of pairwise comparisons
Tscores <- 3:1-mean(3:1) # true scores 
cpcbayeslm(K,paircompars,Tscores)

oseipep/pcdbayeslm documentation built on Aug. 6, 2023, 8:45 a.m.