fun.bimodal.fit.pml: Finds the final fits using partition maximum likelihood...

fun.bimodal.fit.pmlR Documentation

Finds the final fits using partition maximum likelihood estimation for the bimodal dataset.

Description

This is the secondary optimization procedure to evaluate the final bimodal distribution fits using the partition maximum likelihood. It usually relies on initial values found by fun.bimodal.init function.

Usage

fun.bimodal.fit.pml(data1, data2, first.fit, second.fit, prop, param1, param2, 
selc1, selc2)

Arguments

data1

First data set, usually obtained by fun.class.regime.bi.

data2

Second data set, usually obtained by fun.class.regime.bi.

first.fit

The distribution parameters or the initial values of the first distribution fit.

second.fit

The distribution parameters or the initial values of the second distribution fit.

prop

The proportion of the data set, usually obtained from fun.bimodal.init.

param1

Can be either rs or fmkl, depending on the type of first distribution used.

param2

Can be either rs or fmkl, depending on the type of second distribution used.

selc1

Selection of initial values for the first distribution, can be either "rs", "fmkl" or "star". Choose initial values from RPRS (ML), RMFMKL (ML) or STAR method.

selc2

Selection of initial values for the second distribution, can be either "rs", "fmkl" or "star". Choose initial values from RPRS (ML), RMFMKL (ML) or STAR method.

Details

This function should be used in tandem with fun.bimodal.init function.

Value

par

The first four numbers are the parameters of the first generalised lambda distribution, the second four numbers are the parameters of the second generalised lambda distribution and the last value is the proportion of the first generalised lambda distribution.

value

The objective value of negative likelihood obtained.

counts

A two-element integer vector giving the number of calls to functions. Gradient is not used in this case.

convergence

An integer code. 0 indicates successful convergence. Error codes are:

1 indicates that the iteration limit 'maxit' had been reached.

10 indicates degeneracy of the Nelder-Mead simplex.

message

A character string giving any additional information returned by the optimizer, or NULL.

Note

There is currently no guarantee of a global convergence.

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

fun.bimodal.fit.ml, fun.bimodal.init

Examples


 # Extract faithful[,2] into faithful2
 faithful2<-faithful[,2]

 # Uses clara clustering method
 clara.faithful2<-clara(faithful2,2)$clustering

 # Save into two different objects
 qqqq1.faithful2.cc<-faithful2[clara.faithful2==1]
 qqqq2.faithful2.cc<-faithful2[clara.faithful2==2]

 # Find the initial values
 result.faithful2.init<-fun.bimodal.init(data1=qqqq1.faithful2.cc,
 data2=qqqq2.faithful2.cc, 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))

 # Find the final fits
 result.faithful2.rsrs<-fun.bimodal.fit.pml(data1=qqqq1.faithful2.cc,
 data2=qqqq2.faithful2.cc, result.faithful2.init[[2]],
 result.faithful2.init[[3]], result.faithful2.init[[1]],param1="rs",
 param2="rs",selc1="rs",selc2="rs")

 # Output
 result.faithful2.rsrs

GLDEX documentation built on Aug. 21, 2023, 9:08 a.m.