You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to add several columns to the summary_log() output.
AIC
This is a straightforward calculation. Consider if there are any edge cases to catch.
Example code
add_aic<-function(.runlog) {
## check summary log appendedif(any(str_detect(names(.runlog), "param_count")) &
any(str_detect(names(.runlog), "ofv"))) {
return(mutate(.runlog, aic=2*param_count+ofv))
}
## if not, return unchanged
warning("AIC could not be computed")
return(.runlog)
}
dOFV
The change in OFV from the parent model. Several considerations:
What to do if there are multiple models in based_on? Likely select the first?
What to do if the based on model has NA for ofv? This could happen with Bayesian models, or the new bootstrap model type.
Example code
## compare ofv to that of the model in based_on## if multiple models are in based_on, use the firstadd_dofv<-function(.runlog) {
.runlog %>%
mutate(based_on_join=purrr::map_chr(based_on, function(x) {ifelse(length(x) >0, x[1], NA)})) %>%
left_join(
select(.runlog, based_on_join=run, based_on_ofv=ofv),
by="based_on_join"
) %>%
mutate(dofv= as.numeric(format(ofv-based_on_ofv, nsmall=2))) %>%
select(-based_on_ofv, -based_on_join)
}
dAIC
If we're adding the above, should we also calculate the difference in AIC?
The text was updated successfully, but these errors were encountered:
Once consideration worth talking about: summary logs dont have a based_on column, which is required for add_dofv. Do we:
want to only implement this for run_log() %>% add_summary(), or
add based_on to the summary_log (and maybe even the config_log()).
I dont think it would make sense to remove the based_on column when dofv is present (i.e. dont just add it to compute dofv, and then remove), as this could cause confusion.
We would like to add several columns to the
summary_log()
output.AIC
This is a straightforward calculation. Consider if there are any edge cases to catch.
Example code
dOFV
The change in OFV from the parent model. Several considerations:
based_on
? Likely select the first?NA
forofv
? This could happen with Bayesian models, or the new bootstrap model type.Example code
dAIC
If we're adding the above, should we also calculate the difference in AIC?
The text was updated successfully, but these errors were encountered: