Open biancapossamai opened 6 years ago
Hi Bia,
The warning messages are due to an issue in another R package that MixSIAR used. I've fixed this bug but haven't pushed a new version to CRAN yet. The warnings don't affect the model, but if you'd like to make them go away, install the version of MixSIAR on github:
library(devtools)
install_github("brianstock/MixSIAR", dependencies=TRUE)
Looks like a mismatch between your data and the options you're selecting for random/fixed effects. Do you have source data by factor 1 or 2? Are all of the sources present at all levels of your factors? You'll need to share more about your scientific question, data, and what model options you're using.
Hi Brian! Firstly, thank you! My factors are "year' (7 levels) and 'species' (4 levels). I have seven years of data (seasonally - 2010 to 2016) of various fishes. The fishes were classified into four trophic guilds. All years contains all guilds and sources.
'Years' is fixed and 'Guilds' is random. The source data change by year (factor 1).
Example of my tables:
str(mix) List of 21 $ data :'data.frame': 529 obs. of 4 variables: ..$ d13C : num [1:529] -19 -17.8 -16.7 -14.3 -14.2 ... ..$ d15N : num [1:529] 10.6 10.2 10.4 10.4 10 ... ..$ Year : int [1:529] 2010 2010 2010 2010 2010 2010 2010 2010 2010 2010 ... ..$ GUILD: Factor w/ 4 levels "DTV","OMN","ZBV",..: 1 1 1 1 1 1 1 1 1 1 ... $ data_iso : num [1:529, 1:2] -19 -17.8 -16.7 -14.3 -14.2 ...
d13C,d15N,Year,GUILD -15.30,12.77,2010,ZPL -15.38,13.52,2010,ZPL -15.38,13.80,2010,ZPL -10.95,11.55,2011,DTV -9.26,7.98,2011,DTV -10.73,9.64,2011,DTV -9.46,11.24,2011,DTV -10.81,10.92,2011,DTV -12.06,9.07,2011,DTV -17.73,8.41,2011,DTV -7.53,7.95,2011,DTV -10.15,9.80,2011,OMN -12.65,10.70,2011,OMN -14.04,9.44,2011,OMN -12.52,11.59,2011,OMN -16.57,15.10,2011,ZBV -14.72,11.31,2011,ZBV -12.20,12.39,2011,ZBV -12.45,12.74,2011,ZBV -14.14,12.03,2011,ZPL -14.59,11.41,2011,ZPL -14.98,12.73,2011,ZPL
str(source) List of 15 $ n.sources : int 4 $ source_names : chr [1:4] "benthic_C3" "benthic_C4" "detritus" "pelagic"
,Year,Meand13C,SDd13C,Meand15N,SDd15N,n benthic_C3,2010,-27.16,0.98,6.02,1.84,24 benthic_C3,2011,-25.47,1.45,5.80,1.02,17 benthic_C3,2012,-27.46,0.62,6.18,1.14,3 benthic_C3,2013,-25.95,1.57,4.97,2.07,18 benthic_C3,2014,-27.33,1.19,8.64,1.65,18 benthic_C3,2015,-27.65,0.77,8.31,0.96,12 benthic_C3,2016,-28.16,1.07,7.97,1.80,9 benthic_C4,2010,-11.66,1.27,6.52,1.42,41 benthic_C4,2011,-12.40,1.46,6.18,1.43,18 benthic_C4,2012,-13.18,0.38,6.02,0.29,6
Thank you for your attention! Bia
Hi Brian, I am still having a problem with MixSIAR. JAGS can't run the model. The error is about the nodes...
"Error in node src_tau[4,1,6] Invalid parent values"
The script:
model_filename <- "MixSIAR_model.txt" # Name of the JAGS model file resid_err <- TRUE process_err <- TRUE write_JAGS_model(model_filename, resid_err, process_err, mix, source) run <- list(chainLength=200000, burn=150000, thin=50, chains=3, calcDIC=TRUE) jags.1 <- run_model(run="test", mix, source, discr, model_filename,
- alpha.prior = 1, resid_err, process_err) Compiling model graph Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 131 Unobserved stochastic nodes: 142 Total graph size: 6547
Initializing model Deleting model
I have one species with isotopic values between 2010-2016 and the years seasons. I want to know the variation in sources assimilation through the years and seasons,
My script:
mix.filename <- system.file("extdata/MIXSIAR", "DTV_consumers.csv", package = "MixSIAR") mix <- load_mix_data(filename=mix.filename, iso_names=c("d13C","d15N"), factors=c("Year","Season"), fac_random=c(FALSE,FALSE), fac_nested=c(FALSE,TRUE), cont_effects=NULL)
source.filename <- system.file("extdata/MIXSIAR", "DTV_fontes.csv", package = "MixSIAR") source <- load_source_data(filename=source.filename, source_factors="Year", conc_dep=FALSE, data_type="means", mix)
discr.filename <- system.file("extdata/MIXSIAR", "DTV_tef.csv", package = "MixSIAR") discr <- load_discr_data(filename=discr.filename, mix)
The data:
DTV_consumers:
-19.029,10.567,2010,2 -17.774,10.179,2010,2 -16.72,10.373,2010,2 -14.287,10.37,2010,2 -14.20411168,9.997,2010,2
DTV_fontes:
C4_Plant,2010,-12.18059528,0.46670958,5.782473684,1.042284705,19 C4_Plant,2011,-12.26673811,0.386272525,5.734846154,1.377147042,13 C4_Plant,2012,-13.18067857,0.378688243,6.024666667,0.288739598,6 C4_Plant,2013,-13.58241071,0.287178455,5.64875,0.972268235,12 C4_Plant,2014,-12.95473469,0.461079775,9.050392857,4.279736294,14 C4_Plant,2015,-12.47016667,0.395855789,7.992833333,0.278014038,6 C4_Plant,2016,-12.71566667,0.328688133,5.181916667,2.694039852,6 POM_estu,2010,-19.4885,1.199112554,1.809833333,1.500514736,6 POM_estu,2011,-20.20399107,1.581525623,6.080625,1.807880661,8
DTV_tef:
C4_Plant,0.54,0.53,4.78,1.30 POM_estu,0.54,0.53,4.78,1.30 SOM_estu,0.54,0.53,4.78,1.30 POM_mar,0.54,0.53,4.78,1.30 | |
Can you help me? Thank you very much,
Bianca.
Hi,
I had the same issue as described above: in my case the issue appeared because I had sample sizes of 1 for some of my sources.
What I had done was taking the only value we had and add an arbitrary value of SD based on the literature (I found some SI values with SD from other regions, or closely related species) since MixSIAR does not accept SD=0. But I hadn't change the n =1 and so the error message kept appearing.
So, now I used my unique known value and arbitrary SD, but I informed an arbitrarily high n as suggested for when the sample size is unknown. Doing so seems to work, since the model is currently running.
Hopefully, my message can help people in the future.
Have a good day, Chloé
Thank you for your reply, Chloe. Yes, I was having trouble with the model, and luckily Brian Stock could help me and he figure this out, so I used my SD = 0.0001 and this solved my problem. The model does not accept standard deviation = zero. Thank you very much for your input.
Have a good day,
Bianca Possamai Postdoctoral Research Associate in Biology Center for Reservoir and Aquatic Systems Research Baylor University
<((((º> °º º° <º))))><
De: CWR-05 @.> Enviado: segunda-feira, 18 de outubro de 2021 15:36 Para: brianstock/MixSIAR @.> Cc: biancapossamai @.>; Author @.> Assunto: Re: [brianstock/MixSIAR] Error in node src_tau[3,1,6] (#133)
Hi,
I had the same issue as described above: in my case the issue appeared because I had sample sizes of 1 for some of my sources.
What I had done was taking the only value we had and add an arbitrary value of SD based on the literature (I found some SI values with SD from other regions, or closely related species) since MixSIAR does not accept SD=0. But I hadn't change the n =1 and so the error message kept appearing.
So, now I used my unique known value and arbitrary SD, but I informed an arbitrarily high n as suggested for when the sample size is unknown. Doing so seems to work, since the model is currently running.
Hopefully, my message can help people in the future.
Have a good day, Chloé
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/brianstock/MixSIAR/issues/133#issuecomment-946144910, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI7EXC4IDMQ262SXOZ5MCKLUHSAL7ANCNFSM4EWWVL5Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi! I am having a problem with MixSIAR... in the truth, I think that is with JAGS. I am following the 'wolves' script, but my factors are not nested. One is random and the second do not. When I run the test model, the following error shows:
Initializing model Deleting model
Error in jags.model(model.file, data = data, inits = init.values, n.chains = n.chains, : Error in node src_tau[3,1,6] Invalid parent values
In addition: Warning messages: 1: In structure(c(), class = c(class(x), class(y))) : Calling 'structure(NULL, )' is deprecated, as NULL cannot have attributes. Consider 'structure(list(), )' instead. 2: In structure(c(), class = c(class(x), class(y))) : Calling 'structure(NULL, )' is deprecated, as NULL cannot have attributes. Consider 'structure(list(), )' instead. 3: In structure(c(), class = c(class(x), class(y))) : Calling 'structure(NULL, )' is deprecated, as NULL cannot have attributes. Consider 'structure(list(), )' instead.
Someone knows what can be? Thank you very much,
Cheers... Bia.