James-Thorson-NOAA / FishLife

Estimate fish traits for all marine fish species globally
https://james-thorson-noaa.github.io/FishLife/
GNU General Public License v3.0
45 stars 12 forks source link

Error in Update_prediction #16

Closed ebabcock closed 1 year ago

ebabcock commented 3 years ago

Hi Jim, I'm trying to run the update example from the vignette. Ynew_ij = matrix( c("Loo"=log(40),"K"=NA,"Winfinity"=NA,"tmax"=NA,"tm"=NA,"M"=NA,"Lm"=NA,"Temperature"=NA), nrow=1) Update = Update_prediction( Taxon=Search_species(Genus="Sebastes",Species="cortezi",add_ancestors=FALSE)$match_taxonomy, Ynew_ij=Ynew_ij)

And I get this error. "TMB has received an error from Eigen. The following condition was not met: lhs.cols()==rhs.rows() && "invalid matrix product"...

Thanks, Beth

James-Thorson-NOAA commented 3 years ago

I don't think the Update_prediction function is being maintained. It probably has some conflict with the V2 FishLife release that includes life-history parameters. Do you need that functionality, or is it OK to skip for now? (And I realize I should probably remove it from the vignette)

ebabcock commented 3 years ago

I can work around it. Fishbase seems to be up to be quite up to date now so I only found a few new growth papers. Thanks for checking.

medeiroswendel commented 3 years ago

Hi James,

I'm also trying to run the update example from the vignette, and I get the same error, like mentioneted above. Do you have a solution?

"TMB has received an error from Eigen. The following condition was not met: lhs.cols()==rhs.rows() && "invalid matrix product"...

Many thanks

Wendell Medeiros-Leal

James-Thorson-NOAA commented 3 years ago

I still haven't fixed this. there's an easier-to-maintain analytical fix, but it would still require some time to implement. Sorry. Perhaps email me individually so I can assess where to put this in the development stack...?

medeiroswendel commented 3 years ago

Hi Jim,

Many thanks for your fast response. I send below, my code-line and data.

vignette("tutorial","FishLife")Predict=Plot_taxa(Search_species(Genus="Pagellus",Species="bogaraveo")$match_taxonomy,mfrow=c(3,2))Obs_Loo <- c(54.26,54.69,54.26,54.69,54.26,54.69,58.50,57.45,58.89,64.18,51.21,55.70,51.60,81.10,54.90,72.10,54.90,56.67,56.72)Obs_K <- c(0.12,0.12,0.12,0.12,0.12,0.12,0.12,0.1,0.12,0.12,0.14,0.15,0.14,0.06,0.13,0.07,0.13,0.14,0.13)Obs_tmax <- c(5,15,15,15,15,15,12,16,16,16)Obs_tm <- c(4,5)Obs_Lm <- c(24,25,29,30)Obs_M <- c(0.30,0.30,0.20,0.20,0.20,0.20,0.20,0.26,0,20)Ynew_ij <- matrix(c("Loo"=log(Obs_Loo),"K"=log(Obs_K),"Winfinity"=rep(NA,19),"tmax"= log(Obs_tmax),"tm"=log(Obs_tm),"M"=log(Obs_M),"Lm"=log(Obs_Lm), "Temperature"=rep(NA,19)), nrow=19, ncol = 8)

library(TMB)Update = Update_prediction( Taxon=Search_species(Genus="Pagellus",Species="bogaraveo",add_ancestors=FALSE)$match_taxonomy, Ynew_ij=Ynew_ij)

Wendell Melquias Medeiros Leal da Silva, MSc.

MSc Degree Research Fellow

[image: Institute of Marine Research | Central Portal]

IMAR – Institute of Marine Research

Departament of Oceanography and Fisheries, University of the Azores

Rua Prof. Doutor Frederico Machado

9901-862 Horta - Faial

Phone: (+351) 292 200 400 Extension: 4153

Em seg., 21 de jun. de 2021 às 17:38, Jim Thorson @.***> escreveu:

I still haven't fixed this. there's an easier-to-maintain analytical fix, but it would still require some time to implement. Sorry. Perhaps email me individually so I can assess where to put this in the development stack...?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/FishLife/issues/16#issuecomment-865221596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSCIA2QGKPX4CQIYUUWDJ3TT52K3ANCNFSM4V2735PA .

Jhenhsu commented 1 year ago

Hi James, I'm also to run the Update_prediction from the vignette, and I get the error as previous comment. Could you please provide me a solution on this matter? Thank you very much.

"TMB has received an error from Eigen. The following condition was not met: lhs.cols()==rhs.rows() && "invalid matrix product"...

Thank you very much!!!!!! Jhen

James-Thorson-NOAA commented 1 year ago

update_prediction is currently deprecated and I am not currently supporting it. I'll close this thread for now.