/usr/share/octave/packages/tsa-4.2.7/invest0.m is in octave-tsa 4.2.7-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | function [AutoCov,AutoCorr,MX,E,NC]=invest0(Y,Pmax,Mode);
% First Investigation of a signal (time series) - automated part
% [AutoCov,AutoCorr,ARPMX,E,ACFsd,NC]=invest0(Y,Pmax);
%
% [AutoCov,AutoCorr,ARPMX,E,ACFsd,NC]=invest0(AutoCov,Pmax,Mode);
%
%
% Y time series
% Pmax maximal order (optional)
%
% AutoCov Autocorrelation
% AutoCorr normalized Autocorrelation
% PartACF Partial Autocorrelation
% ARPMX Autoregressive Parameter for order Pmax-1
% E Error function E(p)
% NC Number of values (length-missing values)
%
% REFERENCES:
% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991.
% M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993.
% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996.
% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981.
% W.S. Wei "Time Series Analysis" Addison Wesley, 1990.
% $Id: invest0.m 11693 2013-03-04 06:40:14Z schloegl $
% Copyright (C) 1998-2003,2008,2010 by Alois Schloegl <a.schloegl@ieee.org>
% This is part of the TSA-toolbox. See also
% http://biosig-consulting.com/matlab/tsa/
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
if nargin<3
Mode=0;
else
Mode=1;
end;
[nr,nc]=size(Y);
NC = sumskipnan(real(~isnan(Y)),2); % number of valid components (data points)
if Mode==0
if nargin<2, Pmax = min([100 nc/3]); end;
M = min(Pmax,nc-1);
AutoCov = acovf(Y,M);
else
AutoCov=Y;
M = min(Pmax,nc-1);
nc = Pmax;
%M=size(AutoCov,2)-1;
end;
AutoCorr = AutoCov(:,2:M+1)./AutoCov(:,ones(M,1));
if 1,Pmax<100; % this needs change of sinvest1
K=M-1;
[MX,E]=lattice(Y,Pmax);
%[MX,E]=ulsar(Y,Pmax);
%[MX,E]=durlev(AutoCov);
% ARP=MX(:,K*(K-1)/2+(1:K));
% PartACF =MX(:,(1:K).*(2:K+1)/2);
else %if nargout > 2
[ARP,RC,E]=lattice(Y,Pmax);
%[ARP,PartACF,E]=durlev(AutoCov);
%MX=[ARP,RC];
end;
|