Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mata's inv() and vecdiag() functions not found

    Hi everyone,

    I am working with some Mata code, and as the title says, Mata's inv() and vecdiag() functions are not working for me. If I do:

    Code:
    mata: mata which inv()
    mata: mata which vecdiag()
    I get a "function ... not found r(111)" error. If I try the same with other functions that start with the same letter, like invsym() or vec(), I don't get any sort of error, and I can use them normally.

    Any idea of what could be happening here? This happened originally in StataNow/MP 19.5 in Windows 11 64-bit. I also tested this in fresh re-install of StataNow/MP 19.5 (revision 08 Apr 2025), without a "profile.do" file or any user-written commands installed. I did the same with fresh installation of Stata/MP 18 (revision 15 May 2023), but these functions were not found in any of the 3 versions.

    Last edited by Nicolas Suarez; 24 May 2025, 15:28. Reason: Title edit and added tags

  • #2
    There are no such functions in Mata among those that ship with it.

    You can see the list of all of the Mata functions that are available here. No function with either of those names are among those on the list.

    Comment


    • #3
      You are totally right, thank you for helping me figure this out. I feel like a complete idiot. If I do help help inv()it takes me to the Stata matrix function for inverting. Since it is right next to invsym(), which is a Mata function too, I got confused.

      Comment


      • #4
        The listing provided in the link provided by Joseph Coveney in #2 is a handy reference.

        That said, it prompts my long-standing—yet thusfar still unfruitful—suggestion that many/most/all of Stata's undocumented features merit formal documentation. See
        Code:
        help undocumented
        I'm obviously in no position to suggest what undocumented features would be of broad interest in the user community, but might speculate that some undocumented Mata functions like
        Code:
        timer(), subdiagget(), rdirichlet(), vech_lower()
        would fall into the broad-interest category for those who program using Mata.

        Comment


        • #5
          Originally posted by John Mullahy View Post
          . . . many/most/all of Stata's undocumented features merit formal documentation. See
          Code:
          help undocumented
          Good catch. I forgot to look there, whew.

          I'm not sure what timer() is still doing on that list inasmuch as it's documented, both here and here.

          Comment


          • #6
            Originally posted by Joseph Coveney View Post
            I'm not sure what timer() is still doing on that list inasmuch as it's documented, both here and here.
            Answer: "Undocumented commands are documented in the system help, but their documentation does not appear in the PDF manuals."

            Comment


            • #7
              In practice undocumented in StataCorp's sense seems to carry one or more of these broad implications:

              1. This functionality is used, or has been used, within official code and users can also employ it if they work out what it does and it suits them.

              2. However, StataCorp reserves the right to withdraw the functionality, make it non-documented, change its name, and so forth.

              3. Therefore, StataCorp does not feel obliged to document such code in detail.

              4. Undocumented does not mean non-documented or not documented.

              This is naturally one user take, and not at all committing StataCorp to the points of view implied.

              Comment

              Working...
              X