声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3059|回复: 4

[综合讨论] 关于落后自相关系数的一个疑问

[复制链接]
发表于 2008-11-18 11:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
求落后自相关的时候,一般我们都是计算前几个系数(比如落后1个时次数到落后n/3个时次,n是序列的长度)。但是,当落后的时次是n-1的时候,我们拿序列的前两个和最后两个来计算(根据附件落后自相关的定义),根据常识这个值应该很接近0,因为落后的时次越多,自相关系数应该逐步趋近0. 但是,又根据常识这任意两个值和另外的任意的两个值计算相关系数的时候,要么是1要么是-1.这个不是很矛盾吗?

比如: a=[1,2,9,10,1,5]; 求落后5个时次的相关系数时:应该用1,5和1,2来求相关,很明显结果是1.
但是,根据
[acf,lag]=autocorr(a,5)
acf = 1.0000 0.0068 -0.5437 -0.1025 0.1544 -0.0150
lag = 0 1 2 3 4 5
当落后5的时候,这个系数是-0.0150。

还是我理解错了。
1.jpg
回复
分享到:

使用道具 举报

发表于 2008-11-18 14:51 | 显示全部楼层
得不到LZ的结果。查了一下autocorr函数如下:
help autocorr
        [R] = autocorr(s,P)
        where s is the input vector, and P is the order of prediction.
        Function to compute the autocorrelation of the data
        computes autocorrelation R(i) for i=1, .. ,P+1.

autocorr输出只有一个参数。按LZ的的数列,用acf=autocorr(a,5)得结果为:
212   125    88    57    11     5

[ 本帖最后由 ChaChing 于 2010-2-3 15:01 编辑 ]
 楼主| 发表于 2008-11-18 20:50 | 显示全部楼层
难道是版本 不同
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
这个是我的help autocorr

谢谢
 楼主| 发表于 2008-11-18 21:04 | 显示全部楼层
这个是一个更离谱的例子,最后几个滞后相关系数大于1了
clc
clear

Tjan=[2.7 5.9 3.4 4.7 3.8 5.3 5.0 4.3 5.7 3.6 3.1 3.9 3.0 4.9 5.7 4.8 5.6 6.4 5.6 4.2 4.9 4.1 4.2 3.3 3.7 7.6];
n=length(Tjan,1);
s=cov(Tjan);
ave=mean(Tjan);
m=25;
for i=0:1:m
r(i+1)=sum((Tjan(1:n-i)-ave).*(Tjan(1+i:n)-ave))/s/(n-i);
end
%上面就是严格按照定义计算的,最后的两个相关系数都大于-1了?????
[ACF, Lags, Bounds] = autocorr(Tjan,25);
这个是用matlab计算的,这个结果是逐渐趋近于0的
发表于 2010-8-15 11:34 | 显示全部楼层
大于1的是,没有标准化的
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-30 19:33 , Processed in 0.072817 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表