I have a scenario in which I’m carrying out Bayesian inversion multiple times. I’d like to parallelize the process and run multiple Bayesian inversions independently. I’m using the MH algorithm for inversion.
Currently my code looks like follows:
function myFunction(arguments) % do some preliminary calcultions % set up data structure parfor i = 1:nsim % number of simulations % set up data.y % set up BayesOpts % uq_createAnalysis % uq_postProcessInversion % generate result structure called "struct_result" total_results(i).result = struct_result end end
I’m getting an error from MATLAB which says:
Error using uq_initialize_uq_inversion (line 71) Dot indexing is not supported for variables of this type. Error in RS_uq_updating (line 43) parfor i = 1:nsim
The line 71 being referred to here is:
Internal.nModelParams = length(Internal.Prior.Marginals);
Any thoughts on what could be causing this error? It works perfectly fine with a simple for loop. Any alternate strategies for more efficient computation are also welcome.