Data4DM / BayesSD

Data for Decision, Affordable Analytics for All
8 stars 0 forks source link

Stochasticity in function block #27

Closed hyunjimoon closed 1 year ago

hyunjimoon commented 1 year ago

Relevant to previously discussed topic with @Dashadower which he might have mentioned could be done with C++ coding.

Semantic error in '/Users/hyunjimoon/Dropbox/tolzul/BayesSD/ContinuousCode/5_BayesCalib/stan_files/mngInven_lookup_functions_manual.stan', line 103, column 98, included from
'/Users/hyunjimoon/Dropbox/tolzul/BayesSD/ContinuousCode/5_BayesCalib/stan_files/mngInven_lookup_draws2data_manual.stan', line 2, column 0:
   -------------------------------------------------
   101:      real order_fulfillment_rate = shipment_rate;
   102:      real time_step = 0.0625;
   103:      real white_noise = noise_standard_deviation * 24 * noise_correlation_time / time_step ^ 0.5 * uniform_rng(0,1) - 0.5;
                                                                                                           ^
   104:      real change_in_process_noise = process_noise - white_noise / noise_correlation_time;
   105:      real process_noise_dydt = change_in_process_noise;
   -------------------------------------------------

Random number generators are only allowed in transformed data block, generated quantities block or user-defined functions with names ending in _rng.
hyunjimoon commented 1 year ago

This is resolved by feeding randomly generated data (via stan data block).