
textmodel_wordfish(data, dir = c(1, 2), priors = c(Inf, Inf, 3, 1), tol = c(1e-06, 1e-08), dispersion = c("poisson", "quasipoisson"), dispersionLevel = c("feature", "overall"), dispersionFloor = 0)
"print"(x, n = 30L, ...)
"show"(object)
"show"(object)
"poisson"
), or
quasi-Poisson ("quasipoisson"
)"feature"
for term-level variances, or "overall"
for a single dispersion parameterdispersion =
"quasipoisson"
.print
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
.
textmodel_wordfish(LBGexample, dir = c(1,5))
## Not run:
# ie2010dfm <- dfm(ie2010Corpus, verbose = FALSE)
# (wfm1 <- textmodel_wordfish(ie2010dfm, dir = c(6,5)))
# (wfm2a <- textmodel_wordfish(ie2010dfm, dir = c(6,5),
# dispersion = "quasipoisson", dispersionFloor = 0))
# (wfm2b <- textmodel_wordfish(ie2010dfm, dir = c(6,5),
# dispersion = "quasipoisson", dispersionFloor = .5))
# plot(wfm2a@phi, wfm2b@phi, xlab = "Min underdispersion = 0", ylab = "Min underdispersion = .5",
# xlim = c(0, 1.0), ylim = c(0, 1.0))
# plot(wfm2a@phi, wfm2b@phi, xlab = "Min underdispersion = 0", ylab = "Min underdispersion = .5",
# xlim = c(0, 1.0), ylim = c(0, 1.0), type = "n")
# underdispersedTerms <- sample(which(wfm2a@phi < 1.0), 5)
# which(features(ie2010dfm) %in% names(topfeatures(ie2010dfm, 20)))
# text(wfm2a@phi, wfm2b@phi, wfm2a@features,
# cex = .8, xlim = c(0, 1.0), ylim = c(0, 1.0), col = "grey90")
# text(wfm2a@phi[underdispersedTerms], wfm2b@phi[underdispersedTerms],
# wfm2a@features[underdispersedTerms],
# cex = .8, xlim = c(0, 1.0), ylim = c(0, 1.0), col = "black")
# if (require(austin)) {
# wfmodelAustin <- austin::wordfish(quanteda::as.wfm(ie2010dfm), dir = c(6,5))
# cor(wfm1@theta, wfm1Austin$theta)
# }## End(Not run)
Run the code above in your browser using DataLab