I have two sets of data (temperature and catch) and I am following a proposed method in an article I am reading on the empirical cumulative function (ECDF) analysis. Firstly, I have derived the ECDF for my temperature data using the ecdf function in R. The second step was to get the catch-weighted cumulative distribution for temperature, which I honestly cannot understand the concept.
$$
W(t)=\frac1n\sum_{i=1}^n\frac{y_i}{y}I_{\{x_i\}}
$$
where $y_i$ is the catch for day $i$; $y$ mean is the average of catch for all days and $I_{\{x_i\}}$ is the indication function.
How do I compute for this curve?
Best Answer
Here are a couple of base R suggestions, one for where the weights are integers but not too large and the second for where the weights are simply positive
So the unweighted ecdf looks like
and the first weighted ecdf looks like
and the second weighted ecdf looks like