-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Hi All,
@aanh1009 @aabrossi @Ajordan00 @calebboxwell @IzzyTheChromodoris @jabren26-dev @lrkerm28-spec @livmacel @lnblom28 @pkhuat @rohanunis @shantgard @snnaroola @canura8818 @zoeahmiegbe @SeascapeScience @btupper
@ngvt1n alerted me that I have a rather big bug in the tutorials...
message start
In the tutorials, page "Models" prepares model_input and converts depth to log10(depth) (in the log_me field), then feeds this data into tuning and fitting the model. However, in page "Prediction", when we pull the Brickman data again, we don't apply the depth conversion for present and the 2075 forecast, leading to the depth being wayyy off scale, skewing the entire prediction.
A simple fix like
covars_rcp85_2075 = read_brickman(db |> filter(scenario == "RCP85",
year == 2075,
interval == "mon"),
add = c("depth", "month")) |>
mutate(depth = log10(depth)) |> # <---- the fix is here
select(all_of(cfg$keep_vars))
worked for me! I know because finally, GLM works and doesn't give me back a 100% black map.
message end
Doh! Clearly I flubbed that! Please note that the bug only affects the last step when you use predict_stars. keep in mind that if you used Xbtm, too, and log scaled it to build the model, then be sure to log scale it in the prediction data, too.
If you have submitted your paper already please don't worry about it. If you are almost done and are ready to send the paper in please don't worry about it. If you haven't even started your paper then please take the time to fix your code as Tin shows above. And, of course, if you are just curious to see what difference correcting the error makes then go ahead and give the fix a shake.
That was a great catch, and I am so sorry that this error leaked through.