forecastOptions
Option set for forecast
Description
creates
an option set with the options specified by one or more opt
= forecastOptions(Name,Value
)Name,Value
pair
arguments.
Examples
Specify Input Signal Offset for Model Forecasting
Create a default option set for forecast
.
opt = forecastOptions;
Specify the input offset for a single-input data set as 5.
opt.InputOffset = 5;
You can now use this option set for forecasting. Before forecasting model response, the forecast
command subtracts this offset value from the past input data signal.
Specify Handling of Initial Conditions During Model Forecasting
Create an option set for forecast
using zero initial conditions.
opt = forecastOptions('InitialCondition','z');
Specify Output Offset for Forecasting Multi-Experiment Data
Load past measured data from two experiments.
load iddata1 load iddata2
z1
and z2
are iddata
objects that store SISO input-output data. Create a two-experiment data set from z1
and z2
.
z = merge(z1,z2);
Estimate a transfer function model with 2 poles using the multi-experiment data.
sys = tfest(z,2);
Specify the offset as -1 and 1 for the output signals of the two experiments.
opt = forecastOptions('OutputOffset',[-1 1]);
OutputOffset
is specified as an Ny-by-Ne matrix where Ny is the number of outputs in each experiment, and Ne is the number of experiments. In this example, Ny is 1 and Ne is 2.
Using the option set opt
, forecast the response of the model 10 time steps into the future. The software subtracts the offset value OutputOffset(i,j)
from the output signal i of experiment j before using the data in the forecasting algorithm. The removed offsets are added back to generate the final result.
y = forecast(sys,z,10,opt)
y = Time domain data set containing 2 experiments. Experiment Samples Sample Time Exp1 10 0.1 Exp2 10 0.1 Outputs Unit (if specified) y1 Inputs Unit (if specified) u1
y
is an iddata
object that returns the forecasted response corresponding to each set of past experimental data.
Input Arguments
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: forecastOptions('InitialCondition','e')
specifies
that the software estimates the initial conditions of the measured
input-output data such that the 1-step prediction error for observed
output is minimized.
InitialCondition
— Handling of initial conditions
'e'
(default) | 'z'
| idpar
object x0Obj
Handling of initial conditions, specified as the comma-separated
pair consisting of 'InitialCondition'
and one of
the following values:
'z'
— Zero initial conditions.'e'
— Estimate initial conditions such that the 1-step prediction error is minimized for the observed output.For nonlinear grey-box models, only those initial states
i
that are designated as free in the model (sys.InitialStates(i).Fixed = false
) are estimated. To estimate all the states of the model, first specify all theNx
states of theidnlgrey
modelsys
as free.for i = 1:Nx sys.InitialStates(i).Fixed = false; end
Similarly, to fix all the initial states to values specified in
sys.InitialStates
, first specify all the states as fixed in thesys.InitialStates
property of the nonlinear grey-box model.x0obj
— Specification object created usingidpar
. Use this object for discrete-time state-space models only (idss
,idgrey
, andidnlgrey
). Usex0obj
to impose constraints on the initial states by fixing their value or specifying minimum or maximum bounds.
InputOffset
— Input signal offset
[]
(default) | column vector | matrix
Input signal offset for time-domain data, specified as the comma-separated
pair consisting of 'InputOffset'
and one of the
following values:
[]
— No input offsets.A column vector of length Nu, where Nu is the number of inputs. When you use the
forecast
command, the software subtracts the offset valueInputOffset(i)
from the ith input signals in the past and future input values. You specify these values in thePastData
andFutureInputs
arguments offorecast
. The software then uses the offset subtracted inputs to forecast the model response.Nu-by-Ne matrix — For multi-experiment data, specify
InputOffset
as an Nu-by-Ne matrix, where Ne is the number of experiments. The software subtracts the offset valueInputOffset(i,j)
from the ith input signal of the jth experiment in thePastData
andFutureInputs
arguments offorecast
before forecasting.
OutputOffset
— Output signal offset
[]
(default) | column vector | matrix
Output signal offset for time-domain data, specified as the
comma-separated pair consisting of 'OutputOffset'
and
one of the following values:
[]
— No output offsets.A column vector of length Ny, where Ny is the number of outputs. When you use the
forecast
command, the software subtracts the offset valueOutputOffset(i)
from the ith past output signal that you specify in thePastData
argument offorecast
. The software then uses the offset subtracted output to compute the detrended forecasts. The removed offsets are added back to the detrended forecasts to generate the final result.Ny-by-Ne matrix — For multi-experiment data, specify
OutputOffset
as an Ny-by-Ne matrix, where Ne is the number of experiments. Before forecasting, the software subtracts the offset valueOutputOffset(i,j)
from the ith output signal of the jth experiment in thePastData
argument offorecast
. For an example, see Specify Output Offset for Forecasting Multi-Experiment Data.
Output Arguments
opt
— Option set for forecast
forecastOptions
option set
Option set for forecast
, returned as a forecastOptions
option set.
Version History
Introduced in R2012a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)