Creates an emperical cumulative distribution function (ECDF) overlaid with a cumulative distribution function (CDF)
chart.ECDF(
R,
main = "Empirical CDF",
xlab = "x",
ylab = "F(x)",
colorset = c("black", "#005AFF"),
lwd = 1,
lty = c(1, 1),
element.color = "darkgray",
xaxis = TRUE,
yaxis = TRUE,
...
)
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
set the chart title, same as in plot
set the x-axis label, same as in plot
set the y-axis label, same as in plot
color palette to use, defaults to c("black", "#005AFF"), where first value is used to color the step function and the second color is used for the fitted normal
set the line width, same as in plot
set the line type, same as in plot
specify the color of chart elements. Default is "darkgray"
if true, draws the x axis
if true, draws the y axis
any other passthru parameters to plot
Peter Carl
The empirical cumulative distribution function (ECDF for short) calculates
the fraction of observations less or equal to a given value. The resulting
plot is a step function of that fraction at each observation. This function
uses ecdf
and overlays the CDF for a fitted normal function as well.
Inspired by a chart in Ruppert (2004).
Ruppert, David. Statistics and Finance, an Introduction. Springer. 2004. Ch. 2 Fig. 2.5
data(edhec)
chart.ECDF(edhec[, 1, drop=FALSE])
Run the code above in your browser using DataLab