Description Usage Arguments Details Value Note Author(s) References See Also Examples
This function performs a maximum likelihood parameter estimation for univariate generalized hyperbolic distributions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | fit.ghypuv(data, lambda = 1, alpha.bar = 0.5, mu = median(data),
sigma = mad(data), gamma = 0,
opt.pars = c(lambda = T, alpha.bar = T, mu = T,
sigma = T, gamma = !symmetric),
symmetric = F, standardize = F, save.data = T,
na.rm = T, silent = FALSE, ...)
fit.hypuv(data,
opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.NIGuv(data,
opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.VGuv(data, lambda = 1,
opt.pars = c(lambda = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.tuv(data, nu = 3.5,
opt.pars = c(nu = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.gaussuv(data, na.rm = T, save.data = T)
|
data |
An object coercible to a |
lambda |
Starting value for the shape parameter |
alpha.bar |
Starting value for the shape parameter |
nu |
Starting value for the shape parameter |
mu |
Starting value for the location parameter |
sigma |
Starting value for the dispersion parameter |
gamma |
Starting value for the skewness parameter |
opt.pars |
A named logical |
symmetric |
If |
standardize |
If |
save.data |
If |
na.rm |
If |
silent |
If |
... |
Arguments passed to |
The general-purpose optimization routine optim
is used to
maximize the loglikelihood function. The default method is that of
Nelder and Mead which uses only function values. Parameters of
optim
can be passed via the ... argument of the fitting
routines.
An object of class mle.ghyp
.
The variance gamma distribution becomes singular when x - mu = 0. This singularity is catched and the reduced density function is computed. Because the transition is not smooth in the numerical implementation this can rarely result in nonsensical fits.
Providing both arguments, opt.pars
and symmetric
respectively, can result in a conflict when opt.pars['gamma']
and symmetric
are TRUE
. In this case symmetric
will dominate and opt.pars['gamma']
is set to FALSE
.
Wolfgang Breymann, David Luethi
ghyp
-package vignette in the doc
folder or on http://cran.r-project.org/web/packages/ghyp/.
fit.ghypmv
, fit.hypmv
, fit.NIGmv
,
fit.VGmv
, fit.tmv
for multivariate fitting routines.
ghyp.fit.info
for information regarding the fitting procedure.
1 2 3 4 5 6 7 8 9 | data(smi.stocks)
nig.fit <- fit.NIGuv(smi.stocks[,"SMI"], opt.pars = c(alpha.bar = FALSE),
alpha.bar = 1, control = list(abstol = 1e-8))
nig.fit
summary(nig.fit)
hist(nig.fit)
|
Loading required package: numDeriv
Loading required package: gplots
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
[1] "Llh: 5.43442381858987E+03; Pars: 5.626297E-04, 8.875123E-03, 0.000000E+00"
[1] "Llh: -9.63118912675987E+04; Pars: 4.730129E-01, 8.875123E-03, 0.000000E+00"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: -1.33159421324728E+05; Pars: 5.626297E-04, 8.875123E-03, 4.724503E-01"
[1] "Llh: 5.40585124384195E+03; Pars: 2.562630E-03, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.42996237953101E+03; Pars: 1.562630E-03, 1.424923E-02, 0.000000E+00"
[1] "Llh: 5.43079814576067E+03; Pars: 1.562630E-03, 1.422076E-02, 0.000000E+00"
[1] "Llh: 5.41369364563650E+03; Pars: 1.562630E-03, 1.423498E-02, 1.000000E-03"
[1] "Llh: 5.43906676328363E+03; Pars: 1.562630E-03, 1.423498E-02, -1.000000E-03"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.42137059007665E+03; Pars: -1.437370E-03, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.43772029929769E+03; Pars: -4.373703E-04, 1.424923E-02, 0.000000E+00"
[1] "Llh: 5.43857178038201E+03; Pars: -4.373703E-04, 1.422076E-02, 0.000000E+00"
[1] "Llh: 5.43892892734741E+03; Pars: -4.373703E-04, 1.423498E-02, 1.000000E-03"
[1] "Llh: 5.42938207221730E+03; Pars: -4.373703E-04, 1.423498E-02, -1.000000E-03"
[1] "Llh: 5.42996237953101E+03; Pars: 1.562630E-03, 1.424923E-02, 0.000000E+00"
[1] "Llh: 5.43772029929769E+03; Pars: -4.373703E-04, 1.424923E-02, 0.000000E+00"
[1] "Llh: 5.44030385848315E+03; Pars: 5.626297E-04, 1.426348E-02, 0.000000E+00"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.43280955921200E+03; Pars: 5.626297E-04, 1.424923E-02, 1.000000E-03"
[1] "Llh: 5.44070688002371E+03; Pars: 5.626297E-04, 1.424923E-02, -1.000000E-03"
[1] "Llh: 5.43079814576067E+03; Pars: 1.562630E-03, 1.422076E-02, 0.000000E+00"
[1] "Llh: 5.43857178038201E+03; Pars: -4.373703E-04, 1.422076E-02, 0.000000E+00"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.44203031551468E+03; Pars: 5.626297E-04, 1.420654E-02, 0.000000E+00"
[1] "Llh: 5.43363797827799E+03; Pars: 5.626297E-04, 1.422076E-02, 1.000000E-03"
[1] "Llh: 5.44156695163584E+03; Pars: 5.626297E-04, 1.422076E-02, -1.000000E-03"
[1] "Llh: 5.41369364563650E+03; Pars: 1.562630E-03, 1.423498E-02, 1.000000E-03"
[1] "Llh: 5.43892892734741E+03; Pars: -4.373703E-04, 1.423498E-02, 1.000000E-03"
[1] "Llh: 5.43280955921200E+03; Pars: 5.626297E-04, 1.424923E-02, 1.000000E-03"
[1] "Llh: 5.43363797827799E+03; Pars: 5.626297E-04, 1.422076E-02, 1.000000E-03"
[1] "Llh: 5.41734544414001E+03; Pars: 5.626297E-04, 1.423498E-02, 2.000000E-03"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.43906676328363E+03; Pars: 1.562630E-03, 1.423498E-02, -1.000000E-03"
[1] "Llh: 5.42938207221730E+03; Pars: -4.373703E-04, 1.423498E-02, -1.000000E-03"
[1] "Llh: 5.44070688002371E+03; Pars: 5.626297E-04, 1.424923E-02, -1.000000E-03"
[1] "Llh: 5.44156695163584E+03; Pars: 5.626297E-04, 1.422076E-02, -1.000000E-03"
[1] "Llh: 5.44117035692981E+03; Pars: 5.626297E-04, 1.423498E-02, 0.000000E+00"
[1] "Llh: 5.43317170665703E+03; Pars: 5.626297E-04, 1.423498E-02, -2.000000E-03"
Symmetric Normal Inverse Gaussian Distribution:
Parameters:
alpha.bar mu sigma gamma
1.0000000000 0.0005626297 0.0142349834 0.0000000000
log-likelihood:
5441.17
Call:
fit.NIGuv(data = smi.stocks[, "SMI"], opt.pars = c(alpha.bar = FALSE), alpha.bar = 1, control = list(abstol = 1e-08))
Symmetric Normal Inverse Gaussian Distribution:
Parameters:
alpha.bar mu sigma gamma
1.0000000000 0.0005626297 0.0142349834 0.0000000000
Call:
fit.NIGuv(data = smi.stocks[, "SMI"], opt.pars = c(alpha.bar = FALSE), alpha.bar = 1, control = list(abstol = 1e-08))
Optimization information:
log-Likelihood: 5441.17
AIC: -10876.34
Fitted parameters: mu, sigma, gamma; (Number: 3)
Number of iterations: 4
Converged: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.