Example of using crossval function with ar or arx-function in matlab?

2 visualizaciones (últimos 30 días)
Can anyone give or redirect to a source where I could see a simple example of the usage of the CROSSVAL function in MATLAB, where the prediction function is either AR or ARX function?
I cannot find examples from the MATLAB's documentation or the web...
EDIT:
I'm using time series data on temperatures, wind speed, nitrogen oxyde, etc. to construct an AR forecast model on the air conditions.
My professor just adviced to me use cross validation to check how well my model does its work.
I'm new in Matlab and data analysis so I can't give very deeply analyzed answers.
What I'm trying to do is the following:
I have a bunch of data on air conditions in a vector (integers corresponding to for example temperatures) and I try to create an AR model with this data. Now I want to use cross validation to see how well the model is doing forecasting, but I would like to see an example how this is done =)
  2 comentarios
Shashank Prasanna
Shashank Prasanna el 14 de En. de 2013
Autoregressive models are serially correlated, could you elaborate on what you have in mind when you say cross validation of an AR model?
CHHAVI
CHHAVI el 26 de Jul. de 2020
Dear Sir, I want to do cross validation and leave one out in matlab. please help

Iniciar sesión para comentar.

Respuesta aceptada

Shashank Prasanna
Shashank Prasanna el 14 de En. de 2013
If you have programmed your own AR/ARX estimator then great, if you haven't then both Econometrics toolbox as well as System Id toolbox has built in support for AR/ARX models. I recommend the Econometrics toolbox if you have the license.
So as far as cross validation goes, you should take you data and slice it up into parts. Make sure you don't randomize it since AR models are meant to capture the serial autocorrelation.
If you have 2 sets of data, you can estimate the AR model using the first set and test the model on the second set. Unfortunately I can't find an example but this is fairly straight forward if you already have a function that estimates the model since all you have to do is feed different parts of your data to the same function and test it on the remaining part.
  1 comentario
Edvard
Edvard el 14 de En. de 2013
Ok, I'll give it a shot =) Thank you! and yes I have the econometrics toolbar

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by