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.m259 chars13 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.m35 chars2 lines
The model_est
object contains the estimated parameters of the ARMA model.
gistlibby LogSnag