CornishFisher: Functions for Cornish-Fisher density, CDF, random number...

Description Usage Arguments Details Value Author(s) References Examples

Description

Usage

1
2
3
4
5
6
7
  dCornishFisher(x, n, skew, ekurt)

  pCornishFisher(q, n, skew, ekurt)

  qCornishFisher(p, n, skew, ekurt)

  rCornishFisher(n, sigma, skew, ekurt, seed = NULL)

Arguments

n

Scalar, number of simulated values in rCornishFisher. Sample length in density,distribution,quantile function.

sigma

Scalar, standard deviation.

skew

Scalar, skewness.

ekurt

Scalar, excess kurtosis.

seed

Set seed here. Default is NULL.

x,q

Vector of standardized quantiles. See detail.

p

Vector of probabilities.

Details

CDF(q) = Pr(sqrt(n)*(x_bar-mu)/sigma < q)

Value

n Simulated values from Cornish-Fisher distribution.

Author(s)

Eric Zivot and Yi-An Chen.

References

  1. A.DasGupta, "Asymptotic Theory of Statistics and Probability", Springer Science+Business Media,LLC 2008

  2. Thomas A.Severini, "Likelihood Methods in Statistics", Oxford University Press, 2000

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
 # generate 1000 observation from Cornish-Fisher distribution
rc <- rCornishFisher(1000,1,0,5)
hist(rc,breaks=100,freq=FALSE,main="simulation of Cornish Fisher Distribution",
    xlim=c(-10,10))
lines(seq(-10,10,0.1),dnorm(seq(-10,10,0.1),mean=0,sd=1),col=2)
# compare with standard normal curve

# example from A.dasGupta p.188 exponential example
# x is iid exp(1) distribution, sample size = 5
# then x_bar is Gamma(shape=5,scale=1/5) distribution
q <- c(0,0.4,1,2)
# exact cdf
pgamma(q/sqrt(5)+1,shape=5,scale=1/5)
# use CLT
pnorm(q)
# use edgeworth expansion
pCornishFisher(q,n=5,skew=2,ekurt=6)

## End(Not run)

R-Finance/FactorAnalytics documentation built on May 8, 2019, 3:51 a.m.