cmlegault / IBMWG

Index Based Methods Working Group
0 stars 1 forks source link

a number of IBMs not working #38

Closed cmlegault closed 4 years ago

cmlegault commented 4 years ago

see mse_checks.rds in main directory (created by do_mse_test.R in code directory)

liz-brooks commented 4 years ago

this seems like the same issue as #37, with perhaps a more recent (by hours?) identification of the particular methods/scenarios. perhaps close #37 and just refer to this issue?

On Tue, Sep 22, 2020 at 4:45 PM Chris Legault notifications@github.com wrote:

see mse_checks.rds in main directory (created by do_mse_test.R in code directory)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cmlegault/IBMWG/issues/38, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFL5LJZHSUCEMZK64APCODSHEEH7ANCNFSM4RWHJEEQ .

--


Liz Brooks, PhD
Operations Research Analyst
Population Dynamics Branch
NOAA/NMFS
Northeast Fisheries Science Center
166 Water Street                       phone: 508.495.2238
Woods Hole, MA  02543             fax: 508.495.2393
timjmiller commented 4 years ago

@gavinfay @cmlegault design matrix IBM elements for planbsmooth need to say "planBsmoothfxn" so that this function is used instead of ApplyPlanBsmooth_fast.

cmlegault commented 4 years ago

setup_scenario.R has code that is supposed to handle this IBM = case_when( IBM == "PlanBsmooth" ~ "planBsmoothfxn",

This approach is needed for the Empirical Approaches (due to multiple approaches within one call). I could change design_matrix.R to use planBsmoothfxn instead of PlanBsmooth if that would be easier.

timjmiller commented 4 years ago

@gavinfay As the code is now, it also appears that helper functions in wham_mse_functions.R are not available to the IBM functions when using furrr. E.g., when M_CC is the IBM it uses DLM_Z, but it doesn't exist. Same with Expandsurveymodified using get.stable.period.

liz-brooks commented 4 years ago

that identifies some of the methods that had problems in summarize_results (pasted below, but see also issue #37). i don't have chris's mse_checks handy, but when i previously looked i noticed some differences in the methods and attributed it to possibly some fixes having taken place between my run and chris's. anyway, just a note to double check by running do_mse_test.R and also testing summarize_results.R.

the problems i found and corresponding method name in progress table are: [1,] "18" "true_Skate_CR" [2,] "19" "true_Skate_CR" [3,] "20" "true_Skate_CR" [4,] "21" "true_Skate_CR" [5,] "22" "true_Skate_CR" [6,] "23" "true_Skate_CR" [7,] "24" "true_Skate_CR" [8,] "25" "M_CC" [9,] "26" "M_CC" [10,] "27" "M_CC" [11,] "28" "M_CC" [12,] "29" "M_CC" [13,] "30" "M_CC" [14,] "31" "M_CC" [15,] "32" "M_CC" [16,] "33" "planBsmoothfxn" [17,] "58" "ExpandSurvey_modified" [18,] "59" "ExpandSurvey_modified" [19,] "60" "ExpandSurvey_modified" [20,] "61" "ExpandSurvey_modified" [21,] "62" "ExpandSurvey_modified" [22,] "63" "ExpandSurvey_modified" [23,] "64" "ExpandSurvey_modified" [24,] "65" "ExpandSurvey_modified" [25,] "74" "run.aim" [26,] "75" "run.aim" [27,] "76" "run.aim" [28,] "77" "run.aim" [29,] "78" "run.aim" [30,] "79" "run.aim" [31,] "80" "run.aim" [32,] "81" "M_CC" [33,] "82" "M_CC" [34,] "83" "M_CC" [35,] "84" "M_CC" [36,] "85" "M_CC" [37,] "86" "M_CC" [38,] "87" "M_CC" [39,] "88" "M_CC" [40,] "89" "M_CC" [41,] "90" "M_CC" [42,] "91" "M_CC" [43,] "92" "M_CC" [44,] "93" "M_CC" [45,] "94" "M_CC" [46,] "95" "M_CC" [47,] "96" "M_CC" [48,] "97" "JoeDLM"

On Thu, Sep 24, 2020 at 2:40 PM Tim Miller notifications@github.com wrote:

@gavinfay https://github.com/gavinfay As the code is now, it also appears that helper functions in wham_mse_functions.R are not available to the IBM functions when using furrr. E.g., when M_CC is the IBM it uses DLM_Z, but it doesn't exist. Same with Expandsurveymodified using get.stable.period.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cmlegault/IBMWG/issues/38#issuecomment-698518574, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFL5LKPV5P6ML2PGIQ2WR3SHOHBLANCNFSM4RWHJEEQ .

--


Liz Brooks, PhD
Operations Research Analyst
Population Dynamics Branch
NOAA/NMFS
Northeast Fisheries Science Center
166 Water Street                       phone: 508.495.2238
Woods Hole, MA  02543             fax: 508.495.2393
timjmiller commented 4 years ago

@rich-bell I fixed several library-specific function calls, but still get this error in JoeDLM:

Error in Wsave[, , it] <- mod$W: number of items to replace is not a multiple of replacement length

rich-bell commented 4 years ago

JoeDLM only takes three inputs, the catch, the number of years between assessments and the seasonal index. And it uses two packages

require(dlm)

require(RandomFieldsUtils)

If it is getting to Wsave[, , it] <- mod$W then the dynamic linear model is running and the MCMC ran. If the function is getting the three input objects and the packages are loaded, I do not know what would be wrong. I can forward this on to Joe. He would require the y object list. that is being input. @timjmiller

timjmiller commented 4 years ago

In recent push to repo, I have reduced the errors to just two methods. @gavinfay @cmlegault For planBsmoothfxn we still get this error: Error in match.arg(method): object 'Year' not found I believe it is occuring in ApplyPlanBsmooth_fast

@rich-bell @cmlegault For JoeDLM we get this error: Error in x[, i] <- m$residuals: number of items to replace is not a multiple of replacement length I think it pertains to line 1104, but not sure how to fix it. If this requires Joe to deal with it and we can get planBsmooth working perhaps skip over JoeDLM for now to get simulations going.

rich-bell commented 4 years ago

@cmlegault @timjmiller Joe is working on his function and hopefully it will be ready by Monday.

cmlegault commented 4 years ago

Fixed the PlanBsmooth problems. Definitely in the "duh" category. Just needed to declare which packages were needed for filter and drop_na (dplyr and tidyr, respectively). The do_mse_test.R code now only shows JoeDLM in mse_check$IBM.

rich-bell commented 4 years ago

@timjmiller @cmlegault Joe edited his function and it is now uploaded to the WHAM_MSE_function.R

cmlegault commented 4 years ago

All IBMs appear to be working. Thanks everyone!