postdrawspcd: Draws samples from the posterior distribution for paired...

View source: R/postdrawspcd.R

postdrawspcdR Documentation

Draws samples from the posterior distribution for paired comparison data

Description

This function performs a new posterior ranking methodology developed in the paper by Prince P. Osei and Ori David (2021) to account for the uncertainty in the ranking of items.

Usage

postdrawspcd(
  N,
  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"
)

Arguments

N

Number of posterior samples.

noitems

Number of items in the comparison graph

nocompars

The number of 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 a vector of zeros of length noitems.

xvar

The prior covariance matrix of noitems default is vars times the identity matrix 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 complete graph of three noitems.

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

Value

A posterior rankings of posterior draws from cpcbayeslm

Author(s)

Prince P. Osei and Ori Davidov

Examples

##  A graph of three items
##  K <- 3 # number of items
## edges <- c(1,2,1,3,2,3) # edge set
## compars <- rep(3,3) # pairwise comparisons
##  Tscores <- 1:3-mean(1:3) # The true score sum to zero
##  N <- 100 # number of samples to draw
## postdrawspcd(N,K,compars,Tscores,Edges=edges)

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