EconPapers    
Economics at your fingertips  
 

blockops: A new Mata library for eacient operations on block matrices

Daniel Schneider
Additional contact information
Daniel Schneider: Max Planck Institute for Demographic Research

UK Stata Conference 2025 from Stata Users Group

Abstract: This presentation introduces a new Mata library called blockops. Its main feature is a class that divides a matrix into multiple submatrices. Operations on the original matrix are then carried out in terms of the submatrices. The library mainly serves two purposes: First, it provides a simple approach to dealing with special kinds of sparse matrices. Submatrices that consist entirely of zeroes are represented by a null pointer and do not partake in arithmetic operations. For suitable applications, this can lead to vast increases in speed with regard to matrix multiplication and matrix inversion. The second purpose is the application of a built in or user-deRned function to each submatrix, similarly to, for example, R's *apply() functions. This can ease code generation and improve readability while maintaining Mata's favorable speed properties. Several examples are shown to demonstrate the usefulness of the new library for statistical calculations.

Date: 2025-09-04
References: Add references at CitEc
Citations:

Downloads: (external link)
http://repec.org/lsug2025/

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:lsug25:19

Access Statistics for this paper

More papers in UK Stata Conference 2025 from Stata Users Group Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-09-13
Handle: RePEc:boc:lsug25:19