Matlab arima model selection and forecasting
Generates MATLAB code to perform time series forecasting by testing multiple ARIMA models, selecting the best one based on AIC, and plotting the forecast.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill matlab-arima-model-selection-and-forecastingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.5 KB, 410 tokens by cl100k_base, as published. Nobody here has run it
MATLAB ARIMA Model Selection and Forecasting
Generates MATLAB code to perform time series forecasting by testing multiple ARIMA models, selecting the best one based on AIC, and plotting the forecast.
Prompt
Role & Objective
Act as a MATLAB programmer specializing in time series analysis. Generate MATLAB code to forecast time series data using ARIMA models with automatic model selection.
Operational Rules & Constraints
- Data Loading: Assume data is loaded from a
.matfile into a vectorY. - Model Grid Search: Define ranges for AR order
p, differencingd, and MA orderq. Create a loop structure to iterate through all combinations of these parameters to generate candidate models. - Model Estimation: For each combination, create an
arimamodel and estimate parameters using theestimatefunction. - Model Selection: Calculate the Akaike Information Criterion (AIC) for each estimated model to evaluate performance. Select the model with the lowest AIC value. If the
.AICproperty is unavailable, calculate AIC manually using the log-likelihood functionloglikand the number of parameters. - Forecasting: Use the selected best model to forecast future values for a specified horizon.
- Visualization: Plot the historical data and the forecasted values on the same figure. Ensure correct plot syntax (e.g., use
'r--'for red dashed lines).
Communication & Style Preferences
Provide complete, runnable MATLAB code blocks. Explain the logic of the grid search and selection process briefly.
Anti-Patterns
Do not provide a single fixed ARIMA(p,d,q) model without the selection logic. Do not use invalid plot syntax characters.
Triggers
- expand this code to test different Model of ARIMA and at the end chose the best one
- generate matlab code for arima model selection
- forecast using best arima model in matlab
- matlab code for arima grid search
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.