Statistics & probability

Phase type lifetime model fitting calculator from uncensored observations

Fit two- or three-stage Coxian lifetime distributions and inspect rates, continuation probabilities and local-fit diagnostics.

Your numbers

Valid JSON. Positive uncensored lifetimes. Local fixed-topology Coxian likelihood; continuation boundaries allowed.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A Coxian phase-type lifetime begins in the first transient stage and either exits or advances after each stage. Its flexibility comes from combining exponential waiting times with stage-specific continuation probabilities.

THE FORMULABoundedCoxianPH:initialα=e1;T_ii=-λ_i,T_i,i+1=λ_i p_i,λ_i>0,0≤p_i≤1,lastp=0. Densityf(t)=αexp(Tt)(-T1). Fituncensoredt>0 maximizingΣlogf withtransformedrates/probabilities,multipledeclaredstarts,matrixexponentialstableatcoalescentrates. nphases1analyticλ=n/Σt;higherphasesneedslocaloptstatus,gradient/KKT,boundary andidentifiabilitywarnings. Momentsα(-T)^-11 andsecond2α(-T)^-21. Do notfitgeneralTunderCoxianlabel.

A worked example

With the prefilled inputs, rates = [0.8972590753353169,2.8658254766030464]. Positive uncensored lifetimes. Local fixed-topology Coxian likelihood; continuation boundaries allowed.

Good to know

Fixed sequential Coxian topology,initial phase0;absorption from each phase. Feasible-direction checked local candidate including continuation boundaries0/1;no censored observations or parameter-identifiability guarantee.

Model a lifetime as hidden stages

A Coxian phase-type lifetime begins in the first transient stage and either exits or advances after each stage. Its flexibility comes from combining exponential waiting times with stage-specific continuation probabilities.

The stages are a mathematical representation of the lifetime distribution. Fitting several phases does not establish that the real system contains that exact number of physical processes.

Exponential submodel maximum likelihoodOne-phase analytic lifetime reference123density f(t)=0.5 exp(−0.5t)n = 3; Σt = 6λ̂ = 3/6 = 0.5mean = 2log L = −3log2−3Analytic baseline; multi-phase fitting is a separate numerical task.
Scroll across to see the full diagram.
For completed lifetimes1,2,3, the one-phase rate estimate is0.5. The public Coxian engine may support only2/3phases, so this is an analytic baseline rather than a runnable fit example.

Compare with the Continuous time Markov chain calculator from a rate matrix. Estimate latent transient-state rates and initial mixture from observed absorption times; the existing CTMC evaluates a supplied generator but does not infer it from lifetimes.

Use uncensored positive lifetimes

Positive uncensored lifetimes. Local fixed-topology Coxian likelihood; continuation boundaries allowed.The supported input is a collection of completed lifetimes strictly greater than zero. Right-censored records contribute survival probabilities rather than densities and require a different likelihood mode.

All times must use the same unit. Changing from hours to minutes rescales fitted transition rates while preserving the implied lifetime probabilities at correspondingly rescaled times. The interface fits two or three transient stages to thirty to five hundred completed positive lifetimes. It begins in stage zero, and each nonfinal stage has a separate positive waiting-time rate and continuation probability. Setting continuation to zero can remove the practical influence of later phases; setting it to one forces progression after that stage. Such boundaries are part of the declared constrained search and may be weakly identified. The one-phase exponential calculation in the discussion is an analytic convention check, not a selectable one-phase mode in this interface.

Define the Coxian structure

Each stage has a positive exit rate and, except for the last, a continuation probability between zero and one. The transient generator has negative rates on its diagonal and forward transitions only to the next stage.

The absorption rate from a stage is the part of its exit rate not used for continuation. Keeping that distinction explicit prevents an entered rate from being counted twice in the fitted density.

Fit the observed density

For each lifetime, the density is obtained from the transient matrix exponential and the absorption-rate vector. The log likelihood adds those density logs over observations.

Several starts are needed for a numerical higher-phase fit because local optima and equivalent representations can occur. A reported likelihood and feasible-direction diagnostic are more informative than an unexplained set of phase rates.

An exponential special case

With one phase, the maximum-likelihood rate is the number of observations divided by their total time. For lifetimes one,two,three, this gives three divided by six, or one-half.

The fitted mean is two and the log likelihood is minus three times log two minus three. This exact case checks the rate convention and provides a baseline for a more flexible multi-phase fit.

Interpret nonunique stage parameters

Different phase parameters can produce identical or nearly identical lifetime distributions. A fitted curve can therefore be stable while the individual stage rates change substantially across numerical starts.

Compare likelihood, survival curves and lifetime moments, not just phase labels. Near-equal rates need stable matrix calculations because formulas that divide by rate differences can become numerically unreliable. The phase order is a representation convention and should not be mistaken for observed transition labels.

Assess complexity honestly

Adding phases can improve in-sample likelihood without improving useful prediction. Retain a simpler baseline and use suitable validation or model-selection reasoning for the intended application.

This bounded fitter reports the specified Coxian family and its numerical limitations. It should not claim a globally optimal general phase-type representation or extrapolate unsupported tail behavior as if it were directly observed. The density is evaluated using sequential phase probabilities and the absorption vector. Distinct-rate formulas provide an efficient calculation away from nearly equal rates; a generator matrix exponential handles the close-rate case. Several deterministic starts are compared, and feasible-direction checks reject a candidate that can still improve locally. These diagnostics do not certify a global maximum or identify a unique physical stage mechanism. The reported rates and continuation probabilities should be interpreted together with the fitted likelihood. A continuation-boundary candidate deserves explicit attention because apparently precise later-stage rates can have little influence on the observed lifetime distribution. Fixed sequential Coxian topology,initial phase0;absorption from each phase. Feasible-direction checked local candidate including continuation boundaries0/1;no censored observations or parameter-identifiability guarantee.

A few questions, answered

Are fitted phases necessarily real physical stages?

No. They can be a flexible mathematical representation with nonunique parameterizations.

Can I include censored times in the lifetime list?

Not as completed events; censored records need survival contributions in a separate supported likelihood.

Why run several optimization starts?

Multi-phase likelihoods can contain local optima and nearly equivalent parameter sets.

What happens if all rates are nearly equal?

A stable matrix-exponential evaluation should handle the limit; unstable formulas dividing by rate differences should be avoided.

Find your calculator

Start typing to explore the library.