Skip to content

Commit

Permalink
Adjust combined error implementation (fix InsightRX#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianklose committed Dec 22, 2023
1 parent c722355 commit 83bc70b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/parse_model_definitions.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ parse_model_definitions <- function(
"if(ltbs_", obs_types, ") {", cr, " ",
" log_dv_", obs_types, " ~ normal(log(ipred_obs_", obs_types, "), ruv_add_", obs_types, "); ", cr, " ",
"} else {", cr, " ",
" dv_", obs_types, " ~ normal(ipred_obs_", obs_types, ", (ruv_prop_", obs_types, " * ipred_obs_", obs_types, " + ruv_add_", obs_types,"));", cr, " ",
" dv_", obs_types, " ~ normal(ipred_obs_", obs_types, ", (sqrt(pow(ruv_prop_", obs_types, " * ipred_obs_", obs_types, ", 2) + pow(ruv_add_", obs_types,", 2)));", cr, " ",
"}"
)

Expand All @@ -214,7 +214,7 @@ parse_model_definitions <- function(
paste0("real ipred_ruv_", obs_types, "[n_obs_", obs_types, "];"),
paste0(
"for(i in 1:n_obs_", obs_types, "){", cr, " ",
" ipred_ruv_", obs_types, "[i] = normal_rng(ipred_obs_", obs_types, "[i], (ruv_prop_", obs_types, " * ipred_obs_", obs_types, "[i] + ruv_add_", obs_types, "));", cr, " ",
" ipred_ruv_", obs_types, "[i] = normal_rng(ipred_obs_", obs_types, "[i], (sqrt(pow(ruv_prop_", obs_types, " * ipred_obs_", obs_types, "[i], 2) + pow(ruv_add_", obs_types, ", 2)));", cr, " ",
"}"
)
)
Expand Down

0 comments on commit 83bc70b

Please sign in to comment.