multiscale: Fit a zero- or multi-dimensional spatial voting model.

Description Usage Arguments Value Examples

Description

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.

Usage

1
2
multiscale(method = "sparse", prior, data, init, max.iter = 250,
  tol = 1e-04, verbose = TRUE)

Arguments

method

One of c("sparse", "intercepts"), with "sparse" as the default. If "intercepts", estimate an intercept-only model. Otherwise, estimate a model with positive dimension.

prior

A list of priors for the parameters ab, gamma:

  • sigma.inv.ab a (D+1)\times (D+1) positive definite matrix corresponding to the inverse of the prior covariance matrix for (α, β).

  • mu.ab a (D+1) vector corresponding to the prior mean of (α, β).

  • sigma.inv.gamma a D \times D definite matrix corresponding to the inverse of the prior covariance matrix for γ.

  • mu.gamma a D vector corresponding to the prior mean of γ.

data

A list of data values:

  • Y an N \times J matrix of \pm 1 or NA.

  • N, J the dimensions of Y.

  • D the dimensions of political conflict being modeled.

init

A list of initialization values for alpha, beta, gamma.

max.iter

The maximum number of iterations.

tol

The algorithm stops after the current iteration and the previous iteration parameters have correlation 1 - tol.

verbose

print useful warnings and updates on algorithm progress.

Value

A list of estimated parameters alpha, beta, gamma

Examples

 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)

matthewtyler/MultiScale documentation built on May 8, 2019, 11:57 p.m.