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
4
votes
3 answers

Riemann sum of a probability density

I am trying to find the probability of an event of a random variable past a specific value, i.e. pr(x>a), where a is some constant, typically much higher than the average of x, and x is not of any standard Gaussian distribution. So I wanted to fit…
Niklas Lindeke
  • 380
  • 1
  • 7
  • 24
4
votes
1 answer

normpdf behaves strangely

In the following manner, function ret = f(pIx5, dS) sigma = 1; rho = dS(1); theta = dS(2); mu_x = rho*cos(theta); display(pIx5); display(mu_x); pdf = normpdf(pIx5, mu_x, sigma); ret = max(pdf); end I get…
user366312
  • 16,949
  • 65
  • 235
  • 452
4
votes
2 answers

how to calculate PDF in tensorflow

In Matlab, I can calculate the probability density function(PDF) of Gaussian distribution by using x = [0.8147,0.9058,0.1270,0.9134,0.6324,0.0975,0.2785,0.5469,0.9575,0.9649] y = normpdf(x,1.0,2.5) output: y = 0.1591 0.1595 0.1501 0.1595…
Raady
  • 1,686
  • 5
  • 22
  • 46
4
votes
2 answers

Can't get y-axis on Matplotlib histogram to display probabilities

I have data (pd Series) that looks like (daily stock returns, n = 555): S = perf_manual.returns S = S[~((S-S.mean()).abs()>3*S.std())] 2014-03-31 20:00:00 0.000000 2014-04-01 20:00:00 0.000000 2014-04-03 20:00:00 -0.001950 2014-04-04…
Joël
  • 162
  • 1
  • 9
4
votes
0 answers

Get representative values from 2d density

How do you get N pairs of values, which represent a joint probability (2d density) of a much larger pairs of values? I do MCMC sampling on parameters of a function, and I want to visualize the posterior density of that function by plotting, say, 20…
Jonas Lindeløv
  • 5,442
  • 6
  • 31
  • 54
4
votes
2 answers

How to generate a 2D random vector in MATLAB?

I have a non-negative function f defined on a unit square S = [0,1] x [0,1] such that My question is, how can I use MATLAB to generate a 2D random vector from S according to the probability density function f?
mononono
  • 161
  • 6
4
votes
1 answer

Plotting histogram with theoretical curve: Random realization

I need to write a program that generates random realizations of the Cauchy distribution with null location and unit scale. Also I need to make a histogram between -5 and 5 bins, for a random realization of 1,000 points, together with the…
4
votes
3 answers

Probability density function numpy histogram/scipy stats

We have the arraya=range(10). Using numpy.histogram: hist,bins=numpy.histogram(a,bins=(np.max(a)-np.min(a))/1, range=np.min(a),np.max(a)),density=True) According to numpy tutorial: If density=True, the result is the value of the probability…
DimKoim
  • 1,024
  • 6
  • 20
  • 33
4
votes
3 answers

Multiply Probability Distribution Functions

I'm having a hard time building an efficient procedure that adds and multiplies probability density functions to predict the distribution of time that it will take to complete two process steps. Let "a" represent the probability distribution…
Jonathan
  • 491
  • 5
  • 19
4
votes
1 answer

Estimate pdf of a vector using Gaussian Kernel

I am using Gaussian kernel to estimate a pdf of a data based on the equation where K(.) is Gaussian kernel, data is a given vector. z is bin from 1 to 256. size of bin is 1. I implemented by matlab code. However, the result show the amplitude of…
4
votes
2 answers

Overlapping stacked density plots

I'm trying to achieve a similar plot to this one, using R's native plot command. I was able to get something similar with the code below, however, I'd like the density polygons to overlap. Can anyone suggest a way to do this? data = lapply(1:5,…
Omar Wagih
  • 8,504
  • 7
  • 59
  • 75
4
votes
1 answer

Showing major peaks in densities across facets using R

I am trying to plot distributions/densities of data, using ggplot within facets. Here is what I have right now where the red line shows the mean with mean value shown in each facet. Now here, mean values do not make sense, I wish to have similar…
user1777527
  • 63
  • 1
  • 4
4
votes
1 answer

Generating a probability from a pdf?

I have some data that is normally distributed and to which I have fitted a pdf. However, I want to get the probability of the likelihood of a given value from the dataset occurring. From my understanding, this is the area of the bin under the pdf…
GeoMonkey
  • 1,615
  • 7
  • 28
  • 56
4
votes
1 answer

Python Joint Distribution of N Variables

So I need to calculate the joint probability distribution for N variables. I have code for two variables, but I am having trouble generalizing it to higher dimensions. I imagine there is some sort of pythonic vectorization that could be helpful,…
The Dude
  • 661
  • 2
  • 11
  • 20
3
votes
2 answers

How to get a probability density function from vector?

I have a vector that I want to transform into a probability density function. The mean is 1. How do I plot this? The vector: x <- c(0.7601401, 0.8607037, 0.8748152, 0.885415, 0.8904619, 0.899021, 0.9034128, 0.9050411, 0.9093876, 0.9141021,…
wokter
  • 226
  • 3
  • 14