IDEAS home Printed from https://ideas.repec.org/p/boc/lsug25/19.html
   My bibliography  Save this paper

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

Author

Listed:
  • Daniel Schneider

    (Max Planck Institute for Demographic Research)

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.

Suggested Citation

  • Daniel Schneider, 2025. "blockops: A new Mata library for eacient operations on block matrices," UK Stata Conference 2025 19, Stata Users Group.
  • Handle: RePEc:boc:lsug25:19
    as

    Download full text from publisher

    File URL: http://repec.org/lsug2025/
    Download Restriction: no
    ---><---

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:lsug25:19. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.