| rkt_ecdf | R Documentation |
Calculate an empirical cumulative distribution function based on a sample x and optionally a vector w of weights.
rkt_ecdf(x, w)
## S3 method for class 'rkt_ecdf'
print(x, ...)
## S3 method for class 'rkt_ecdf'
mean(x, ...)
## S3 method for class 'rkt_ecdf'
variance(x, ...)
## S3 method for class 'rkt_ecdf'
plot(x, ...)
x |
Numeric vector containing the sample. Alternatively, if |
w |
Optional. Numeric vector containing the weights of each value in |
... |
Further parameters. |
The weights vector w can contain the counts of each distinct value in x, this is the most natural use case.
In general the weights are describing the jumps of the final ecdf. Normalization is handled internally.
If x contains duplicates, corresponding values in w will be summed up.
Only positive weights are allowed. Elements in x with non-positive weights will be ignored.
A function of class rkt_ecdf.
require(ROCket)
plot(rkt_ecdf(rnorm(100)))
plot(rkt_ecdf(c(0, 1)))
plot(rkt_ecdf(c(0, 1), c(1, 10)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.