Package 'dhh'

Title: A Heavy-Headed Distribution
Description: The density, cumulative distribution, quantiles, and i.i.d random variables of a heavy-headed distribution. For more information, please see the vignette.
Authors: Runlong Tang [aut, cre]
Maintainer: Runlong Tang <[email protected]>
License: GPL (>= 2)
Version: 0.0.1
Built: 2024-12-01 08:48:00 UTC
Source: CRAN

Help Index


Density Function Of The Heavy-Headed Distribution

Description

This function gives the values of the density of the heavy-headed distribution.

Usage

dhh(x, a=0, b=1, alpha=0.1)

Arguments

x

x is a vector of real values, at which the values of the density will be calculated.

a, b

The interval (a,b) is the support of the distribution. The default values for a and b are 0 and 1, respectively.

alpha

It is a positive parameter of the distribution. Its default value is set to be 0.1. When alpha = 1, the distribution is uniform. When alpha > 1, the density at a is zero.

Details

See the references.

Value

It returns the values of the density at x.

Author(s)

Runlong Tang

References

Runlong Tang (2018) A Note On Finite Moments, Rediscovery Of The Pareto Distribution and Distributions With Heavy Tails and Heads (v1) https://sites.google.com/site/tangrunlong/notes-on-finance

See Also

phh qhh rhh

Examples

dhh(0.5)

dhh(0.5, 0, 1, 0.1)

dhh(c(0.5, 0.7))

curve(dhh, -1, 2)

curve(dhh(x, a=0, b=1, alpha=0.1), -1, 2)

curve(dhh(x, a=0, b=10, alpha=0.1), -1, 11)

Cumulative Distribution Function (CDF) Of The Heavy-Headed Distribution

Description

This function gives the values of the CDF of the heavy-headed distribution.

Usage

phh(x, a = 0, b = 1, alpha = 0.1)

Arguments

x

x is a vector of real values, at which the values of the CDF will be calculated.

a, b

The interval (a,b) is the support of the distribution. The default values for a and b are 0 and 1, respectively.

alpha

It is a positive parameter of the distribution. Its default value is set to be 0.1. When alpha = 1, the distribution is uniform. When alpha > 1, the density at a is zero.

Details

See the references.

Value

It returns the values of the CDF at x.

Author(s)

Runlong Tang

References

Runlong Tang (2018) A Note On Finite Moments, Rediscovery Of The Pareto Distribution and Distributions With Heavy Tails and Heads (v1) https://sites.google.com/site/tangrunlong/notes-on-finance

See Also

dhh qhh rhh

Examples

phh(0)

phh(1)

phh(0.5)

phh(0.5, 0, 1, 0.1)

phh(c(0.5, 0.7))

curve(phh, from = -1, to = 2)

curve(phh(x, a=0, b=1, alpha=0.1), -1, 2)

curve(phh(x, a=0, b=10, alpha=0.1), -1, 11)

curve(phh(x, a=0, b=100, alpha=0.1), -1, 11)

Quantiels of Of The Heavy-Headed Distribution

Description

This function gives the quantiles of the heavy-headed distribution.

Usage

qhh(p, a = 0, b = 1, alpha = 0.1)

Arguments

p

p is a vector of probabilities, at which the quantiles of the CDF will be calculated.

a, b

The interval (a,b) is the support of the distribution. The default values for a and b are 0 and 1, respectively.

alpha

It is a positive parameter of the distribution. Its default value is set to be 0.1. When alpha = 1, the distribution is uniform. When alpha > 1, the density at a is zero.

Details

See the references.

Value

It returns the quantiles of the CDF at p.

Author(s)

Runlong Tang

References

Runlong Tang (2018) A Note On Finite Moments, Rediscovery Of The Pareto Distribution and Distributions With Heavy Tails and Heads (v1) https://sites.google.com/site/tangrunlong/notes-on-finance

See Also

dhh phh rhh

Examples

qhh(0.9)

qhh(0.9, a=0, b=1, alpha=0.1)

qhh(0.9, a=0, b=10, alpha=0.1)

qhh((1:9)/10)

curve(qhh, from = 0.1, to = 0.9)

curve(qhh(x, 0, 1, 0.1), from = 0.1, to = 0.9)
curve(qhh(x, a=10, b=100, alpha = 0.1), from = 0.1, to = 0.9)

Random Variables of Of The Heavy-Headed Distribution

Description

This function generate i.i.d. random variables following the heavy-headed distribution.

Usage

rhh(n, a = 0, b = 1, alpha = 0.1)

Arguments

n

It is the number of the random variables.

a, b

The interval (a,b) is the support of the distribution. The default values for a and b are 0 and 1, respectively.

alpha

It is a positive parameter of the distribution. Its default value is set to be 0.1. When alpha = 1, the distribution is uniform. When alpha > 1, the density at a is zero.

Details

See the references.

Value

It returns a vector of n random varialbes following the heavy-headed distribution.

Author(s)

Runlong Tang

References

Runlong Tang (2018) A Note On Finite Moments, Rediscovery Of The Pareto Distribution and Distributions With Heavy Tails and Heads (v1) https://sites.google.com/site/tangrunlong/notes-on-finance

See Also

dhh phh qhh

Examples

rhh(1)

rhh(2)

hist(rhh(10000), freq=FALSE)

curve(dhh, add = TRUE, col = 2)

dhh(c(0.1, 0.01, 0.001, 0.0001, 0.00001))