Announcement

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

  • Programming the Bivariate Normal Probability

    I have a question about programming a bivariate normal distribution for the ml command.

    I have a two-step sample selection model where the first step is a probit and the second step is a left-censored Tobit (censored at zero). The error terms are assumed to be bivariate normal (not standard normal as the standard deviation for tobit is σ, not one).

    My question is about programming the likelihood function when probit=1 and tobit is censored at zero. In this case, I need to calculate the bivariate normal probability (through a double integral of the pdf from -∞ to xb1 for probit and from -∞ to -xb2 for tobit).

    If it was a standard bivariate normal distribution, I can easily calculate the probability through

    egen `sp' = mvnp(`xb1' `xb2')...
    However, this approach does not work when one of the standard deviations is σ. Does anyone know if there is any command/plugin allowing me to calculate the bivariate normal probability including σ?


  • #2
    Any normally distributed variable can be standardised to have mean of 0 and standard deviation of 1 by subtracting the mean, and dividing by the standard deviation.

    Comment


    • #3
      Originally posted by Joro Kolev View Post
      Any normally distributed variable can be standardised to have mean of 0 and standard deviation of 1 by subtracting the mean, and dividing by the standard deviation.
      Thanks! That is also what I expected.

      Comment


      • #4
        Shuye Yu

        in your egen `sp' = mvnp(`xb1' `xb2')... example, is the mvnp command available through a user defined program from SSC? If so what is the name of it please?

        Comment


        • #5
          It appears to be from this article here:
          https://journals.sagepub.com/doi/pdf...867X0600600202


          Originally posted by Oscar Ozfidan View Post
          Shuye Yu

          in your egen `sp' = mvnp(`xb1' `xb2')... example, is the mvnp command available through a user defined program from SSC? If so what is the name of it please?

          Comment


          • #6
            Joro Kolev Thank you!

            Comment


            • #7
              Unless I've missed something specifying σ can be done when you specify the covariance matrix argument to chol(...) in mvnp (see section 3.1 of the paper linked in #5), at which point you'd also specify the off-diagonal element(s) of the covariance matrix.

              Comment


              • #8
                Joro Kolev
                I am trying to calculate the probability value between any two pairs of h and k that conform to bivariate normal distribution with correlation rho. So, below is how I think I could attack this. Can you please check if below looks accurate to you? Also, is there an easier way to use standardized values of a variable without having to generate separate variables for the standardized values?

                binormal(`h',`k',rho) is the joint cumulative distribution over (-infinity,h]X(-infinity,k] with correlation rho; h and k are normalized
                then the probability between two pairs of any h and k combination is gen prbetw`hmax'`kmax'and`hmin'`kmin' = binormal(`hmax',`kmax',rho) -binormal(`hmin',`kmin',rho)
                Last edited by Oscar Ozfidan; 08 Mar 2021, 07:34.

                Comment

                Working...
                X