Hostname: page-component-5db58dd55d-mhzq2 Total loading time: 0 Render date: 2026-06-02T12:53:18.727Z Has data issue: false hasContentIssue false

matrixdist: an R package for statistical analysis of matrix distributions

Published online by Cambridge University Press:  02 October 2025

Martin Bladt
Affiliation:
Department of Mathematical Sciences, University of Copenhagen, Copenhagen, Denmark
Alaric Mueller
Affiliation:
Faculty of Business and Economics, University of Lausanne, Lausanne, Switzerland
Jorge Yslas*
Affiliation:
Institute for Financial and Actuarial Mathematics, University of Liverpool, Liverpool, UK
*
Corresponding author: Jorge Yslas; Email: jorge.yslas1@gmail.com
Rights & Permissions [Opens in a new window]

Abstract

The matrixdist R package provides a comprehensive suite of tools for the statistical analysis of matrix distributions, including phase-type, inhomogeneous phase-type, discrete phase-type, and related multivariate distributions. This paper introduces the package and its key features, including the estimation of these distributions and their extensions through expectation-maximization algorithms, as well as the implementation of regression through the proportional intensities and mixture-of-experts models. Additionally, the paper provides an overview of the theoretical background, discusses the algorithms and methods implemented in the package, and offers practical examples to illustrate the application of matrixdist in real-world actuarial problems. The matrixdist R package aims to provide researchers and practitioners a wide set of tools for analyzing and modeling complex data using matrix distributions.

Information

Type
Actuarial Software
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press on behalf of Institute and Faculty of Actuaries
Figure 0

Table 1. Transformations

Figure 1

Figure 1 Hill plot for losses in the AutoBi dataset.

Figure 2

Figure 2 QQ plot of fitted distribution.

Figure 3

Figure 3 Histogram of the logarithm of losses versus fitted density (blue line).

Figure 4

Figure 4 Survival function of losses for the new claimant.

Figure 5

Figure 5 QQ plot of fitted distirbutions for each marginal.

Figure 6

Figure 6 Contour plots of the kernel density estimates for each combination of the margins of the original data (top) and of a sample simulated from the fitted MPH* model (bottom).

Figure 7

Figure 7 QQ plot for residuals of IPH for BC.

Figure 8

Figure 8 QQ plot for residuals of IPH for CO.

Figure 9

Table 2. Loglikelihood and RMSE for severity models

Figure 10

Table 3. Summary of frequency model performance: loglikelihood, chi-square statistic, and RMSE

Figure 11

Table 4. Classes of matrix distributions available in matrixdist

Figure 12

Table 5. Methods for matrix distributions available in matrixdist

Supplementary material: File

Bladt et al. supplementary material

Bladt et al. supplementary material
Download Bladt et al. supplementary material(File)
File 2.6 MB