This is a wrapper function that expands the main Time Series
analyses function (TS
) across the LDA models (estimated
using LDA
or LDA_set
and the
Time Series models, with respect to both continuous time formulas and the
number of discrete changepoints. This function allows direct passage of
the control parameters for the parallel tempering MCMC through to the
main Time Series function, TS
, via the
ptMCMC_controls
argument.
check_TS_on_LDA_inputs
checks that the inputs to
TS_on_LDA
are of proper classes for a full analysis.
TS_on_LDA(LDA_models, document_covariate_table, formulas = ~1, nchangepoints = 0, timename = "time", weights = NULL, control = list()) check_TS_on_LDA_inputs(LDA_models, document_covariate_table, formulas = ~1, nchangepoints = 0, timename = "time", weights = NULL, control = list())
LDA_models | List of LDA models (class |
---|---|
document_covariate_table | Document covariate table (rows: documents,
columns: time index and covariate options). Every model needs a
covariate to describe the time value for each document (in whatever
units and whose name in the table is input in |
formulas | Vector of |
nchangepoints | Vector of |
timename |
|
weights | Optional class |
control | A |
TS_on_LDA
: TS_on_LDA
-class list
of results
from TS
applied for each model on each LDA model input.
check_TS_inputs
: An error message is thrown if any input
is not proper, else NULL
.
# \donttest{ data(rodents) document_term_table <- rodents$document_term_table document_covariate_table <- rodents$document_covariate_table LDAs <- LDA_set(document_term_table, topics = 2:3, nseeds = 2) LDA_models <- select_LDA(LDAs) weights <- document_weights(document_term_table) formulas <- c(~ 1, ~ newmoon) mods <- TS_on_LDA(LDA_models, document_covariate_table, formulas, nchangepoints = 0:1, timename = "newmoon", weights) # }