The proposal distribution of the M-H algorithm is probably incorrect as-is. I suggest changing this line in mh_generate_pps:
q = max(p_bnds(:,1),min(p_bnds(:,2),p + (p_bnds(:,2)-p_bnds(:,1))/10.*(2*rand(num_p,1)-1)));
to:
for ii = 1:numel(q0)
q(ii) = icdf(truncate(makedist('Normal', 'mu', p(ii), 'sigma', sigma_proposal), 0, 1), rand());
end
where sigma_proposal is some pre-defined width of the proposal distribution and we assume every parameter runs 0 --> 1 (LB & UB stored somewhere else).
The proposal distribution of the M-H algorithm is probably incorrect as-is. I suggest changing this line in
mh_generate_pps:to:
where
sigma_proposalis some pre-defined width of the proposal distribution and we assume every parameter runs 0 --> 1 (LB & UB stored somewhere else).