Description Usage Arguments Value Examples
View source: R/mcmc_functions.R
This function runs the BTUN mcmc algorithm
1 |
n.iter |
The number of iterations to be run |
delta |
The underrlaxed tuning parameter must be in (0, 1) |
k.mean |
The GP prior mean vector |
k.chol |
The cholesky decomposition of the GP prior covariance matrix |
win.matrix |
A matrix, where w_ij give the number of times area i beat j |
f.initial |
A vector of the intial esitmate for f |
alpha |
A boolean if inference for alpha should be carried out |
A list of MCMC output
f.matrix - A matrix containing the each iteration of f
alpha.sq - A vector containing the iterations of alpha^2
accpetance.rate - The acceptance rate for f
time.taken - Time tkane to run the MCMC algorithm in seconds
1 2 3 4 5 6 7 8 9 | n.iter <- 10
delta <- 0.1
k.mean <- c(0, 0, 0)
k.chol <- diag(3)
comparisons <- data.frame("winner" = c(1, 3, 2, 2), "loser" = c(3, 1, 1, 3))
win.matrix <- comparisons_to_matrix(3, comparisons)
f.initial <- c(0, 0, 0)
mcmc.output <- run_mcmc(n.iter, delta, k.mean, k.chol, win.matrix, f.initial)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.