kurtCompound: function kurtCompound

Description Usage Arguments Details Author(s) References Examples

View source: R/kurtCompound.R

Description

Function kurtCompound calculates kurtosis of the random variable X.

Usage

1
kurtCompound(parent,compound,compoundDist,params,...)

Arguments

parent

name of the parent distribution. It can be any continuous distribution supported by R.

compound

name of the compound distribution. It can be any discrete distribution supported by this package.

compoundDist

list of available compounding distributions

params

Parameter or list of parameters of compounding distribution.

...

Parameters of continuous distribution could be provided as additional parameters.

Details

Parameters of the parent distribution must be provided in the same way as it is in built in R functions. See http://127.0.0.1:23174/library/stats/html/Distributions.html

Author(s)

S. Nadarajah, B. V. Popovic, M. M. Ristic

References

S. Nadarajah, B.V. Popovic, M.M. Ristic (2012) Compounding: an R package for computing continuous distributions obtained by compounding a continuous and a discrete distribution, Computational Statistics, DOI 10.1007/s00180-012-0336-y, http://www.springerlink.com/content/6r464013w6mp3545/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
compoundDist <- c("geometric","poisson","negativebinomial","binomial",
"logarithmic","binomialbinomial","binomialpoisson",
"poissonbinomial","neymantypea","polyaaeppli",
"poissonpascal","pascalpoisson",
"logarithmicbinomial","logarithmicpoisson",
"poissonlindley",
"hyperpoisson","yule","waring","kattitypeh1",
"kattitypeh2","neymantypeb","neymantypec",
"hypergeometric","thomas")
parentD<-"beta"
compoundD<-"hypergeometric"
params<-c(3,2,0.5)
kurtCompound(parentD,compoundD,compoundDist,params,shape1=2,shape2=0.3)

## The function is currently defined as
kurtCompound <- function(parent,compound,compoundDist,params,...) {
    if (!exists(paste("p",parent,sep=""))) {
        return(paste("The parent distribution",parent,"doesn't exist"))
    }
    if (!is.element(compound,compoundDist)) {
        return(paste("The discrete distribution",compound,"doesn't exist"))
    }
   m1 <- meanCompound(parent,compound,compoundDist,params,...)
   m3 <- momentCompound(3,parent,compound,compoundDist,params,...)
   m4 <- momentCompound(4,parent,compound,compoundDist,params,...)
   sig2 <- varCompound(parent,compound,compoundDist,params,...)
   return((m4-4*m1*m3+6*m1^2*sig2+3*m1^4)/sig2^2)
}

Compounding documentation built on May 20, 2017, 1:49 a.m.

Search within the Compounding package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.