1function [GAMMA, RHO0, RESIDUALS] = trace_gamma(T, limit)
2% Estimates the
auto-correlation decay rate of a trace.
5% - limit: maximum lag considered (optional,
default = 1000)
7% - GAMMA: autocorrelation decay rate
16lag = 1:min(limit,length(T));
17rho = trace_acf(T, lag);
20RHO0 = 1/2 * (1 - 1/SCV);
22opt = statset(
'nlinfit');
25opt.RobustWgtFun =
'fair';
27 [GAMMA,RESIDUALS] = nlinfit(lag, rho, @geometric, 0.99, opt);
29 warning(
'Non linear regression for ACF decay rate failed, trying lsqcurvefit');
30 GAMMA = lsqcurvefit(@geometric, 0.99, lag, rho, -1, 1);
33 function rhok = geometric(gamma,k)
34 rhok = (RHO0 * gamma.^k)
';