Closed cgrandin closed 4 years ago
I think we can go back only 10 years now, retrospectives for 20 years has always been way to much and then makes it hard to read figures. What did you get non-positive definite hessians on - the retrospective runs?
Yes it happened on -11 years
I think 10 is plenty, but we can still look at why that occurred at -11.
Changed rec main end year to 2003 for a -15 year retro and it worked.
Here's where the retrospectives are set up -https://github.com/pacific-hake/hake-assessment/blob/75c6df672e3f421cf87d6a6307ca278aa0904933/R/retrospectives.R#L58
Right now is just subtracts 1 in the starter file @kellijohnson-NOAA Can you add some code to read in the control file, modify, and write it out?
Is it even worth doing, given that the gradients are so bad?
There is actually some similar code on line 64 which is for something else (which I forget the reason for)
Not sure on the usefulness question, but I think I can just read in the control file using the new r4ss function capability of SS_readctl, but this will require everyone to move to the development branch.
model$ctl
holds the contents of the control file as a vector of lines (read in using readLines()
) and model$ctl.file
is the full path filename for the control file. You can modify the control file like this while inside the run_retrospectives()
function.
ctl <- model$ctl
# modify ctl lines as necessary
writeLines(ctl, model$ctl.file)
Great, I can do this tomorrow (i.e., Tues the 28th). I did a test today to make sure that if I read in the control file using SS_readctl and wrote it back to the disk with SS_writectl that the model would still work and give the same results. It does, so it might be best and most sustainable going forward to just use the r4ss commands rather than assuming the comment lines of SS will remain the same.
It would be great if you can get it working using r4ss::SS_readctl()
. I remember once a few years ago Ian saying that that function may never exist because nobody knows the file structure 100% Even Rick.. Maybe some work went into solidifying that. Anyway it would be a good addition if you want to try
Beyond that I got non-positive definite hessians... this will impact the squid plots. The question is are we ok with only going back 10 years. Has the 1999 year class been used as an example long enough?