I fitted a empirical distribution to a set of time series data (Y) by following code in R:
Ye=rank(Y)/(length(Y)+1)
How we can find the inverse of this distribution? Thanks
Basically answered in comments, recollected here:
An ECDF has right inverses but no left inverses; sometimes the former is good enough when an inverse is needed. (A function 𝑓 has a right inverse 𝑔 when 𝑓(𝑔(𝑦))=𝑦 for all 𝑦 in the image of 𝑓.) The right inverse can be found with a binary search or its equivalent. I cannot tell from the information given so far whether a right inverse would be suitable in this situation. – whuber
ecdf
function. 2) The function doesn't have an actual inverse. What did you need it for? Random sampling? $\endgroup$sample
) $\endgroup$sample
withreplace=TRUE
(of course). $\endgroup$