Clear Filters
Clear Filters

lratiotest warning about loglikelihood values

6 views (last 30 days)
I am trying to compare ARIMA models using the lratiotest function.
Running the code below, I get following error message when calling lratiotest:
Warning: Restricted loglikelihood exceeds unrestricted loglikelihood.
ipc_ea_2009 = ipc_ea(fin_index:length(ipc_ea)); % get relevant period without crisis build-up
lags = zeros(5);
log_likelihoods = zeros(5);
for p = 1:5
for q = 1:5
lags(p,q) = p+q;
mod = arima('Constant',0,'ARLags',p,'D',1, 'MALags',q, 'Distribution', 'Gaussian');
[fit,~,fit_ll] = estimate(mod,ipc_ea_2009,'Display','off');
log_likelihoods(p,q) = fit_ll;
lags = reshape(lags,25,1);
log_likelihoods = reshape(log_likelihoods,25,1);
% starting out with the unrestricted arima(5,1,5)
model_u = log_likelihoods(25);
model_r = log_likelihoods(1:24);
df = lags(25)-lags(1:24);
[H,pValue,Stat,CriticalValue] = lratiotest(model_u, model_r, df, 0.05);
The variable log_likelihoods contains:
How can I fix this warning?

Answers (1)

arushi on 12 Apr 2024
Hi Karen,
The warning message you're encountering, "Warning: Restricted loglikelihood exceeds unrestricted loglikelihood," suggests an issue with how the likelihood ratio test (LRT) is being applied or interpreted in your context. The likelihood ratio test is typically used to compare a more complex (unrestricted) model against a simpler (restricted) model, under the assumption that the simpler model is nested within the more complex one. The unrestricted model should have a higher (or equal) log-likelihood than the restricted model because it has more parameters, allowing it to fit the data at least as well if not better.
Here are a few things to check and consider to address this issue:
1. Model Nesting and Comparison Validity
Ensure that the models being compared are properly nested. This means every restricted model (with fewer parameters) should be a special case of the unrestricted model. This is a fundamental assumption of the LRT. In your loop, you're comparing ARIMA models with different combinations of AR and MA terms, which is generally the right approach.
2. Log-Likelihood Values
The warning suggests that for at least one comparison, a restricted model has a higher log-likelihood than your unrestricted model (ARIMA(5,1,5) in this case). This could be due to numerical issues, model convergence problems, or the data better fitting a simpler model due to overfitting concerns with the more complex model.
Debugging Steps
  1. Inspect Individual Fits: Check the output of the estimate function for each model fit. Look for warnings or indications that a model did not converge properly.
  2. Manual Verification: For at least one pair of models where the restricted model's log-likelihood is unexpectedly higher, manually inspect the models, their parameters, and their log-likelihood values to understand why this might be happening.
Hope this helps.




Community Treasure Hunt

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

Start Hunting!