Description Usage Arguments Value Examples
The sparse (as opposed to dense) algorithm ignores the latent variables for missing vote observations when updating the global parameters alpha, beta, gamma. It is robust in the presence of many missing votes.
1 2 | multiscale(method = "sparse", prior, data, init, max.iter = 250,
tol = 1e-04, verbose = TRUE)
|
method |
One of |
prior |
A list of priors for the parameters ab, gamma:
|
data |
A list of data values:
|
init |
A list of initialization values for |
max.iter |
The maximum number of iterations. |
tol |
The algorithm stops after the current iteration and the previous iteration parameters have correlation 1 - |
verbose |
print useful warnings and updates on algorithm progress. |
A list of estimated parameters alpha
, beta
, gamma
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
data(s109) # from pscl package
data(s109)
Y <- s109$votes ## WARNING: data must be +/- 1, or NA
Y[Y %in% 1:3] <- 1
Y[Y %in% 4:6] <- -1
Y[Y %in% c(0, 7:9)] <- NA
data <- list(Y = Y, N = dim(Y)[1], J = dim(Y)[2], D = 2)
prior <- make_prior(data)
init <- make_starts(data)
lout <- multiscale(method = "sparse", prior = prior, data = data, init = init)
cor(lout$gamma)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.