\HeaderA{chart.ECDF}{Create an ECDF overlaid with a Normal CDF}{chart.ECDF}
\keyword{ts}{chart.ECDF}
\keyword{multivariate}{chart.ECDF}
\keyword{distribution}{chart.ECDF}
\keyword{models}{chart.ECDF}
\keyword{hplot}{chart.ECDF}
\begin{Description}\relax
Creates an emperical cumulative distribution function (ECDF) overlaid with a cumulative distribution function (CDF)
\end{Description}
\begin{Usage}
\begin{verbatim}
chart.ECDF(R, main = "Empirical CDF", xlab = "x", ylab = "F(x)", colorset = c("black", "#005AFF"), lwd = 1, xlim = NULL, ylim = NULL, lty = c(1, 1), element.color = "darkgray", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{R}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{main}] set the chart title, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlab}] set the x-axis label, same as in \code{\LinkA{plot}{plot}} 
\item[\code{ylab}] set the y-axis label, same as in \code{\LinkA{plot}{plot}} 
\item[\code{colorset}] 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  
\item[\code{lwd}] set the line width, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlim}] set the x-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{ylim}] set the y-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{element.color}] specify the color of chart elements.  Default is "darkgray" 
\item[\code{lty}] set the line type, same as in \code{\LinkA{plot}{plot}} 
\item[\code{...}] any other passthru parameters to \code{\LinkA{plot}{plot}} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
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 \code{ecdf} and overlays the CDF for a fitted normal function as well.  Inspired by a chart in Ruppert (2004).
\end{Details}
\begin{Value}
chart of an ECDF calculated from the data overlaid with a CDF
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{References}\relax
Ruppert, David. \emph{Statistics and Finance, an Introduction}. Springer. 2004. Ch. 2 Fig. 2.5

\url{http://www.stat.tamu.edu/~ljin/Finance/chapter2/Fig2_5.txt}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{plot}{plot}}, \code{\LinkA{ecdf}{ecdf}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(edhec)
chart.ECDF(edhec[, 1, drop=FALSE])

\end{ExampleCode}
\end{Examples}

