plot.Arima(TSA)
plot.Arima()所属R语言包:TSA
Compute and Plot the Forecasts Based on a Fitted Time Series Model
计算和绘制上一个合身的时间序列模型预测技术
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plots the time series data and its predictions with 95% prediction bounds.
图解的时间序列数据和其预测与95%预测界限。
用法----------Usage----------
## S3 method for class 'Arima':
plot(x, n.ahead = 12, col = "black", ylab = object$series,
lty = 2, n1, newxreg, transform, Plot=TRUE, ...)
参数----------Arguments----------
参数:x
a fitted arima model
一个装有ARIMA模型
参数:n.ahead
number of prediction steps ahead (default=12)
预测步骤数提前(默认值= 12)
参数:col
color of the prediction bounds
预测范围的颜色
参数:ylab
label of the y-axis
标签的y-轴
参数:lty
line type of the point predictor; default=dashed lines
线式的点预测;默认值=虚线
参数:n1
starting time point of the plot (default=earliest time point)
图的起始时间点(默认值=最早的时间点)
参数:newxreg
a matrix of covariate(s) over the period of prediction
在此期间的预测矩阵的协变量(S)
参数:transform
function used to transform the forecasts and their prediction bounds; if missing, no transformation will be carried out. This option is useful if the model was fitted to the transformed data and it is desirable to obtain the forecasts on the original scale. For example, if the model was fitted with the logarithm of the data, then transform = exp will plot the forecasts and their prediction bounds on the original scale.
功能用于将预测和预测的边界,如果缺失,没有改造将进行。此选择是有用的,如果模型拟合的变换后的数据,它是可取的,以获得预测原始规模。例如,如果模型拟合的对数的数据,然后转化= exp会绘制在原有规模的预测及预测界限。
参数:Plot
Plotting will be suppressed if Plot is set to be FALSE; default is TRUE
绘图将被抑制,如果图设置为FALSE,默认为TRUE
参数:...
additional parameters passed to the plot function
额外的参数传递给绘图功能
值----------Value----------
Side effects of the function: plot the forecasts and their 95% prediction bounds, unless Plot is set to be FALSE. The part of the observed series is plotted with all data plotted as open circles and linked by a smooth line. By default the predicted values are plotted as open circles joined up by a dashed line. The plotting style of the predicted values can be altered by supplying relevant plotting options, e.g specifying the options type='o', pch=19 and lty=1 will plot the predicted values as solid circles that are overlaid on the connecting smooth solid line. The prediction limits are plotted as dotted lines, with default color being black. However, the prediction limits can be drawn in other colors. For example, setting col='red' paints the prediction limits in red. An interesting use of the col argument is setting col=NULL which has the effect of not drawing the prediction limits.
副作用的功能:绘制的预测和95%的预测界限,,除非图是假的。所观察到的系列的一部分绘制与空心圆圈绘制的所有数据和链接由一光滑的线。缺省情况下,预测值绘制作为开放加入了由虚线的圆。通过提供相关的打印选项,例如指定选项类型=O,PCH = 19 LTY = 1将绘制实心圆,覆盖在光滑的实线连接的预测值的预测值,可以改变绘图样式。预测范围为虚线绘制,默认的颜色是黑的。然而,预测限制,可以得出在其他颜色。例如,设置列=红在红色油漆的预测限制。一个有趣的用途的山坳里的参数设置的山坳= NULL,其效果不绘制的预测极限。
The function returns an invisible list containing the following components. <table summary="R valueblock"> <tr valign="top"><td>pred</td> <td> the time series of predicted values</td></tr> <tr valign="top"><td>lpi</td> <td> the corresponding lower 95% prediction limits</td></tr> <tr valign="top"><td>upi</td> <td> the corresponding upper 95% prediction limits</td></tr> </table>
该函数返回一个不可见的含有以下成分的列表。 <table summary="R valueblock"> <tr valign="top"> <TD> pred </ TD> <TD>时间序列的预测值</ TD> </ TR> <TR VALIGN = “顶”<TD> lpi </ TD> <TD>相应降低95%的预测限制</ TD> </ TR> <tr valign="top"> <TD>upi </ TD> <TD>相应的95%预测上限限制</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Kung-Sik Chan
实例----------Examples----------
data(oil.price)
oil.IMA11alt=arima(log(oil.price),order=c(0,1,1),
# create the design matrix of the covariate for prediction[创建设计矩阵的协预测]
xreg=data.frame (constant=seq(oil.price)))
n=length(oil.price)
n.ahead=24
newxreg=data.frame(constant=(n+1)n+n.ahead))
# do the prediction and plot the results[做了预测,并得出结果]
plot(oil.IMA11alt,n.ahead=n.ahead,newxreg=newxreg,
ylab='Log(Oil Price)',xlab='Year',n1=c(2000,1))
# do the same thing but on the orginal scale[做同样的事情,但在原价的规模]
plot(oil.IMA11alt,n.ahead=n.ahead,newxreg=newxreg,
ylab='Oil Price',xlab='Year',n1=c(2000,1),transform=exp,pch=19, lty=1,type='o')
# Setting pch=19 plots the predicted values as solid circles.[设置PCH = 19图,作为实心圆的预测值。]
res=plot(oil.IMA11alt,n.ahead=n.ahead,newxreg=newxreg,
ylab='Oil Price',xlab='Year',n1=c(2000,1),transform=exp,pch=19,col=NULL)
# Setting col=NULL will make the prediction bands invisible. Try col='red'. [设置列= NULL带无形的预测。尝试列=红。]
res
# prints the predicted values and their 95% prediction limits.[打印的预测值和95%的预测区间。]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|