Understanding the order of operations in an equation

41 Views Asked by At

So I have an equation which I further need to program into R. But before starting the programming I need to understand what is actually happening in the equation and in what order it must be solved. As I am not a mathematician it is not obvious. The equation itself is a construction of an empirical copula $C_n$, where observed data is first transformed to uniform data on $[0,1]$ and then ranked to calculate $C_n$. Here is the equation (it is from Genest and Favre 2007):

$$ C_n(u_1i, u_2i, u_3i) = \frac{1}{n} \sum_{i=1}^{n}I(\frac{R_i}{n+1}\leq u_1i, \frac{S_i}{n+1}\leq u_2i,\frac{T_i}{n+1}\leq u_3i) $$

where $n$ is a sample size, $I(A)$ denotes the indicator variable of the logical expression $A$ and takes the value of 0 if A is false. $C_n$ is a trivariate copula with three variables. The ranks of variables are represented as $R_i$, $S_i$ and $T_i$.

Questions:

I do not quite understand how the part $\frac{R_i}{n+1}\leq u_1i$ should be programmed and what it does. Does it compare the rank of every observation over samples size to original observation? And what is the role of $I$ and what happens if $I$ takes a value of zero? I would really appreciate if someone could bit by bit explain what is happening in this equation.Thanks!