Extraction of ordinate and abscissa using CDF


I have two dataframes i.e. ref and observed.
I would like to extract ordinate and abscissa for each observed 's rain value from the cumulative distribution function (CDF) of each month of ref's rain_total.

id1 <- "1JvSG10RmHbxamhvvWEVyb0AzK_9bC_2m"

                         "&export=download"),col_names = TRUE) 

ref=ref %>% 

                         "&export=download"),col_names = TRUE) 

I used the following code for CDF using 1st month

cdf <- as.data.frame(Ecdf(ref$rain_total))
plot(cdf, type="l")

Trial for ordinate and abscissa extraction:

#quantile at 20%, 50% and 80%
quantile(ecdf(ref$rain_total), c(0.2, 0.5, 0.8))

# ordinate for value 2.54,15,45
predict(loess(cdf$y ~ cdf$x), c(2.54, 15, 45))

This solution does provide a value higher than the expected value like for ordinate at 45 should not >1 and quantile 50% should be <5.08 which is not a good condition in mine case.
I will be grateful if I can get another approached like extracting from the line plot instead of the step function which I have tried.


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.