Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fun.moments.bimodal

Finds the moments of fitted mixture of generalised lambda distribution by simulation.


Description

This functions compute the mean, variance, skewness and kurtosis of the fitted generalised lambda distribution mixtures using Monte Carlo simulation.

Usage

fun.moments.bimodal(result1, result2, prop1, prop2, len = 1000, 
no.test = 1000, param1, param2)

Arguments

result1

A vector comprising four values for the first generalised lambda distribution.

result2

A vector comprising four values for the second generalised lambda distribution.

prop1

Proportion of the first generalised lambda distribution

prop2

1-prop1, this can be left unspecified.

len

Length of object for each simulation run.

no.test

Number of simulation run.

param1

This can be "rs" or "fmkl", specifying the type of the first generalised lambda distribution.

param2

This can be "rs" or "fmkl", specifying the type of the second generalised lambda distribution.

Details

There is also a theoretical computation of the moments in fun.theo.bi.mv.gld, it should be noted that the theoretical moments may not exist. The length of object in len means how many observations should be generated in each simulation run, with the number of simulation runs governed by no.test.

Value

A matrix with four columns showing the mean, variance, skewness and kurtosis of the fitted generalised lambda distribution mixtures using Monte Carlo simulation. Each row represents a simulation run.

Author(s)

Steve Su

See Also

Examples

## Fitting the first column of the Old Faithful Geyser data
# fit1<-fun.auto.bimodal.ml(faithful[,1],init1.sel="rmfmkl",init2.sel="rmfmkl",
# init1=c(-0.25,1.5),init2=c(-0.25,1.5),leap1=3,leap2=3)

## After fitting compute the monte carlo moments using fun.moments.bimodal
# fun.moments.bimodal(fit1$par[1:4],fit1$par[5:8],prop1=fit1$par[9],
# param1="fmkl",param2="fmkl")

## It is also possible to compare this with the moments of the original dataset:
# fun.moments(faithful[,1])

GLDEX

Fitting Single and Mixture of Generalised Lambda Distributions (RS and FMKL) using Various Methods

v2.0.0.7
GPL (>= 3)
Authors
Steve Su, with contributions from: Diethelm Wuertz, Martin Maechler and Rmetrics core team members for low discrepancy algorithm, Juha Karvanen for L moments codes, Robert King for gld C codes and starship codes, Benjamin Dean for corrections and input in ks.gof code and R core team for histsu function.
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.