Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctStanKalman

Get Kalman filter estimates from a ctStanFit object


Description

Get Kalman filter estimates from a ctStanFit object

Usage

ctStanKalman(
  fit,
  nsamples = NA,
  pointest = TRUE,
  collapsefunc = NA,
  cores = 1,
  standardisederrors = FALSE,
  subjectpars = TRUE,
  tformsubjectpars = TRUE,
  indvarstates = FALSE,
  ...
)

Arguments

fit

fit object from ctStanFit.

nsamples

either NA (to extract all) or a positive integer from 1 to maximum samples in the fit.

pointest

If TRUE, uses the posterior mode as the single sample.

collapsefunc

function to apply over samples, such as mean

cores

Integer number of cpu cores to use. Only needed if savescores was set to FALSE when fitting.

standardisederrors

If TRUE, computes standardised errors for prior, upd, smooth conditions.

subjectpars

if TRUE, state estimates are not returned, instead, predictions of each subjects parameters are returned, for parameters that had random effects specified.

tformsubjectpars

if FALSE, subject level parameters are returned in raw, pre transformation form.

indvarstates

if TRUE, do not remove indvarying states from output

...

additional arguments to collpsefunc.

Value

list containing Kalman filter elements, each element in array of iterations, data row, variables. llrow is the log likelihood for each row of data.

Examples

if(w32chk()){
k=ctStanKalman(ctstantestfit,subjectpars=TRUE,collapsefunc=mean)
}

ctsem

Continuous Time Structural Equation Modelling

v3.4.3
GPL-3
Authors
Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.