【问题标题】:Prewhitening / autocorrelation removal / AR(1) deterministic trend model预白化/自相关去除/AR(1) 确定性趋势模型
【发布时间】:2015-03-20 12:41:57
【问题描述】:

我正在尝试使用 K. Hamed 在此处找到的论文中描述的方法对时间序列进行预白化:http://www.sciencedirect.com/science/article/pii/S0022169409000675

这个想法是将具有线性趋势分量的 AR(1) 模型拟合到数据中,以消除自相关。我想要预白化的模型由

给出

x_t = rho * x_(t-1) + alpha + beta * t + e_t

其中 x_t 和 x_(t-1) 是时间序列的观测值,rho 是自相关系数,beta 是趋势的斜率,e_t 是不相关的噪声。抱歉不知道如何格式化方程式,我尝试使用 Latex 语法无济于事...

反正我估计参数是 rho = 0.02, alpha = 0.16 and beta = -0.00092

在给定这些特定参数值的情况下,如何在 R 中拟合 AR(1) 模型?我认为在 Arima 函数中使用 init 可以让我指定它们,但它只是将输入用作 initial 值。

fit <- Arima(x, order=c(1,0,0),init=c(0.02, 0.16))

此外,您如何将通用 ARIMA 模型与线性趋势拟合?我尝试了以下

for(t in 2:length(x)){
  fit <- Arima(x, order=c(1,0,0),init=c(0.02, 0.16)) - 0.00092 * t
}

但它返回一个错误为non numeric argument to binary operator,我不知道如何解决这个问题。

提前致谢。

【问题讨论】:

    标签: r


    【解决方案1】:

    来自forecast::Arima 文档:

    Arima(x, order=c(0,0,0), seasonal=c(0,0,0),
        xreg=NULL, include.mean=TRUE, include.drift=FALSE, 
        include.constant, lambda=model$lambda, transform.pars=TRUE, 
        fixed=NULL, init=NULL, method=c("CSS-ML","ML","CSS"), n.cond, 
        optim.control=list(), kappa=1e6, model=NULL)
    

    您必须在 xreg 参数中包含一个外部回归量(即 线性趋势)作为向量

    xreg Optionally, a vector or matrix of external regressors, which must have the same number of rows as x.

    【讨论】:

    • 感谢您对我问题第二部分的回答。关于在Arima函数中设置具体参数值,我想我误解了理论。据我所知,Arima 为我估算了参数值,因此无法将它们输入到函数中。
    猜你喜欢
    • 1970-01-01
    • 2018-09-10
    • 1970-01-01
    • 2012-01-16
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 2021-09-21
    • 1970-01-01
    相关资源
    最近更新 更多