AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-arima-model-selection-and-forecasting" ~/.claude/skills/ecnu-icalk-autoskill-matlab-arima-model-selection-and-forecasting && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/matlab-arima-model-selection-and-forecasting/SKILL.mdsource content
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
file into a vector.mat
.Y - Model Grid Search: Define ranges for AR order
, differencingp
, and MA orderd
. Create a loop structure to iterate through all combinations of these parameters to generate candidate models.q - Model Estimation: For each combination, create an
model and estimate parameters using thearima
function.estimate - 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
property is unavailable, calculate AIC manually using the log-likelihood function.AIC
and the number of parameters.loglik - 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
for red dashed lines).'r--'
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