Learn R Programming

ghyp (version 1.1.0)

lik.ratio.test: Likelihood-ratio test

Description

This function performs a likelihood-ratio test on fitted generalized hyperbolic distribution objects of class mle.ghyp.

Usage

lik.ratio.test(x, x.subclass, conf.level = 0.95)

Arguments

x
An object of class mle.ghyp.
x.subclass
An object of class mle.ghyp whose parameters form a subset of those of x.
conf.level
Confidence level of the test.

Value

  • A list with components:
  • statisticThe value of the L-statistic.
  • p.valueThe p-value for the test.
  • dfThe degrees of freedom for the L-statistic.
  • H0A boolean stating whether the null hypothesis is TRUE or FALSE.

Details

The likelihood-ratio test can be used to check whether a special case of the generalized hyperbolic distribution is the true underlying distribution. The likelihood-ratio is defined as $$\Lambda = \frac{sup{L(\theta | \mathbf{X}) : \theta \in \Theta_0}} { sup{L(\theta | \mathbf{X}) : \theta \in \Theta}}.$$ Where $L$ denotes the likelihood function with respect to the parameter $\theta$ and data $\mathbf{X}$, and $\Theta_0$ is a subset of the parameter space $\Theta$. The null hypothesis H0 states that $\theta \in \Theta_0$. Under the null hypothesis and under certain regularity conditions it can be shown that $-2 \log(\Lambda)$ is asymtotically chi-squared distributed with $\nu$ degrees of freedom. $\nu$ is the number of free parameters specified by $\Theta$ minus the number of free parameters specified by $\Theta_0$. The null hypothesis is rejected if $-2 \log(\Lambda)$ exceeds the conf.level-quantile of the chi-squared distribution with $\nu$ degrees of freedom.

See Also

fit.ghypuv, logLik, AIC and stepAIC.ghyp.

Examples

Run this code
data(smi.stocks)

  sample <- smi.stocks[, "SMI"]
  
  t.symmetric <- fit.tuv(sample, silent = TRUE, symmetric = TRUE) 
  t.asymmetric <- fit.tuv(sample, silent = TRUE)
  
  # Test symmetric student-t against asymmetric student-t in case
  # of SMI log-returns
  lik.ratio.test(t.asymmetric, t.symmetric, conf.level = 0.95)
  # -> keep the null hypothesis  
  
  set.seed(1000)
  sample <- rghyp(1000, student.t(gamma = 0.1))

  t.symmetric <- fit.tuv(sample, silent = TRUE, symmetric = TRUE) 
  t.asymmetric <- fit.tuv(sample, silent = TRUE)
  
  # Test symmetric student-t against asymmetric student-t in case of
  # data simulated according to a slightly skewed student-t distribution
  lik.ratio.test(t.asymmetric, t.symmetric, conf.level = 0.95) 
  # -> reject the null hypothesis

  t.symmetric <- fit.tuv(sample, silent = TRUE, symmetric = TRUE) 
  ghyp.asymmetric <- fit.ghypuv(sample, silent = TRUE)

  # Test symmetric student-t against asymmetric generalized 
  # hyperbolic using the same data as in the example above
  lik.ratio.test(ghyp.asymmetric, t.symmetric, conf.level = 0.95) 
  # -> keep the null hypothesis

Run the code above in your browser using DataLab