Skip to content

Commit

Permalink
only extract frac_obs if obs_scale_sd exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Feb 20, 2024
1 parent 710b00b commit c25de34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ extract_parameter_samples <- function(stan_fit, data, reported_dates,
value.V1 := NULL
]
}
if (data$obs_scale_sd > 0) {
if ("obs_scale_sd" %in% names(data) && data$obs_scale_sd > 0) {
out$fraction_observed <- extract_static_parameter("frac_obs", samples)
out$fraction_observed <- out$fraction_observed[, value := value.V1][,
value.V1 := NULL
Expand Down

0 comments on commit c25de34

Please sign in to comment.