Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 多元时间序列模型_R_Time Series - Fatal编程技术网

R 多元时间序列模型

R 多元时间序列模型,r,time-series,R,Time Series,我试图根据三个变量预测税基(时间序列):税收减免、收入流入和经济利润。 我尝试将auto.arima与xreg一起使用,但出现错误: 没有找到合适的ARIMA模型 2011年至2013年的税收减免数据基本上都是零,2014年是50000,2015年是75000,接下来的几年都是100000。 此外,税收减免就像每家公司在其最初10万美元的利润中获得10万美元的免税额一样。我真的很想知道我的模型是否正确,或者我应该如何对这些数据建模?代码如下: tb = ts(data1$Taxbreak, st

我试图根据三个变量预测税基(时间序列):税收减免、收入流入和经济利润。 我尝试将
auto.arima
xreg
一起使用,但出现错误:

没有找到合适的ARIMA模型

2011年至2013年的税收减免数据基本上都是零,2014年是50000,2015年是75000,接下来的几年都是100000。 此外,税收减免就像每家公司在其最初10万美元的利润中获得10万美元的免税额一样。我真的很想知道我的模型是否正确,或者我应该如何对这些数据建模?代码如下:

tb = ts(data1$Taxbreak, start = c(2001), frequency = 1)
inflows = ts(data1$`Inflow of earnings`, start = c(2001), frequency = 1)
ep = ts(data1$`Economic Profits`, start = c(2001), frequency = 1)

xreg = cbind(tb, inflows,ep)
colnames(xreg) <- c("taxbreak","inflows", "economic profit")
xreg

B =ts(data1$`GR Tax Base`, start = c(2001), frequency = 1)
Box.test(B, lag = 15, type = "Ljung-Box")#stationary
acf(B)

revfit<-auto.arima(B, xreg=xreg)
tsdisplay(residuals(revfit))


newtb = ts(forecasted1$Taxbreak, start = c(2017), frequency = 1)
newinflows = ts(forecasted1$`Inflow of earnings`, start = c(2017), frequency = 1)
newperep = ts(forecasted1$`Economic Profits`, start = c(2017), frequency = 1)
nnewxreg = cbind(newtb, newinflows, newep)
nnewxreg

fcast <- forecast(revfit, xreg = nnewxreg)
list(fcast)
plot(fcast)
tsdisplay(residuals(fcast))
accuracy(fcast)
对于代码的其余部分,我计划使用以下数据作为我的
newxreg
预测2017年至2020年的税基

Year  Taxbreak  earnings    Profits    
2017    $1.00   9330906     2,384
2018    $1.00   9566108     2,497
2019    $1.00   9801311     2,575
2020    $1.00   10036513    2,670
2021    $1.00   10271716    2,766
2022    $1.00   10506918    2,861

错误发生在代码中的什么位置?您是否能够创建收入经济利润2001年0.00美元5332463 762 2002年0.00美元5431753 808 2003年0.00美元5643742 979 2004年0.00美元6134432 1179 2005年0.00美元6433098 1375 2006年0.00美元6871455 1578 2007年0.00美元7265704 1609 2008年0.00美元7390580 1435 2009年0.00美元717171789 1237年的年度免税流入2010美元0.00美元7258068 1588 2011美元0.00美元7581240 1782 2012美元0.00美元7862034 1952 2013美元0.00美元7903139 2006 2014美元1.00美元8211705 2026 2015美元1.00美元8625298 2098 2016美元1.00 9095703 2288我将上述数据用于以下代码tb=ts(数据1$Taxbreak,start=c(2001),frequency=1)流入量=ts(data1$
收益流入量
,start=c(2001),frequency=1)ep=ts(data1$
经济利润
,start=c(2001),frequency=1)xreg=cbind(tb,流入量,ep)colnames(xreg)我在这一步得到了错误:revfit
Year    Taxbreak earnings   Profits    Tax Base
2001    $0.00   $5,332,463  762        32,222,803,774
2002    $0.00   $5,431,753  808       33,610,875,248
2003    $0.00   $5,643,742  979     30,835,183,333
2004    $0.00   $6,134,432  1,179   36,383,352,174
2005    $0.00   $6,433,098  1,375   48,219,466,667
2006    $0.00   $6,871,455  1,578   59,596,984,211
2007    $0.00   $7,265,704  1,609   60,346,996,997
2008    $0.00   $7,390,580  1,435   61,060,551,948
2009    $0.00   $7,171,789  1,237   64,854,063,604
2010    $0.00   $7,258,068  1,588   60,502,826,855
2011    $0.00   $7,581,240  1,782   61,554,035,336
2012    $0.00   $7,862,034  1,952   68,020,593,640
2013    $0.00   $7,903,139  2,006   75,653,752,650
2014    $1.00   $8,211,705  2,026   77,369,017,668
2015    $1.00   $8,625,298  2,098   73,887,957,597
2016    $1.00   9095703 2288.857    76,386,659,364
Year  Taxbreak  earnings    Profits    
2017    $1.00   9330906     2,384
2018    $1.00   9566108     2,497
2019    $1.00   9801311     2,575
2020    $1.00   10036513    2,670
2021    $1.00   10271716    2,766
2022    $1.00   10506918    2,861