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

How to plot a Complementary Cumulative Distribution Function (CCDF) in R (preferbly in ggplot)?

Here is my code and my output (CDF): install.packages("ggplot2") library(ggplot2) chol <- read.table(url("http://assets.datacamp.com/blog_assets/chol.txt"), header = TRUE) df <- data.frame(x = chol$AGE) ggplot(df, aes(x)) + stat_ecdf() I'd like…
Übel Yildmar
  • 491
  • 1
  • 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
0 answers

PDF from CDF in Python

Does anybody know if there is a tool to compute PDF from CDF in Python on arbitrary grid and for CDF of arbitrary number of variables. PDF - probability distribution function CDF - cumulative distribution function
user1700890
  • 7,144
  • 18
  • 87
  • 183
3
votes
1 answer

Scipy Weibull CDF calculation

I'm doing survival calculations in Scipy and can't get the correct values. My code: x, a, c = 1000, 1.5, 5000 vals = exponweib.cdf(x,a,c,loc=0,scale=1) vals should equal 0.085559356392783004, but I'm getting 0 instead. If I define my own function…
Brandon Booth
  • 31
  • 1
  • 3
3
votes
2 answers

Cumulative Normal Distribution Function in C/C++ with parameters

I want to implement equivalent of matlab normcdf function in C++, I have already found this useful post: Cumulative Normal Distribution Function in C/C++ pointing to this implementation http://www.johndcook.com/cpp_phi.html. But I want it with…
Michal
  • 1,955
  • 5
  • 33
  • 56
3
votes
2 answers

How to plot PDF and CDF for a normal distribution in matlab

I couldn't find a function in matlab that implement gets mean and standard deviation of normal distribution and plot its PDF and CDF. I am afraid the two functions I have implemented bellow are missing something, since I get maximal value for…
0x90
  • 39,472
  • 36
  • 165
  • 245
3
votes
1 answer

Interpolating with multiple y-values

I'm trying to interpolate a quantile function (inverse CDF) from a set of x (quantiles) and y (values) samples, using several methods from scipy. Since it is a quantile function, the values sometimes repeat themselves. For example, the CDF…
ohad
  • 353
  • 3
  • 12
3
votes
1 answer

Use the cumulative distribution function of Weibull in R

I have to simulate a system's fail times, to do so I have to use the Weibull distribution with a "decreasing hazard rate" and a shape of "0.7-0.8". I have to generate a file with 100 results for the function that uses random numbers from 0 to 1. So…
Golan_trevize
  • 2,353
  • 5
  • 22
  • 22
3
votes
1 answer

In MATLAB (cumulative distribution function), how can I find the corresponding data point (Y) for any chosen cumulative probability?

In a CDF (using MATLAB) how can I find the corresponding data value (X) for any chosen cumulative distribution (Y)? Please refer to the pasted code (I would post an image but I need a "10 reputation"). Instead of "eye-balling" the plot, how can I…
3
votes
1 answer

Performing KS.test on empirical weighted distribution functions in R

I want to compare two datasets with differing amounts of data and differing start/end points. I wanted to use the KS.test as I am doing something similar in a C program I wrote (compares data via GSL histogram -> GSL cdf -> self-written KS test) but…
Bas Jansen
  • 3,273
  • 5
  • 30
  • 66
3
votes
1 answer

histogram matching in Python

I am trying to do histogram matching of simulated data to observed precipitation data. The below shows a simple simulated case. I got the CDF of both the simulated and observed data and got stuck theree. I hope a clue would help me to get…
user1142937
  • 314
  • 5
  • 19
3
votes
1 answer

How to plot CDF in R

I am trying to plot a CDF plot using ecdf() function using the following code: > x<-ecdf(data$V6) > summary(x) Empirical CDF: 2402 unique values with summary Min. 1st Qu. Median Mean 3rd Qu. Max. 3392 71870 120100 …
Nasir
  • 1,982
  • 4
  • 19
  • 35
2
votes
1 answer

How do I chart categorical, cumulative, and time-dependent data?

I have a bunch of time-dependent data, non-decreasing and right-continuous, always with come category involved, that can be repeated. I am looking for a sort of a variable width-bar chart, or cascade chart, flipped on it's side, from the right. For…
Neil
  • 1,767
  • 2
  • 16
  • 22
2
votes
3 answers

Plotting CDF and PDF in R with custom function

I was wondering if there was any way to plot this PDF and CDF in R. I found these on a different question a user asked, and was curious. I know that I have to create a function and then plot this, but I'm struggling with the different parameters…
2
votes
1 answer

How to get the Cumulative Distribution Function with PyMC3?

I am trying to recreate the models in John Kruschke's 'Doing Bayesian Data Analysis' and am currently trying to model ordinal data (chapter 23 in the book. This is the JAGS model that I'm trying to recreate: total = length(y) #Threshold 1 and…
NotSinJicx
  • 21
  • 3
1 2
3
22 23