Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix combined error / ruv implementation (issue #33) #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marianklose
Copy link

In case you agree with the issue described in #33, I guess it could be simply fixed within parse_model_definitions(). In the likelihood section it leads to this change in the model.stan file (if generated with write_stan_model()):

original

dv_pk ~ normal(ipred_obs_pk, (ruv_prop_pk * ipred_obs_pk + ruv_add_pk));

new

dv_pk ~ normal(ipred_obs_pk, (sqrt(pow(ruv_prop_pk * ipred_obs_pk, 2) + pow(ruv_add_pk, 2))));

and similarily in the simulate_posterior section:

original

for(i in 1:n_obs_pk){
    ipred_ruv_pk[i] = normal_rng(ipred_obs_pk[i], (ruv_prop_pk * ipred_obs_pk[i] + ruv_add_pk));
  }

new

for(i in 1:n_obs_pk){
  ipred_ruv_pk[i] = normal_rng(ipred_obs_pk[i], (sqrt(pow(ruv_prop_pk * ipred_obs_pk[i], 2) + pow(ruv_add_pk, 2))));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant