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

fun.bimodal.init

Finds the initial values for optimisation in fitting the bimodal generalised lambda distribution.


Description

After classifying the data using fun.class.regime.bi, this function evaluates the temporary or initial solutions by estimating each part of the bimodal distribution using the maximum likelihood estimation and starship method. These initial solutions are then passed onto fun.bimodal.fit.ml or fun.bimodal.fit.pml to obtain the final fits.

Usage

fun.bimodal.init(data1, data2, rs.leap1, fmkl.leap1, rs.init1, fmkl.init1, 
rs.leap2, fmkl.leap2, rs.init2, fmkl.init2,fun1="runif.sobol",
fun2="runif.sobol",no=10000)

Arguments

data1

The first data obtained by the clustering algorithm.

data2

The second data obtained by the clustering algorithm.

rs.leap1

Scrambling (0,1,2,3) for the sobol sequence for the first RS distribution fit. See scrambling/leap argument for runif.sobol, runif.halton or QUnif.

fmkl.leap1

Scrambling (0,1,2,3) for the sobol sequence for the first FMKL distribution fit. See scrambling/leap argument for runif.sobol, runif.halton or QUnif.

rs.init1

Inititial values (lambda3 and lambda4) for the first RS generalised lambda distribution. c(-1.5,1.5) tends to work well.

fmkl.init1

Inititial values (lambda3 and lambda4) for the first FMKL generalised lambda distribution. c(-0.25,1.5) tends to work well

rs.leap2

Scrambling (0,1,2,3) for the sobol sequence for the second RS distribution fit. See scrambling/leap argument for runif.sobol, runif.halton or QUnif.

fmkl.leap2

Scrambling (0,1,2,3) for the sobol sequence for the second FMKL distribution fit. See scrambling/leap argument for runif.sobol, runif.halton or QUnif.

rs.init2

Inititial values (lambda3 and lambda4) for the second RS generalised lambda distribution. c(-1.5,1.5) tends to work well.

fmkl.init2

Inititial values (lambda3 and lambda4) for the second FMKL generalised lambda distribution. c(-0.25,1.5) tends to work well

fun1

A character string of either "runif.sobol" (default), "runif.halton" or "QUnif" for the first distribution fit.

fun2

A character string of either "runif.sobol" (default), "runif.halton" or "QUnif" for the second distribution fit.

no

Number of initial random values to find the best initial values for optimisation.

Details

All three methods of fitting (RPRS, RMFMKL and STAR) will be given for each part of the bimodal distribution.

Value

prop

Proportion of the number of observations in the first data in relation to the entire data.

first.fit

A matrix comprising the parameters of GLD obtained from RPRS, RMFMKL and STAR for the first dataset.

second.fit

A matrix comprising the parameters of GLD obtained from RPRS, RMFMKL and STAR for the second dataset.

Note

This is not designed to be called by the end user explicitly, the difficulties with RPRS parameterisation should be noted by the users.

Author(s)

Steve Su

References

Su (2007). Fitting Single and Mixture of Generalized Lambda Distributions to Data via Discretized and Maximum Likelihood Methods: GLDEX in R. Journal of Statistical Software: *21* 9.

See Also

Examples

## Split the first column of the faithful data into two using 
## fun.class.regime.bi
# faithful1.mod<-fun.class.regime.bi(faithful[,1], 0.1, clara)

## Save the datasets
# qqqq1.faithful1.cc1<-faithful1.mod$data.a
# qqqq2.faithful1.cc1<-faithful1.mod$data.b

## Find the initial values for secondary optimisation.
# result.faithful1.init1<-fun.bimodal.init(data1=qqqq1.faithful1.cc1,
# data2=qqqq2.faithful1.cc1, rs.leap1=3,fmkl.leap1=3,rs.init1 = c(-1.5, 1.5), 
# fmkl.init1 = c(-0.25, 1.5), rs.leap2=3,fmkl.leap2=3,rs.init2 = c(-1.5, 1.5), 
# fmkl.init2 = c(-0.25, 1.5))

## These initial values are then passed onto fun,bimodal.fit.ml to obtain the 
## final fits.

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.