get_dennis_ests.m

Revision 1 - 3/16/07 at 12:42 pm by e2holmes

Back to revision history for get_dennis_ests.m
This file is part of the project PVA estimation code
function dennis=get_dennis_ests(data)
%data is a row vector
%missing values are given by a -99
%This is an implementation of the algorithm in Dennis et al 1991

a=find(data~=-99);
tau=a(2:end)-a(1:(end-1));
b=data(data~=-99);
%need to deal with zeros
if(ismember(0,b)) b=b+1; end
b = b(2:end)./b(1:(end-1));


%ref page 121 Dennis et al 1991
trans_data = log(b)./sqrt(tau);
[slope, notused, residuals]=regress(trans_data',sqrt(tau'));
dennis.mu=slope;
dennis.s2p=var(residuals);
%assuming no non-process error in the data (ref page 121 Dennis et al 1991)
%distribution of mu_est is normal(mu, s2p/tq)
%distribution of (q-1)s2p_est/s2p is chi_sq(q-1)

Sculpin 0.2 | xhtml | problems or comments? | report bugs