diff --git a/Analysis/Diagnostics/setup.R b/Analysis/Diagnostics/setup.R index 4d1f453..a53fdf1 100644 --- a/Analysis/Diagnostics/setup.R +++ b/Analysis/Diagnostics/setup.R @@ -6,8 +6,6 @@ # MIT License: https://opensource.org/licenses/MIT # ——————————————————————————————— - - cat('\n\n Setup begins \n\n') LocalRun=T @@ -51,7 +49,7 @@ nsimJitter <- as.integer(Sys.getenv("nsimJitter", 100)) npeels <- as.integer(Sys.getenv("npeels", 8)) RetroTest <- as.integer(Sys.getenv("RetroTest", 1)) -JitAnalysis <- as.integer(Sys.getenv("JitAnalysis", 1)) +JitAnalysis <- as.integer(Sys.getenv("JitAnalysis", 0)) ResidTest <- as.integer(Sys.getenv("ResidTest", 1)) SelfTestObs <- as.integer(Sys.getenv("SelfTestObs", 1)) diff --git a/Analysis/EstimCheck/SelfTestBoth.R b/Analysis/EstimCheck/SelfTestBoth.R index 264a7a4..6a2145e 100644 --- a/Analysis/EstimCheck/SelfTestBoth.R +++ b/Analysis/EstimCheck/SelfTestBoth.R @@ -6,30 +6,14 @@ # MIT License: https://opensource.org/licenses/MIT # ——————————————————————————————— - - ###################################### ## self test (Parametric bootstrap) ## ###################################### cat('\n\n running the parametric bootstrap test (SelfTestBoth: both obs and process errors are randomised) \n\n') - #cat('\n\n also REML (on/off) \n\n') - -# objTemp1=apply(ModelsEstimResults, 2, function(x) x$f ) -# objTemp2=apply(ModelsEstimResults, 2, function(x) x$f ) - -# for(i in 1:length(objTemp1)) { -# objTemp1[[i]]$Penal=1 -# objTemp2[[i]]$Penal=0 -# } - - #print(paste0("number of models: ", length(c(objTemp1, objTemp2)) )) - + BootTestResults2=parallel::mcmapply(MackBoot, FittedObj=apply(ModelsEstimResults, 2, function(x) x$f), - #FittedObj=c(objTemp1, objTemp2), - #REML=list(F,T), - #REML=list(F,T), MoreArgs = list(nsims=nsimSelfBoth, SimProcess=1, seed=seed, @@ -37,4 +21,3 @@ mc.cores = nGridJobs, SIMPLIFY = T) - diff --git a/Analysis/EstimCheck/setup.R b/Analysis/EstimCheck/setup.R index 2d59045..8c1d8ea 100644 --- a/Analysis/EstimCheck/setup.R +++ b/Analysis/EstimCheck/setup.R @@ -6,8 +6,6 @@ # MIT License: https://opensource.org/licenses/MIT # ——————————————————————————————— - - cat('\n\n Setup begins \n\n') LocalRun=T diff --git a/README.md b/README.md index c4c9359..684e5dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![DOI](https://zenodo.org/badge/724971318.svg)](https://zenodo.org/doi/10.5281/zenodo.10258210) -This repository contains the code and data for the following paper: + +This repository contains the code and data for the following paper, which ensures reproducibility and transparency of the research: ## **Enhancing data-limited assessments: Optimal utilization of fishery-dependent data through random effects — A case study on Korea chub mackerel (_Scomber japonicus_)** @@ -13,7 +14,7 @@ In a state-space framework, temporal variations in fishery-dependent processes c ## How to run the code 1. Navigate to the `Analysis` folder. -2. Execute the scripts by entering `makefile` in the terminal, ensuring that the working directory is set to the appropriate subfolders in this order: `Modelfitting`, `Diagnostics`, and `EstimCheck`. Before running the `Modelfitting` subfolder, modify the `setup.R` script by changing `penalty=0` to `penalty=1` for the `ModelEstim.R` script. `penalty=1` enables the use of a non-degenerate estimator. +2. Execute the scripts by entering `makefile` in the terminal, ensuring that the working directory is set to the appropriate subfolders in this order: `Modelfitting`, `Diagnostics`, and `EstimCheck`. The execution order should be: i. `Modelfitting` @@ -21,12 +22,16 @@ The execution order should be: iii. `EstimCheck` ## Important things to note when running the code -- Certain datasets, such as CPUE (Catch Per Unit Effort) and length composition data, were digitized from figures published in earlier studies (Kim et al., 2018; Jung, 2019; Gim, 2019) using WebPlotDigitizer ([Rohatgi, 2022](https://automeris.io/WebPlotDigitizer/)). + +- Certain datasets, such as CPUE (Catch Per Unit Effort) and length composition data, were digitized from figures published in earlier studies openly accessible online (Kim et al., 2018; Jung, 2019; Gim, 2019) using WebPlotDigitizer ([Rohatgi, 2022](https://automeris.io/WebPlotDigitizer/)). The accuracy of the digitization was verified by comparing the digitized data with the original figures. + - The data for the length composition were rounded to integers and the CPUE (Catch Per Unit Effort) to two decimal places in the actual analysis. However, we presented the data in its raw form for transparency regarding digitization. +- Results from simulation runs, such as those from parametric bootstrap, are not stored in this repository due to their substantial file size. However, the repository does include the code necessary to conduct these simulations. Please note that running these simulations on a local machine without parallelization may be time-consuming. Should you require the simulation results, they can be requested directly from the author of this repository. + ## References -Figures used for digitization were sourced from the following references: +Figures used for digitization were sourced from the following publications: - Kim, K., Hyun, S.-Y., & Seo, Y. I. (2018). (Korean) Inference of age compositions in a sample of fish from fish length data. *The Korean Journal of Fisheries and Aquatic Sciences*, 51(1), 79–90. [DOI](https://doi.org/10.5657/KFAS.2018.0079) diff --git a/Results/ModelFitted.RData b/Results/ModelFitted.RData index b4c0113..c80b675 100644 Binary files a/Results/ModelFitted.RData and b/Results/ModelFitted.RData differ