Announcement

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

  • Using mvtnorm_mata_function in Project

    How can I include the functions from mvtnorm_mata_function.do in my project (http://fmwww.bc.edu/RePEc/bocode/m)? I tried issuing 'ssc install mvtnorm' but it does not seem to include the mata functions.

  • #2
    Let me share what I've found in the hope that someone seeing this can take the next step.

    At SSC the mvtnorm.pkg file contains
    Code:
    d 'MVTNORM': module to work with the multivariate normal and multivariate t distributions, with and without variable truncation
    d
    d  A set of commands that allows users to evaluate different
    d distributional quantities of the multivariate normal
    d distribution, and a particular type of non-central multivariate t
    d distribution. Specifically, their probability density functions,
    d distribution functions, equicoordinate quantiles, and
    d pseudo-random vectors can be computed, either in the absence or
    d presence of variable truncation. The commands are written in a
    d combination of Stata and Mata for speed. In addition, a set of
    d corresponding Mata functions is provided. 
    d
    d KW: normal distribution
    d KW: multivariate normal
    d KW: t distribution
    d KW: multivariate t
    d KW: truncation
    d
    d Requires: Stata version 11
    d
    d Distribution-Date: 20211224
    d
    d Author: Michael J. Grayling, Cambridge University
    d Support: email mjg211@@cam.ac.uk
    d
    d Author: Adrian Mander 
    d Support: email Adrian.Mander@@mrc-hnr.cam.ac.uk
    d
    f mvnormalden.ado
    f mvnormalden.sthlp
    f ../i/invmvnormal.ado
    f ../i/invmvnormal.sthlp
    f ../i/invmvt.ado
    f ../i/invmvt.sthlp
    f ../i/invtmvnormal.ado
    f ../i/invtmvnormal.sthlp
    f ../i/invtmvt.ado
    f ../i/invtmvt.sthlp
    f mvt.ado
    f mvt.sthlp
    f mvtden.ado
    f mvtden.sthlp
    f ../p/pmvnormal.ado
    f ../p/pmvnormal.sthlp
    f ../r/rmvnormal.ado
    f ../r/rmvnormal.sthlp
    f ../r/rmvt.ado
    f ../r/rmvt.sthlp
    f ../r/rtmvnormal.ado
    f ../r/rtmvnormal.sthlp
    f ../r/rtmvt.ado
    f ../r/rtmvt.sthlp
    f ../t/tmvnormal.ado
    f ../t/tmvnormal.sthlp
    f ../t/tmvnormalden.ado
    f ../t/tmvnormalden.sthlp
    f ../t/tmvt.ado
    f ../t/tmvt.sthlp
    f ../t/tmvtden.ado
    f ../t/tmvtden.sthlp
    f mvtnorm_mata_functions.do
    which I would expect to cause mvtnorm_mata_functions.do into Stata's PLUS/m directory. But having just installed mvtnorm, I find that the the end of my stata.trk file shows
    Code:
    S http://fmwww.bc.edu/RePEc/bocode/m
    N mvtnorm.pkg
    D 13 Sep 2022
    U 916
    d 'MVTNORM': module to work with the multivariate normal and multivariate t distributions, with and without variable truncation
    d 
    d  A set of commands that allows users to evaluate different
    d distributional quantities of the multivariate normal
    d distribution, and a particular type of non-central multivariate t
    d distribution. Specifically, their probability density functions,
    d distribution functions, equicoordinate quantiles, and
    d pseudo-random vectors can be computed, either in the absence or
    d presence of variable truncation. The commands are written in a
    d combination of Stata and Mata for speed. In addition, a set of
    d corresponding Mata functions is provided.
    d 
    d KW: normal distribution
    d KW: multivariate normal
    d KW: t distribution
    d KW: multivariate t
    d KW: truncation
    d 
    d Requires: Stata version 11
    d 
    d Distribution-Date: 20211224
    d 
    d Author: Michael J. Grayling, Cambridge University
    d Support: email mjg211@@cam.ac.uk
    d 
    d Author: Adrian Mander
    d Support: email Adrian.Mander@@mrc-hnr.cam.ac.uk
    d 
    f m/mvnormalden.ado
    f m/mvnormalden.sthlp
    f i/invmvnormal.ado
    f i/invmvnormal.sthlp
    f i/invmvt.ado
    f i/invmvt.sthlp
    f i/invtmvnormal.ado
    f i/invtmvnormal.sthlp
    f i/invtmvt.ado
    f i/invtmvt.sthlp
    f m/mvt.ado
    f m/mvt.sthlp
    f m/mvtden.ado
    f m/mvtden.sthlp
    f p/pmvnormal.ado
    f p/pmvnormal.sthlp
    f r/rmvnormal.ado
    f r/rmvnormal.sthlp
    f r/rmvt.ado
    f r/rmvt.sthlp
    f r/rtmvnormal.ado
    f r/rtmvnormal.sthlp
    f r/rtmvt.ado
    f r/rtmvt.sthlp
    f t/tmvnormal.ado
    f t/tmvnormal.sthlp
    f t/tmvnormalden.ado
    f t/tmvnormalden.sthlp
    f t/tmvt.ado
    f t/tmvt.sthlp
    f t/tmvtden.ado
    f t/tmvtden.sthlp
    e
    omitting the installation of mvtnorm_mata_functions.do.

    In any event you can download the file and run it as any other do-file.

    Comment


    • #3
      Files with extensions other than .ado or .sthlp (and .mata, .mlib, .mo, I believe) are regarded ancillary files. You want

      Code:
      ssc install ... , all
      See

      Code:
      help ssc
      Ancillary files are typically saved to the current working directory, not PLUS. See

      Code:
      help net
      and [R] net.

      Comment


      • #4
        Thank you William Lisowski and daniel klein!!

        Comment

        Working...
        X