Learn R Programming

⚠️There's a newer version (1.1.9) of this package.Take me there.

matrixdist

Statistics for Matrix Distributions

This package implements tools which are useful for the statistical analysis of homogeneous and in-homogeneous 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.

The main method for fitting in-homogeneous phase--type is fit, which allows data to be right-censored or aggregated. Several in-homogeneity transforms are considered, as well as the most common sub-intensity matrix structures.

Simulation can be efficiently performed using the method sim. Various other methods for computing functionals of in-homogeneous phase--type objects are the following: dens (density), cdf (cumulative distribution function), haz (hazard rate), and quan (quantile).

For phase--type distributions, the additional methods minimum, maximum, "+" obtain the matrix representations of the resulting phase--type distribution obtained through their application to two random variables. The method moment computes exact moments of phase--type distributions of any order.

Finally, show, coef, logLik are auxiliary methods for visualizing, extracting coefficients and log-likelihood of phase--type objects, respectively.

Copy Link

Version

Install

install.packages('matrixdist')

Monthly Downloads

240

Version

1.1.2

License

GPL-3

Maintainer

Martin Bladt

Last Published

June 18th, 2021

Functions in matrixdist (1.1.2)

LInf_norm

L-oo norm of a matrix
EMstep_UNI

EM using Uniformization for matrix exponential
EMstep_PADE

EM using Matlab algorithm for matrix exponential in combination with Armadillo
a_rungekutta

Runge Kutta for the calculation of the a vectors in a EM step
Fisher,sph-method

Fisher Information Method for sph Class
LRT,ph,ph-method

LRT Method for ph Class
cdf,iph-method

Distribution Method for inhomogeneous phase type distributions
EMstep_RK

EM step using Runge Kutta
Fisher

New Generic for obtaining the Fisher Information of Survival Matrix Distributions
LRT

New Generic for doing a likelihood ratio test between two Matrix Distribution models
coef,sph-method

Coef Method for sph Class
cdf

New Generic for the Distribution of Matrix Distributions
cdf,ph-method

Distribution Method for phase type distributions
initialState

Initial state of Markov jump process
iph-class

Inhomogeneous Phase Type distributions
default_step_length

Default size of the steps in the RK
logLikelihoodMloglogistic_UNI

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

Density Method for phase type distributions
logLik,ph-method

logLik Method for ph Class
dens,iph-method

Density Method for inhomogeneous phase type distributions
cumulateVector

Cumulate vector
logLikelihoodMloglogistic_RKs

Loglikelihood of matrix-loglogistic using RK
iph

Constructor Function for inhomogeneous phase type distributions
logLikelihoodMlognormal_UNIs

Loglikelihood of matrix-lognormal using Uniformization
coef,iph-method

Coef Method for iph Class
coef,ph-method

Coef Method for ph Class
logLikelihoodMlognormal_RK

Loglikelihood of matrix LogNormal using RK
logLikelihoodMgompertz_UNI

Loglikelihood of matrix-Gompertz using Uniformization
evaluate

New Generic for Evaluating Survival Matrix Distributions
logLikelihoodMgompertz_RKs

Loglikelihood of matrix-Gompertz using RK
evaluate,sph-method

Evaluation Method for sph Class
logLikelihoodMlognormal_PADEs

Loglikelihood of matrix-lognormal using Pade
cumulateMatrix

Cumulate matrix
embeddedMC

Embedded Markov chain of a sub-intensity matrix
diagonal_vector

Creates a matrix with the given vector in the diagonal
logLikelihoodMpareto_PADE

Loglikelihood of matrix-Pareto using Pade
logLikelihoodMweibull_PADEs

Loglikelihood of matrix-Weibull using Pade
dens

New Generic for the Density of Matrix Distributions
logLikelihoodMgev_RK

Loglikelihood of matrix GEV using RK
logLikelihoodMgev_PADE

Loglikelihood of matrix-GEV using Pade
matrix_VanLoan

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

Matrix Gompertz cdf
matrixdist-package

Statistics for Matrix Distributions
maximum,iph,iph-method

Maximum Method for inhomogeneous phase type distributions
mgompertzden

Matrix Gompertz density
matrix_VanLoanArma

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

Matrix Weibull density
logLikelihoodMweibull_UNIs

Loglikelihood of matrix-Weibull using Uniformization
logLikelihoodMweibull_RK

Loglikelihood of matrix Weibull using RK
logLikelihoodMgompertz_PADEs

Loglikelihood of matrix-Gompertz using Pade
clone_matrix

Clone a matrix
logLikelihoodMgompertz_RK

Loglikelihood of matrix Gompertz using RK
matrixMax

Maximum entry in a matrix
logLikelihoodPH_PADE

Loglikelihood of PH using Pade
matrix_exponential

Matrix exponential algorithm
matrixMaxDiagonal

Maximum entry in the diagonal of a matrix
logLikelihoodMloglogistic_UNIs

Loglikelihood of matrix-loglogistic using Uniformization
logLikelihoodMlognormal_PADE

Loglikelihood of matrix-lognormal using Pade
clone_vector

Clone a vector
logLikelihoodPH_UNIs

Loglikelihood of PH using Uniformization
matrixExpSum_arma

Computes e^(Sx) base on the values on powerVector
fit,ph-method

Fit Method for ph Class
logLikelihoodMpareto_UNIs

Loglikelihood of matrix-Pareto using Uniformization
matrix_inverse_slow

Inverse of a matrix
maximum,ph,ph-method

Maximum Method for phase type distributions
logLikelihoodMweibull_PADE

Loglikelihood of matrix-Weibull using Pade
matrix_inverse

Inverse of a matrix
maximum

New Generic for Maximum of two Matrix Distributions
mlognormalden

Matrix LogNormal density
mloglogisticden

Matrix Log-Logistic density
matrix_exponential_slow

Matrix exponential algorithm
mlognormalcdf

Matrix LogNormal cdf
matrix_product_slow

Product of two matrices
matrix_sum

Add matrices
quan

New Generic for the Quantile of Matrix Distributions
random_structure

Random structure of a phase-type
newState

New state in a Markov jump process
fit

New Generic for Estimating Matrix Distributions
riph

Random inhomogeneous phase-type
reversTransformData

Applies the inverse of the GEV but giving back the vector in reverse order
logLikelihoodMgompertz_UNIs

Loglikelihood of matrix-Gompertz using Uniformization
haz,ph-method

Hazard rate Method for phase type distributions
logLikelihoodMloglogistic_PADE

Loglikelihood of matrix-loglogistic using Pade
logLikelihoodMpareto_PADEs

Loglikelihood of matrix-Pareto using Pade
logLikelihoodMpareto_RK

Loglikelihood of matrix Pareto using RK
haz

New Generic for the Hazard rate of Matrix Distributions
show,sph-method

Show Method for survival phase type objects
show,ph-method

Show Method for phase type distributions
minimum,iph,iph-method

Minimum Method for inhomogeneous phase type distributions
moment,ph-method

Moment Method for phase type distributions
solve_linear_system

Solves a system with multiple right hand sides
sim

New Generic for Simulating Matrix Distributions
phcdf

Phase-type cdf or tail
rmatrixgev

Random matrix GEV
phdensity

Phase-type density
rphasetype

Random phase-type
logLikelihoodMloglogistic_PADEs

Loglikelihood of matrix-loglogistic using Pade
logLikelihoodMgev_UNI

Loglikelihood of matrix-GEV using Uniformization
derivativeMatrixweibull

Derivative of matrix Weibull
logLikelihoodMgompertz_PADE

Loglikelihood of matrix-Gompertz using Pade
logLikelihoodMpareto_RKs

Loglikelihood of matrix-Pareto using RK
logLikelihoodMpareto_UNI

Loglikelihood of matrix-Pareto using Uniformization
minimum,ph,ph-method

Minimum Method for phase type distributions
logLikelihoodPH_RK

Loglikelihood using RK
mgevcdf

Matrix GEV cdf
logLikelihoodPH_PADEs

Loglikelihood of PH using Pade
mparetoden

Matrix Pareto density
mweibullcdf

Matrix Weibull cdf
quan,ph-method

Quantile Method for phase type distributions
+,ph,ph-method

Sum Method for phase type distributions
vectorOfMatrices_arma2

Computes elements S^n / n! until the value size
mgevden

Matrix GEV density
reg,ph-method

Regression Method for ph Class
logLikelihoodMloglogistic_RK

Loglikelihood of matrix Log-Logistic using RK
logLikelihoodMlognormal_UNI

Loglikelihood of matrix-lognormal using Uniformization
logLikelihoodMlognormal_RKs

Loglikelihood of matrix-lognormal using RK
logLikelihoodMweibull_RKs

Loglikelihood of matrix-Weibull using RK
matrix_power

Computes A^n
logLikelihoodPH_RKs

Loglikelihood of PH using RK
logLikelihoodMweibull_UNI

Loglikelihood of matrix-Weibull using Uniformization
logLikelihoodPH_UNI

Loglikelihood using Uniformization
reg

New Generic for Regression with Matrix Distributions
sim,iph-method

Simulation Method for inhomogeneous phase type distributions
sim,ph-method

Simulation Method for phase type distributions
matrix_product

Product of two matrices
sph-class

Survival Analysis for Phase Type distributions
sph

Constructor Function for Survival phase type objects
mloglogisticcdf

Matrix Log-Logistic cdf
mparetocdf

Matrix Pareto cdf
minimum

New Generic for Minimum of two Matrix Distributions
moment

New Generic for Moment of Matrix Distributions
runge_kutta

Runge Kutta for the calculation of the a,b and c vectors in a EM step
ph-class

Phase Type distributions
show,iph-method

Show Method for inhomogeneous phase type distributions
ph

Constructor Function for phase type distributions
sumPH

Computes the initial distribution and sub-intensity of the sum of PH
vectorOfMatrices_arma

Computes elements S^n / n! until the value size