Code covered by the BSD License
-
ARJones_irreg(msnnr,rcinit,pA...
-
ARMA_MLfit(rcs,im,xm,lagmax,p...
The likelihood fit.
-
ARMLfit_irreg(rcs,msnn,lagmax...
The conditional-likelihood fit.
-
ARfil(im,xm,rcinit,lagmax,p)
-
ARfil_irreg(msnn,rcinit,lagma...
-
ARjones(ti,xi,rcinit,p)
-
[asel,bsel,sellog]=ARMAsel_ir...
-
[asel,bsel,sellog]=ARMAsel_mi...
-
jonesfit(rcs,ti,xi,p);
-
jonesfit_irreg(rcs,mdsnn,p);
% function lhtot = jonesfit_irreg(rcs,mdsnn,p);
-
keepdata(x,p)
% Keeps arbitrary fraction p of equidistant data x at times ti.
-
mssnnr(ti, xi, T, w);
multi shift slotted nearest neighbor resampling
-
nnresample(ti, xi, Tres_ratio...
-
irreg_demo.m
-
mis_demo.m
-
simple_irreg_demo.m
-
simple_mis_demo.m
-
View all files
from
ARMAsel for Irregular or Missing Data
by Piet M T Broersen
Spectral and Autocorrelation Analysis with automatic selection from AR, MA and ARMA models
|
| mssnnr(ti, xi, T, w);
|
function msnn = mssnnr(ti, xi, T, w);
% multi shift slotted nearest neighbor resampling
%
% ti : irregular input times [s]
% xi : irregular input signal
% T : regular output resampling time [s]
% w : slot width as fraction of T
%
% mssnnr resamples according to NN
% startings time for multi shift records Tw, 2*Tw, ... ninit*Tw
% only samples with t(i) - 1/2*Tw < t(i) < kT+init*Tw < t(i) + 1/2*Tw.
% Program requires w < = T
if w > 1
return;
end
N = length(xi);
ninit=floor(1/w); % init= 1:ninit as starting points
Tw = w * T;
msnn=cell(2,ninit);
ti=ti-ti(1)+Tw; %shift of entire time scale
for init=1:ninit,
xout = zeros(1,N);
tout = zeros(1,N);
t = init*Tw;
i = 1;
j = 1;
while i <= N
while (ti(i) <= (t - 0.5 *Tw))
i = i + 1;
if i > N
break;
end
end
if i <= N
dtmin = abs(ti(i) - t);
dtmini = 0;
while (ti(i) < (t + 0.5 .* Tw))
if abs(ti(i) - t) <= dtmin
dtmin = abs(ti(i)-t);
dtmini = i;
end
i = i + 1;
if i > N
break;
end
end
if (dtmini ~= 0)
tout(j) = t;
xout(j) = xi(dtmini);
j = j + 1;
end
end
t = t + T;
end
msnn{1,init} = round((tout(1:j-1)-(init-1)*Tw)/T);
msnn{2,init} = xout(1:j-1);
end
|
|
Contact us at files@mathworks.com