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
1
vote
1 answer

how an ecdf object can be used inside an R package?

I am trying to build an R package and it has several ecdf objects in it. They have been created by ecdf(some variables such as p1). I put them in a list and save that as rda file in data folder, however when I run the function inside the package…
user2774905
  • 53
  • 1
  • 5
1
vote
1 answer

plot multiple cumulative percentage graph by groups

I have data looks like: zip ID count 230 B 12 230 A 10 230 C 9 230 D 5 270 C 10 270 A 9 270 B 8 290 C 9 290 A 8 290 B 6 zip and ID are factor and count is numeric.…
kuki
  • 303
  • 2
  • 6
  • 15
1
vote
1 answer

Changing the size of the text in the axis labels of an Ecdf plot

I've constructed an Ecdf plot from the Hmisc package with the following call: require(Hmisc) Ecdf(latency_targ1, group = CONDITION, lty = c(1, 2, 3, 4), lwd = 4, label.curves = list(method = 'arrow', keys = "lines", lwd = 2), xlim…
skleene
  • 389
  • 3
  • 13
1
vote
1 answer

Warning error of "plot.new has not been called yet" when attempting to plot ecdf for a variable

I am having difficulty plotting an ECDF function for a variable. The simple code below provides an example; A = rnorm(100) plot(ecdf(A), abline(v=c(-1,1,1.5))) When I attempt to plot the function with vertical lines the warning message…
McIlwaine
  • 11
  • 1
  • 1
  • 2
1
vote
2 answers

How I do manually change the key labels values in a legend in ggplot2?

I wonder how I can change the key labels in the legend box. I need replace the values 1 by the word " Activo" and the values 2 by the world "Inactivo" I tried to use scale_fill_discrete but It does not work This is a sample of the data frame …
gmoazocar
  • 21
  • 1
  • 6
1
vote
1 answer

ecdf() function in Matlab not giving all the values in output

I computed CDF of my empirical distribution using ecdf() function in Matlab for a distribution with 10,000 values. However, the output that I get from it contains only 9967 values. How can I get total 10,000 values for my CDF? Thanks.
user238469
0
votes
0 answers

ecdf plot in R with categorical data for comparison

I would like to understand why my ecdf plot starts with values below 0. I wanted to create a plot that shows how many occurrences happened in fixed intervals of 5 minutes in all sessions to make a comparison among them. The data used for the…
Jo-Achna
  • 315
  • 1
  • 3
  • 14
0
votes
0 answers

R error with MEPDF package inside function cube

I want to build a bivariate empirical distribution function. I have found the package MEPDF which does the job I want, however I get an error even while using the example available from the help. Here is a documentation for this package with the…
0
votes
0 answers

How can I compute the area between two cdfs in R?

I have two cdfs plots as shown below and I need to compute the area between two curves. So, the red one can be either completely below green one or completely above it or crossing the green one as shown in the image. For the case when two plots are…
Nmgh
  • 113
  • 7
0
votes
0 answers

Calcualting the empirical distribution function using statsmodels yields error

I would like to plot an empirical distribution function using statmodels. I tried what is advised here How to plot empirical cdf (ecdf): import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt price_values = [[4.2], …
PeterBe
  • 700
  • 1
  • 17
  • 37
0
votes
1 answer

Adding more information to an eCDF plot in R

I used the following code to get a eCDF plot: df %>% group_by(group1, group2) %>% summarise(n = length(unique(sessionID))) %>% ggplot(aes(n)) + stat_ecdf(geom = "step") + scale_x_continuous(n.breaks = 30) + theme_classic() I would like…
user2845095
  • 465
  • 2
  • 9
0
votes
1 answer

create and plot a cumulative probability density function with custom bin # and sizes of stock price ROC in R

I want to import daily stock market price data into R from any ticker, and examine one historical time segment of it. Then, from this segment, convert these prices into daily ROC/rateofchange % changes. Next, take this ROC series and create a…
0
votes
1 answer

How to produce an inverse ecdf plot with counts rather than proportions using ggplot2

I am working with a dataset which contains information about individual treatment episodes. In the dataframe treatment, each row is a separate treatment episode containing a patient key (amongst other information). I would like to produce a plot…
Mark
  • 119
  • 8
0
votes
0 answers

KDE Confidence Interval

Can anyone help with below code? My code as below In[152]: sample = kde.resample(43826) 5 ** np.percentile(sample, 5) In[153]: def resample_kde_percentile(kde): sample = kde.resample(kde.n) return 5 ** np.percentile(sample,…
LOCKI_suj
  • 11
  • 1
  • 4
0
votes
1 answer

Filling out between to ECDF (step) plots in python?

I have two data sets, and need to create the ecdf plot, which I have done by: # sample data df1000=np.random.exponential(1, 1000) df10000= np.random.exponential(1, 10000) def ecdf(data): """Generate x and y values for plotting an ECDF.""" …
Parviz
  • 111
  • 3