Discuss merging dsge_simulated_theoretical_correlation and dsge_simulated_theoretical_covariance
dsge_simulated_theoretical_covariance
sets options_.ar = 0
before calling th_autocovariances
. dsge_simulated_theoretical_correlation
again calls th_autocovariances
and therefore recomputes the variance. One call with options_.nar
would suffice. This inefficiency is even more pronounced at higher order with pruning
where we need to call pruned_state_space_system
.
We should either
- Merge the two functions.
- Have
dsge_simulated_theoretical_covariance
compute and store everything and only usedsge_simulated_theoretical_correlation
to fill the fields.