Giter Site home page Giter Site logo

lime's Issues

create_lh_list makes Mat_l vector shorter than LF

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.

Documentation for output of Report and Sdreport after running LIME model

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!

More of a Question - how to run LIME for multiple species at once?

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)
```

Trouble running length data only model

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)

Updated M, vbk, linf, ,t0, lwa, lwb, M50, M95, S50, S95. The rest are defaults

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")

Example for generating data returns Error

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.
Use force = 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.
Use force = TRUE to force installation

Thank you for the help,

Tyrell DeWeber

Can't download LIME

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

  • removing 'C:/Users/tdteears/AppData/Local/Temp/Rtmp0UTONf/Rinst335c2d842ef5/LIME'
    -----------------------------------
    ERROR: package installation failed
    Error: Failed to install 'LIME' from GitHub:
    System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr (last 10 lines):
    E> ** installing vignettes
    E> ** testing if installed package can be loaded from temporary location
    E> Error: package or namespace load failed for 'LIME' in namespaceExport(ns, exports):
    E> undefined exports: runstack
    E> Error: loading failed
    E> Execution halted
    E> ERROR: loading failed
    E> * removing 'C:/Users/tdteears/AppData/Local/Temp/Rtmp0UTONf/Rinst335c2d842ef5/LIME'
    E> -----------------------------------
    E> ERROR: package installation failed

Eigen/Dense: No such file or directory

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":

  1. some computers have had problems downloading the development version from github,
  2. when trying to publish the LIME shiny app online, it defaults to accessing the TMB package from CRAN, which means it can't find the LIME package.

Questions about the Fdynamics option

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.

Small tunas identified issues estimating selectivity

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.