Main Content

forecastOptions

Option set forforecast

Description

example

opt= forecastOptionscreates the default option set forforecast. Use dot notation to modify this option set. Any options that you do not modify retain their default values.

example

opt= forecastOptions(Name,Value)creates an option set with the options specified by one or moreName,Valuepair arguments.

Examples

collapse all

Create a default option set forforecast.

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, theforecastcommand subtracts this offset value from the past input data signal.

Create an option set forforecastusing zero initial conditions.

opt = forecastOptions('InitialCondition','z');

Load past measured data from two experiments.

loadiddata1loadiddata2

z1andz2areiddataobjects that store SISO input-output data. Create a two-experiment data set fromz1andz2.

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]);

OutputOffsetis specified as anNy-by-Nematrix whereNyis the number of outputs in each experiment, andNeis the number of experiments. In this example,Nyis 1 andNeis 2.

Using the option setopt, forecast the response of the model 10 time steps into the future. The software subtracts the offset valueOutputOffset(i,j)from the output signaliof experimentjbefore 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

yis aniddataobject that returns the forecasted response corresponding to each set of past experimental data.

Input Arguments

collapse all

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis 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 encloseNamein 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.

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.

    对于非线性灰色矩形模型, only those initial statesithat 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 theNxstates of theidnlgreymodelsysas free.

    fori = 1:Nx sys.InitialStates(i).Fixed = false;end

    Similarly, to fix all the initial states to values specified insys.InitialStates, first specify all the states as fixed in thesys.InitialStatesproperty of the nonlinear grey-box model.

  • x0obj— Specification object created usingidpar. Use this object for discrete-time state-space models only (idss,idgrey, andidnlgrey). Usex0objto impose constraints on the initial states by fixing their value or specifying minimum or maximum bounds.

输入信号时域数据的偏移,specified as the comma-separated pair consisting of'InputOffset'and one of the following values:

  • []— No input offsets.

  • A column vector of lengthNu, whereNuis the number of inputs. When you use theforecastcommand, the software subtracts the offset valueInputOffset(i)from theith input signals in the past and future input values. You specify these values in thePastDataandFutureInputsarguments offorecast. The software then uses the offset subtracted inputs to forecast the model response.

  • Nu-by-Nematrix — For multi-experiment data, specifyInputOffsetas anNu-by-Nematrix, whereNeis the number of experiments. The software subtracts the offset valueInputOffset(i,j)from theith input signal of thejth experiment in thePastDataandFutureInputsarguments offorecastbefore forecasting.

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 lengthNy, whereNyis the number of outputs. When you use theforecastcommand, the software subtracts the offset valueOutputOffset(i)from theith past output signal that you specify in thePastDataargument 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-Nematrix — For multi-experiment data, specifyOutputOffsetas anNy-by-Nematrix, whereNeis the number of experiments. Before forecasting, the software subtracts the offset valueOutputOffset(i,j)from theith output signal of thejth experiment in thePastDataargument offorecast. For an example, seeSpecify Output Offset for Forecasting Multi-Experiment Data.

Output Arguments

collapse all

Option set forforecast, retuned as aforecastOptionsoption set.

Version History

Introduced in R2012a