merrillrudd / lime Goto Github PK
View Code? Open in Web Editor NEWLength-based integrated mixed effects model
License: MIT License
Length-based integrated mixed effects model
License: MIT License
I am unable to download the LIME package. It gives the error below. Any help would be greatly appreciated.
Error: package or namespace load failed for 'LIME' in namespaceExport(ns, exports):
undefined exports: runstack
Error: loading failed
Execution halted
ERROR: loading failed
Hi there,
I've run the LIME model and am trying to make sense of the outputs, but I'm having trouble finding documentation for what the list attributes within $Report and $Sdreport actually mean. Is there a resource that you can point me towards that provides the description for each individual attribute (e.g., lF_y, lF_fy, in Sdreport and F_fy in Report, though documentation for all of them would be ideal)?
Thank you in advance!
I am having trouble running the length data only model. I have included the error and input data below. I was also wondering if it is most appropriate to use fishery dependent, fishery independent or both if available?
I get the following error:
Error in MakeADFun(data = TmbList[["Data"]], parameters = TmbList[["Parameters"]], : Error when reading the variable: 'n_LF_ft'. Please check data and parameters.
2.
MakeADFun(data = TmbList[["Data"]], parameters = TmbList[["Parameters"]], random = TmbList[["Random"]], map = TmbList[["Map"]], inner.control = list(maxit = 1000), hessian = FALSE, DLL = "LIME")
1.
run_LIME(modpath = NULL, input = inputs_all, data_avail = "LC")
My input code is as follows:
library(LIME)
lh <- create_lh_list(vbk=0.21,
linf=65,
t0=-0.01,
lwa=0.0245,
lwb=2.79,
S50=c(20),
S95=c(26),
selex_input="length",
selex_type=c("logistic"),
M50=34,
maturity_input="length",
M=0.27,
binwidth=1,
CVlen=0.1,
SigmaR=0.737,
SigmaF=0.2,
SigmaC=0.1,
SigmaI=0.1,
R0=1,
Frate=0.1,
Fequil=0.25,
qcoef=1e-5,
start_ages=0,
rho=0.43,
theta=10,
nseasons=1,
nfleets=1)
dir <- "D:\DMF\Stock_Assessment\STB\CSMA\LIME_approach\Lime_model\"
file <- paste(dir,"length_comps.txt",sep = "")
stb_data <- read.delim(file, header = TRUE, sep = "\t")
stb_data[is.na(stb_data)] <- 0 # Replace na with 0
rownames(stb_data) <- seq(2004, 2014, 1)
stb_data <- stb_data[, -1]
stb_data <- as.matrix(stb_data)
colnames(stb_data) <- seq(0.5, 112.5, 1)
length_years <- rownames(stb_data)
years_name <- length_years
length_bins <- colnames(stb_data)
LF <- stb_data
rownames(LF) <- length_years
colnames(LF) <- length_bins
head(LF)
neff_ft <- c(33, 30, 63, 21, 21, 17, 130, 5, 43, 141, 2)
data_all <- list("years"=1:11, "LF"=LF, "neff_ft"=neff_ft)
inputs_all <- create_inputs(lh=lh, input_data=data_all)
start <- Sys.time()
lc_only <- run_LIME(modpath=NULL,
input=inputs_all,
data_avail="LC")
For some small tuna species, selectivity is estimated very high (S50 close to Linf but not at the bound) and fishing mortality is then estimated very high to result in similar SPR between LIME and LB-SPR. Need to figure out why this is happening!
Hello! I am trying to try and figure out how to run LIME for multiple species consecutively, and so I have created a table in my environment (LIME_data_all) that has names for many species in a column (sci_name) and then life history traits/LIME inputs in subsequent columns, with appropriate names for the create_lh_list function (e.g. vbk, linf, lwa, etc.). However, I am wondering how to change the script (pasted below) to instead bring-in this table with multiple species.
Any feedback would be helpful! Thank you so much!
Now let's populate the `create_lh_list` function with example values.
```{r, tidy=TRUE}
lh <- create_lh_list(vbk=0.21,
linf=65,
t0=-0.01,
lwa=0.0245,
lwb=2.79,
S50=c(20),
S95=c(26),
selex_input="length",
selex_type=c("logistic"),
M50=34,
maturity_input="length",
M=0.27,
binwidth=1,
CVlen=0.1,
SigmaR=0.737,
SigmaF=0.2,
SigmaC=0.1,
SigmaI=0.1,
R0=1,
Frate=0.1,
Fequil=0.25,
qcoef=1e-5,
start_ages=0,
rho=0.43,
theta=10,
nseasons=1,
nfleets=1)
```
Hi Merrill,
This is just a heads up, since I forked LIME awhile ago to make some changes specific to my application and haven't merged updates in the last year or so... Maybe you've fixed this. But if you haven't come across this potential error yet:
It's possible for create_lh_list
to make a Mat_l
vector that's shorter than the user-specified length-frequency data dimension. It uses 1.3*linf
as the max length, and there's no check for what the user's max length in the LF data is. I stumbled across it when I kept everything (data, model, code) the same except with a lower linf and higher vbk... was surprised it wouldn't run.
Not urgent - I just changed my local create_lh_list
to use 1.4*linf
for now.
LIME does not install when TMB was installed from CRAN -- in the installation from github, it produces "fatal error: Eigen/Dense: No such file or directory".
I've found that when installed as the development version from GitHub (https://github.com/kaskr/adcomp) this issue goes away.
However, there are some problems with this "fix":
I installed LIME today on R 4.1.3 after installing RTools, TMBhelper as directed. When attempting to follow the vignette example in "LIME: An R package for simulation and estimation using length data to account for variable fishing mortality and recruitment", I get the following error shown below. Apparently I do have the latest versions installed.
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
library(LIME)
lh <- create_lh_list(vbk=0.21,
linf=65,
t0=-0.01,
lwa=0.0245,
lwb=2.79,
M=0.27,
M50=34,
M95=NULL,
maturity_input="length",
S50=20,
S95=26,
selex_input="length",
binwidth=1,
CVlen=0.1,
SigmaR=0.737,
SigmaF=0.2,
R0=1,
rho=0.43,
nseasons=1)
true <- generate_data(modpath=NULL,
itervec=1,
lh=lh,
Fdynamics="Ramp",
Rdynamics="AR",
Nyears=20,
Nyears_comp=20,
comp_sample=200,
init_depl=0.8,
seed=1)
Error in FUN(X[[i]], ...) : object 'R_t' not found
devtools::install_github("kaskr/TMB_contrib_R/TMBhelper")
Skipping install of 'TMBhelper' from a github remote, the SHA1 (d275e522) has not changed since last install.
Useforce = TRUE
to force installation
devtools::install_github("merrillrudd/LIME", build_vignettes=TRUE)
Skipping install of 'LIME' from a github remote, the SHA1 (9dcfc7f) has not changed since last install.
Useforce = TRUE
to force installation
Thank you for the help,
Tyrell DeWeber
Hi,
I found that the Fdynamics option varies from file to file. But I don't understand what these options mean. Could you give me some introduction? I would like to know which options in Fdynamics and Rdynamics correspond to scenarios labeled "equilibrium", "two-way", "one-way" in your paper "Accounting for variable recruitment and fishing mortality in length-based stock assessments for data-limited fisheries" .
Fdynamics: Pattern for fishing mortality dynamics; options include Constant, Oneway, Endogenous, or None.
Fdynamics:Specify name of pattern of fishing mortality dynamics, Constant, Endogenous, Ramp, Increasing, or None. Input number to project forward using a specific F.
Fdynamics:Specify name of pattern of fishing mortality dynamics, Constant, Endogenous, Ramp, Increasing, or None. Input number to project forward using a specific F.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.