Estimates the distributional parameters for a standardized generalized hyperbolic distribution.

## Usage

sghFit(x, zeta = 1, rho = 0, lambda = 1, include.lambda = TRUE,
scale = TRUE, doplot = TRUE, span = "auto", trace = TRUE,
title = NULL, description = NULL, ...)

## Arguments

x

a numeric vector.

zeta, rho, lambda

shape parameter zeta is positive, skewness parameter rho is in the range (-1, 1). and index parameter lambda, by default 1.

include.lambda

a logical flag, by default TRUE. Should the index parameter lambda included in the parameter estimate?

scale

a logical flag, by default TRUE. Should the time series be scaled by its standard deviation to achieve a more stable optimization?

doplot

a logical flag. Should a plot be displayed?

span

x-coordinates for the plot, by default 100 values automatically selected and ranging between the 0.001, and 0.999 quantiles. Alternatively, you can specify the range by an expression like span=seq(min, max, times = n), where, min and max are the left and right endpoints of the range, and n gives the number of the intermediate points.

trace

a logical flag. Should the parameter estimation process be traced?

title

a character string which allows for a project title.

description

a character string which allows for a brief description.

...

parameters to be parsed.

## Value

an object from class "fDISTFIT".

Slot fit is a list with the following components:

estimate

the point at which the maximum value of the log liklihood function is obtained.

minimum

the value of the estimated maximum, i.e. the value of the log likelihood function.

code

an integer indicating why the optimization process terminated.
1: relative gradient is close to zero, current iterate is probably solution;
2: successive iterates within tolerance, current iterate is probably solution;
3: last global step failed to locate a point lower than estimate. Either estimate is an approximate local minimum of the function or steptol is too small;
4: iteration limit exceeded;
5: maximum step size stepmax exceeded five consecutive times. Either the function is unbounded below, becomes asymptotic to a finite value from above in some direction or stepmax is too small.

the gradient at the estimated maximum.

steps

number of function calls.

## Examples

## sghFit -
# Simulate Random Variates:
set.seed(1953)
s = rsgh(n = 2000, zeta = 0.7, rho = 0.5, lambda = 0)

## sghFit -
# Fit Parameters:
sghFit(s, zeta = 1, rho = 0, lambda = 1, include.lambda = TRUE,
doplot = TRUE)
#>
#>  Objective Function Value:   -2647.471
#>  Parameter Estimates:        1 0 1
#>
#>  Objective Function Value:   -2647.471
#>  Parameter Estimates:        1 0 1
#>
#>  Objective Function Value:   -2647.471
#>  Parameter Estimates:        1 1.490116e-08 1
#>
#>  Objective Function Value:   -2647.471
#>  Parameter Estimates:        1 0 1
#>
#>  Objective Function Value:   -Inf
#>  Parameter Estimates:        0.96663 0.9989405 0.9683076
#>
#>  Objective Function Value:   -2594.623
#>  Parameter Estimates:        0.996663 0.09989405 0.9968308
#>
#>  Objective Function Value:   -2594.624
#>  Parameter Estimates:        0.996711 0.09989405 0.9968308
#>
#>  Objective Function Value:   -2594.645
#>  Parameter Estimates:        0.996663 0.09984604 0.9968308
#>
#>  Objective Function Value:   -2594.623
#>  Parameter Estimates:        0.996663 0.09989405 0.9968788
#>
#>  Objective Function Value:   -2524.793
#>  Parameter Estimates:        0.982503 0.2992784 0.9900936
#>
#>  Objective Function Value:   -2524.793
#>  Parameter Estimates:        0.9825144 0.2992784 0.9900936
#>
#>  Objective Function Value:   -2524.793
#>  Parameter Estimates:        0.982503 0.299277 0.9900936
#>
#>  Objective Function Value:   -2524.793
#>  Parameter Estimates:        0.982503 0.2992784 0.9901305
#>
#>  Objective Function Value:   -2505.046
#>  Parameter Estimates:        0.9247665 0.4890543 0.9645671
#>
#>  Objective Function Value:   -2505.046
#>  Parameter Estimates:        0.9247909 0.4890543 0.9645671
#>
#>  Objective Function Value:   -2505.046
#>  Parameter Estimates:        0.9247665 0.4890529 0.9645671
#>
#>  Objective Function Value:   -2505.047
#>  Parameter Estimates:        0.9247665 0.4890543 0.9646077
#>
#>  Objective Function Value:   -2495.774
#>  Parameter Estimates:        0.7983562 0.4267042 0.8226766
#>
#>  Objective Function Value:   -2482.511
#>  Parameter Estimates:        0.597971 0.4268163 0.6049115
#>
#>  Objective Function Value:   -15525.21
#>  Parameter Estimates:        1.490116e-08 0.3999997 -0.6322011
#>
#>  Objective Function Value:   -2482.512
#>  Parameter Estimates:        0.597989 0.4268163 0.6049115
#>
#>  Objective Function Value:   -2482.511
#>  Parameter Estimates:        0.597971 0.4268176 0.6049115
#>
#>  Objective Function Value:   -2482.512
#>  Parameter Estimates:        0.597971 0.4268163 0.6049334
#>
#>  Objective Function Value:   -9543.319
#>  Parameter Estimates:        1.490116e-08 0.6196524 -0.8337277
#>
#>  Objective Function Value:   -2484.203
#>  Parameter Estimates:        0.4815999 0.5095759 0.5396964
#>
#>  Objective Function Value:   -2481.034
#>  Parameter Estimates:        0.5545759 0.4654131 0.5768911
#>
#>  Objective Function Value:   -2481.035
#>  Parameter Estimates:        0.5545936 0.4654131 0.5768911
#>
#>  Objective Function Value:   -2481.034
#>  Parameter Estimates:        0.5545759 0.4654116 0.5768911
#>
#>  Objective Function Value:   -2481.035
#>  Parameter Estimates:        0.5545759 0.4654131 0.5769016
#>
#>  Objective Function Value:   -2479.327
#>  Parameter Estimates:        0.5153132 0.4196073 0.5541257
#>
#>  Objective Function Value:   -2479.327
#>  Parameter Estimates:        0.5153203 0.4196073 0.5541257
#>
#>  Objective Function Value:   -2479.327
#>  Parameter Estimates:        0.5153132 0.4196084 0.5541257
#>
#>  Objective Function Value:   -2479.327
#>  Parameter Estimates:        0.5153132 0.4196073 0.5541456
#>
#>  Objective Function Value:   -2478.091
#>  Parameter Estimates:        0.4611318 0.4505896 0.5379252
#>
#>  Objective Function Value:   -2478.091
#>  Parameter Estimates:        0.4611515 0.4505896 0.5379252
#>
#>  Objective Function Value:   -2478.091
#>  Parameter Estimates:        0.4611318 0.4505885 0.5379252
#>
#>  Objective Function Value:   -2478.091
#>  Parameter Estimates:        0.4611318 0.4505896 0.5379346
#>
#>  Objective Function Value:   -2477.59
#>  Parameter Estimates:        0.4127338 0.4131126 0.5176498
#>
#>  Objective Function Value:   -2477.59
#>  Parameter Estimates:        0.4127389 0.4131126 0.5176498
#>
#>  Objective Function Value:   -2477.59
#>  Parameter Estimates:        0.4127338 0.4131137 0.5176498
#>
#>  Objective Function Value:   -2477.59
#>  Parameter Estimates:        0.4127338 0.4131126 0.5176733
#>
#>  Objective Function Value:   -2477.025
#>  Parameter Estimates:        0.4277878 0.442396 0.4622076
#>
#>  Objective Function Value:   -2477.025
#>  Parameter Estimates:        0.4277998 0.442396 0.4622076
#>
#>  Objective Function Value:   -2477.025
#>  Parameter Estimates:        0.4277878 0.4423948 0.4622076
#>
#>  Objective Function Value:   -2477.025
#>  Parameter Estimates:        0.4277878 0.442396 0.4622141
#>
#>  Objective Function Value:   -2476.739
#>  Parameter Estimates:        0.4701276 0.4433887 0.4135831
#>
#>  Objective Function Value:   -2476.739
#>  Parameter Estimates:        0.4701216 0.4433887 0.4135831
#>
#>  Objective Function Value:   -2476.739
#>  Parameter Estimates:        0.4701276 0.4433897 0.4135831
#>
#>  Objective Function Value:   -2476.739
#>  Parameter Estimates:        0.4701276 0.4433887 0.4135965
#>
#>  Objective Function Value:   -2476.498
#>  Parameter Estimates:        0.4847757 0.4542832 0.3517387
#>
#>  Objective Function Value:   -2476.198
#>  Parameter Estimates:        0.525779 0.4629315 0.2724897
#>
#>  Objective Function Value:   -2475.785
#>  Parameter Estimates:        0.653231 0.4952472 0.002811424
#>
#>  Objective Function Value:   -2475.785
#>  Parameter Estimates:        0.6532343 0.4952472 0.002811424
#>
#>  Objective Function Value:   -2475.785
#>  Parameter Estimates:        0.653231 0.4952459 0.002811424
#>
#>  Objective Function Value:   -2475.785
#>  Parameter Estimates:        0.653231 0.4952472 0.002824826
#>
#>  Objective Function Value:   -2478.242
#>  Parameter Estimates:        0.5426647 0.4600108 -0.06066984
#>
#>  Objective Function Value:   -2475.663
#>  Parameter Estimates:        0.6431653 0.502983 -0.0009041901
#>
#>  Objective Function Value:   -2475.663
#>  Parameter Estimates:        0.6431685 0.502983 -0.0009041901
#>
#>  Objective Function Value:   -2475.663
#>  Parameter Estimates:        0.6431653 0.5029816 -0.0009041901
#>
#>  Objective Function Value:   -2475.663
#>  Parameter Estimates:        0.6431653 0.502983 -0.0008909593
#>
#>  Objective Function Value:   -2475.617
#>  Parameter Estimates:        0.6322473 0.4994268 -0.007470356
#>
#>  Objective Function Value:   -2475.617
#>  Parameter Estimates:        0.6322518 0.4994268 -0.007470356
#>
#>  Objective Function Value:   -2475.617
#>  Parameter Estimates:        0.6322473 0.499428 -0.007470356
#>
#>  Objective Function Value:   -2475.617
#>  Parameter Estimates:        0.6322473 0.4994268 -0.007458999
#>
#>  Objective Function Value:   -2475.595
#>  Parameter Estimates:        0.6330886 0.5041055 -0.01981401
#>
#>  Objective Function Value:   -2475.595
#>  Parameter Estimates:        0.633092 0.5041055 -0.01981401
#>
#>  Objective Function Value:   -2475.595
#>  Parameter Estimates:        0.6330886 0.5041043 -0.01981401
#>
#>  Objective Function Value:   -2475.595
#>  Parameter Estimates:        0.6330886 0.5041055 -0.01980751
#>
#>  Objective Function Value:   -2475.58
#>  Parameter Estimates:        0.6356588 0.5048162 -0.03276981
#>
#>  Objective Function Value:   -2475.55
#>  Parameter Estimates:        0.6464089 0.5111394 -0.07053396
#>
#>  Objective Function Value:   -2475.519
#>  Parameter Estimates:        0.6633998 0.5201116 -0.1352302
#>
#>  Objective Function Value:   -2475.519
#>  Parameter Estimates:        0.6634028 0.5201116 -0.1352302
#>
#>  Objective Function Value:   -2475.519
#>  Parameter Estimates:        0.6633998 0.5201127 -0.1352302
#>
#>  Objective Function Value:   -2475.519
#>  Parameter Estimates:        0.6633998 0.5201116 -0.1352239
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6689899 0.5250719 -0.1705175
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.668993 0.5250719 -0.1705175
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6689899 0.5250735 -0.1705175
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6689899 0.5250703 -0.1705175
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6689899 0.5250719 -0.1705108
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699212 0.526159 -0.1761966
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699245 0.526159 -0.1761966
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699178 0.526159 -0.1761966
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699212 0.52616 -0.1761966
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699212 0.5261579 -0.1761966
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699212 0.526159 -0.1760518
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699212 0.526159 -0.1763414
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700252 0.5262556 -0.1767013
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700657 0.5262556 -0.1767013
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6699847 0.5262556 -0.1767013
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700252 0.5262668 -0.1767013
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700252 0.5262443 -0.1767013
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700252 0.5262556 -0.1765645
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700252 0.5262556 -0.176838
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.526254 -0.1766919
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.670086 0.526254 -0.1766919
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.669949 0.526254 -0.1766919
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.5262782 -0.1766919
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.5262298 -0.1766919
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.526254 -0.1765471
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.526254 -0.1768368
#>
#>  Objective Function Value:   -2475.512
#>  Parameter Estimates:        0.6700175 0.526254 -0.1766919
#>
#>  Standardized Parameters:
#>        zeta        rho     lambda
#>  0.6700175  0.5262540 -0.1766919
#>
#>  1st Parameterization:
#>       alpha       beta      delta         mu
#>  1.3633157  0.7174504  0.5779677 -0.4887948

#>
#> Title:
#>  SGH Parameter Estimation
#>
#> Call:
#>  sghFit(x = s, zeta = 1, rho = 0, lambda = 1, include.lambda = TRUE,
#>     doplot = TRUE)
#>
#> Model:
#>  Standarized GH Distribution
#>
#> Estimated Parameter(s):
#>       zeta        rho     lambda
#>  0.6700175  0.5262540 -0.1766919
#>