フィルターのクリア

differencing a time series

2 ビュー (過去 30 日間)
Chithralekha
Chithralekha 2013 年 8 月 10 日
I want to difference a time series till it becomes stationary.how to code it using matlab.i am writing my code below.please help me to continue it acf=autocorr of time series
l(k)=lower limit
u(k)=upper limit
if ((acf(k+1)<l(k)) || (acf(k+1)>u(k))),a time series is non-stationary.now i have to difference a time series till it becomes stationary.how to write using a single expression.
  2 件のコメント
dpb
dpb 2013 年 8 月 10 日
編集済み: dpb 2013 年 8 月 10 日
What's k supposed to represent--the k-th lag of the acf series or the acf after the k-th difference of x?
Maybe my utility function can help some w/ the complexity -- it's just syntactic sugar but by putting the logic expressions at a lower level it can often lead to seeing how to reduce expressions...
while ~all(iswithin(acf,l,u))
... do another difference here
end
where acf is presumed to be the acf at the kth iteration
iswithin is
function flg=iswithin(x,lo,hi)
% returns T for values within range of input
% SYNTAX:
% [log] = iswithin(x,lo,hi)
% returns T for x between lo and hi values, inclusive
flg= (x>=lo) & (x<=hi);
Chithralekha
Chithralekha 2013 年 8 月 11 日
k is the kth lag of time series.

サインインしてコメントする。

回答 (1 件)

dpb
dpb 2013 年 8 月 11 日
OK, presuming you have a vector of given length and the limits of the same, then
(acf(k+1)<l(k)) || (acf(k+1)>u(k)))
is
acf(2:end)<l || acf(2:end)>u
if do want the short-circuiting operator here.

カテゴリ

Help Center および File ExchangeData Preprocessing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by