# Estimation of Density Function from a Transformed CDF [closed]

Suppose I can observe $x_1,...,x_n$ as the realization of the random variables $X_1,..,X_n$. Using $x_1,...,x_n$, I can estimate the empirical cumulative distribution function (CDF), $F_n(x)=\sum_{i=1}^n\frac{I(x_i\leq x)}{n}$. Now, with a given $\lambda$, I can transform this CDF by using the Wang transform which is $F^*(x)=\Phi\big[\Phi^{-1}(F_n(x))-\lambda\big]$, where $\Phi(.)$ is the cdf of standard normal distribution.

Question: How can I estimate the $f^*(x)$ (i.e. the probability density function under the new transformation) using $F^*(x)$? Is there any package in R to do that?

• Well the obvious (perhaps naive) estimate would be the $\hat{F^*}$ obtained by applying $F^*$ to $\hat{F}$; obviously that doesn't work for places where $\hat{F}$ is 0 or 1, though the usual methods of dealing with percentiles/percentile ranks in QQ plots and such could be applied (the $(i-\alpha)/(n+1-2\alpha)$ kinds of things in place of $\hat{F}$). – Glen_b Mar 10 '13 at 2:41
• I really don't get what you mean. – Stat Mar 10 '13 at 2:56
• I think part of the issue is you're talking about ecdfs then saying you want to estimate pdfs. I was confused by that and focused on estimating $F^*$, rather than $f^*$ there. Now ecdfs are discrete estimates of $F$, pdfs aren't either of those things. My comment is not an adequate answer and should probably be ignored. – Glen_b Mar 10 '13 at 3:01

Since $F_n$ is discrete, you cannot talk about a density. $F^*$ is the cdf of a discrete distribution.

I would suggest using a continuous distribution estimator, such a kernel estimators, instead of the EDCF. Using this, you can simply differentiate the expression of interest. You will get an expression that will require the estimation of a PDF and a CDF. Both can be done using kernel estimators. They can be implemented in R using the package kerdiest and the default packages.

• No buddy, that's not true. $F^{*}$ is a distribution function of a new random variable that has a density. I need to estimate this density. – Stat Mar 10 '13 at 2:51
• Nope, it depends on a discrete estimator: the ECDF (hint: its jumps at each observation). See my recommendation. – Filth Mar 10 '13 at 2:51
• I am not arguing with you. Good luck. – Filth Mar 10 '13 at 3:16

I originally came to post something like this answer but got distracted by the details of the way the question was asked. Apologies.

If you take a kernel estimate of $f$, then the density of a transformation ($W=T(X)$) of $X$, $f_W(w)$ can be estimated from the Jacobian and $f(T^{-1}(x))$. That is, you can transform a kernel density estimate just as you would any other density. [I use such a trick when dealing with nearly lognormal random variables (transforming data by taking logs, doing a standard KDE and then transforming the estimate back via the above trick) - it often - but not always - results in density estimates that behave nicely, and the need for wider bandwidths at the right than at the left is automatically handled.]

e.g. see p3 here (the reference to theorem 11 of p200 of MGB is presumably a reference to 'Mood, Graybill and Boes, Introduction To The Theory Of Statistics')