textmodel_wordfish.Rd
Estimate Slapin and Proksch's (2008) "wordfish" Poisson scaling model of one-dimensional document positions using conditional maximum likelihood.
textmodel_wordfish( x, dir = c(1, 2), priors = c(Inf, Inf, 3, 1), tol = c(1e-06, 1e-08), dispersion = c("poisson", "quasipoisson"), dispersion_level = c("feature", "overall"), dispersion_floor = 0, sparse = FALSE, abs_err = FALSE, svd_sparse = TRUE, residual_floor = 0.5 )
x | the dfm on which the model will be fit |
---|---|
dir | set global identification by specifying the indexes for a pair of documents such that \(\hat{\theta}_{dir[1]} < \hat{\theta}_{dir[2]}\). |
priors | prior precisions for the estimated parameters \(\alpha_i\), \(\psi_j\), \(\beta_j\), and \(\theta_i\), where \(i\) indexes documents and \(j\) indexes features |
tol | tolerances for convergence. The first value is a convergence threshold for the log-posterior of the model, the second value is the tolerance in the difference in parameter values from the iterative conditional maximum likelihood (from conditionally estimating document-level, then feature-level parameters). |
dispersion | sets whether a quasi-Poisson quasi-likelihood should be
used based on a single dispersion parameter ( |
dispersion_level | sets the unit level for the dispersion parameter,
options are |
dispersion_floor | constraint for the minimal underdispersion multiplier
in the quasi-Poisson model. Used to minimize the distorting effect of
terms with rare term or document frequencies that appear to be severely
underdispersed. Default is 0, but this only applies if |
sparse | specifies whether the |
abs_err | specifies how the convergence is considered |
svd_sparse | uses svd to initialize the starting values of theta,
only applies when |
residual_floor | specifies the threshold for residual matrix when
calculating the svds, only applies when |
An object of class textmodel_fitted_wordfish
. This is a list
containing:
global identification of the dimension
estimated document positions
estimated document fixed effects
estimated feature marginal effects
estimated word fixed effects
document labels
feature labels
regularization parameter for betas in Poisson form
log likelihood at convergence
standard errors for theta-hats
dfm to which the model was fit
The returns match those of Will Lowe's R implementation of
wordfish
(see the austin package), except that here we have renamed
words
to be features
. (This return list may change.) We
have also followed the practice begun with Slapin and Proksch's early
implementation of the model that used a regularization parameter of
se\((\sigma) = 3\), through the third element in priors
.
In the rare situation where a warning message of "The algorithm did not converge." shows up, removing some documents may work.
Slapin, J. & Proksch, S.O. (2008). A Scaling Model for Estimating Time-Series Party Positions from Texts. American Journal of Political Science, 52(3), 705--772.
Lowe, W. & Benoit, K.R. (2013). Validating Estimates of Latent Traits from Textual Data Using Human Judgment as a Benchmark. Political Analysis, 21(3), 298--313.