Package jline.lib.empht
Class EMpht
-
- All Implemented Interfaces:
public final class EMpht
Kotlin port of EMpht.c - EM algorithm for fitting Phase-type distributions Latest corrections made 9 March, 1998
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
EMpht.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static EMpht.Companion
Companion
-
Constructor Summary
Constructors Constructor Description EMpht()
-
Method Summary
Modifier and Type Method Description final static Triple<Matrix, Matrix, Matrix>
fitPhaseType(Matrix observations, Matrix weights, Matrix censored, Matrix censorWeights, Integer p, Integer structure, Integer maxIter)
Fit a phase-type distribution using EM algorithm final static Double
computeLogLikelihoodMatrix(Matrix observations, Matrix weights, Matrix pi, Matrix T, Matrix exitRates)
Compute the log-likelihood of observations given phase-type parameters final static Triple<Matrix, Matrix, Matrix>
emStepMatrix(Matrix pi, Matrix T, Matrix exitRates, Matrix observations, Matrix weights)
Run a single EM step with Matrix input/output final static Triple<Matrix, Matrix, Matrix>
generateRandomPhaseType(Integer p, Integer structure)
Generate a random phase-type distribution with Matrix output -
-
Method Detail
-
fitPhaseType
final static Triple<Matrix, Matrix, Matrix> fitPhaseType(Matrix observations, Matrix weights, Matrix censored, Matrix censorWeights, Integer p, Integer structure, Integer maxIter)
Fit a phase-type distribution using EM algorithm
- Parameters:
observations
- Matrix (n x 1) of observation timesweights
- Matrix (n x 1) of observation weightscensored
- Matrix (m x 1) of censored observation times (optional)censorWeights
- Matrix (m x 1) of censored observation weights (optional)p
- Number of phasesstructure
- Structure of the phase-type distribution (1-8)maxIter
- Maximum number of EM iterations- Returns:
Tuple of (pi, T, exitRates) as Matrix objects
-
computeLogLikelihoodMatrix
final static Double computeLogLikelihoodMatrix(Matrix observations, Matrix weights, Matrix pi, Matrix T, Matrix exitRates)
Compute the log-likelihood of observations given phase-type parameters
- Parameters:
observations
- Matrix (n x 1) of observation timesweights
- Matrix (n x 1) of observation weightspi
- Matrix (p x 1) of initial probabilitiesT
- Matrix (p x p) of transition ratesexitRates
- Matrix (p x 1) of exit rates- Returns:
Log-likelihood value
-
emStepMatrix
final static Triple<Matrix, Matrix, Matrix> emStepMatrix(Matrix pi, Matrix T, Matrix exitRates, Matrix observations, Matrix weights)
Run a single EM step with Matrix input/output
- Parameters:
pi
- Matrix (p x 1) of initial probabilitiesT
- Matrix (p x p) of transition ratesexitRates
- Matrix (p x 1) of exit ratesobservations
- Matrix (n x 1) of observation timesweights
- Matrix (n x 1) of observation weights- Returns:
Updated (pi, T, exitRates) as Matrix objects
-
generateRandomPhaseType
final static Triple<Matrix, Matrix, Matrix> generateRandomPhaseType(Integer p, Integer structure)
Generate a random phase-type distribution with Matrix output
- Parameters:
p
- Number of phasesstructure
- Structure type (1-5)- Returns:
Tuple of (pi, T, exitRates) as Matrix objects
-
-
-
-