| Contents | Index |
yp = predict(sys,data,K)
yp = predict(sys,data,K,opt)
[yp,x0e,sys_pred]
= predict(sys,data,K,___)
predict(sys,data,K___)
yp = predict(sys,data,K) predicts the output of an identified model, sys, K steps ahead using input-output data history from data.
yp = predict(sys,data,K,opt) predicts the output using the option set opt to configure prediction behavior.
[yp,x0e,sys_pred] = predict(sys,data,K,___) also returns the estimated initial state, x0e, and a predictor system, sys_pred.
predict(sys,data,K___) plots the predicted output.
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.
predict predicts the response over the time span of data. forecast performs prediction into the unseen future, which is a time range beyond the last instant of measured data. predict is a tool for validating the quality of an estimated model. Use predict to determine if the prediction result matches the observed response in data.OutputData. If sys is a good prediction model, consider using it with forecast (only supports linear models).
sys |
Identified model. sys may be a linear or nonlinear identified model. |
data |
Measured input-output data. Specify data as an iddata object. If sys is a time-series model, which has no input signals, then specify data as an iddata object with no inputs, or a matrix of past (already observed) time-series data. |
K |
Prediction horizon. Specify K as a positive integer that is a multiple of the data sample-time. Default: 1 |
opt |
Prediction options. opt is an option set that specifies the following:
Use predictOptions to create the options set. |
Simulate a time-series model.
init_sys = idpoly([1 -0.99],[],[1 -1 0.2]); e = iddata([],randn(400,1)); data = sim(init_sys,e);
data is an iddata object containing the simulated response data of a time-series model.
Estimate an ARMAX model for the simulated data.
na = 1; nb = 2; sys = armax(data(1:200),[na nb]);
sys is an idpoly model encapsulating the identified ARMAX model for the simulated data data.
Obtain a 4 step-ahead prediction for the estimated model.
K = 4; yp = predict(sys,data,K);
Analyze the prediction.
plot(data(201:400),yp(201:400)); legend('Simulated data','Predicted data');

Use compare to substitute the use of predict and plot here.
For example:
compare(data,sys,K);
ar | arx | compare | forecast | iddata | idpar | lsim | n4sid | pe | predictOptions | sim | simsd

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |