bayeslmsamples: Draws from the posterior distribution for Bayesian linear...

View source: R/bayeslmsamples.R

bayeslmsamplesR Documentation

Draws from the posterior distribution for Bayesian linear models for paired comparison data

Description

Draws from the posterior distribution for Bayesian linear models for paired comparison data

Usage

bayeslmsamples(
  iter,
  noitems,
  nocompars,
  scores,
  vars = 1,
  muprior = zeros(noitems, 1),
  varprior = vars * diag(noitems),
  Edges = c(1, 2, 1, 3, 2, 3),
  prior = "conju",
  data = NULL,
  type = "simulated"
)

Arguments

iter

The number of posterior draws.

noitems

The number of items for the paired comparison.

nocompars

A vector of pairwise comparisons among noitems.

scores

The true scores or merits of noitems

vars

The true constant variance of scores; default is 1.

muprior

The normal prior mean for noitems; default is a vector of zeros of length noitems.

varprior

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

Edges

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

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

data

he data containing the comparison outcomes; defalut is NULL.

type

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

Value

Posterior draws from cpcbayeslm

Author(s)

Prince P. Osei and Ori Davidov

Examples

##  A graph of three items
##  K <- 3 # number of items
## Kedges <- 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
## bayeslmsamples(100,K,compars,Tscores,Edges=Kedges)

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