Questions tagged [probability-distribution]

A probability distribution is a function that defines the probability of occurrences of the different possible values of a variable.

What is it?

A probability distribution is a function that defines the probability of occurrences of the different possible values of a variable.

Typical examples of distributions are the uniform distribution in which each value has the same probability, the normal distribution in which the values around the avergage have a higher probability and the extreme values the lowest probability.

See also

315 questions
2
votes
1 answer

Best copula package for python

came across three similar named python packages for parametric copula estimation: copula package copulae package pycopula package have I missed any? Which of the above are most popular, accurate, (maybe regularly updated), and contains…
2
votes
2 answers

Obtain the value of the random variable given the cumulative probability (Python)

Here is a quick background information. I am trying to obtain a combined CDF for the linear combination of two lognormal random variables using Monte-Carlo approach and then, invert it to do sampling. Here is the Python code for doing the…
2
votes
1 answer

Probability distribution in np.random.choice

The numpy function np.random.choice takes in an optional parameter called 'p' that denotes the probability distribution of the values it is sampling . So , my question is , even though the function generates random values , do values that have…
AnonymousMe
  • 509
  • 1
  • 5
  • 18
2
votes
1 answer

Matlab: Truncated multivariate normal random sampling?

I am wishing to sample from a truncated multivariate normal distribution directly in Matlab. I am aware I can simply use mvnrnd and check whether the returned value is within the domain of interest. However, this is a waste of resources when a…
2
votes
2 answers

How to smooth a probability distribution plot in Python?

I made a probability DataFrame df, sorted by value: value prob 0 -31 0.002597 1 -23 0.005195 2 -22 0.005195 3 -21 0.002597 4 -20 0.002597 5 -18 0.005195 6 -15 0.002597 ... 39 19 0.007792 40 21 …
jstaxlin
  • 517
  • 4
  • 18
2
votes
1 answer

Generating random priorities for a treap in C++

I am creating a treap, and I want to know, which random number generator is most suitable for generating priorities at insertion. The data set is about 6000 items long. I am modifying an existing template class(largely just declared methods without…
dodekja
  • 537
  • 11
  • 24
2
votes
0 answers

How to recover the spatial probability distribution of a GPS location from its accuracy?

A location coordinate determined by GPS is not perfectly accurate. It follows a probability distribution. An Android location comes with an accuracy property. The Android Developer docs for Location.getAccuracy() says: We define horizontal…
2
votes
1 answer

How to sample from a Wishart Distribution in Python

I need to generate random samples from a Wishart Distribution in Python. Is there a simple way to do that?
Rumu
  • 403
  • 1
  • 3
  • 10
2
votes
0 answers

Visualization of Bivariate Probability Distribution

I need to obtain the 3D plot of the joint probability distribution of two random variables x and y. Whereas this plot can be easily obtained with Mathematica, I wasn't able to find any documentation in Python. Can you help me out with that?
ElenaPhys
  • 443
  • 2
  • 5
  • 16
2
votes
0 answers

Plot joint return period

I have two variables var1 and var2. I want to have joint return period plot of two variables like The blue line indicates the joint return period of two variables and the number indicate the return period value in years(1,5,10,50,...). I am not sure…
2
votes
2 answers

How to sample in Tensorflow by custom probability distribution?

I have a vector e.g., V = [10, 30, 20, 50] of N elements and a probability vector P = [.2, .3, .1, .4]. In tensorflow, how can I randomly sample K elements from V that obey the given probability distribution P? I want the sampling to be done with…
user1205476
  • 391
  • 1
  • 3
  • 12
2
votes
2 answers

How to find cumulative probability for a given value in a GEV distribution in R?

I have fitted my data to a GEV distribution, and I wonder how to find the probability of P(x<=40). Thanks for any help. library(extRemes) ams <-…
Yang Yang
  • 858
  • 3
  • 26
  • 49
2
votes
2 answers

How do I implement the Probability density function of a Gaussian Distribution

I need to implement a class in Python, that represents a Univariate (for now) Normal Distribution. What I have in mind is as follows class Norm(): def __init__(self, mu=0, sigma_sq=1): self.mu = mu self.sigma_sq = sigma_sq …
2
votes
2 answers

Efficient binary sampling from vector of probability distribution vectors in MatLab

I'm tidying up some digit classification code. So I feed in an image of a digit, say "7" and I get out 10 probabilities (i.e. sums to 1). If my algorithm is working well, the 7th element should have the highest value. An added complication is that…
P i
  • 29,020
  • 36
  • 159
  • 267
1
vote
1 answer

KL and JS Divergence analysis of PDFs of numbers

I am playing around with divergence metrics, and I found that if I implement the calculations on my own or rely on the built-in libs, I get two different numbers. Now, I don't know what am (is) I (the built-in function) doing wrong. For simple…