user3397243
user3397243

Reputation: 567

Desired probability distribution

I have a data "zcosmo" that follows a certain distribution. It has many fluctuations (i.e it increases slightly at some point and then flattens etc, but overall it increases from 0 to 0.5). So I fit the data using a function that follows the distribution of the data.

This function is the probability distribution lets say of the data. Here in this image, the fit gives me the blue line, which I want to use as the probabilty distribution function.

enter image description here

def fit(x,p1,p2):
    return (p1*x)+(p2*(x**2))

Now I theoretically know how to create data that follows this function!

"y" will then have the desired probability distribution p(y)

I am struggling to find a way to do it in Python. Is there a package that does the above??

Upvotes: 0

Views: 189

Answers (1)

Julian Irwin
Julian Irwin

Reputation: 302

You should take a look at the SciPy stack. It includes great libraries for probability and statistics, numerical integration and plotting.

Upvotes: 0

Related Questions