Questions tagged [cdf]

CDF is an acronym for cumulative distribution function. While the pdf gives the probability density of each value of a random variable, the cdf (often denoted F(x)) gives the probability that the random variable will be less than or equal to a specified value.

A cumulative density function describes the probability that a real-valued random variable X with a given probability distribution will be found at a value less than or equal to x.

The cdf of a discrete random variable is the summation of the probability mass function (pmf) of that distribution. If the random variable is continuous, this turns out to be the integral of the probability density function (pdf).

enter image description here

In applied statistics, cdfs are important in comparing distributions, playing a role in plots (e.g., pp-plots), and hypothesis tests (e.g., the Kolmogorov-Smirnov test).

Strongly related to


Common Data Format

Please pay attention another acronym for CDF is describe in and here is the NASA link for more details.

341 questions
4
votes
1 answer

CDF to test the distribution of nodes in R

Hi I'm struggling to get a CDF plot from a function in R. Context: I've produced a graph and done a log-log plot of the degree distribution of the nodes, which seems to follow a power-law. But I want to do the CDF on a log scale as an added…
pandanotp
  • 41
  • 8
4
votes
2 answers

How to smooth ecdf plots in r

I have a df with 5 variables, head(df,15) junc N1.ir N2.ir W1.ir W2.ir W3.ir 1 pos$chr1:3197398 0.000000 0.000000 0.000000 0.000000 0.000000 2 pos$chr1:3207049 0.000000 0.000000 0.000000 0.000000 0.000000 3 …
4
votes
2 answers

How to make a CDF from a histogram in MATLAB

I am trying to create function that takes a histogram and makes a CDF from it. However I cannot use the cdfplot function in Matlab. How would I go about doing this? This produces the input histogram: x = randn(1000,1); nbins = 25; h =…
Sari
  • 101
  • 1
  • 2
  • 5
4
votes
1 answer

Create a quantile function given a discrete CDF in R that can handle

So for example, I have a discrete function with a CDF as follows: cdf <- c(0.00, 0.35, 0.71, 0.92, 1.00, 1.00, 1.00, 1.00) I can create a sort of quantile function with the following line . . . result <- which(cdf == min(cdf[cdf > x])) . . . where…
timbo
  • 1,533
  • 1
  • 15
  • 26
4
votes
0 answers

cdf for Dirichlet distribution

I want to run an estimation assuming that my variables are distributed according to the Dirichlet distribution. To do so, I need to use the cdf function. For all the distributions in R, there are the respective r,p and d functions that produce…
KGeor
  • 107
  • 6
3
votes
2 answers

calculate probability and draw a cdf in Excel

Now I have a column of data like this: 0.000000 0.000000 0.000000 0.000000 0.024995 0.024996 0.024996 0.024997 0.024997 0.024997 0.024997 0.025004 0.025010 0.025011 0.025996 0.025996 0.025996 First I want to calculate the cumulative probability of…
manxing
  • 3,165
  • 12
  • 45
  • 56
3
votes
2 answers

how to draw guide lines on a gnuplot generated cdf?

At work have a set of floating point values that I sort and compute a CDF for and plot within gnuplot. I'd like to draw a line showing where the 80% and 90% thresholds of the CDF are, i.e. a line coming in from the left @ the 0.8 y tic mark,…
highbandwidth
  • 156
  • 1
  • 6
3
votes
0 answers

mzcdf2peaks does not accepts given data created by mzcdfread in Matlab r2020a

So I have the following code and error: >> data = mzcdfread('sample1.cdf'); Reading filename: sample1.cdf Number of dimensions: 11 Unlimited Dimension: 8 Number of variables: 12 Number of attributes: 10 Exploring global netCDF attributes: …
Marci
  • 57
  • 8
3
votes
1 answer

Trying to interpolate the output of a histogram function in Python

What I am trying to do is to play around with some random distribution. I don't want it to be normal. But for the time being normal is easier. import matplotlib.pyplot as plt from scipy.stats import norm ws=norm.rvs(4.0, 1.5, size=100) density,…
3
votes
1 answer

computing the maximum point-wise distance of both CDFs

I have 2 CDF and have to find the maximum pointwise distance. I created histograms and plotted both. The values are generated by a random function which takes the sum of two random numbers 1-6 for 100 times, similar to two dice. But, I can't manage…
3
votes
1 answer

Heavy tail distribution - Weibull

I know that the Weibull distribution exhibits subexponential heavy-tailed behavior when the shape parameter is < 1. I need to demonstrate this using the limit definition of a heavy tailed distribution: for all How do I incorporate the cumulative…
ejf071189
  • 613
  • 1
  • 6
  • 8
3
votes
3 answers

defining the X values for a code

I have this task to create a script that acts similarly to normcdf on matlab. x=linspace(-5,5,1000); %values for x p= 1/sqrt(2*pi) * exp((-x.^2)/2); % THE PDF for the standard normal t=cumtrapz(x,p); % the CDF for the standard…
Rey
  • 33
  • 4
3
votes
1 answer

Sampling from multivariate customised cumulative distribution function in Matlab

Consider a 5-variate cumulative distribution function (cdf) which I call F. I want to sample random 5x1 vectors from this cdf in Matlab. F is not a cdf that has been already implemented in Matlab (such as normal, t-student, etc.). Specifically, it…
TEX
  • 2,249
  • 20
  • 43
3
votes
1 answer

scikitlearn- How can I get cdf of a gaussian mixture model?

Right now I do something like this, and im wonedring if there are better ways. import numpy as np from scipy import integrate from sklearn.mixture import GaussianMixture as GMM model = GMM(n, covariance_type = "full").fit(X) def cdf(x): return…
h3h325
  • 751
  • 1
  • 9
  • 19
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
1
2
3
22 23