I'm trying to learn machine learning and till now I know "Discrete Probability distribution is a probability distribution in which sum of all probabilities sum to one and this is not continuous'. Now I have a problem to solve which contains following data.

Population = [111 x 200] matrix data and I need to calculate 'Centroids' from this data using the probability density function

P(x,y) = (1/z)*p(x,y)
where Z is a normalization constant

I tried to find the centroids by dividing each column array sum by total mean of the array and got some 200 values but I'm not sure whether it is correct or not?? please help.

  • $\begingroup$ What is p(x,y) in your question? $\endgroup$ – Tim Dec 13 '16 at 14:25
  • $\begingroup$ Its a 2D matrix population data along longitude and longitude. i.e, the longitude is in the range of 0-111 and longitude ranges from 0-200 $\endgroup$ – Rudresha Parameshappa Dec 13 '16 at 14:29
  • $\begingroup$ and data is having high values more than 200 thats why the problem asking to normalize it $\endgroup$ – Rudresha Parameshappa Dec 13 '16 at 14:30
  • $\begingroup$ So in the end, it's some kind of n*k matrix with counts ? $\endgroup$ – Tim Dec 13 '16 at 14:30
  • $\begingroup$ @Tim the values (x,y) in the matrix are greater than 200,111 $\endgroup$ – Rudresha Parameshappa Dec 13 '16 at 14:31

As I understand your question, your data is stored in a matrix of counts and you ask how to translate this to empirical probabilities.

Empirical probability (probabilities estimated from empirical counts) is calculated as

$$ \hat\Pr(X = x_i) = \frac{n_i}{\sum_{i=1}^M n_i} $$

where $n_i$ is a number of observed datapoints equal to $x_i$. In your case you have a spectral distribution with counts per each longitude $x$ and latitude $y$, so in fact you have a bivariate distribution, i.e. probability of observing your outcome on latitude $y_i$ and longitude $x_i$,

$$ \hat\Pr(X = x_i, Y = y_j) = \frac{n_{ij}}{\sum_{i=1}^M\sum_{j=1}^K n_{ij}} $$

where $n_{ij}$ is a number of observed datapoints at $x_i, y_j$ coordinate.

If you divided the counts by column totals, you calculated the conditional probabilities, i.e. probability of observing your outcome at longitude $x_i$ when focusing only on values from latitude $y_i$,

$$ \hat\Pr(X = x_i \mid Y = y_j) = \frac{ \hat\Pr(X = x_i, Y = y_j) }{\hat\Pr(Y = y_j)} = \frac{n_{ij}}{ n_{\cdot j} } = \frac{n_{ij}}{\sum_{i=1}^M n_{ij} } $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.