Calculate relevant summaries for the run of a Time Series
model within TS
and package the output as a
TS_fit
-class object.
package_TS(data, formula, timename, weights, control, rho_dist, eta_dist)
data |
|
---|---|
formula |
|
timename |
|
weights | Optional class |
control | A |
rho_dist | List of saved data objects from the ptMCMC estimation of
change point locations returned by |
eta_dist | Matrix of draws (rows) from the marginal posteriors of the
coefficients across the segments (columns), as estimated by
|
TS_fit
-class list containing the following elements, many of
which are hidden for print
ing, but are accessible:
data
input to the function.
formula
input to the function.
nchangepoints
input to the function.
weights
input to the function.
timename
input to the function.
control
input to the function.
Iteration-by-iteration
logLik values for the
full time series fit by multinom_TS
.
Iteration-by-iteration change point estimates from
est_changepoints
.
Iteration-by-iteration marginal regressor estimates from
est_regressors
, which have been
unconditioned with respect to the change point locations.
ptMCMC diagnostics,
see diagnose_ptMCMC
Summary table describing rhos
(the change
point locations),
see summarize_rhos
.
Variance-covariance matrix for the estimates of
rhos
(the change point locations), see
measure_rho_vcov
.
Summary table describing ets
(the
regressors),
see summarize_etas
.
Variance-covariance matrix for the estimates of
etas
(the regressors), see
measure_eta_vcov
.
Across-iteration average of log-likelihoods
(lls
).
Total number of parameters in the full model, including the change point locations and regressors.
Penalized negative log-likelihood, based on
logLik
and nparams
.
# \donttest{ data(rodents) document_term_table <- rodents$document_term_table document_covariate_table <- rodents$document_covariate_table LDA_models <- LDA_set(document_term_table, topics = 2)[[1]] data <- document_covariate_table data$gamma <- LDA_models@gamma weights <- document_weights(document_term_table) formula <- gamma ~ 1 nchangepoints <- 1 control <- TS_control() data <- data[order(data[,"newmoon"]), ] rho_dist <- est_changepoints(data, formula, nchangepoints, "newmoon", weights, control) eta_dist <- est_regressors(rho_dist, data, formula, "newmoon", weights, control) package_TS(data, formula, "newmoon", weights, control, rho_dist, eta_dist) # }