matlab中有一个函数是autocorr

我查看它的帮助

AUTOCORR Compute or plot sample auto-correlation function.

Compute or plot the sample auto-correlation function (ACF) of a univariate,

stochastic time series. When called with no output arguments, AUTOCORR

displays the ACF sequence with confidence bounds.

[ACF, Lags, Bounds] = autocorr(Series)

[ACF, Lags, Bounds] = autocorr(Series , nLags , M , nSTDs)

Optional Inputs: nLags , M , nSTDs

Inputs:

Series - Vector of observations of a univariate time series for which the

sample ACF is computed or plotted. The last row of Series contains the

most recent observation of the stochastic sequence.

Optional Inputs:

nLags - Positive, scalar integer indicating the number of lags of the ACF

to compute. If empty or missing, the default is to compute the ACF at

lags 0,1,2, ... T = minimum[20 , length(Series)-1]. Since an ACF is

symmetric about zero lag, negative lags are ignored.

M - Non-negative integer scalar indicating the number of lags beyond which

the theoretical ACF is deemed to have died out. Under the hypothesis that

the underlying Series is really an MA(M) process, the large-lag standard

error is computed (via Bartlett's approximation) for lags > M as an

indication of whether the ACF is effectively zero beyond lag M. On the

assumption that the ACF is zero beyond lag M, Bartlett's approximation

is used to compute the standard deviation of the ACF for lags > M. If M

is empty or missing, the default is M = 0, in which case Series is

assumed to be Gaussian white noise. If Series is a Gaussian white noise

process of length N, the standard error will be approximately 1/sqrt(N).

M must be less than nLags.

nSTDs - Positive scalar indicating the number of standard deviations of the

sample ACF estimation error to compute assuming the theoretical ACF of

Series is zero beyond lag M. When M = 0 and Series is a Gaussian white

noise process of length N, specifying nSTDs will result in confidence

bounds at +/-(nSTDs/sqrt(N)). If empty or missing, default is nSTDs = 2

(i.e., approximate 95% confidence interval).

Outputs:

ACF - Sample auto-correlation function of Series. ACF is a vector of

length nLags + 1 corresponding to lags 0,1,2,...,nLags. The first

element of ACF is unity (i.e., ACF(1) = 1 = lag 0 correlation).

Lags - Vector of lags corresponding to ACF (0,1,2,...,nLags).

Bounds - Two element vector indicating the approximate upper and lower

confidence bounds assuming that Series is an MA(M) process. Note that

Bounds is approximate for lags > M only.

我始终弄不明白M 到底有什么用处,请各位高手帮帮忙?

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐