create arma model in matlab

To create an ARMA model in Matlab, you can use the armax function. Here is an example code snippet to create an ARMA(2,1) model for a time-series data:

main.m
% Load the time-series data
load data.mat

% Define ARMA model order
p = 2; % AR (Auto-Regressive) order
q = 1; % MA (Moving-Average) order

% Create the ARMA model using armax function
model = armax(data, [p,q]);

% Print summary of the model
present(model)
259 chars
13 lines

In the above code, data is a column vector containing the time-series values. The armax function takes the time-series data as input and the [p,q] parameter specifies the AR and MA orders respectively. The output model is an ARMA model object in Matlab.

You can estimate the parameters of the ARMA model using estimate function as shown below:

main.m
model_est = estimate(model, data);
35 chars
2 lines

The model_est object contains the estimated parameters of the ARMA model.

gistlibby LogSnag