我正在尝试使用Julia进行自相关并将其与Python的结果进行比较。他们如何得出不同的结果?
朱莉娅代码
using StatsBase
t = range(0, stop=10, length=10)
test_data = sin.(exp.(t.^2))
acf = StatsBase.autocor(test_data)
给
10-element Array{Float64,1}:
1.0
0.13254954979179642
-0.2030283419321465
0.00029587850872956104
-0.06629381497277881
0.031309038331589614
-0.16633393452504994
-0.08482388975165675
0.0006905628640697538
-0.1443650483145533
Python代码
from statsmodels.tsa.stattools import acf
import numpy as np
t = np.linspace(0,10,10)
test_data = np.sin(np.exp(t**2))
acf_result = acf(test_data)
给
array([ 1. , 0.14589844, -0.10412699, 0.07817509, -0.12916543,
-0.03469143, -0.129255 , -0.15982435, -0.02067688, -0.14633346])
1
在两种情况下都打印测试数据
—
Mad Physicist