声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 4989|回复: 4

[综合讨论] predict函数的用法?????

[复制链接]
发表于 2008-12-8 19:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
哪位高手给详细说一下建立了ARMA模型之后,怎样用predict函数进行预测啊?就是我用100个数据进行建模,怎样用predict预测出101--110个数据啊?
[yp,x0p,mpred] = predict(m,data,k,'InitialState',init)
里面的参数都应该怎么设啊?
回复
分享到:

使用道具 举报

 楼主| 发表于 2008-12-9 15:40 | 显示全部楼层
:@( 没人帮忙吗?
发表于 2008-12-9 18:42 | 显示全部楼层
Description


data is the output-input data as an iddata object, and m is any idmodel object (idpoly, idproc, idss, idgrey, or idarx). predict is meaningful only for time-domain data.

The argument k indicates that the k step-ahead prediction of y according to the model m is computed. In the calculation of yp(t), the model can use outputs up to time  

and inputs up to the current time t. The default value of k is 1.

The output yp is an iddata object containing the predicted values as OutputData. The output argument mpred contains the k step-ahead predictor. This is given as a cell array, whose kth entry is an idpoly model for the predictor of output number k. Note that these predictor models have as input both input and output signals in the data set. The channel names indicate how the predictor model and the data fit together.

init determines how to deal with the initial state: init ='estimate': The initial state is set to a value that minimizes the norm of the prediction error associated with the model and the data. init = 'zero' sets the initial state to zero. init = 'model' uses the model's internally stored initial state. init = x0, where x0 is a column vector of appropriate dimension, uses that value as initial state.

If init is not specified, the model property m.InitialState is used, so that 'Estimate', 'Backcast', and 'Auto' set init = 'Estimate', while m.InitialState = 'Zero' sets init = 'zero', and 'Model' and 'Fixed' set init = 'model'.

An important use of predict is to evaluate a model's properties in the mid-frequency range. Simulation with sim (which conceptually corresponds to k = inf) can lead to levels that drift apart, since the low-frequency behavior is emphasized. One step-ahead prediction is not a powerful test of the model's properties, since the high-frequency behavior is stressed. The trivial predictor  can give good predictions in case the sampling of the data is fast.

Another important use of predict is to evaluate time-series models. The natural way of studying a time-series model's ability to reproduce observations is to compare its k step-ahead predictions with actual data.

Note that for output-error models, there is no difference between the k step-ahead predictions and the simulated output, since, by definition, output-error models only use past inputs to predict future outputs.

Algorithm


The model is evaluated in state-space form, and the state equations are simulated k steps ahead with initial value , where  is the Kalman filter state estimate.

Examples


Simulate a time series, estimate a model based on the first half of the data, and evaluate the four step-ahead predictions on the second half.
m0 = idpoly([1 -0.99],[],[1 -1 0.2]);
e = iddata([],randn(400,1));
y = sim(m0,e);
m = armax(y(1:200),[1 2]);
yp = predict(m,y,4);
plot(y(201:400),yp(201:400))



Note that the last two commands are also achieved by
compare(y,m,4,201:400);

评分

1

查看全部评分

发表于 2011-1-8 20:32 | 显示全部楼层

点评

反对: 1.0
反对: 1
建议多少发表一些意见  发表于 2011-1-9 11:21
发表于 2011-4-14 19:45 | 显示全部楼层
回复 3 # sogooda 的帖子

predict函数返回值为iddata对象,他不满足数学加减法,但是可以用plot绘制出值来!我现在对两个数据进行predict,然后想把预测结果加起来,怎么做?
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-16 08:46 , Processed in 0.060127 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表