I believe I have identified an inconsistency between the Bayesian inversion manual and the implementation in uq_postProcessInversion.m when the function is called with an integer value for the burnIn parameter. Denoting this value as burnInIntValue, the following holds:
According to the documentation (page 57), burnInIntValue samples should be discarded (i.e., not copied into Results.PostProc) as burn-in.
However, in uq_postProcessInversion.m (lines 346–349), the execution is stopped if burnInIntValue is greater than or equal to the size of the Samples vector. Afterwards, the line
Sample = Sample(burnIn:end,:,:);
ensures that only burnInIntValue – 1 samples are actually removed, not burnInIntValue as stated.
As a result, one cannot (mis)use uq_postProcessInversion.m to discard all but the last set of samples from the MCMC AIES sampler and then generate scatter plots for this final set using uq_display. I was attempting this approach based on the suggestion in the “Restarting a Bayesian Inversion” solution, where these sample points can serve as starting vectors for subsequent Bayesian inversions with the MCMC AIES sampler.
To avoid modifications that alter the results of existing code, I propose updating the documentation for integer burnIn values. Instead of:
“Specifies the number of sample points that are discarded as burn-in.”
it could be revised to something like:
“Specifies the index of the first sample point not discarded as burn-in, i.e., the number of discarded samples equals the given value minus one.”
I had also considered changing the condition in line 345 of the code from
if burnIn >= size(Sample,1)
to
if burnIn > size(Sample,1)
but this does not achieve the intended behavior.
Best regards,
Asac