Package: ctsem 3.11.0

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. See <https://osf.io/preprints/psyarxiv/4q9ex_v2> for a detailed tutorial. 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> . <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.11.0.tar.gz
ctsem_3.11.0.zip(r-4.7)ctsem_3.11.0.zip(r-4.6)ctsem_3.11.0.zip(r-4.5)
ctsem_3.11.0.tgz(r-4.6-x86_64)ctsem_3.11.0.tgz(r-4.6-arm64)ctsem_3.11.0.tgz(r-4.5-x86_64)ctsem_3.11.0.tgz(r-4.5-arm64)
ctsem_3.11.0.tar.gz(r-4.7-arm64)ctsem_3.11.0.tar.gz(r-4.7-x86_64)ctsem_3.11.0.tar.gz(r-4.6-arm64)ctsem_3.11.0.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
ctsem/json (API)

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

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

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

On CRAN:

Conda:

stochastic-differential-equationstime-seriescpp

8.33 score 48 stars 1 packages 327 scripts 926 downloads 2 mentions 73 exports 61 dependencies

Last updated from:f1426ed908. Checks:11 WARNING, 1 ERROR, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING806
linux-devel-x86_64WARNING777
source / vignettesERROR702
linux-release-arm64WARNING734
linux-release-x86_64WARNING762
macos-release-arm64WARNING430
macos-release-x86_64WARNING1030
macos-oldrel-arm64WARNING665
macos-oldrel-x86_64WARNING1055
windows-develWARNING1013
windows-releaseWARNING929
windows-oldrelWARNING998
wasm-releaseFAIL236

Exports:ctACFctACFresidualsctAddSamplesctCheckFitctChisqTestctCollapsectDeintervalisectDiscreteParsctDiscreteParsPlotctDiscretiseDatactDocsctEmpiricalBayesFitctExtractctFitctFitAddSamplesctFitCovCheckctFitCovCheckPlotctFitUpdatectGeneratectGenerateFromFitctGenerateFromPriorsctIntervalisectKalmanctKalmanArrayctLongToWidectLOOctModelctModelConvertOMXctModelCoverage_checkctModelHigherOrderctModelLatexctModelMatricesctModelMatrices<-ctOptimUncertaintyctPlotArrayctPlotPosteriorctPolyctPostPredDatactPostPredictctPostPredPlotsctPredictctPredictTIPctRawParnamesctResidualsctStanContinuousParsctStanDiscreteParsctStanDiscreteParsPlotctStanFitctStanFitUpdatectStanGeneratectStanGenerateFromFitctStanKalmanctStanModelctStanParnamesctStanPlotPostctStanPostPredictctStanSubjectParsctStanTIpredeffectsctSubjectParsctSummaryMatricesctTIpredEffectsctWideNamesctWideToLonginv_logitlog1p_expplot.ctKalmanDFplotctACFsdpcor2covstan_reinitsfstan_unconstrainsamplesstandatact_specificsubjectsstanWplottest_isclose

Dependencies:abindbackportsBHcallrcheckmateclicOdecorpcorcpp11data.tableDerivdescdistributionalexpmfarvergenericsggplot2gluegridExtragtableinlineisobandlabelinglatticelifecycleloomagrittrMASSMatrixmatrixStatsmizemvtnormnumDerivotelparallellypillarpkgbuildpkgconfigplyrpngposteriorprocessxpsQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstanrstantoolsS7scalesStanHeaderstensorAtibbleutf8vctrsviridisLitewithr

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
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
ctDiscreteParsctDiscretePars ctStanDiscretePars
ctDiscreteParsPlotctDiscreteParsPlot ctStanDiscreteParsPlot
Discretise long format continuous time (ctsem) data to specific timestep.ctDiscretiseData
Get documentation pdf for ctsemctDocs
Empirical Bayes subject-wise ctsem fitsctEmpiricalBayesFit
ctExample1ctExample1
ctExample1TIpredctExample1TIpred
ctExample2ctExample2
ctExample2levelctExample2level
ctExample3ctExample3
ctExample4ctExample4
Extract samples from a ctStanFit objectctExtract extract
Fit a ctsem modelctFit ctStanFit
Sample more values from an optimized ctstanfit objectctAddSamples ctFitAddSamples
Visual lagged covariance or correlation diagnostics for ctsem fits.ctFitCovCheck
ctFitCovCheckPlotctFitCovCheckPlot
Update a ctStanFit objectctFitUpdate ctStanFitUpdate
ctGeneratectGenerate
Add a '$generated' object to ctstanfit object, with random data generated from posterior of ctstanfit objectctGenerateFromFit ctStanGenerateFromFit
Generate data from a ctstanmodel objectctGenerateFromPriors ctStanGenerate
Converts absolute times to intervals for wide format ctsem panel datactIntervalise
Get Kalman filter estimates from a ctStanFit objectctKalmanArray ctStanKalman
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
Convert an old OpenMx-style ctsem model to the modern ctsem model format.ctModelConvertOMX ctStanModel
Coverage Check FunctionctModelCoverage_check
Raise the order of a ctsem type ='omx' model object.ctModelHigherOrder
Generate and optionally compile latex equation of subject level ctsem model.ctModelLatex
Matrix view for ctStanModel objectsctModelMatrices ctModelMatrices<-
Update optimized ctsem uncertainty estimatesctOptimUncertainty
Plots three dimensional y values for quantile plotsctPlotArray
ctPlotPosteriorctPlotPosterior ctStanPlotPost
Plots uncertainty bands with shadingctPoly
Create a data.table to compare data generated from a ctsem fit with the original data.ctPostPredData
Compares model implied density and values to observed, for a ctStanFit object.ctPostPredict ctStanPostPredict
Create diagnostic plots to assess the goodness-of-fit for a ctsem model.ctPostPredPlots
ctPredictctKalman ctPredict
ctPredictTIPctPredictTIP
ctRawParnamesctRawParnames ctStanParnames
Extract Standardized Residuals from a ctsem FitctResiduals
ctstantestdatctstantestdat
ctstantestfitctstantestfit
Update an already compiled and fit ctStanFit objectctStanUpdModel
Extract an array of subject specific parameters from a ctStanFit object.ctStanSubjectPars ctSubjectPars
ctSummaryMatricesctStanContinuousPars ctSummaryMatrices
Get time independent predictor effect estimatesctStanTIpredeffects ctTIpredEffects
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
log1p_explog1p_exp
longexamplelongexample
OscillatingOscillating
Plots prediction output from ctPredict.plot.ctKalmanDF
plot.ctStanFitctStanPlot plot.ctStanFit
Prior plottingplot.ctStanModel
Plot an approximate continuous-time ACF object from ctACFplotctACF
Print ctStanFit summariesprint.summary.ctStanFit
sdcor2covsdpcor2cov
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
Summarise empirical Bayes subject-wise ctsem fitssummary.ctEmpiricalBayesFit
summary.ctStanFitsummary.ctStanFit
Tests if 2 values are close to each othertest_isclose