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
1
vote
1 answer

Getting univariate probability densitiy function for a dataset of IP addresses

I have two simple datasets having 10k IP addresses encoded as Integers (so the data is discrete and can take any number range between 1 and 4B). FYI: One dataset is a real dataset captured at a network, while the other one is a synthetic one. At the…
1
vote
0 answers

Python how to deconvolve two Gaussian distributions

The distribution of the sum of two normal independent random variables can be computed with aconvolution. I.e. Z=X+Y and f_z = convolution(f_x, f_y). I know that the convolution of two normal distributions is also a normal distribution with mean…
1
vote
1 answer

How fit a curve with scipy with restriction on the parameter range

I am trying to fit a GEV to some data using scipy.genextreme.fit, e.g. from scipy.stats import genextreme as gev import numpy as np # Generate some random data data = np.random.normal(size=1000) # Fit the data to a GEV distribution params =…
1
vote
1 answer

Uniform sampling arroung a unit sphere

I am looking for an algorithm to uniformly sample the surface of a unit sphere. I have been reading in https://mathworld.wolfram.com/SpherePointPicking.html. Their approach appears to translate as: def randomPoints(n): u = np.random.uniform(0,…
1
vote
1 answer

What do the scipy.stats.binom and script.stats.hypergeom functions actually do?

I am trying to work with some hypergeometric and binomial random variables, and so I am looking at the scipy.stats functionality. But I'm confused what scipy.stats.binom() and script.stats.hypergeom() functions actually do. Do they implicitly create…
1
vote
1 answer

Sampling non-repeating integers with given probability distribution

I need to sample n different values taken from a set of integers. These integers should have different occurence probability. E.g. the largest the lukilier. By using the random package I can sample a set of different values from the set, by maeans…
user8110728
1
vote
1 answer

Poission Distribution considering time left

I want to calculate the remaining probabilities for each result in a football game at n minute. In this case I have expected goals for home team of 2.69 and away team 1.12 at 70 minute for a current result of 2-1 Code from scipy.stats import…
luka
  • 531
  • 3
  • 13
1
vote
0 answers

Maximum Mean Discrepancy (implementation with Python and Scikitlearn) and Uncertanties

I am using this code from Jindong Wang to estimate MMD (Maximum Mean Discrepancy) with the aim of distinguishing between different characteristics of time series that I artificially generate following this skcikit-learn example. I started with…
1
vote
1 answer

Understand the nature of distribution for a dataset in Python?

Let's say I have a dataset (sinusoidal curve in this example): import matplotlib.pyplot as plt import numpy as np T = 1 Fs = 10000 N = T*Fs t = np.linspace(0,T,N) x = 10 * np.sin(2*np.pi*2*t)…
1
vote
3 answers

Multiple mutually exclusive events and probabilities in netlogo

consider the following 5 events that can occur in netlogo, [a b c d e f] Each event has a specific probability of occurring. Say [0 0 0.3 0.5 0.1 0.1], that is, p(a) = 0, p(b) = 0, p (d) = 0.5 One (and only one event)must occur . How do I model it…
1
vote
0 answers

DAX function equivalent to FINV

I'm looking for a DAX function equivalent to the FINV function in excel which calculates the inverse of the F probability distribution given a probability, numerator and denominator degrees of freedom. I've searched through the official list of DAX…
Jane
  • 11
  • 2
1
vote
3 answers

Sample numbers from a custom distribution of probabilities

I need to sample numbers from a distribution, but the probabilities of all numbers must be something I can control. For example, say I have 5 nodes (a, b, c, d, e) on a graph, and each node has an "attachment probability" that determines how likely…
Cybernetic
  • 12,628
  • 16
  • 93
  • 132
1
vote
2 answers

How to tune random.choice probability - python -

I made a function that randomly selects one from a list of texts. def ttc(*arg): a = random.choice([*arg]) return ''.join(a) print(ttc("Price", "Condition", "Loan")) print(ttc("entertainment", "geese", "Uruguay", "comedy",…
anfwkdrn
  • 327
  • 1
  • 7
1
vote
1 answer

Overlaying probability density functions on one plot

I would like to create a probability density function for the isotopic measurements of N from three NOx sources. The number of measurements varies between sources, so I've created three dataframes. Here is the code: import pandas as pd import…
1
vote
0 answers

Finding KL Divergence from set of numbers

If I have 2 lists of numbers (shown below), how could I find the KL Divergence? Do I first have to find the probability distribution in them (if so, how could one do that)? I've tried putting the data through a kernel density function but it has not…