I am working on Bayesian analysis and save it using saveRDS(resStan, "resStan.rds") script. Unfortunately, I forgot the generative quantity block in the script. Now, I want to add it as new, therefore, is it possible to add the generative Quantity block on the resStan.rds file with out repeating the whole steps?
If you don’t want to rerun the whole model, you could extract mu from the stanfit object, then compute y_hat in R. Alternatively, use the gqs function as suggested by @bgoodri.
If what you want is to have the y_hat inside the same stanfit object that you already created, I don’t know if that’s doable, but perhaps someone will chime in with a way to do it.