Description Usage Arguments Value
View source: R/importance_sampling.R
This function calculates importance weights for a previously fitted Stan model given a new set of input data. Given a stanfit object with MCMC samples and a new set of input data for the stan model, calculate importance sampling weights. For example, a time series model predicting into the future can be updated with new data post-hoc when data becomes available.
1 2 3 4 5 6 | importance_sampling(
originalFit,
oldData,
newData,
model_code = originalFit@stanmodel@model_code[1]
)
|
originalFit |
stanfit containing MCMC samples |
oldData |
list() containing data used to fit originalFit |
newData |
list() containing the new input data |
model_code |
string containing Stan model code for originalFit (optional) |
list containing weights, neff, lpOriginal and lpNew
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.