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;
end
end
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:
-340.485668054773
-334.522914100928
-342.907508852972
-342.956015065684
-343.000412390143
-333.972859848341
-335.223009974139
-334.368894183728
-335.234865940324
-334.734053408058
-344.545740375831
-335.386800606845
-344.831558645563
-345.044215158301
-344.795009838202
-345.097563048760
-335.128973733821
-345.086019494768
-345.443870064777
-346.253404467528
-345.168693904948
-335.934650953789
-344.909840797136
-346.255587823234
-345.916640381693
How can I fix this warning?

Answers (1)

arushi
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.

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!