Package: LDATS 0.2.7

Juniper L. Simonis

LDATS: Latent Dirichlet Allocation Coupled with Time Series Analyses

Combines Latent Dirichlet Allocation (LDA) and Bayesian multinomial time series methods in a two-stage analysis to quantify dynamics in high-dimensional temporal data. LDA decomposes multivariate data into lower-dimension latent groupings, whose relative proportions are modeled using generalized Bayesian time series models that include abrupt changepoints and smooth dynamics. The methods are described in Blei et al. (2003) <doi:10.1162/jmlr.2003.3.4-5.993>, Western and Kleykamp (2004) <doi:10.1093/pan/mph023>, Venables and Ripley (2002, ISBN-13:978-0387954578), and Christensen et al. (2018) <doi:10.1002/ecy.2373>.

Authors:Juniper L. Simonis [aut, cre], Erica M. Christensen [aut], David J. Harris [aut], Renata M. Diaz [aut], Hao Ye [aut], Ethan P. White [aut], S.K. Morgan Ernest [aut], Weecology [cph]

LDATS_0.2.7.tar.gz
LDATS_0.2.7.zip(r-4.5)LDATS_0.2.7.zip(r-4.4)LDATS_0.2.7.zip(r-4.3)
LDATS_0.2.7.tgz(r-4.4-any)LDATS_0.2.7.tgz(r-4.3-any)
LDATS_0.2.7.tar.gz(r-4.5-noble)LDATS_0.2.7.tar.gz(r-4.4-noble)
LDATS_0.2.7.tgz(r-4.4-emscripten)LDATS_0.2.7.tgz(r-4.3-emscripten)
LDATS.pdf |LDATS.html
LDATS/json (API)
NEWS

# Install 'LDATS' in R:
install.packages('LDATS', repos = c('https://weecology.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/weecology/ldats/issues

Datasets:

On CRAN:

changepointldaparallel-temperingportalsoftmax

98 exports 25 stars 2.46 score 54 dependencies 44 scripts 988 downloads

Last updated 5 years agofrom:d48386296a. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 22 2024
R-4.5-winNOTEAug 22 2024
R-4.5-linuxNOTEAug 22 2024
R-4.4-winNOTEAug 22 2024
R-4.4-macNOTEAug 22 2024
R-4.3-winOKAug 22 2024
R-4.3-macOKAug 22 2024

Exports:AICcautocorr_plotcheck_changepointscheck_controlcheck_document_covariate_tablecheck_document_term_tablecheck_formulacheck_formulascheck_LDA_modelscheck_LDA_set_inputscheck_LDA_TS_inputscheck_multinom_TS_inputscheck_nchangepointscheck_seedscheck_timenamecheck_topicscheck_TS_inputscheck_TS_on_LDA_inputscheck_weightsconform_LDA_TS_datacount_tripsdiagnose_ptMCMCdocument_weightsecdf_plotest_changepointsest_regressorseta_diagnostics_plotseval_stepexpand_TSiftrueLDA_msgLDA_plot_bottom_panelLDA_plot_top_panelLDA_setLDA_set_controlLDA_TSLDA_TS_controllogsumexpmeasure_eta_vcovmeasure_rho_vcovmemoise_funmessageqmirror_vcovmodalvaluemultinom_TSmultinom_TS_chunknormalizepackage_chunk_fitspackage_LDA_setpackage_LDA_TSpackage_TSpackage_TS_on_LDAposterior_plotpred_gamma_TS_plotprep_chunksprep_cptsprep_idsprep_LDA_controlprep_pbarprep_proposal_distprep_ptMCMC_inputsprep_savesprep_temp_sequenceprep_TS_dataprint_model_run_messageprocess_savespropose_stepproposed_step_modsrho_diagnostics_plotsrho_histrho_linesselect_LDAselect_TSset_gamma_colorsset_LDA_plot_colorsset_LDA_TS_plot_colsset_rho_hist_colorsset_TS_summary_plot_colssim_LDA_datasim_LDA_TS_datasim_TS_datasoftmaxstep_chainssummarize_etassummarize_rhosswap_chainstake_steptrace_plotTSTS_controlTS_diagnostics_plotTS_on_LDATS_summary_plotupdate_cptsupdate_idsupdate_pbarupdate_savesverify_changepoint_locations

Dependencies:BHcachemclicodacolorspacecpp11crayondigestextraDistrfansifarverfastmapgenericsggplot2gluegridExtragtablehmsisobandlabelinglatticelifecyclelubridatemagrittrMASSMatrixmemoisemgcvmodeltoolsmunsellmvtnormnlmeNLPnnetpillarpkgconfigprettyunitsprogressR6RColorBrewerRcpprlangscalesslamtibbletimechangetmtopicmodelsutf8vctrsviridisviridisLitewithrxml2

Latent Dirichlet Allocation Time Series (LDATS)

Rendered fromLDATS_codebase.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2019-07-10
Started: 2018-12-13

Comparison to Christensen et al. 2018

Rendered frompaper-comparison.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2020-03-18
Started: 2019-02-12

LDATS Rodents Example

Rendered fromrodents-example.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2020-03-18
Started: 2018-05-22

Readme and manuals

Help Manual

Help pageTopics
Calculate AICcAICc
Produce the autocorrelation panel for the TS diagnostic plot of a parameterautocorr_plot
Check that a set of change point locations is propercheck_changepoints
Check that a control list is propercheck_control
Check that the document covariate table is propercheck_document_covariate_table
Check that document term table is propercheck_document_term_table
Check that a formula is propercheck_formula
Check that formulas vector is proper and append the response variablecheck_formulas
Check that LDA model input is propercheck_LDA_models
Check that nchangepoints vector is propercheck_nchangepoints
Check that nseeds value or seeds vector is propercheck_seeds
Check that the time vector is propercheck_timename
Check that topics vector is propercheck_topics
Check that weights vector is propercheck_weights
Count trips of the ptMCMC particlescount_trips
Calculate ptMCMC summary diagnosticsdiagnose_ptMCMC
Calculate document weights for a corpusdocument_weights
Produce the posterior distribution ECDF panel for the TS diagnostic plot of a parameterecdf_plot
Use ptMCMC to estimate the distribution of change point locationsest_changepoints
Estimate the distribution of regressors, unconditional on the change point locationsest_regressors
Expand the TS models across the factorial combination of LDA models, formulas, and number of change pointsexpand_TS
Replace if TRUEiftrue
Jornada rodent datajornada
Create the model-running-message for an LDALDA_msg
Run a set of Latent Dirichlet Allocation modelscheck_LDA_set_inputs LDA_set
Create control list for set of LDA modelsLDA_set_control
Run a full set of Latent Dirichlet Allocations and Time Series modelscheck_LDA_TS_inputs conform_LDA_TS_data LDA_TS
Create the controls list for the LDATS modelLDA_TS_control
Package to conduct two-stage analyses combining Latent Dirichlet Allocation with Bayesian Time Series modelsLDATS-package LDATS
Calculate the log likelihood of a VEM LDA model fitlogLik.LDA_VEM
Log likelihood of a multinomial TS modellogLik.multinom_TS_fit
Determine the log likelihood of a Time Series modellogLik.TS_fit
Calculate the log-sum-exponential (LSE) of a vectorlogsumexp
Logical control on whether or not to memoisememoise_fun
Optionally generate a message based on a logical inputmessageq
Create a properly symmetric variance covariance matrixmirror_vcov
Determine the mode of a distributionmodalvalue
Fit a multinomial change point Time Series modelcheck_multinom_TS_inputs multinom_TS
Fit a multinomial Time Series model chunkmultinom_TS_chunk
Normalize a vectornormalize
Package the output of the chunk-level multinomial models into a multinom_TS_fit listpackage_chunk_fits
Package the output from LDA_setpackage_LDA_set
Package the output of LDA_TSpackage_LDA_TS
Summarize the Time Series modelpackage_TS
Package the output of TS_on_LDApackage_TS_on_LDA
Plot a set of LDATS LDA modelsplot.LDA_set
Plot the key results from a full LDATS analysisplot.LDA_TS
Plot the results of an LDATS LDA modelLDA_plot_bottom_panel LDA_plot_top_panel plot.LDA_VEM
Plot an LDATS TS modelplot.TS_fit
Produce the posterior distribution histogram panel for the TS diagnostic plot of a parameterposterior_plot
Prepare the time chunk table for a multinomial change point Time Series modelprep_chunks
Initialize and update the change point matrix used in the ptMCMC algorithmprep_cpts update_cpts
Initialize and update the chain ids throughout the ptMCMC algorithmprep_ids update_ids
Set the control inputs to include the seedprep_LDA_control
Initialize and tick through the progress barprep_pbar update_pbar
Pre-calculate the change point proposal distribution for the ptMCMC algorithmprep_proposal_dist
Prepare the inputs for the ptMCMC algorithm estimation of change pointsprep_ptMCMC_inputs
Prepare and update the data structures to save the ptMCMC outputprep_saves process_saves update_saves
Prepare the ptMCMC temperature sequenceprep_temp_sequence
Prepare the model-specific data to be used in the TS analysis of LDA outputprep_TS_data
Print the message to the console about which combination of the Time Series and LDA models is being runprint_model_run_message
Print the selected LDA and TS models of LDA_TS objectprint.LDA_TS
Print a Time Series model fitprint.TS_fit
Print a set of Time Series models fit to LDAsprint.TS_on_LDA
Fit the chunk-level models to a time series, given a set of proposed change points within the ptMCMC algorithmproposed_step_mods
Add change point location lines to the time series plotrho_lines
Portal rodent datarodents
Select the best LDA model(s) for use in time seriesselect_LDA
Select the best Time Series modelselect_TS
Prepare the colors to be used in the gamma time seriesset_gamma_colors
Prepare the colors to be used in the LDA plotsset_LDA_plot_colors
Create the list of colors for the LDATS summary plotset_LDA_TS_plot_cols
Prepare the colors to be used in the change point histogramset_rho_hist_colors
Create the list of colors for the TS summary plotset_TS_summary_plot_cols
Simulate LDA data from an LDA structure given parameterssim_LDA_data
Simulate LDA_TS data from LDA and TS model structures and parameterssim_LDA_TS_data
Simulate TS data from a TS model structure given parameterssim_TS_data
Calculate the softmax of a vector or matrix of valuessoftmax
Conduct a within-chain step of the ptMCMC algorithmeval_step propose_step step_chains take_step
Summarize the regressor (eta) distributionsmeasure_eta_vcov summarize_etas
Summarize the rho distributionsmeasure_rho_vcov summarize_rhos
Conduct a set of among-chain swaps for the ptMCMC algorithmswap_chains
Produce the trace plot panel for the TS diagnostic plot of a parametertrace_plot
Conduct a single multinomial Bayesian Time Series analysischeck_TS_inputs TS
Create the controls list for the Time Series modelTS_control
Plot the diagnostics of the parameters fit in a TS modeleta_diagnostics_plots rho_diagnostics_plots TS_diagnostics_plot
Conduct a set of Time Series analyses on a set of LDA modelscheck_TS_on_LDA_inputs TS_on_LDA
Create the summary plot for a TS fit to an LDA modelpred_gamma_TS_plot rho_hist TS_summary_plot
Verify the change points of a multinomial time series modelverify_changepoint_locations