https://github.com/Data2Dynamics/d2d
Tip revision: 83d6eedd5f6c33ae94dbce6c4e620d2f1bb57b1f authored by Joep Vanlier on 09 April 2015, 08:41:55 UTC
Forgot to update C version number
Forgot to update C version number
Tip revision: 83d6eed
arDisturb.m
% Disturb model parameters
%
% arDisturb(strength)
% strength: pval+randn(0,strength) [1]
function arDisturb(strength)
global ar
if(isempty(ar))
error('please initialize by arInit')
end
if(~exist('strength', 'var'))
strength = 0.1;
end
ar.p(ar.qFit==1) = ar.p(ar.qFit==1) + randn(size(ar.p(ar.qFit==1))) * strength;
ar.p(ar.p<ar.lb) = ar.lb(ar.p<ar.lb);
ar.p(ar.p>ar.ub) = ar.ub(ar.p>ar.ub);
arChi2;