fun.simu.bimodal: Simulate a mixture of two generalised lambda distributions.

fun.simu.bimodalR Documentation

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

fun.theo.bi.mv.gld, fun.moments.bimodal, fun.rawmoments

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 documentation built on Aug. 21, 2023, 9:08 a.m.