Announcement

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

  • mvnormalcv takes 20 minutes when it should take under a second

    Usually mvnormalcv executes in a fraction of a second but for some reason this specific setup it took 20 minutes (and in a fairly beefy server at that). Any ideas?

    Code:
    set rmsg on
    mata
    bound = (0.580, 0.970, 0.771, 0.914, 0.673, 1.068, 0.810, 0.592, 1.271)
    means = J(1, 9, 0)
    sigma = 0.088,
            0.104,
            0.023,
            0.070,
            0.046,
            0.136,
            0.100,
            0.025,
            0.074,
            0.245,
            -0.032,
            0.130,
            0.100,
            0.215,
            0.116,
            -0.015,
            0.143,
            0.155,
            -0.077,
            -0.026,
            -0.004,
            0.027,
            0.024,
            -0.173,
            0.218,
            0.060,
            0.137,
            0.103,
            -0.008,
            0.139,
            0.118,
            0.119,
            0.018,
            -0.037,
            0.094,
            0.297,
            0.106,
            -0.029,
            0.171,
            0.171,
            0.055,
            0.056,
            0.091,
            -0.011,
            0.420
    mvnormalcv(-bound, bound, means, sigma)
    end

  • #2
    I can report from experience that dimensions beyond 7 or 8 (yours is 9) typically bring execution to a halt for me when using any of the mvnormal(...) functions. Running your code has done so on my not-so-beefy computer.

    When you report that it usually executes in a fraction of a second are you referring to 9-dimension problems or to smaller ones?

    Either way, have you tried reducing the number of quadrature points, using
    Code:
    mvnormalcvqp(L, U, M, V, q)
    instead of
    Code:
    mvnormalcv(L, U, M, V)

    Comment


    • #3
      John Mullahy Fraction of a second remark: yes, I meant smaller problems fed to mvnormalcv. However, I also fed this problem to R's mvtnorm and it executed fairly quickly, leading me to believe there was an issue here.

      Yes, I also tried playing around with the number of curvature points and it was still slow. (Though I did not benchmark it.)

      Comment

      Working...
      X