Package: ctsem 3.10.1

ctsem: Continuous Time Structural Equation Modelling

Hierarchical continuous (and discrete) time state space modelling, for linear and nonlinear systems measured by continuous variables, with limited support for binary data. The subject specific dynamic system is modelled as a stochastic differential equation (SDE) or difference equation, measurement models are typically multivariate normal factor models. Linear mixed effects SDE's estimated via maximum likelihood and optimization are the default. Nonlinearities, (state dependent parameters) and random effects on all parameters are possible, using either max likelihood / max a posteriori optimization (with optional importance sampling) or Stan's Hamiltonian Monte Carlo sampling. See <https://github.com/cdriveraus/ctsem/raw/master/vignettes/hierarchicalmanual.pdf> for details. Priors may be used. For the conceptual overview of the hierarchical Bayesian linear SDE approach, see <https://www.researchgate.net/publication/324093594_Hierarchical_Bayesian_Continuous_Time_Dynamic_Modeling>. Exogenous inputs may also be included, for an overview of such possibilities see <https://www.researchgate.net/publication/328221807_Understanding_the_Time_Course_of_Interventions_with_Continuous_Time_Dynamic_Models> . Stan based functions are not available on 32 bit Windows systems at present. <https://cdriver.netlify.app/> contains some tutorial blog posts.

Authors:Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]

ctsem_3.10.1.tar.gz
ctsem_3.10.1.zip(r-4.5)ctsem_3.10.1.zip(r-4.4)ctsem_3.10.1.zip(r-4.3)
ctsem_3.10.1.tgz(r-4.4-x86_64)ctsem_3.10.1.tgz(r-4.4-arm64)ctsem_3.10.1.tgz(r-4.3-x86_64)ctsem_3.10.1.tgz(r-4.3-arm64)
ctsem_3.10.1.tar.gz(r-4.5-noble)ctsem_3.10.1.tar.gz(r-4.4-noble)
ctsem.pdf |ctsem.html
ctsem/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/cdriveraus/ctsem/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

stochastic-differential-equationstime-series

9.71 score 41 stars 2 packages 355 scripts 1.2k downloads 2 mentions 56 exports 61 dependencies

Last updated 3 months agofrom:33d092b455. Checks:OK: 1 NOTE: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 31 2024
R-4.5-win-x86_64NOTEOct 31 2024
R-4.5-linux-x86_64NOTEOct 31 2024
R-4.4-win-x86_64NOTEOct 31 2024
R-4.4-mac-x86_64NOTEOct 31 2024
R-4.4-mac-aarch64NOTEOct 31 2024
R-4.3-win-x86_64NOTEOct 31 2024
R-4.3-mac-x86_64NOTEOct 31 2024
R-4.3-mac-aarch64NOTEOct 31 2024

Exports:ctACFctACFresidualsctAddSamplesctCheckFitctChisqTestctCollapsectDeintervalisectDensityctDiscretiseDatactDocsctExtractctFitctFitMultiModelctGeneratectIndplotctIntervalisectKalmanctLongToWidectLOOctModelctModelHigherOrderctModelLatexctPlotArrayctPolyctPostPredDatactPostPredPlotsctPredictTIPctResidualsctStanContinuousParsctStanDiscreteParsctStanDiscreteParsPlotctStanFitctStanFitUpdatectStanGeneratectStanGenerateFromFitctStanKalmanctStanModelctStanParnamesctStanPlotPostctStanPostPredictctStanSubjectParsctStanTIpredeffectsctWideNamesctWideToLonginv_logitisdiaglog1p_expplot.ctKalmanDFplotctACFsdpcor2covstan_checkdivergencesstan_reinitsfstan_unconstrainsamplesstandatact_specificsubjectsstanWplottest_isclose

Dependencies:abindbackportsBHcallrcheckmateclicOdecolorspacedata.tableDerivdescdistributionalexpmfansifarvergenericsggplot2gluegridExtragtableinlineisobandlabelinglatticelifecycleloomagrittrMASSMatrixmatrixStatsmgcvmizemunsellmvtnormnlmenumDerivpillarpkgbuildpkgconfigplyrposteriorprocessxpsQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsscalesStanHeadersstatmodtensorAtibbleutf8vctrsviridisLitewithr

Introduction to Hierarchical Continuous Time Dynamic Modelling with ctsem

Rendered fromhierarchicalmanual.rnwusingknitr::knitr_notangleon Oct 31 2024.

Last update: 2024-05-21
Started: 2019-07-09

Readme and manuals

Help Manual

Help pageTopics
ctsemctsem-package ctsem
AnomAuthAnomAuth
Continuous Time Autocorrelation Function (ctACF)ctACF
Calculate Continuous Time Autocorrelation Function (ACF) for Standardized Residuals of ctsem fit.ctACFresiduals
Sample more values from an optimized ctstanfit objectctAddSamples
Visual model fit diagnostics for ctsem fit objects.ctCheckFit
Chi Square test wrapper for ctStanFit objects.ctChisqTest
ctCollapse Easily collapse an array margin using a specified function.ctCollapse
ctDeintervalisectDeintervalise
ctDensityctDensity
Discretise long format continuous time (ctsem) data to specific timestep.ctDiscretiseData
Get documentation pdf for ctsemctDocs
ctExample1ctExample1
ctExample1TIpredctExample1TIpred
ctExample2ctExample2
ctExample2levelctExample2level
ctExample3ctExample3
ctExample4ctExample4
Extract samples from a ctStanFit objectctExtract extract
ctFit function placeholderctFit
Fit and summarise a list of ctsem modelsctFitMultiModel
ctGeneratectGenerate
ctIndplotctIndplot
Converts absolute times to intervals for wide format ctsem panel datactIntervalise
ctKalmanctKalman
ctLongToWide Restructures time series / panel data from long format to wide format for ctsem analysisctLongToWide
K fold cross validation for ctStanFit objectsctLOO
Define a ctsem modelctModel
Raise the order of a ctsem model object of type 'omx'.ctModelHigherOrder
Generate and optionally compile latex equation of subject level ctsem model.ctModelLatex
Plots three dimensional y values for quantile plotsctPlotArray
Plots uncertainty bands with shadingctPoly
Create a data.table to compare data generated from a ctsem fit with the original data.ctPostPredData
Create diagnostic plots to assess the goodness-of-fit for a ctsem model.ctPostPredPlots
ctPredictTIPctPredictTIP
Extract Standardized Residuals from a ctsem FitctResiduals
ctStanContinuousParsctStanContinuousPars
ctStanDiscreteParsctStanDiscretePars
ctStanDiscreteParsPlotctStanDiscreteParsPlot
ctStanFitctStanFit
Update a ctStanFit objectctStanFitUpdate
Generate data from a ctstanmodel objectctStanGenerate
Add a '$generated' object to ctstanfit object, with random data generated from posterior of ctstanfit objectctStanGenerateFromFit
Get Kalman filter estimates from a ctStanFit objectctStanKalman
Convert a frequentist (omx) ctsem model specification to Bayesian (Stan).ctStanModel
ctStanParnamesctStanParnames
ctStanPlotPostctStanPlotPost
Compares model implied density and values to observed, for a ctStanFit object.ctStanPostPredict
Extract an array of subject specific parameters from a ctStanFit object.ctStanSubjectPars
ctstantestdatctstantestdat
ctstantestfitctstantestfit
Get time independent predictor effect estimatesctStanTIpredeffects
Update an already compiled and fit ctStanFit objectctStanUpdModel
ctWideNames sets default column names for wide ctsem datasets. Primarily intended for internal ctsem usage.ctWideNames
ctWideToLong Convert ctsem wide to long formatctWideToLong
datastructuredatastructure
Inverse logitinv_logit
Diagnostics for ctsem importance samplingisdiag
log1p_explog1p_exp
longexamplelongexample
OscillatingOscillating
Plots Kalman filter output from ctKalman.plot.ctKalmanDF
plot.ctStanFitctStanPlot plot.ctStanFit
Prior plottingplot.ctStanModel
Plot an approximate continuous-time ACF object from ctACFplotctACF
sdcor2covsdpcor2cov
Analyse divergences in a stanfit objectstan_checkdivergences
Quickly initialise stanfit object from model and datastan_reinitsf
Convert samples from a stanfit object to the unconstrained scalestan_unconstrainsamples
Adjust standata from ctsem to only use specific subjectsstandatact_specificsubjects
Optimize / importance sample a stan or ctStan model.stanoptimis
Runs stan, and plots sampling information while sampling.stanWplot
summary.ctStanFitsummary.ctStanFit
Tests if 2 values are close to each othertest_isclose