Learn R Programming

GeneralizedHyperbolic (version 0.8-4)

ghypScale: Rescale a generalized hyperbolic distribution

Description

Given a specific mean and standard deviation will rescale any given generalized hyperbolic distribution to have the same shape but the specified mean and standard deviation. Can be used to standardize a generalized hyperbolic distribution to have mean zero and standard deviation one.

Usage

ghypScale(newMean, newSD,
          mu = 0, delta = 1, alpha = 1, beta = 0, lambda = 1,
          param = c(mu, delta, alpha, beta, lambda))

Arguments

newMean

Numeric. The required mean of the rescaled distribution.

newSD

Numeric. The required standard deviation of the rescaled distribution.

mu

Numeric. Location parameter \(\mu\) of the starting distribution, default is0.

delta

Numeric. Scale parameter \(\delta\) of the starting distribution, default is 1.

alpha

Numeric. Tail parameter \(\alpha\) of the starting distribution, default is 1.

beta

Numeric. Skewness parameter \(\beta\) of the starting distribution, default is 0.

lambda

Numeric. Shape parameter \(\lambda\) of the starting distribution, default is 1.

param

Numeric. Specifying the parameters of the starting distribution as a vector of the form c(mu,delta,alpha,beta,lambda).

Value

A numerical vector of length 5 giving the value of the parameters in the rescaled generalized hyperbolic distribution in the usual (\(\alpha, \beta\)) parameterization.

Examples

Run this code
# NOT RUN {
param <- c(2,10,0.1,0.07,-0.5) # a normal inverse Gaussian
ghypMean(param = param)
ghypVar(param = param)
## convert to standardized parameters
(newParam <- ghypScale(0, 1, param = param))
ghypMean(param = newParam)
ghypVar(param = newParam)

## try some other mean and sd
(newParam <- ghypScale(1, 1, param = param))
ghypMean(param = newParam)
sqrt(ghypVar(param = newParam))
(newParam <- ghypScale(10, 2, param = param))
ghypMean(param = newParam)
sqrt(ghypVar(param = newParam))
# }

Run the code above in your browser using DataLab