logLik-AIC-methods: Extract Log-Likelihood and Akaike's Information Criterion

Description Usage Arguments Value Note Author(s) See Also Examples

Description

The functions logLik and AIC extract the Log-Likelihood and the Akaike's Information Criterion from fitted generalized hyperbolic distribution objects. The Akaike information criterion is calculated according to the formula -2 * log-likelihood + k * npar, where npar represents the number of parameters in the fitted model, and k = 2 for the usual AIC.

Usage

1
2
3
4
5
## S4 method for signature 'mle.ghyp'
logLik(object, ...)

## S4 method for signature 'mle.ghyp'
AIC(object, ..., k = 2)

Arguments

object

An object of class mle.ghyp.

k

The “penalty” per parameter to be used; the default k = 2 is the classical AIC.

...

An arbitrary number of objects of class mle.ghyp.

Value

Either the Log-Likelihood or the Akaike's Information Criterion.

Note

The Log-Likelihood as well as the Akaike's Information Criterion can be obtained from the function ghyp.fit.info. However, the benefit of logLik and AIC is that these functions allow a call with an arbitrary number of objects and are better known because they are generic.

Author(s)

David Luethi

See Also

fit.ghypuv, fit.ghypmv, lik.ratio.test, ghyp.fit.info, mle.ghyp-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  data(smi.stocks)

  ## Multivariate fit
  fit.mv <- fit.hypmv(smi.stocks, nit = 10)
  AIC(fit.mv)
  logLik(fit.mv)

  ## Univariate fit
  fit.uv <- fit.tuv(smi.stocks[, "CS"], control = list(maxit = 10))
  AIC(fit.uv)
  logLik(fit.uv)

  # Both together
  AIC(fit.uv, fit.mv)
  logLik(fit.uv, fit.mv)

Example output

Loading required package: numDeriv
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

[1] "iter: 1; rel.closeness:  2.140754E-03; log-likelihood:  3.353427E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 2; rel.closeness:  2.011287E-04; log-likelihood:  3.354101E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 3; rel.closeness:  4.849463E-05; log-likelihood:  3.354264E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 4; rel.closeness:  1.234251E-05; log-likelihood:  3.354305E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 5; rel.closeness:  3.161630E-06; log-likelihood:  3.354316E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 6; rel.closeness:  8.111358E-07; log-likelihood:  3.354318E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 7; rel.closeness:  2.082995E-07; log-likelihood:  3.354319E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 8; rel.closeness:  5.353488E-08; log-likelihood:  3.354319E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 9; rel.closeness:  1.376934E-08; log-likelihood:  3.354319E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
[1] "iter: 10; rel.closeness:  3.544058E-09; log-likelihood:  3.354319E+04; alpha.bar:  5.602796E-09; lambda:  3.500000E+00"
There were 30 warnings (use warnings() to see them)
[1] -67018.39
[1] 33543.19
[1] "Llh:  4.22925135539231E+03; Pars: -1.750000E+00,  0.000000E+00,  1.532858E-02,  0.000000E+00"
[1] "Llh:  4.24641499471618E+03; Pars: -2.138967E+00,  0.000000E+00,  1.532858E-02,  0.000000E+00"
[1] "Llh: -1.83013297494468E+04; Pars: -1.750000E+00,  4.178036E-01,  1.532858E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh: -6.87422166226201E+04; Pars: -1.750000E+00,  0.000000E+00,  1.532858E-02,  4.178036E-01"
[1] "Llh:  1.62798194490441E+03; Pars: -1.924243E+00,  2.089018E-01,  1.888978E-02, -4.178036E-01"
[1] "Llh:  1.81907265655274E+03; Pars: -1.877213E+00,  1.566764E-01,  1.792857E-02, -2.089018E-01"
[1] "Llh: -3.03435044943628E+05; Pars: -1.999558E+00, -3.394654E-01,  2.042908E-02, -1.044509E-01"
[1] "Llh: -4.84050081342422E+03; Pars: -1.805838E+00,  2.284864E-01,  1.646981E-02, -2.611273E-02"
[1] "Llh: -1.15007932248033E+05; Pars: -1.930296E+00, -1.501482E-01,  1.901350E-02, -7.833818E-02"
[1] "Llh: -1.08830390316283E+03; Pars: -1.835298E+00,  1.338277E-01,  1.707191E-02, -3.916909E-02"
[1] "Llh:  4.36146814441471E+03; Pars: -1.751502E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36193970174800E+03; Pars: -1.750750E+00,  1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35550507574385E+03; Pars: -1.750750E+00, -1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36142858460196E+03; Pars: -1.750750E+00,  0.000000E+00,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36157716749811E+03; Pars: -1.750750E+00,  0.000000E+00,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.36022949403826E+03; Pars: -1.750750E+00,  0.000000E+00,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.35950166990143E+03; Pars: -1.750750E+00,  0.000000E+00,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36161010638509E+03; Pars: -1.748501E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36201218966855E+03; Pars: -1.749250E+00,  1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35557050494123E+03; Pars: -1.749250E+00, -1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36150017678949E+03; Pars: -1.749250E+00,  0.000000E+00,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36164753766928E+03; Pars: -1.749250E+00,  0.000000E+00,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.36030048207458E+03; Pars: -1.749250E+00,  0.000000E+00,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.35957265793776E+03; Pars: -1.749250E+00,  0.000000E+00,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.36193970174800E+03; Pars: -1.750750E+00,  1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36201218966855E+03; Pars: -1.749250E+00,  1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35684200682966E+03; Pars: -1.750000E+00,  2.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36189932979369E+03; Pars: -1.750000E+00,  1.000000E-03,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36205089783638E+03; Pars: -1.750000E+00,  1.000000E-03,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.35743625887260E+03; Pars: -1.750000E+00,  1.000000E-03,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.36323754924191E+03; Pars: -1.750000E+00,  1.000000E-03,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.35550507574385E+03; Pars: -1.750750E+00, -1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35557050494123E+03; Pars: -1.749250E+00, -1.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.34399725886205E+03; Pars: -1.750000E+00, -2.000000E-03,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35547251906475E+03; Pars: -1.750000E+00, -1.000000E-03,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.35560138545469E+03; Pars: -1.750000E+00, -1.000000E-03,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.35752665521949E+03; Pars: -1.750000E+00, -1.000000E-03,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.35026971657653E+03; Pars: -1.750000E+00, -1.000000E-03,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.36142858460196E+03; Pars: -1.750750E+00,  0.000000E+00,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36150017678949E+03; Pars: -1.749250E+00,  0.000000E+00,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36189932979369E+03; Pars: -1.750000E+00,  1.000000E-03,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.35547251906475E+03; Pars: -1.750000E+00, -1.000000E-03,  2.330162E-02,  0.000000E+00"
[1] "Llh:  4.36138782124129E+03; Pars: -1.750000E+00,  0.000000E+00,  2.332493E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36019401707530E+03; Pars: -1.750000E+00,  0.000000E+00,  2.330162E-02,  1.000000E-03"
[1] "Llh:  4.35946764713207E+03; Pars: -1.750000E+00,  0.000000E+00,  2.330162E-02, -1.000000E-03"
[1] "Llh:  4.36157716749811E+03; Pars: -1.750750E+00,  0.000000E+00,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.36164753766928E+03; Pars: -1.749250E+00,  0.000000E+00,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.36205089783638E+03; Pars: -1.750000E+00,  1.000000E-03,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.35560138545469E+03; Pars: -1.750000E+00, -1.000000E-03,  2.325506E-02,  0.000000E+00"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.36168376348522E+03; Pars: -1.750000E+00,  0.000000E+00,  2.323182E-02,  0.000000E+00"
[1] "Llh:  4.36033427962420E+03; Pars: -1.750000E+00,  0.000000E+00,  2.325506E-02,  1.000000E-03"
[1] "Llh:  4.35960499838249E+03; Pars: -1.750000E+00,  0.000000E+00,  2.325506E-02, -1.000000E-03"
[1] "Llh:  4.36022949403826E+03; Pars: -1.750750E+00,  0.000000E+00,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.36030048207458E+03; Pars: -1.749250E+00,  0.000000E+00,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.35743625887260E+03; Pars: -1.750000E+00,  1.000000E-03,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.35752665521949E+03; Pars: -1.750000E+00, -1.000000E-03,  2.327833E-02,  1.000000E-03"
[1] "Llh:  4.36019401707530E+03; Pars: -1.750000E+00,  0.000000E+00,  2.330162E-02,  1.000000E-03"
[1] "Llh:  4.36033427962420E+03; Pars: -1.750000E+00,  0.000000E+00,  2.325506E-02,  1.000000E-03"
[1] "Llh:  4.35575761041746E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  2.000000E-03"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35950166990143E+03; Pars: -1.750750E+00,  0.000000E+00,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.35957265793776E+03; Pars: -1.749250E+00,  0.000000E+00,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.36323754924191E+03; Pars: -1.750000E+00,  1.000000E-03,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.35026971657653E+03; Pars: -1.750000E+00, -1.000000E-03,  2.327833E-02, -1.000000E-03"
[1] "Llh:  4.35946764713207E+03; Pars: -1.750000E+00,  0.000000E+00,  2.330162E-02, -1.000000E-03"
[1] "Llh:  4.35960499838249E+03; Pars: -1.750000E+00,  0.000000E+00,  2.325506E-02, -1.000000E-03"
[1] "Llh:  4.36153927439802E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02,  0.000000E+00"
[1] "Llh:  4.35430196214381E+03; Pars: -1.750000E+00,  0.000000E+00,  2.327833E-02, -2.000000E-03"
[1] -8715.079
[1] 4361.539
[1]  -8715.079 -67018.387
[1]  4361.539 33543.193

ghyp documentation built on May 2, 2019, 6:09 p.m.