pacific-hake / hake-assessment

:zap: :fish: Build the assessment document using latex and knitr
MIT License
13 stars 6 forks source link

Retrospectives only go to 10 years #608

Closed cgrandin closed 4 years ago

cgrandin commented 4 years ago

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?

aaronmberger-nwfsc commented 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?

cgrandin commented 4 years ago

Yes it happened on -11 years

aaronmberger-nwfsc commented 4 years ago

I think 10 is plenty, but we can still look at why that occurred at -11.

cgrandin commented 4 years ago

See https://github.com/pacific-hake/hake-assessment/issues/613

kellijohnson-NOAA commented 4 years ago

Changed rec main end year to 2003 for a -15 year retro and it worked.

cgrandin commented 4 years ago

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)

kellijohnson-NOAA commented 4 years ago

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.

cgrandin commented 4 years ago

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)
kellijohnson-NOAA commented 4 years ago

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.

cgrandin commented 4 years ago

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