LikelihoodRatioTest¶
- LikelihoodRatioTest(model0NbParameters, model0LogLikelihood, model1NbParameters, model1LogLikelihood, level=0.05)¶
Nested likelihood model selection.
This test helps selecting between two nested models estimated by likelihood maximization.
Suppose that is a model with -dimensional parameter where is a -dimensional subset of . We suppose that is obtained by constraining to be equal to a fixed value denoted by . Then is a model with parameter .
Let denote the maximum likelihood estimator of for model and its maximized log-likelihood.
The profile log-likelihood for is defined as:
We define the profile deviance statistic depending on as the maximized log-likelihood with respect to when is frozen:
Under suitable regularity conditions, for large , follows a distribution.
We use the profile deviance statistic to define the confidence region for the true value of parameter :
where is the quantile of the distribution. The level is the Type 1 error of the test, which means the mistaken rejection of model .
In order to test the validity of model with parameter relative to with parameter at the -level of significance, we check the value :
if , we accept rather than ,
if , we reject in favor of .
- Parameters:
- model0NbParametersint, ,
Number of parameters of
- m0llhfloat
log-likelihood
- model1NbParametersint, ,
Number of parameters of
- m1llhfloat
log-likelihood
- levelfloat, , optional
Risk of wrongly rejecting Default value is 0.05
- Returns:
- test_result
TestResult
Test result.
- test_result
Notes
Both models must have been estimated on the same data.
Examples using the function¶
Estimate a GEV on the Port Pirie sea-levels data
Estimate a GPD on the daily rainfall data
Estimate a GEV on race times data
Estimate a GEV on the Fremantle sea-levels data