Casal2 / CASAL2

Integrated Population Dynamics Model (Casal2)
https://casal2.github.io
GNU General Public License v2.0
27 stars 24 forks source link

Fix MCMC #266

Closed Zaita closed 5 years ago

Zaita commented 5 years ago

This is for Sophie. Couple of issues with MCMC not working with the FrontEnd application and switching between Betadiff and non auto-diff functionality.

Zaita commented 5 years ago

I've tested this with TwoSex and it seems to be working ok now. I've added a new command line parameter --skip-estimation. This will load mpd.out from the model directory and use this to start the chain. So the MCMC doesn't need to complete a minimisation first.

smormede commented 5 years ago

@Zaita I have downloaded the latest casal2 and tried to run the MCMC on the rsr model performance test. I use betadiff and had to remove tolerance and iterations. I used the basic casal2 -m (see at the end of the message) and below is the message I got.

If I use --skip-estimation I get that message immediately (doesn't go through the mpd by the looks as you noted).

Note that estimations was ok, very similar to the casal result and 23 minutes compared with 18 for the casal equivalent.


**** CODE ERROR - CASAL2 is FORCE QUITTING ****


Source File: C:\Jenkins\workspace\CASAL2_windows_installer_incremental\CASAL2\source\Minimisers\Common\Dummy\Dummy.cpp(line: 43) Source Method: Execute

Message: Hmmm... For some reason you've executed the Dummy minimiser. This is bad. This has likely happened because you've tried to run an autodiff minimiser off the release shared library NOTE: This error is a bug in the software and can be corrected by a developer Please contact the application developers at casal2@niwa.co.nz to have this issue fixed

C:\Users\mormedes\OneDrive - NIWA\Projects\Specific_Projects\2019\casal2\SophieOct18runs(10)sexed2015modeleverythingin\CASAL\rsr model performance\casal2>casal2 -m > mcmcJan19.log

smormede commented 5 years ago

@SamikDatta can you please add in the manual under section 3.4 the command line argument --skip-estimation and also all the other ones that are currently missing: check the list with what you get when on the command line you type casal2 (reproduced below).

thanks

-h [ --help ] Print help -l [ --license ] Display CASAL2 license -v [ --version ] Display version information -c [ --config ] arg Configuration file -r [ --run ] Basic model run mode -e [ --estimate ] Point estimation run mode -m [ --mcmc ] Markov Chain Monte Carlo run mode (arg = continue, default: false) --skip-estimation Skip estimation before running the MCMC, load existing MPD --resume Resume the MCMC chain --objective-file arg Objective file for resuming an MCMC --sample-file arg Sample file for resuming an MCMC -p [ --profiling ] Profling run mode -s [ --simulation ] arg Simulation mode (arg = number of candidates) -f [ --projection ] arg Projection mode (arg = number of projections per set of input values) -i [ --input ] arg Load free parameter values from file --fi Force the input file to only allow @estimate parameters (basic run mode only) -g [ --seed ] arg Random number seed -q [ --query ] arg Query an object type to see its description and parameters. Argument object_type.sub_type e.g. process.recruitment_constant -d [ --debug ] Run in debug mode (with debug output --nostd Do not print the standard header report --loglevel arg Set log level: finest, fine, trace, none(default) -o [ --output ] arg Create estimate value report directed to --single-step Single step the model each year with new estimable values --tabular Print reports in Tabular mode --unittest Run the unit tests for CASAL2 --no-mpd Do not create an MPD file

smormede commented 5 years ago

@Zaita I have also just tested it on a numerical_differences minimiser (same model I think). I get a different error: can't load mpd.out

call: casal2 -m --skip-estimation > mcmcJan19.log

error below, happened an hour or so after starting so clearly had been going through some sort of calculation before trying to load mpd.out (copied below).


**** USER CONFIGURATION ERROR **** **** THE ERROR SHOULD BE DESCRIBED BELOW ****


Source File: C:\Jenkins\workspace\CASAL2_windows_installer_incremental\CASAL2\source\MCMCs\MCMC.cpp(line: 132) Source Method: Execute Message: Failed to load MPD Data from mpd.out file

NOTE: 1 other errors have been logged above

mpd.out file:

Zaita commented 5 years ago

@smormede Are we happy to close this? Can re-open if it's still an issue. Initial tests show that it's working well.

smormede commented 5 years ago

Yes all good now, including --resume. Thanks for sorting this out.