Closed chantelwetzel-noaa closed 6 months ago
Attaching a txt document with the output from rlang::last_trace() since the format got messed up in the original issue.
@chantelwetzel-noaa I have been doing some research to try and remedy this bug that I built into the code accidently. And, I believe that the easiest way to fix it is to change the configuration file to just have a single column for spatiotemporal instead of spatiotemporal1 and spatiotemporal2. That way we can pass either a vector or a single character to the spatiotemporal column. Does that sound like an okay fix? And, sorry it took me so long to wrap my head around how to get this done.
I think that proposed approach is reasonable and would resolve the issues I was encountering when running tweedie model (see fix-tweedie branch) but I am not sure if that would fix this error. Let me test this out locally and let you know what I get back.
Right, I got mixed up on the issue. This is an error with the mapping of the residuals. I just got the same error on my machine, so I can investigate it.
This is happening because in fit[["data"]]
the names are as follows:
Browse[1]> names(fit[["data"]])
[1] "year" "fyear" "survey_name"
[4] "common_name" "catch_numbers" "catch_weight"
[7] "effort" "pass_scaled" "vessel_year"
[10] "longitude" "latitude" "depth"
[13] "depth_scaled" "depth_scaled_squared" "x"
[16] "y" "residuals"
and it is expected that there would be "residuals_2"
as well.
Looks like I broke the code here:
if (
lookup_is_delta(fit[["formula"]]) &&
lookup_is_mixture(fit[["formula"]])
) {
fit[["data"]][["residuals2"]] <- stats::residuals(fit, model = 2)
}
I will fix it.
Is there an existing issue for this?
Current Behavior
The diagnostic plots error out for delta models (have not fully tested for tweedie models) on the following lines in the diagnose function:
The error that prints to the screen is:
And output from rlang::last_trace() is:
Environment
Anything else?
No response