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

Base R Function Convolution

I am building a collection of functions which return probability density functions (pdfs) from the pdfs of two independent random variables. The most common example of this would be the sum of independent random variables X, Y which is given by the…
owen88
  • 454
  • 3
  • 12
3
votes
2 answers

How to random sample lognormal data in Python using the inverse CDF and specify target percentiles?

I'm trying to generate random samples from a lognormal distribution in Python, the application is for simulating network traffic. I'd like to generate samples such that: The modal sample result is 320 (~10^2.5) 80% of the samples lie within the…
4Oh4
  • 2,031
  • 1
  • 18
  • 33
3
votes
1 answer

efficient numpy.cumsum and numpy.digitize

Given a matrix of values that represent probabilities I am trying to write an efficient process that returns the bin that the value belongs to. For example: sample = 0.5 x = np.array([0.1]*10) np.digitize( sample, np.cumsum(x))-1 #returns 5 is the…
geompalik
  • 1,582
  • 11
  • 22
3
votes
2 answers

How can I display empirical pdf of my 100x1 vector data in Matlab?

I have a data which is 100x1 vector. How can I display its empirical pdf in Matlab? Also, if I want to compare the pdf of three vectors on the same graph, then how to do that? Right now I am using pdfplot.m file to plot my empirical pdf, however…
user238469
3
votes
1 answer

Can continuous random variables be converted into discrete using scipy?

If I initialize a subclass of scipy.stats.rv_continuous , for example scipy.stats.norm >>> from scipy.stats import norm >>> rv = norm() Can I convert it into a list of probabilities with each element representing the probability of a range of…
Yashu Seth
  • 935
  • 4
  • 9
  • 24
3
votes
1 answer

Using MATLAB's chi2gof with non-standard user-specified PDFs

I would like to use MATLAB's chi2gof to perform a chi-square goodness-of-fit test. My problem is that my assumed (i.e., theoretical) distribution is not one of the standard built-in probability distributions in MATLAB. The specific form of my…
3
votes
2 answers

How can I get the probability density function from a regression random forest?

I am using random-forest for a regression problem to predict the label values of Test-Y for a given set of Test-X (new values of features). The model has been trained over a given Train-X (features) and Train-Y (labels). "randomForest" of R serves…
Rotail
  • 1,025
  • 4
  • 19
  • 40
3
votes
1 answer

R plot density ggplot vs plot

I am using the density function in R and then computing some results from the obtained densities. After that, I use the ggplot2 to display the PDFs of the same data. However, the results are slightly different from what is shown in the respective…
Panda
  • 155
  • 8
3
votes
2 answers

Generate random samples from arbitrary discrete probability density function in Matlab

I've got an arbitrary probability density function discretized as a matrix in Matlab, that means that for every pair x,y the probability is stored in the matrix: A(x,y) = probability This is a 100x100 matrix, and I would like to be able to generate…
3
votes
3 answers

Probability Distribution of each unique numbers in an array (length unknown) after excluding zeros

Part of my datafile looks as ifile.txt 1 1 3 0 6 3 0 3 3 5 I would like to find probability of each numbers excluding zeros. e.g. P(1)=2/8; P(3)=4/8 and so on Desire output ofile.txt 1 0.250 3 0.500 5 0.125 6 0.125 Where 1st column shows the…
Kay
  • 1,957
  • 2
  • 24
  • 46
3
votes
1 answer

R - Get joint probabilities from 2D Kernel Density Estimate

I have two vectors S and V, and using the function kde2d, I get the following plot of their joint density: Using this data, is it possible to obtain an empirical estimate of the joint probability, in the form P(S[i],V[j]) ? In the question How to…
user3294195
  • 1,748
  • 1
  • 19
  • 36
3
votes
6 answers

Sorting list from smallest-largest-smallest in Java

I'm trying to sort a set of data so that it looks like a histogram of a probability distribution function (I'm assuming normally distributed for the moment). I have a list of entries: private static final class SortableDatasetEntry{ Number…
Zack Newsham
  • 2,810
  • 1
  • 23
  • 43
3
votes
1 answer

Probability density function with javascript d3 and dc

I'm trying to create a probability density function of a dataset using Javascript, (d3 and dc libraries) (similar to density function of R) but I have not found how can I do it. Can it be done? Thanks PD: With jqplot is this:…
fhuertas
  • 4,764
  • 2
  • 17
  • 28
3
votes
2 answers

Why Gauss filter chooses such values?

Gauss filter is a famous image denoising tool in image processing domain. I saw lots of opensource software choose the template like this: Where do these value come from?
tidy
  • 4,747
  • 9
  • 49
  • 89
3
votes
2 answers

matlab - pdf for multivariate uniform distribution

The pdf for the multivariate normal distribution in MATLAB is mvnpdf(...). What about the case where multiple variables are uniformly distributed: Is there a function to describe their joint distribution analogous to the multivariate normal…
Shehroz
  • 347
  • 2
  • 9
  • 25