Skip to content

g3_iterative: Error in if (is.na(attr(lik_init, "nll"))) { : argument is of length zero #28

@MikkoVihtakari

Description

@MikkoVihtakari

I get the error in the title when trying to run my model through g3_iterative(). The error stems from this line and, further, from here and results from adfun$report(adfun$par) not returning a list element named nll (see the output below). Has something been changed somewhere or is this issue specific to my model?

adfun <- gadget3::g3_tmb_adfun(tmb_model, tmb_param, type = 'Fun')
res <- adfun$report(adfun$par)
names(adfun$report(adfun$par))

[1] "nll_adist_surveyindices_log_Juv_SI_1__weight"       "adist_surveyindices_log_SI_48_obs__wgt"            
 [3] "adist_surveyindices_log_SI_48_model__wgt"           "nll_cdist_sumofsquares_RussianS_ldist__weight"     
 [5] "nll_cdist_sumofsquares_TrawlNor_ldist__num"         "cdist_sumofsquares_OtherNor_ldist_model__num"      
 [7] "nll_cdist_sumofsquares_RussianS_ldist__num"         "nll_cdist_sumofsquares_OtherNor_ldist__num"        
 [9] "nll_cdist_sumofsquares_EggaS_ldist__weight"         "cdist_sumofsquares_TrawlRus_ldist_obs__num"        
[11] "cdist_sumofsquares_EggaN_aldist_male_obs__num"      "nll_cdist_sumofsquares_EggaN_aldist_male__num"     
[13] "cdist_sumofsquares_RussianS_sexdist_obs__num"       "cdist_sumofsquares_RussianS_ldist_model__num"      
[15] "cdist_sumofsquares_TrawlNor_sexdist_model__num"     "adist_surveyindices_log_Juv_SI_2_model__params"    
[17] "nll_adist_surveyindices_log_SI_28_47__weight"       "cdist_sumofsquares_OtherNor_ldist_obs__num"        
[19] "cdist_sumofsquares_RussianS_ldist_obs__num"         "cdist_sumofsquares_RussianS_sexdist_model__num"    
[21] "nll_cdist_sumofsquares_EggaN_aldist_female__weight" "nll_cdist_sumofsquares_EggaS_matp__weight"         
[23] "nll_cdist_sumofsquares_RussianS_sexdist__num"       "cdist_sumofsquares_EggaN_aldist_female_model__num" 
[25] "nll_cdist_sumofsquares_EggaS_ldist__num"            "cdist_sumofsquares_EcoS_ldist_model__num"          
[27] "nll_adist_surveyindices_log_Juv_SI_2__wgt"          "cdist_sumofsquares_EggaN_ldist_model__num"         
[29] "nll_cdist_sumofsquares_EcoS_ldist__num"             "nll_adist_surveyindices_log_Juv_SI_1__wgt"         
[31] "nll_cdist_sumofsquares_OtherNor_ldist__weight"      "cdist_sumofsquares_TrawlNor_ldist_obs__num"        
[33] "cdist_sumofsquares_WinterS_ldist_obs__num"          "cdist_sumofsquares_EcoS_ldist_obs__num"            
[35] "cdist_sumofsquares_TrawlNor_sexdist_obs__num"       "cdist_sumofsquares_EggaS_ldist_obs__num"           
[37] "nll_cdist_sumofsquares_EggaN_ldist__num"            "nll_cdist_sumofsquares_EcoS_sexdist__weight"       
[39] "nll_adist_surveyindices_log_SI_48__wgt"             "nll_cdist_sumofsquares_TrawlNor_sexdist__weight"   
[41] "nll_cdist_sumofsquares_TrawlRus_sexdist__num"       "nll_cdist_sumofsquares_TrawlNor_sexdist__num"      
[43] "cdist_sumofsquares_EcoS_sexdist_obs__num"           "adist_surveyindices_log_SI_28_47_model__params"    
[45] "adist_surveyindices_log_SI_28_47_obs__wgt"          "nll_cdist_sumofsquares_EggaN_ldist__weight"        
[47] "cdist_sumofsquares_TrawlRus_sexdist_model__num"     "cdist_sumofsquares_OtherNor_sexdist_obs__num"      
[49] "nll_cdist_sumofsquares_OtherNor_sexdist__num"       "cdist_sumofsquares_EggaS_ldist_model__num"         
[51] "cdist_sumofsquares_EggaS_matp_obs__num"             "adist_surveyindices_log_Juv_SI_1_model__params"    
[53] "nll_adist_surveyindices_log_SI_28_47__wgt"          "cdist_sumofsquares_WinterS_ldist_model__num"       
[55] "nll_cdist_sumofsquares_EggaS_matp__num"             "cdist_sumofsquares_TrawlNor_ldist_model__num"      
[57] "cdist_sumofsquares_TrawlRus_ldist_model__num"       "cdist_sumofsquares_OtherNor_sexdist_model__num"    
[59] "nll_understocking__wgt"                             "nll_cdist_sumofsquares_TrawlRus_sexdist__weight"   
[61] "adist_surveyindices_log_SI_28_47_model__wgt"        "nll_cdist_sumofsquares_OtherNor_sexdist__weight"   
[63] "nll_adist_surveyindices_log_Juv_SI_2__weight"       "nll_adist_surveyindices_log_SI_48__weight"         
[65] "nll_cdist_sumofsquares_EggaN_matp__num"             "nll_cdist_sumofsquares_EcoS_sexdist__num"          
[67] "nll_cdist_sumofsquares_EcoS_ldist__weight"          "adist_surveyindices_log_Juv_SI_1_obs__wgt"         
[69] "nll_cdist_sumofsquares_RussianS_sexdist__weight"    "adist_surveyindices_log_SI_48_model__params"       
[71] "nll_cdist_sumofsquares_WinterS_ldist__weight"       "nll_cdist_sumofsquares_TrawlNor_ldist__weight"     
[73] "nll_cdist_sumofsquares_EggaN_aldist_male__weight"   "cdist_sumofsquares_EggaN_matp_model__num"          
[75] "nll_cdist_sumofsquares_EggaN_aldist_female__num"    "cdist_sumofsquares_EggaS_matp_model__num"          
[77] "cdist_sumofsquares_EggaN_aldist_female_obs__num"    "nll_cdist_sumofsquares_TrawlRus_ldist__num"        
[79] "nll_cdist_sumofsquares_TrawlRus_ldist__weight"      "adist_surveyindices_log_Juv_SI_2_obs__wgt"         
[81] "adist_surveyindices_log_Juv_SI_1_model__wgt"        "nll_cdist_sumofsquares_EggaN_matp__weight"         
[83] "cdist_sumofsquares_EggaN_matp_obs__num"             "cdist_sumofsquares_EggaN_ldist_obs__num"           
[85] "adist_surveyindices_log_Juv_SI_2_model__wgt"        "nll_cdist_sumofsquares_WinterS_ldist__num"         
[87] "cdist_sumofsquares_EggaN_aldist_male_model__num"    "cdist_sumofsquares_TrawlRus_sexdist_obs__num"      
[89] "cdist_sumofsquares_EcoS_sexdist_model__num"        

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions