Extracts a time-varying latent state from a list of stan output and returns
it as a
<data.table>.
extract_latent_state(param, samples, dates)A <data.frame> containing the following columns:
Integer index (1..N) corresponding to the position in the supplied dates vector. This is the row/time-step index that maps to the date column
The date corresponding to this time step
Integer sample ID from the posterior
Numeric value of the parameter sample
Character string indicating the latent state to extract
Extracted stan model (using rstan::extract())
A vector identifying the dimensionality of the latent state to extract. Generally this will be a date.