# APA data application
# It will take about 10 minutes to run the demo.
data(APA)
y = freq2case(APA, freq.col = 1)
y = 6 - y
# number of observed judges
n = dim(y)[1]
# number of items
k = dim(y)[2]
# number of parameteros of beta
p = k
beta0 = rep(0, p)
alpha = k + 1
A0 = diag(100, ncol = p, nrow = p)
P = diag(k + 1, ncol = k - 1, nrow = k - 1)
# Construct Z
Z = array(0, dim = c(n, k, p))
for (j in 1:n)
{
Z[j, , ] = diag(1, nrow= k, ncol = p)
}
# Total iterations of Gibbs sampling
MAX_ITERATIONS = 10000
# Number of iterations to be reduced(burnt in)
BURN_IN_ITERATIONS = 1000
# Run the model, time consuming
# output_list = mvnos.model(y, p, Z, beta0, A0, alpha, P,
# MAX_ITERATIONS = MAX_ITERATIONS, BURN_IN_ITERATIONS = BURN_IN_ITERATIONS)
Run the code above in your browser using DataLab