Questions tagged [ecdf]

Empirical Cumulative Distribution Function in statistics

For definition please see its Wikipedia page.

In software, a built-in function ecdf takes a vector of samples and generates its ECDF. It is also easy to produce it ourselves, as given in this example: How to derive an ecdf function?

162 questions
0
votes
1 answer

ECDF plot for all columns in the dataframe in R

I need to plot ECDF's of all columns of the dataframe in one single plot and get an x_limit on the axis too. The function that I wrote: library(lattice) library(latticeExtra) ecdf_plot <- function(data){ # Drop columns with only NA's …
Syed Ahmed
  • 199
  • 1
  • 10
0
votes
2 answers

how to ggplot the CDF of multiple variables in r?

I have the the DF data.frame. I want to plot the cumulative distribution function (CDF) of the variables in DF using ggplot. using the following code produce the plot but because of big range in the data for variables i don't see the plot well. I…
Hydro
  • 1,057
  • 12
  • 25
0
votes
1 answer

How does one calculate the empirical cumulative distribution (ecdf) of an image in Python?

I am trying to calculate the empirical cumulative distribution of images in Python. What is the best practice in doing so? And also I need the result to be stored in an array so that I can use it in further steps of my analysis. I am using this…
Amir Charkhi
  • 768
  • 7
  • 23
0
votes
1 answer

Predicting probability of failure mid life with weibull or ecdf using python

thank you for taking a look at this. I have failure data for tires over a 5 year period. For each tire, I have the start date(day0), the end date(dayn), and the number of miles driven for each day. I used the total miles each car drove to create 2…
jswtraveler
  • 345
  • 6
  • 19
0
votes
1 answer

Combine ECDF plot with histogram in secondary axis ggplot

I have one income variable. I want to make a combination plot of a histogram and cumulative distribution in one plot with two y-axes. I got this code, income<- bi_tr%>% ggplot(aes(x=`12 Income`,na.rm = TRUE))+ #this fill comment goes to define…
0
votes
0 answers

Add secondary axis with cumulative distribution to ggplot R

I would like to add the cumulative distribution to one of my ggplots. Somehow, I fail to get the scaling right. This is the sample: require(ggplot2) set.seed(123456) 'dummy df' df<-data.frame(id=seq(1,100,1),value2= rnorm(100, 1000, 5000)) 'set…
Juan
  • 171
  • 1
  • 12
0
votes
1 answer

Empirical CDF vs Theoretical CDF in R

I want to check the "probability integral transform" theorem using R. Let's suppose X is an exponential random variable with lambda = 5. I want to check that the random variable U = F_X = 1 - exp(-5*X) has a uniform (0,1) distribution. How would…
Luca Dibo
  • 227
  • 1
  • 2
  • 12
0
votes
0 answers

Minimum values in a dataset are not 0th percentile using ecdf function in R

I am tasked with determining the percentile rank of variables in a sample dataset, compared to a reference dataset. In R version 3.6.1, I've found ecdf() does what I want it to do, but I'm running into a problem where percentiles of minimum values…
fwEco
  • 73
  • 1
  • 5
0
votes
1 answer

How to create bins for data then calculate the ecdf?

I have a dataframe (see below) with 4 pieces per machine and a run time for each piece. I would like to bin the run time into bins of every 50 hours then calculate the empirical probability of the run times. I have attempted to expand the grid to…
jackbio
  • 131
  • 7
0
votes
0 answers

How to track points plotted in an ECDF back to an original data frame in R?

So I started with 5 data frames corresponding to different categories. Let's call them d1,d2,d3,d4,d5 defined with the code: d1<-data.frame(runif(1000,0,10000)) d2<-data.frame(runif(1000,0,10000)) d3<-data.frame(runif(1000,0,10000))…
sarwoz
  • 13
  • 2
0
votes
0 answers

R, calculating various levels of ecdf() for list elements

I have a list [list] of several elements, [elem] say 10, each of which contains random values, say 100, in column [values]. I would like to create a table that contains outputs of cumulative distribution, ecdf() function, at various levels of…
wit
  • 63
  • 7
0
votes
1 answer

Is it possible to plot multiple ecdf and cdf in one plot using cdf?

I'm making a cdf for my dataset x,y, and z. How do I put them in one plot? Im using fitdist to obtain the ecdf and cdf for x,y, and z. ## Say if we have x=runif(30) y=runif(30) z=runif(30) ## To fit the distribution I used fitdist …
oric29
  • 3
  • 1
0
votes
1 answer

Save multiple R ggplots ecdf par page into a pdf file with mapply

I compare the empirical CDF of a variable with 3 theoretical CDF. I do this for 150 variables and want to print out the result in a single PDF file with 4 charts per page. I do not use a loop but mapply instead. Ideally, I could use…
Bertrand G
  • 37
  • 6
0
votes
1 answer

the display of ECDF in R

I would like to display a few CDF data (the R code is below), by using a set of numerical BREAKS on a X axis to be shown at EQUAL DISTANCE from each other (although numerically, the BREAKS are on log10 axis and do not reflecting an equal…
Bogdan
  • 345
  • 1
  • 16