如何用 R 中自相关参数的预定值拟合 ar(1) 模型?
how to fit ar(1) model with predetermined value of autocorrelation parameter in R?
我有以下数据:
ar <- arima.sim(list(order=c(1,0,0), ar=0.9), n=M1) + 10
如何将 AR(1) 模型拟合到上面 ar 参数 = 0.5 的模拟数据?
编辑:
我用过:
fit <- arima(ar, fixed = 0.5, include.mean = T)
fit
通话:
arima(x = ar, include.mean = T, fixed = 0.5))
Coefficients:
intercept
0.5
这是不正确的。我希望我的拟合模型具有平均值(应该大约为 10)和 ar_parameter=0.5
.
请帮忙
stats::arima
和forecast::Arima
都接受一个参数fixed
,它会将某些参数固定为给定值,并适应其余参数。您需要为不想修复的任何参数传递值 NA
。
因此,您可以这样做:
mod <- stats::arima(ar, c(1,0,0), include.mean = TRUE, fixed = c(0.5, NA))
这将拟合 AR(1),其中 AR 系数固定为 0.5,常数可自由拟合。请参阅有关 fixed
.
中参数排序约定的文档
我有以下数据:
ar <- arima.sim(list(order=c(1,0,0), ar=0.9), n=M1) + 10
如何将 AR(1) 模型拟合到上面 ar 参数 = 0.5 的模拟数据?
编辑:
我用过:
fit <- arima(ar, fixed = 0.5, include.mean = T)
fit
通话:
arima(x = ar, include.mean = T, fixed = 0.5))
Coefficients:
intercept
0.5
这是不正确的。我希望我的拟合模型具有平均值(应该大约为 10)和 ar_parameter=0.5
.
请帮忙
stats::arima
和forecast::Arima
都接受一个参数fixed
,它会将某些参数固定为给定值,并适应其余参数。您需要为不想修复的任何参数传递值 NA
。
因此,您可以这样做:
mod <- stats::arima(ar, c(1,0,0), include.mean = TRUE, fixed = c(0.5, NA))
这将拟合 AR(1),其中 AR 系数固定为 0.5,常数可自由拟合。请参阅有关 fixed
.