ARIMAX 中的标准误差得到 NaN 结果
Standard error in ARIMAX got the NaN result
我想应用关于灾难对夜光强度影响的中断时间序列分析。我有从 2015 年 1 月到 2020 年 5 月的 65 个月的数据。灾难发生在 2018 年 10 月(原始数据的 46 个月)。对于干预前的数据,我有一个 arima 模型函数 ARIMA(3,0,0),(0,0,0)12
干预函数是这样的
the transfer function
enter image description here
所以我这里有代码
air.m1=arimax(kota,order=c(3,0,0),
seasonal=list(order=c(0,0,0),period=12),
xtransf=data.frame(I911=1*(seq(kota)==46),
I911=1*(seq(kota)==46)),transfer=list(c(0,0),c(1,0)))
当我试图知道结果时,我收到了这样的警告
Coefficients:
ar1 ar2 I911-MA0 I911.1-AR1 I911.1-MA0
-0.8738 -0.5048 800.1583 0.0526 -2283.138
s.e. 0.1118 0.1114 NaN NaN NaN
sigma^2 estimated as 1826510: log likelihood = -552.69, aic = 1115.37
Warning message:
In sqrt(diag(x$var.coef)) : NaNs produced
为什么没有出现标准错误?这个问题的解决方案是什么?
这是 kota 变量的样子
Jan Feb Mar Apr May Jun Jul Aug
2015 3627.300 3982.730 3763.880 4568.350 4463.370 3492.180 4689.460 4134.270
2016 3495.830 304.790 4093.980 3696.690 3339.750 2053.980 4105.550 4417.260
2017 3279.070 3064.600 6164.940 2507.610 2835.330 4245.300 421.230 4252.740
2018 161.870 4919.110 3952.470 5848.790 4862.430 4787.780 4905.020 6036.310
2019 3610.630 4413.600 3123.320 5432.030 5050.170 3127.430 6437.540 5001.340
2020 5283.910 5047.740 4971.200 7375.960 3862.400
Sep Oct Nov Dec
2015 3671.630 3392.750 2407.510 3374.650
2016 4354.850 5184.930 1731.430 4675.500
2017 4864.100 2747.270 3795.644 4697.800
2018 5431.930 3224.620 1880.110 3955.170
2019 5577.980 6907.160 5669.520 6981.180
2020
按照交叉验证上关于此 post 的指导,您的数据似乎显示出显着的异方差性。通过用 log()
:
包装 kota
来尝试对数据进行对数转换
library(TSA)
library(lmtest)
# data
vec <- c(3627.300, 3982.730, 3763.880, 4568.350, 4463.370, 3492.180, 4689.460,
4134.270, 3671.630, 3392.750, 2407.510, 3374.650, 3495.830, 304.790,
4093.980, 3696.690, 3339.750, 2053.980, 4105.550, 4417.260, 4354.850,
5184.930, 1731.430, 4675.500, 3279.070, 3064.600, 6164.940, 2507.610,
2835.330, 4245.300, 421.230, 4252.740, 4864.100, 2747.270, 3795.644,
4697.800, 161.870, 4919.110, 3952.470, 5848.790, 4862.430, 4787.780,
4905.020, 6036.310, 5431.930, 3224.620, 1880.110, 3955.170, 3610.630,
4413.600, 3123.320, 5432.030, 5050.170, 3127.430, 6437.540, 5001.340,
5577.980, 6907.160, 5669.520, 6981.180, 5283.910, 5047.740, 4971.200,
7375.960, 3862.400)
# convert to time series
kota <- ts(vec, start=c(2015, 1), end=c(2020, 1), frequency=12)
# test heteroscedasticity
> gqtest(kota ~ 1)
Goldfeld-Quandt test
data: kota ~ 1
GQ = 2.0991, df1 = 30, df2 = 29, p-value = 0.02451
alternative hypothesis: variance increases from segment 1 to 2
# log tranform time series object
air.m1=arimax(log(kota),order=c(3,0,0), # transform to log scale
seasonal=list(order=c(0,0,0),period=12),
xtransf=data.frame(I911=1*(seq(kota)==46),
I911=1*(seq(kota)==46)),
transfer=list(c(0,0),c(1,0)))
> air.m1
Call:
arimax(x = log(kota), order = c(3, 0, 0), seasonal = list(order = c(0, 0, 0),
period = 12), xtransf = data.frame(I911 = 1 * (seq(kota) == 46), I911 = 1 *
(seq(kota) == 46)), transfer = list(c(0, 0), c(1, 0)))
Coefficients:
ar1 ar2 ar3 intercept I911-MA0 I911.1-AR1 I911.1-MA0
-0.0447 0.0686 0.1710 8.1999 14.4892 0.0537 -14.6782
s.e. 0.1255 0.1267 0.1263 0.1023 111.8000 0.4048 111.7594
sigma^2 estimated as 0.4105: log likelihood = -59.45, aic = 132.9
我想应用关于灾难对夜光强度影响的中断时间序列分析。我有从 2015 年 1 月到 2020 年 5 月的 65 个月的数据。灾难发生在 2018 年 10 月(原始数据的 46 个月)。对于干预前的数据,我有一个 arima 模型函数 ARIMA(3,0,0),(0,0,0)12
干预函数是这样的
the transfer function
enter image description here
所以我这里有代码
air.m1=arimax(kota,order=c(3,0,0),
seasonal=list(order=c(0,0,0),period=12),
xtransf=data.frame(I911=1*(seq(kota)==46),
I911=1*(seq(kota)==46)),transfer=list(c(0,0),c(1,0)))
当我试图知道结果时,我收到了这样的警告
Coefficients:
ar1 ar2 I911-MA0 I911.1-AR1 I911.1-MA0
-0.8738 -0.5048 800.1583 0.0526 -2283.138
s.e. 0.1118 0.1114 NaN NaN NaN
sigma^2 estimated as 1826510: log likelihood = -552.69, aic = 1115.37
Warning message:
In sqrt(diag(x$var.coef)) : NaNs produced
为什么没有出现标准错误?这个问题的解决方案是什么?
这是 kota 变量的样子
Jan Feb Mar Apr May Jun Jul Aug
2015 3627.300 3982.730 3763.880 4568.350 4463.370 3492.180 4689.460 4134.270
2016 3495.830 304.790 4093.980 3696.690 3339.750 2053.980 4105.550 4417.260
2017 3279.070 3064.600 6164.940 2507.610 2835.330 4245.300 421.230 4252.740
2018 161.870 4919.110 3952.470 5848.790 4862.430 4787.780 4905.020 6036.310
2019 3610.630 4413.600 3123.320 5432.030 5050.170 3127.430 6437.540 5001.340
2020 5283.910 5047.740 4971.200 7375.960 3862.400
Sep Oct Nov Dec
2015 3671.630 3392.750 2407.510 3374.650
2016 4354.850 5184.930 1731.430 4675.500
2017 4864.100 2747.270 3795.644 4697.800
2018 5431.930 3224.620 1880.110 3955.170
2019 5577.980 6907.160 5669.520 6981.180
2020
按照交叉验证上关于此 post 的指导,您的数据似乎显示出显着的异方差性。通过用 log()
:
kota
来尝试对数据进行对数转换
library(TSA)
library(lmtest)
# data
vec <- c(3627.300, 3982.730, 3763.880, 4568.350, 4463.370, 3492.180, 4689.460,
4134.270, 3671.630, 3392.750, 2407.510, 3374.650, 3495.830, 304.790,
4093.980, 3696.690, 3339.750, 2053.980, 4105.550, 4417.260, 4354.850,
5184.930, 1731.430, 4675.500, 3279.070, 3064.600, 6164.940, 2507.610,
2835.330, 4245.300, 421.230, 4252.740, 4864.100, 2747.270, 3795.644,
4697.800, 161.870, 4919.110, 3952.470, 5848.790, 4862.430, 4787.780,
4905.020, 6036.310, 5431.930, 3224.620, 1880.110, 3955.170, 3610.630,
4413.600, 3123.320, 5432.030, 5050.170, 3127.430, 6437.540, 5001.340,
5577.980, 6907.160, 5669.520, 6981.180, 5283.910, 5047.740, 4971.200,
7375.960, 3862.400)
# convert to time series
kota <- ts(vec, start=c(2015, 1), end=c(2020, 1), frequency=12)
# test heteroscedasticity
> gqtest(kota ~ 1)
Goldfeld-Quandt test
data: kota ~ 1
GQ = 2.0991, df1 = 30, df2 = 29, p-value = 0.02451
alternative hypothesis: variance increases from segment 1 to 2
# log tranform time series object
air.m1=arimax(log(kota),order=c(3,0,0), # transform to log scale
seasonal=list(order=c(0,0,0),period=12),
xtransf=data.frame(I911=1*(seq(kota)==46),
I911=1*(seq(kota)==46)),
transfer=list(c(0,0),c(1,0)))
> air.m1
Call:
arimax(x = log(kota), order = c(3, 0, 0), seasonal = list(order = c(0, 0, 0),
period = 12), xtransf = data.frame(I911 = 1 * (seq(kota) == 46), I911 = 1 *
(seq(kota) == 46)), transfer = list(c(0, 0), c(1, 0)))
Coefficients:
ar1 ar2 ar3 intercept I911-MA0 I911.1-AR1 I911.1-MA0
-0.0447 0.0686 0.1710 8.1999 14.4892 0.0537 -14.6782
s.e. 0.1255 0.1267 0.1263 0.1023 111.8000 0.4048 111.7594
sigma^2 estimated as 0.4105: log likelihood = -59.45, aic = 132.9