samueldnj / hierProdAnalysis

A simulation-estimation model for that compares the performance of hierarchical multispecies and single species surplus production stock assessment models.
0 stars 0 forks source link

Simulating covariance #3

Closed samueldnj closed 7 years ago

samueldnj commented 8 years ago

Add a function in simulation.R that takes an array of standard normal IID deviations and a covariance matrix (or representative thereof) and returns a the corresponding covarying array of deviations. These correlated deviations can then be passed to the dynamics or observation models when creating data or true dynamics.

samueldnj commented 7 years ago

Added functions fillRanWalk (taken from mseR) and genCorrDevs (new) that add the required functionality.

There are lingering questions about what these should return: log-scale or exp-scale (bias corrected) deviations, I think a logical switch as one of the function arguments is probably wise.