我正在尝试使用ARIMA模拟包来模拟一个带有漂移的ARIMA模拟。我的问题是我似乎不能让它工作。
我需要这样的东西:
不过,我的代码会产生这样的结果:
> mean(datatime)
[1] 15881.56
> sd(datatime)
[1] 8726.893
> length(datatime)
[1] 123
# The mean and variance from the original series
originalseriesmean = 15881.56
originalseriesvariance = 8726.893*8726.893
or
测试matplotlib的detrend_linear函数
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import detrend_linear
n = 1000
t = np.arange(n)
y = np.sin(8.*np.pi/n*t) # exactly 4 periods
plt.plot(y, label='raw')
plt.plot(detrend_linear(y), label='detrended')
plt.legend(loc=