Closed Almond-S closed 6 years ago
@ja-thomas can you please look at this?
Problem is here:
I'm not sure why I had to write this (horrible) line... I need to check
Hmmmm, I played around with this some more. I kind of remember why I did it. Since assignment for the parent.frame
was not working correctly and gamboostLSS is writing to the .GlobaleEnv
anyways.
This is pretty bad design from my part, but I didn't find a solution at the time and unfortunately I'm still not sure how to find the correct environment to write the combined_risk
to. This seems to have to do with the fact that we assign functions (with environment) to attributes of objects.
tldr.: This sucks, but I have no idea how to fix it :(
Thanks @ja-thomas for digging into this.
Without having had another look I think the issue is that some functions are defined outside of the relevant environment and hence do not share the same parent environments. Thus, the combined_risk
is written to the wrong place.
Of note, I do not think that gamboostLSS writes to the global environment in other places. We define global variables but only ro get rid of NOTES in R CMD check. Actually, these variables should be defined at the time they are used inside another environment than the global environment.
@Almond-S I am not sure if we should really close this issue. It still isn't solved. Of course it has not the highest priority but it should stay on the list of open issues. Perhaps I'll have some spare time on a train ride can look into this (or someone else has a good idea how to fix this).
With @ja-thomas hints that was easy to fix. combined_risk
simply needed to be defined within mboostLSS_fit
. I'll add some checks to see if it really works and close the issue afterwards.
Thank you both so much!
I had all my simulation studies showing apparently corrupt crossvalidation results, which did not fit to the results with prior gamboostLSS versions, and think that this should have been the problem. And this was kind of the last issue prohibiting me from finishing a project on FDboostLSS for functional responses.
So many thanks again!!
Thanks @hofnerb you're a genius :)
You are more than welcome. Thanks for locating the reason in the first place!
@Almond-S Is it currently sufficient for you to have the bug fixed on github or should we make a quick release to CRAN as well?
I think, having it fixed on gitHub should be completely fine. But if it won't, for whatever reason, I'd get back to you. Thanks again!
attr(model1, "combined_risk")
seems to always relate to the last fitted model instead ofmodel1
. And perhaps related to this issue, the combined_risk cannot be returned when fitting multiple models withmclapply
: