Learn R Programming

matrixdist

Statistics for Matrix Distributions

This package implements tools which are useful for the statistical analysis of discrete, continuous, multivariate, right-censored or regression variants of phase-type distributions. These distributions are absorption times of Markov jump processes, and thus the maximization of their likelihood for statistical estimation is best dealt with using the EM algorithm.

Copy Link

Version

Install

install.packages('matrixdist')

Monthly Downloads

241

Version

1.1.9

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Martin Bladt

Last Published

August 8th, 2023

Functions in matrixdist (1.1.9)

EM_step_mPH_rc

EM step for the mPH class with right-censoring, for different marginal sub-intensity matrices
LRT,ph,ph-method

LRT method for ph class
Fisher,sph-method

Fisher information method for sph class
EMstep_dph

EM for discrete phase-type
Fisher

New generic for obtaining the Fisher information of survival matrix distributions
TVR,dph-method

TVR Method for dph Class
LRT

New generic for likelihood ratio test between two matrix distribution models
EMstep_dph_MoE

EM for discrete phase-type MoE
Nfold,dph-method

Nfold method for phase-type distributions
TVR,ph-method

TVR method for ph class
MoE,ph-method

MoE method for ph Class
EMstep_PADE

EM for phase-type distributions using Pade approximation for matrix exponential
bivdph-class

Bivariate discrete phase-type distributions
EMstep_RK

EM step for phase-type using Runge-Kutta
MoE

New generic for mixture-of-experts regression with matrix distributions
bivdph

Constructor function for bivariate discrete phase-type distributions
TVR

New generic for transformation via rewards of a matrix distribution
Nfold

New generic for N-fold convolution of two matrix distributions
cdf

New generic for the distribution of matrix distributions
MPHstar_EMstep_UNI

EM step using Uniformization for MPHstar class
EMstep_UNI

EM for phase-type using uniformization for matrix exponential
bivdph_density

Bivariate discrete phase-type joint density of the feed forward type
a_rungekutta

Runge-Kutta for the calculation of the a vector in a EM step
bivdph_tail

Bivariate discrete phase-type joint tail of the feed forward type
cdf,iph-method

Distribution method for inhomogeneous phase-type distributions
EMstep_bivdph

EM for discrete bivariate phase-type
MPHstar_data_aggregation

Prepare data for the MPHstar_EMstep_UNI
clone_matrix

Clone a matrix
bivph_tail

Bivariate phase-type joint tail of the feed forward type
MPHstar-class

Multivariate phase-type distributions obtained by transformation via rewards
cdf,miph-method

Distribution method for multivariate inhomogeneous phase-type distributions
default_step_length

Default size of the steps in the RK
MoE,bivdph-method

MoE method for bivdph Class
MoE,dph-method

MoE method for dph Class
biviph-class

Bivariate inhomogeneous phase-type distributions
EMstep_bivdph_MoE

EM for discrete bivariate phase-type MoE
biviph

Constructor function for bivariate inhomogeneous phase-type distributions
dens,bivdph-method

Density method for bivariate discrete phase-type distributions
EMstep_bivph

EM for bivariate phase-type distributions using Pade for matrix exponential
cdf,mph-method

Distribution method for multivariate phase-type distributions
dens,mdph-method

Density method for multivariate discrete phase-type distributions
dens,miph-method

Density method for multivariate inhomogeneous phase-type distributions
coef,mdph-method

Coef method for mdph class
cdf,ph-method

Distribution method for phase-type distributions
EMstep_mdph

EM for multivariate discrete phase-type
MPHstar

Constructor function for multivariate phase-type distributions (MPH* class)
EMstep_mdph_MoE

EM for multivariate discrete phase-type MoE
coef,dph-method

Coef method for dph Class
MoE,mdph-method

MoE method for mdph Class
fit,bivdph-method

Fit method for bivdph Class
coef,ph-method

Coef method for ph class
coef,iph-method

Coef method for iph class
cor,bivdph-method

Cor method for bivdph class
clone_vector

Clone a vector
coef,bivdph-method

Coef method for bivdph class
dens,biviph-method

Density method for bivariate inhomogeneous phase-type distributions
fit,bivph-method

Fit method for bivph Class
cor,mdph-method

Cor method for multivariate discrete phase-type distributions
cdf,dph-method

Distribution method for discrete phase-type distributions
cor,bivph-method

Cor method for bivph class
MoE,mph-method

Fit method for mph/miph class, using mixture-of-experts regression
linCom,bivph-method

Linear combination method for bivariate phase-type distributions
cor,mph-method

Cor method for multivariate phase-type distributions
dphcdf

Discrete phase-type cdf
linCom

New generic for linear combinations of multivariate matrix distributions
logLikelihoodMgompertz_RK

Loglikelihood of matrix-Gompertz using Runge-Kutta
logLikelihoodMloglogistic_RK

Loglikelihood of matrix-loglogistic using Runge-Kutta
coef,biviph-method

Coef method for biviph class
dens

New generic for the density of matrix distributions
dens,bivph-method

Density method for bivariate phase-type distributions
dph-class

Discrete phase-type distributions
coef,bivph-method

Coef method for bivph class
logLikelihoodMgompertz_UNIs

Loglikelihood of PI with matrix-Gompertz using Uniformization
dph

Constructor function for discrete phase-type distributions
dphdensity

Discrete phase-type density
bivph-class

Bivariate phase-type distributions
dens,dph-method

Density method for discrete phase-type distributions
dens,iph-method

Density method for inhomogeneous phase-type distributions
evaluate

New generic for evaluating survival matrix distributions
expm_terms

expm terms of phase-type likelihood using uniformization
logLikelihoodMloglogistic_PADE

Loglikelihood of matrix-loglogistic using Pade
bivph

Constructor function for bivariate phase-type distributions
logLikelihoodMlognormal_PADE

Loglikelihood of matrix-lognormal using Pade
bivph_density

Bivariate phase-type joint density of the feed forward type
dph_pgf

Pgf of a discrete phase-type distribution
bivph_laplace

Bivariate phase-type joint Laplace
logLikelihoodMlognormal_PADEs

Loglikelihood of PI with matrix-lognormal using Pade
logLikelihoodMpareto_UNI

Loglikelihood of matrix-Pareto using uniformization
expmat

Matrix exponential
find_weight

Find weight of observations
fit,MPHstar-method

Fit method for mph class
find_n

Find n such that P(N > n) = h with N Poisson distributed
coef,sph-method

Coef method for sph Class
logLikelihoodMpareto_UNIs

Loglikelihood of PI with matrix-Pareto using uniformization
fit,dph-method

Fit method for dph class
cor,MPHstar-method

Cor method for MPHstar class
fit,mph-method

Fit method for mph Class
fit,mdph-method

Fit method for mdph Class
fit,ph-method

Fit method for ph class
logLikelihoodMlognormal_RK

Loglikelihood of matrix-lognormal using Runge-Kutta
fit

New generic for estimating matrix distributions
logLikelihoodMpareto_RK

Loglikelihood of matrix-Pareto using Runge-Kutta
haz

New generic for the hazard rate of matrix distributions
logLikelihoodPH_RK

Loglikelihood of phase-type using Runge-Kutta
laplace,mph-method

Laplace method for multivariate phase-type distributions
laplace,ph-method

Laplace method for phase-type distributions
haz,ph-method

Hazard rate method for phase-type distributions
logLikelihoodPH_RKs

Loglikelihood of PI with phase-type using Runge-Kutta
cumulate_matrix

Cumulate matrix
mloglogisticcdf

Matrix-loglogistic cdf
mgompertzden

Matrix-Gompertz density
logLikelihoodMweibull_RK

Loglikelihood of matrix-Weibull using Runge-Kutta
matrix_exponential

Matrix exponential
logLikelihoodMgev_PADE

Loglikelihood of matrix-GEV using Pade
matrix_inverse

Inverse of a matrix
logLikelihoodMloglogistic_PADEs

Loglikelihood of PI with matrix-loglogistic using Pade
logLikelihoodMgompertz_PADE

Loglikelihood of matrix-Gompertz using Pade
mean,dph-method

Mean method for discrete phase-type distributions
mean,mdph-method

Mean method for multivariate discrete phase-type distributions
logLikelihoodMgompertz_PADEs

Loglikelihood of PI with matrix-Gompertz using Pade
ph

Constructor function for phase-type distributions
cumulate_vector

Cumulate vector
dens,mph-method

Density method for multivariate phase-type distributions
logLikelihoodMloglogistic_UNI

Loglikelihood of matrix-loglogistic using uniformization
dens,ph-method

Density method for phase-type distributions
laplace

New generic for Laplace transform of matrix distributions
inf_norm

L inf norm of a matrix
mgf

New generic for mgf of matrix distributions
logLikelihoodMloglogistic_UNIs

Loglikelihood of PI with matrix-loglogistic using uniformization
iph

Constructor function for inhomogeneous phase-type distributions
linCom,MPHstar-method

Linear combination method for MPHstar class
embedded_mc

Embedded Markov chain of a sub-intensity matrix
logLikelihoodMloglogistic_RKs

Loglikelihood of PI with matrix-loglogistic using Runge-Kutta
linear_combination

Computes PH parameters of a linear combination of vector from MPHstar
evaluate,sph-method

Evaluation method for sph Class
initial_state

Initial state of Markov jump process
logLikelihoodMpareto_PADEs

Loglikelihood of PI with matrix-Pareto using Pade
logLikelihoodMpareto_RKs

Loglikelihood of PI with matrix-Pareto using Runge-Kutta
logLik,ph-method

Loglikelihood method for ph class
minimum,dph,dph-method

Minimum method for discrete phase-type distributions
laplace,bivph-method

Laplace method for bivph class
logLikelihoodMgev_RK

Loglikelihood of matrix-GEV using Runge-Kutta
logLikelihoodMweibull_PADE

Loglikelihood of matrix-Weibull using Pade
logLikelihoodMgompertz_RKs

Loglikelihood of PI with matrix-Gompertz using Runge-Kutta
logLikelihoodMweibull_PADEs

Loglikelihood of PI with matrix-Weibull using Pade
logLikelihoodbivPH

Loglikelihood for Bivariate PH
logLikelihoodMgompertz_UNI

Loglikelihood of matrix-Gompertz using uniformization
new_state

New state in a Markov jump process
logLikelihoodMgev_UNI

Loglikelihood of matrix-GEV using uniformization
logLikelihoodMweibull_RKs

Loglikelihood of PI with matrix-Weibull using Runge-Kutta
logLikelihoodMweibull_UNI

Loglikelihood of matrix-Weibull using uniformization
logLikelihoodmDPH

Loglikelihood for multivariate discrete phase-type
logLikelihoodPH_UNI

Loglikelihood of phase-type using uniformization
logLikelihoodPH_UNIs

Loglikelihood of PI with phase-type using uniformization
logLikelihoodbivDPH_MoE

Loglikelihood for bivariate discrete phase-type MoE
mixture,ph,ph-method

Mixture method for phase-type distributions
logLikelihoodMlognormal_RKs

Loglikelihood of PI matrix-lognormal using Runge-Kutta
mixture

New generic for mixture of two matrix distributions
logLikelihoodbivDPH

Loglikelihood for bivariate discrete phase-type
mlognormalden

Matrix-lognormal density
mparetoden

Matrix-Pareto density
iph-class

Inhomogeneous phase-type distributions
mparetocdf

Matrix-Pareto cdf
rew_sanity_check

Transform a reward matrix with very small rewards to avoid numerical problems
logLikelihoodDPH

Loglikelihood for discrete phase-type
logLikelihoodMlognormal_UNI

Loglikelihood of matrix-lognormal using uniformization
pgf,bivdph-method

Pgf method for bivariate discrete phase-type distributions
mloglogisticden

Matrix-loglogistic density
mlognormalcdf

Matrix-lognormal cdf
logLikelihoodPH_PADE

Loglikelihood of phase-type using Pade approximation
sim,biviph-method

Simulation method for bivariate inhomogeneous phase-type distributions
logLikelihoodPH_PADEs

Loglikelihood of PI with phase-type using Pade
logLikelihoodDPH_MoE

Loglikelihood for discrete phase-type MoE
marginal,MPHstar-method

Marginal method for MPHstar class
marginal,bivdph-method

Marginal method for bivdph class
marginal,mph-method

Marginal method for multivariate phase-type distributions
logLikelihoodMlognormal_UNIs

Loglikelihood of PI with matrix-lognormal using uniformization
show,miph-method

Show method for multivariate inhomogeneous phase-type distributions
marginal

New generic for the marginals of multivariate matrix distributions
logLikelihoodMpareto_PADE

Loglikelihood of matrix-Pareto using Pade
matrix_power

Computes A^n
minimum,iph,iph-method

Minimum method for inhomogeneous phase-type distributions
m_exp_sum

Computes exp(Sx) via series representation
matrix_product

Product of two matrices
minimum,ph,ph-method

Minimum method for phase-type distributions
mean,bivdph-method

Mean method for bivdph class
logLikelihoodMweibull_UNIs

Loglikelihood of PI with matrix-Weibull using uniformization
mweibullcdf

Matrix-Weibull cdf
marginal_expectation

Marginal conditional expectations
maximum,iph,iph-method

Maximum method for inhomogeneous phase-type distributions
mean,bivph-method

Mean Method for bivph class
marginal,mdph-method

Marginal method for mdph class
logLikelihoodPH_MoE

Loglikelihood for PH-MoE
matrix_vanloan

Creates the matrix (A1, B1 ; 0, A2)
logLikelihoodmDPH_MoE

Loglikelihood for multivariate discrete phase-type MoE
mph

Constructor function for multivariate phase-type distributions
marginal,miph-method

Marginal method for multivariate inhomogeneous phase-type distributions
ph_laplace

Laplace transform of a phase-type distribution
mgevden

Matrix-GEV density
tvr_ph

Performs TVR for phase-type distributions
matrixdist-package

Statistics for Matrix Distributions
n_pos

Find how many states have positive reward
+,dph,dph-method

Sum method for discrete phase-type distributions
+,ph,ph-method

Sum method for phase-type distributions
mgf,bivph-method

Mgf method for bivph class
reg,ph-method

Regression method for ph Class
rdphasetype

Simulate discrete phase-type
mean,MPHstar-method

Mean method for MPHstar class
maximum,dph,dph-method

Maximum method for discrete phase-type distributions
riph

Random inhomogeneous phase-type
revers_data_trans

Applies the inverse of the GEV transformation but giving back the resulting vector in reverse order
reg

New generic for regression with matrix distributions
mdph

Constructor function for multivariate discrete phase-type distributions
show,mph-method

Show method for multivariate phase-type distributions
sim,MPHstar-method

Simulation method for multivariate phase-type distributions
mean,ph-method

Mean method for phase-type distributions
sph-class

Survival analysis for phase-type distributions
sim

New generic for simulating matrix distributions
mgf,ph-method

Mgf method for phase-type distributions
sim,bivdph-method

Simulation method for bivariate discrete phase-type distributions
mgompertzcdf

Matrix-Gompertz cdf
sim,mdph-method

Simulation method for multivariate discrete phase-type distributions
max_diagonal

Maximum diagonal element of a matrix
show,biviph-method

Show method for bivariate inhomogeneous phase-type distributions
miph

Constructor function for multivariate inhomogeneous phase-type distributions
rMDPHstar

Simulate MDPH*
mweibullden

Matrix-Weibull density
mph-class

Multivariate phase-type distributions
show,iph-method

Show method for inhomogeneous phase-type distributions
sim,miph-method

Simulation method for inhomogeneous multivariate phase-type distributions
var,bivdph-method

Var method for bivdph class
mean,mph-method

Mean method for multivariate phase-type distributions
var,MPHstar-method

Var method for MPHstar class
mdph-class

Multivariate discrete phase-type distributions
mdphdensity

Multivariate discrete phase-type density
var,bivph-method

Var method for bivph class
mixture,dph,dph-method

Mixture method for phase-type distributions
marginal,biviph-method

Marginal method for biviph class
pgf

New generic for pgf of matrix distributions
vector_of_powers

Computes elements A^n until the given size
mgf,mph-method

Mgf method for multivariate phase-type distributions
moment,mph-method

Moment method for multivariate phase-type distributions
pgf,dph-method

Pgf Method for discrete phase-type distributions
moment,mdph-method

Moment method for multivariate discrete phase-type distributions
moment,ph-method

Moment method for phase-type distributions
moment,bivdph-method

Moment method for bivdph class
moment,bivph-method

Moment method for bivph class
phcdf

Phase-type cdf
marginal,bivph-method

Marginal method for bivph class
pgf,mdph-method

Pgf method for multivariate discrete phase-type distributions
sum_dph

Computes the initial distribution and sub-intensity of the sum of two discrete phase-type distributed random variables
ph-class

Phase-type distributions
merge_matrices

Merges the matrices S11, S12 and S22 into a sub-intensity matrix
maximum,ph,ph-method

Maximum method for phase-type distributions
rMPHstar

Simulate a MPH* random vector
moment,dph-method

Moment method for discrete phase-type distributions
runge_kutta

Runge-Kutta for the calculation of the a and b vectors and the c matrix in a EM step
plus_states

Find which states have positive reward
rMIPHstar

Simulate a MIPH* random vector
tvr_dph

Performs TVR for discrete phase-type distributions
pow2_matrix

Computes A^(2^n)
var,dph-method

Var method for discrete phase-type distributions
sim,bivph-method

Simulation method for bivariate phase-type distributions
random_structure

Random structure of a phase-type
show,MPHstar-method

Show method for multivariate phase-type distributions
sum_ph

Computes the initial distribution and sub-intensity of the sum of two phase-type distributed random variables.
random_structure_bivph

Random structure of a bivariate phase-type
random_reward

Random reward matrix
maximum

New generic for maximum of two matrix distributions
moment

New generic for moments of matrix distributions
vector_of_matrices

Computes the elements S^n / n! until the a given size
rmatrixgev

Random matrix GEV
show,mdph-method

Show method for multivariate discrete phase-type distributions
var,mph-method

Var method for multivariate phase-type distributions
var,mdph-method

Var method for multivariate discrete phase-type distributions
phdensity

Phase-type density
rphasetype

Simulate phase-type
show,sph-method

Show method for survival phase-type objects
var,ph-method

Var method for phase-type distributions
vector_of_matrices_2

Computes the elements S^n / n! until given value of n
show,ph-method

Show method for phase-type distributions
sim,mph-method

Simulation method for multivariate phase-type distributions
sim,ph-method

Simulation method for phase-type distributions
minimum

New generic for minimum of two matrix distributions
miph-class

Multivariate inhomogeneous phase-type distributions
mgevcdf

Matrix-GEV cdf
show,bivdph-method

Show method for bivariate discrete phase-type distributions
quan,ph-method

Quantile method for phase-type distributions
sim,dph-method

Simulation method for phase-type distributions
quan

New generic for the quantile of matrix distributions
show,bivph-method

Show method for bivariate phase-type distributions
sph

Constructor function for survival phase-type objects
show,dph-method

Show method for discrete phase-type distributions
sim,iph-method

Simulation method for inhomogeneous phase-type distributions
EMstep_MoE_PADE

EM for PH-MoE