Skip to content
Prev 157052 / 398506 Next

Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?

And here is one way of using JohnsonFit to display how a distribution changes with changes in the moments:

library(TeachingDemos)
library(SuppDists)

tmpfun <- function(m1=0,m2=1,m3=-0.2,m4=3.7, xmin=-3, xmax=3){
        parms <- JohnsonFit( c(m1,m2,m3,m4), 'use')
        plot(function(x) dJohnson(x,parms), xmin, xmax)
}

tmplst <- list( Parameters=list(
        m1=list('slider', init=0, from=-1, to=1, resolution=0.1),
        m2=list('slider', init=1, from=0 , to=3, resolution=0.1),
        m3=list('slider', init=-0.2, from=-1, to=1, resolution=0.1),
        m4=list('slider', init=3.7, from=0 , to=10, resolution=0.5)),
        xmin=list('numentry', init=-3, width=5),
        xmax=list('numentry', init=3 , width=5) )

tkexamp( tmpfun, tmplst, plotloc='left' )


of course assuming that you have SuppDists and TeachingDemos packages installed, play around with this (and possibly change parameters and/or limits in tmplst) before demoing it as there are many combinations of the parameters that cause errors.


--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111