0

There are two classes of two-dimensional shape that use probability density functions:

here is the image

I have to choose function of probability density so the classes are inseparable, sum1 and sum2 are not allowed to be equal and their mean value vectors are not the same. I am not allowed to use scikit or any other library except numpy and pyplot. How do I start? First task is to generate 700 random specimens and show them in 2D space (pyplot) in different colors. I don't know where to start.

JohanC
  • 71,591
  • 8
  • 33
  • 66
  • 2
    This seems like asking folks here to solve your project rather than helping you debug some of your efforts. I would suggest reading more on numpy as a start. generating random numbers in numpy and plotting them is as easy as googling it here. – Ehsan May 26 '20 at 21:03
  • [multivariate-normal-density-in-python](https://stackoverflow.com/questions/11615664/multivariate-normal-density-in-python) – JohanC May 26 '20 at 21:10

1 Answers1

0

First i think its important to understand the Gaussian random distributions your using. Here M would be the mean value and "sum" is the covariance matrix sigma. If those terms are not familiar to you https://en.wikipedia.org/wiki/Normal_distribution

Here is a little code snipplet to get you started:

import numpy as np 
import matplotlib.pyplot as plt

mu = [1, 0]
sigma = [[1, 0],[0, 5]]

f1_rand_samples = np.random.multivariate_normal(mu, sigma, 700).T
print(f1_rand_samples)

plt.plot(f1_rand_samples[0,:], f1_rand_samples[1,:], 'x')
plt.axis('equal')
plt.show()

For the further programming i suggest checking out the numpy and matplotlib documentation online. just search for it and I'm sure you will find it.

After looking at the plot in the code example and understanding normal distributions your task should then not be too hard.

Manumerous
  • 455
  • 6
  • 21