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

fun.simu.bimodal

Simulate a mixture of two generalised lambda distributions.


Description

This function allows the user to simulate observations from a mixture of two generalised lambda distributions. It can be very useful for sensitivity analysis.

Usage

fun.simu.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

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 list with length equal to the number of simulation runs. Each subset of the list has random observations equal to the the number specified in len.

Author(s)

Steve Su

See Also

Examples

# Generate random observations from FMKL generalised lambda distributions with 
# parameters (1,2,3,4) and (4,3,2,1) with 50% of data from each distribution.
junk<-fun.simu.bimodal(c(1,2,3,4),c(4,3,2,1),prop1=0.5,param1="fmkl",
param2="fmkl")

# Calculate the maximum number from each simulation run
sapply(junk,max)

# Calculate the median from each simulation run
sapply(junk,median)

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.