Download Package `JohnsonDistribution`

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Central limit theorem wikipedia , lookup

Transcript
Package ‘JohnsonDistribution’
February 19, 2015
Version 0.24
Date 2012-04-16
Title Johnson Distribution
Author A.I. McLeod and Leanna King
Maintainer A.I. McLeod <[email protected]>
Depends R (>= 2.1.0)
Description Johnson curve distributions. Implementation of AS100 and
AS99.
LazyLoad yes
License GPL (>= 2)
URL http://www.stats.uwo.ca/faculty/aim
Repository CRAN
Date/Publication 2012-04-17 10:28:39
NeedsCompilation yes
R topics documented:
JohnsonDistribution-package
FitJohnsonDistribution . . .
yJohnsonDistribution . . . .
zJohnsonDistribution . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Index
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
4
6
8
1
2
JohnsonDistribution-package
JohnsonDistribution-package
Johnson Curve Distribution
Description
Fit and simulate from the family of Johnson Curve Distributions
Details
FitJohnsonDistribution
3
Package:
Type:
Version:
Date:
License:
LazyLoad:
JohnsonDistribution
Package
0.24
2012-04-16
GPL (>= 2)
yes
Author(s)
A. I. McLeod and Leanna King
Maintainer: [email protected]
References
D. Hill, R. Hill, and R. L. Holder, Algorithm AS 99. Fitting Johnson curves by moments, Appl.
Statist.,25, No. 2, 180-189 (1976).
I. D. Hill, Algorithm AS 100. Normal-Johnson and Johnson-normal transformations, Appl. Statist.,25,
No. 2, 190-192 (1976).
See Also
cor
Examples
FitJohnsonDistribution(1, 1, 2, -1)
FitJohnsonDistribution
Fit Johnson Curve by Moments
Description
This implements the Fortran algorithm AS 99 by Hill et al.
Usage
FitJohnsonDistribution(XBAR, SD, RB1, BB2)
Arguments
XBAR
SD
RB1
BB2
mean
standard deviation
coefficient of skewness
coefficient of kurtosis or a negative value to indicate the lognormal family
4
yJohnsonDistribution
Value
Vector of length 6 with named elements: "ITYPE", "GAMMA", "DELTA", "XLAM", "XI", "IFAULT".
ITYPE is 1, SL; 2 for SU, 3 for SB, 4 for Normal. GAMMA, DELTA, XLAM, XI are the parameters for the Johnson distribution, where for the SL family, XI=-1. IFAULT is an error indicator,
0 means no error, 1 if the input standard deviation is negative, 2 if the kurotis, BB2, is less than
skewness coefficient plus 1 and 3 if SB-fitting failed to converge and an SL or ST was fit instead.
Author(s)
A. I. McLeod
References
D. Hill, R. Hill, and R. L. Holder, Algorithm AS 99. Fitting Johnson curves by moments, Appl.
Statist.,25, No. 2, 180-189 (1976).
I. D. Hill, Algorithm AS 100. Normal-Johnson and Johnson-normal transformations, Appl. Statist.,25,
No. 2, 190-192 (1976).
See Also
yJohnsonDistribution, zJohnsonDistribution
Examples
#fit SL with mean 1, variance 1 and skewness 2.
FitJohnsonDistribution(1, 1, 2, -1)
yJohnsonDistribution
Standard normal (Z) to Johnson variable (Y) transformation
Description
A normal variable with mean zero and variance one is transformed to a Johnson distribution variate
specified by the Johnson distribution parameters. This is useful in simulating random variables from
a specified Johnson distribution and in computing the quantiles for a Johnson distribution.
Usage
yJohnsonDistribution(z, ITYPE, GAMMA, DELTA, XLAM, XI)
Arguments
z
ITYPE
GAMMA
DELTA
XLAM
XI
vector of standard normal variables
is 1, SL; 2 for SU, 3 for SB and 4 for Normal
parameter in Johnson distribution
parameter in Johnson distribution
parameter in Johnson distribution
parameter in Johnson distribution
yJohnsonDistribution
5
Details
Our function provides an interface to the Fortran algorithm AS 100 (Hill, 1976).
Value
Corresponding vector of Johnson distribution variables.
Note
The input parameters ITYPE, GAMMA, DELTA, XLAM, XI must all be scalars. An error is given
if they are not.
Author(s)
A. I. McLeod and Leanna King
References
I. D. Hill, Algorithm AS 100. Normal-Johnson and Johnson-normal transformations, Appl. Statist.,25,
No. 2, 190-192 (1976).
See Also
zJohnsonDistribution, FitJohnsonDistribution
Examples
#Example 1.
#fit SL with mean 1, variance 1, skewness 2 then find corresponding variate to Z=2
ans <- FitJohnsonDistribution(1, 1, 2, -1)
GAMMA <- ans["GAMMA"]
DELTA <- ans["DELTA"]
XLAM <- ans["XLAM"]
XI <- ans["XI"]
ITYPE <- 1
z <- 2
yJohnsonDistribution(z, ITYPE, GAMMA, DELTA, XLAM, XI)
#Example 2: find quantiles of SL distribution
#The 0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99
#quantiles for an SL distribution are found and a qq plot is produced.
#SL distribution parameters is determined
#
with mean 1, standard deviation 1, skewness 3
ans <- FitJohnsonDistribution(1, 1, 3, -1)
GAMMA <- ans["GAMMA"]
DELTA <- ans["DELTA"]
XLAM <- ans["XLAM"]
XI <- ans["XI"]
ITYPE <- 1
p<-c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99)
z <- qnorm(p)
y<-yJohnsonDistribution(z, ITYPE, GAMMA, DELTA, XLAM, XI)
6
zJohnsonDistribution
plot(z,y,xlab="normal quantiles", ylab="SL quantiles")
#
#Example 3: simulate SL distribution
#with mean 1, sd 1 and skewness 3
#plot estimated pdf
ans <- FitJohnsonDistribution(1, 1, 3, -1)
GAMMA <- ans["GAMMA"]
DELTA <- ans["DELTA"]
XLAM <- ans["XLAM"]
XI <- ans["XI"]
ITYPE <- 1
z <- rnorm(1000)
y <- yJohnsonDistribution(z, ITYPE, GAMMA, DELTA, XLAM, XI)
pdf <- density(y, bw = "sj")
plot(pdf, main="Estimated pdf of SL with mean 1, sd 1, g1 3", xlab="x", ylab="est.pdf(x)" )
zJohnsonDistribution
Johnson variable (Y) to standard normal (Z) transformation
Description
A Johnson distribution variable with specified parameters is transformed to a unit normal variable
and can be used to compute percentiles.
Usage
zJohnsonDistribution(s, ITYPE, GAMMA, DELTA, XLAM, XI)
Arguments
s
value of Johnson distribution variable. May be vector
ITYPE
is 1, SL; 2 for SU, 3 for SB and 4 for Normal
GAMMA
parameter in Johnson distribution
DELTA
parameter in Johnson distribution
XLAM
parameter in Johnson distribution
XI
parameter in Johnson distribution
Details
Our function provides an interface to the Fortran algorithm AS 100 (Hill, 1976).
Value
Corresponding vector of standard normal variables.
zJohnsonDistribution
7
Note
The input parameters ITYPE, GAMMA, DELTA, XLAM, XI must all be scalars. An error is given
if they are not.
Author(s)
A. I. McLeod and Leanna King
References
I. D. Hill, Algorithm AS 100. Normal-Johnson and Johnson-normal transformations, Appl. Statist.,25,
No. 2, 190-192 (1976).
See Also
yJohnsonDistribution, FitJohnsonDistribution
Examples
#
#Example: find the percentage points for an SL distribution
#
with mean 1, standard deviation 1, skewness 3
#
corresponding to observed values 1, 2, 3, 4, 5
ans <- FitJohnsonDistribution(1, 1, 3, -1)
GAMMA <- ans["GAMMA"]
DELTA <- ans["DELTA"]
XLAM <- ans["XLAM"]
XI <- ans["XI"]
ITYPE <- 1
y <- 1:5
Z <- zJohnsonDistribution(y, ITYPE, GAMMA, DELTA, XLAM, XI)
pnorm(Z)
Index
∗Topic distribution
FitJohnsonDistribution, 3
JohnsonDistribution-package, 2
yJohnsonDistribution, 4
zJohnsonDistribution, 6
∗Topic package
JohnsonDistribution-package, 2
cor, 3
FitJohnsonDistribution, 3, 5, 7
JohnsonDistribution-package, 2
yJohnsonDistribution, 4, 4, 7
zJohnsonDistribution, 4, 5, 6
8