https://git.exeter.ac.uk/mv286/kndy-parameter-inference
Raw File
Tip revision: f5585f5f09d62a2569d21def31dc779774bc2476 authored by mv286 on 15 July 2021, 12:46:14 UTC
Deleting README.md
Tip revision: f5585f5
model_propoasal.m

% The function returns proposal parameter vector sampled from a multivariate normal 
% distribution with mean=thetaC and covariance matrix params.Sigma
% if iteration==1 then the iteration draws the parameter vector from the
% uniform distribution (prior) in the interval [params.minV,params.maxV]

function proposal = model_propoasal(thetaC,params, iteration) 

    if (iteration > 1)
        
        proposalTmp = mvnrnd(thetaC,  params.Sigma);
        proposal=proposalTmp';
        

    else %sample from prior distribution
        z = nan(size( params.minV));
        z(1:4) = params.minV(1:4) + (params.maxV(1:4)-params.minV(1:4)) .* rand(size(params.minV(1:4))) ;
        z(5:8) = params.minV(1:4) + (params.maxV(1:4)-params.minV(1:4)) .* rand(size(params.minV(1:4))) ;
        z(9) = params.minV(9) + (params.maxV(9)-params.minV(9)) .* rand ;
        proposal = z;
       
    end
    
   
back to top