Questions tagged [probability-density]

In probability theory, the density of a random variable is a function that describes the relative likelihood for this random variable to take on a given value. DO NOT CONFUSE THIS TAG WITH 'PDF': Adobe's file format.

Overview

From wiki:

In probability theory, a probability density function (pdf), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. The probability for the random variable to fall within a particular region is given by the integral of this variable’s density over the region. The probability density function is nonnegative everywhere, and its integral over the entire space is equal to one.

Related tags: , , .

Tag Usage

  • DO NOT CONFUSE THIS TAG WITH : Adobe's file format.

  • Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

614 questions
2
votes
2 answers

How to create equal bin width and equal bin height histograms using probability density function

Estimating the probability density function using the histogram by generating some random data. I want now two versions of histogram namely the equal bin width and equal bin height histograms. # -*- coding: utf-8 -*- from scipy.stats import…
2
votes
1 answer

How to identify frequent regions in timeseries in python

I want to identify frequent regions shared by the >2 timeseries data. For instance consider the figure below that contains three timeseries. The frequent regions shared by more than 2 timeseries are highlighted in the figure. I cannot use direct…
EmJ
  • 4,398
  • 9
  • 44
  • 105
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
1 answer

How can Python use n, min, max, mean, std, 25%, 50%, 75%, Skew, Kurtosis to define a psudo-random Probability Density Estimate/Function?

In reading and experimenting with numpy.random, I can't seem to find or create what I need; a 10 parameter Python pseudo-random value generator including count, min, max, mean, sd, 25th%ile,   50th%ile (median),   75th%ile, skew, and kurtosis. From…
2
votes
2 answers

Cumulative probability of estimated empirical distribution for n-dimensional data

The problem I have a dataset with 4 numeric features and 1000 datapoints. The distribution of the values is unknown (numpy randint generates uniform ints, but this is just for the purpose of illustration). Given new datapoint (4 numbers) I want to…
2
votes
2 answers

Calculate probability density mean python

Let's say I have a heatmap of probability density function as a numpy ndarray(m,n). Is there a function that automatically computes mean treating this matrix as probability density? I can't seem to find a function that would automatically do that.…
Mike Azatov
  • 402
  • 6
  • 22
2
votes
2 answers

Calculate probability of value based on 2D density plot in R

I'm looking to work out a function to calculate the likelihood of a certain combination for B and R. The current illustration of the data looks like so: ggplot(df, aes(R,B)) + geom_bin2d(binwidth = c(1,1)) Is there a way to calculate the…
timnus
  • 197
  • 10
2
votes
1 answer

Is there a shortcut to calculate integrals for different types of probability density functions?

In a case like this, from scipy.integrate import quad import numpy as np exponential_distribution = lambda x, lam: lam*np.exp(-lam*x) result = quad(exponential_distribution, 0.25, 0.75, args=0.1)[0] I'm imagining something like that from…
zwithouta
  • 1,319
  • 1
  • 9
  • 22
2
votes
1 answer

Superimpose two plots in MATLAB

I have two RV , one uniform and one Gaussian and I would like to superimpose their PDFs. I am trying the hold on function but it does not work, as it displays only second plot. How do I do this in MATLAB? % MATLAB R2019a % Setup N = [1:5 10 20…
2
votes
2 answers

Legend for plot with multiple densities

I have the following code: x <- seq(-25,25, by = .01) plot(x, dunif(x,-10,10), type = 'l', ylab = 'probability', lwd = 2) lines(x, dnorm(x,0,10), col = 'blue', lwd = 2) lines(x, dstudent_t(x,4,0,10), col = 'red', lwd = 2) lines(x, dcauchy(x,0,10),…
RazorLazor
  • 71
  • 5
2
votes
1 answer

Integration of bivariate lognormal density function

rho = 0.8; ff = @(x, y) (exp(-(((log(x)-10).^2 - 2.* rho .* (log(x)-10) .* (log(y)-10)+(log(y)-10).^2)./(2 .* (1-rho.^2))))./(2.*pi.*sqrt(1-rho.^2).*x.*y)); syms x y vpaintegral(vpaintegral(ff, x, [0 inf]), y, [0 inf]) Why is the above…
user53154
  • 63
  • 5
2
votes
0 answers

How could I plot best the output of my probability density function in python

I am trying to plot the output of the below function. The function itself calculates the probability density for given paramaters. The plot should be bell shaped like the normal distribution but not necessarily symmetric. How should I plot this? Any…
2
votes
2 answers

Estimating probability density in a range between two x values on simulated data

I want to evaluate the probability density of data I've simulated. I know that if I simply want to find the probability density for a single x value on the normal distribution, I could use dnorm() in the following way: dist_mean <- 10 dist_sd <-…
Emman
  • 3,695
  • 2
  • 20
  • 44
2
votes
2 answers

Finding the area under the curve of a probability distribution function in SciPy

I'm working on a univariate problem which involves aggregating payment data on a customer level - so that I have one row per customer, and the total amount they've spent with us. Using this distribution of payment data, I fit an appropriate…
2
votes
1 answer

Mutual Information, Kullback Leibler Divergence between two color images

I am working on a project on Image classification using Mutual Information. It requires me to use probability distribution of a color image, either I want to calculate the Mutual Information or the Kullback Leibler Divergence in Matlab. Can anyone…