Learn R Programming

param2moment (version 0.1.3)

moment2param: Moment to Parameters: A Batch Process

Description

Converts multiple sets of moments to multiple sets of distribution parameters.

Usage

moment2param(distname, FUN = paste0("moment2", distname), ...)

Value

Function moment2param() returns a list of numeric

vectors.

Arguments

distname

character scalar, distribution name. Currently supported are 'GH' for Tukey \(g\)-&-\(h\) distribution, 'sn' for skew-normal distribution and 'st' for skew-\(t\) distribution

FUN

name or character scalar, (name of) function used to solve the distribution parameters from moments. Default is paste0('moment2', distname), e.g., moment2GH will be used for distname = 'GH'. To use one of the educational functions, specify FUN = moment2GH_g_demo or FUN = 'moment2GH_g_demo'.

...

numeric scalars, some or all of mean, sd, skewness and kurtosis (length will be recycled).

Examples

Run this code
skw = c(.2, .5, .8)
krt = c(.5, 1, 1.5)
moment2param(distname = 'GH', skewness = skw, kurtosis = krt)
moment2param(distname = 'st', skewness = skw, kurtosis = krt)

Run the code above in your browser using DataLab