2

Simple question about MVN pdf. I understand the domain to be [0,1]. However, why does scipy.stats.multivariate_normal.pdf output values above this range. E.g.

action = np.array(
              [0.0771532, -0.0921249, 0.155535, 0.110629, -0.0750895, 0.0490313, 0.0416572, -0.0489283, 0.117888, 0.0104795, 0.0261741, -0.193333, -0.199992, -0.119793, -0.00147295, 0.0347881, -0.0862036, -0.0163956, -0.011512, -0.0051254, 0.0744867, -0.0815146, 0.00417948, 0.0575905, 0.0776339, -0.174205, -0.00825691, 0.0330421, -0.163067, 0.0111632, 0.104023, -0.0618963, -0.171926, -0.0930436, 0.0505307, -0.0134338, -0.100431, -0.133168, 0.146748, 0.120166],
              dtype=np.float64).reshape((10,4))
mean = np.array(
            [-0.0125206, -0.019085, 0.0512585, -0.0105176,
             -0.0125206, -0.019085, 0.0512585, -0.0105176,
             -0.0125206, -0.019085, 0.0512585, -0.0105176,
             -0.0125206, -0.019085, 0.0512585, -0.0105176,
             -0.0125207, -0.019085, 0.0512585, -0.0105176,
             -0.0125207, -0.0190849, 0.0512585, -0.0105176,
             -0.0125207, -0.0190849, 0.0512585, -0.0105176,
             -0.0125207, -0.0190849, 0.0512585, -0.0105176,
             -0.0125207, -0.0190849, 0.0512585, -0.0105176,
             -0.0125207, -0.0190849, 0.0512585, -0.0105177,
             ],
            dtype=np.float64).reshape((10,4))
std = np.array(
           [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
            0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
            0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
            0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
           dtype=np.float64).reshape((10,4))


res4 = multivariate_normal.pdf(action[0,:],mean[0,:],np.diag(std[0,:]**2))

print("scipy normal pdf:\n",res4)

#>>> 36.17148

Edit: It is clear thanks to a_statistician that $\int_x pdf(x) = 1$. Now how to find $P(X=x, M=\mu,\Sigma=\sigma)$? I am aware that the probability of any particular data point is zero if the set of possible values is continuous.

errolflynn
  • 123
  • 4
  • 1
    As pointed out in the answer, density functions are not probabilities, they're simply derivatives of distribution functions. The only restriction placed on density functions is that they're non-negative and integrate to $1$, they can still take arbitrarily large values. – Xiaomi Oct 07 '18 at 00:58

1 Answers1

0

You can derive the probability from probability density function (pdf), but pdf itself is not probability. So the limitation that 0<=probability<=1 does not applicable to the pdf.

The domain of k-dimentional MVN pdf is $R^k$ and its range is $(0, \inf)$. Maybe you can go back to univariate normal distribution with mean 0 and variance 0.001, draw a graph of its pdf to see what happens.

user158565
  • 7,032
  • 2
  • 9
  • 19
  • Thank you for clarifying: integral_x(pdf(x)) = 1. Now how to find probability from the set of actions,means,std? – errolflynn Oct 07 '18 at 01:07
  • What the set of action means? If the means and stds can determine the pdf of x, you can get probability of events by integral. If pdf of x cannot be fixed by means and stds, you cannot get the probability, generally. For example, if you specify the (x1,x2) follows the bivariate normal distribution, and you have means and stds, but you cannot write down the pdf, because we need the covariance between x1 and x2 also for pdf. – user158565 Oct 07 '18 at 02:32
  • Assuming no covariance. Is the integral over some delta range? It is a continuous range for x (which is what i mean by actions), so the probability of a point x is technically 0. – errolflynn Oct 07 '18 at 03:20
  • what is delta range? – user158565 Oct 07 '18 at 03:26
  • like integral from x to x+dx is a delta range. just so that probability is not equal to zero. if you know an alternative way to get probability from example, x, please let me know. – errolflynn Oct 07 '18 at 03:28
  • OK. Assume "Assuming no covariance" means covariance = 0. Then for bivariate normal distribution, you can get pdf based on two means and two stds. Then define your event, for example, $1 – user158565 Oct 07 '18 at 03:36