[R] ecdf manipulation
Martin Maechler
maechler at stat.math.ethz.ch
Sat Aug 16 17:50:32 CEST 2008
>>>>> <harryandlaura at talktalk.net>
>>>>> on Fri, 15 Aug 2008 00:51:56 +0100 writes:
> I’m using the edcf function to look at a number of
> empirical distributions graphically for run-time analyses
> of stochastic optimization algorithms. When dealing with
> problems where the optimal solution for these problems is
> always found everything is fine and the graphs are very
> useful for comparative observations. These distributions
> have a vertical axis height of one i.e. a probability of
> one. However, I’ve hit a problem when the optimal
> solution is not always obtained during the allotted
> run-time. In the cases I’m looking these graphs are
> only concerned with the behaviour those runs that find the
> optimal solution.
> e.g. say we have two algorithms one solves a given problem
> 1000 times out of 1000 runs and the second solves the same
> problem 800 times out of 1000 runs then the first plot
> rises from 0 to 1 where as the second should only rise to
> 0.8
> One idea is that the ecdf R code relies upon the number of
> samples n (1000 in this case) is it possible to manipulate
> this R code and pass an extra argument to have n defined
> when the function is called, opposed to the value of n
> being set to the size of the vector being passed in as
> appears to be the current case, whilst maintaining its
> graphical capability?
Yes, this is possible
{ install.packages("fortunes"); fortunes::fortune("Yoda") }
> If so how and where do I get hold of the ecdf R code to
> manipulate?
https::/svn.r-project.org/R/trunk/src/library/stats/R/ecdf.R
always has the (R-devel version of the) ecdf code;
you may also want to study the stepfun code in stepfun.R (same
directory) which is made use of by ecdf and its methods.
Martin Maechler,
ETH Zurich
> If not then does anyone have any suggestions?
> Thanks
> Harry Venables
More information about the R-help
mailing list