I
I
Ivanjo1012022-03-07 02:06:20
Python
Ivanjo101, 2022-03-07 02:06:20

How to test the hypothesis that the sample corresponds to a given distribution law using the Chi-square test?

The Python programming language
I generate a sample like this, using the Numpy library, the approximate size is 1 million.

uniformSample = UniformSample(1000000)
uniformSample.generate()

def generate(self, a=0.0, b=1.0):
        self.left = a
        self.right = b
        self.sample = [np.random.uniform(low=self.left, high=self.right) for _ in range(self.size)]

I have various sample characteristics such as mean, variance, standard deviation and others.
I need to check that the given sample corresponds to one or another type of distribution (there are 8 types in my case). You need to check this through the chi-square test . Dear mathematicians and programmers all rolled into one, can you please help me to check the conformity of the sample to any distribution in the most elegant and simple way possible?
Using built-in functions and libraries in Python is welcome!
Code examples in response to my question - welcome!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question