Feature request/explanation: Gij and Lij calculations from crossTabulation
Hi all,
Thank you so much for the excellent lulcc package. I am attempting to use the crossTabulate function to calculate gain and loss metrics as described by Pontius et al. in their 2004 paper (full pdf available via that link).
I have been able to calculate all of the metrics except for $$ Gij $$ (and its partner statistic $$ Lij $$). I was wondering if anyone might be able to provide some clarification on this calculation? I have generated a crosstab from Time period 1 to Time period 2.
The LaTeX equation is:
$$ G_{ij} = (P_{+j} - P_{jj}) * (P_{i+} / \sum^J_{i=1,i \neq j} P_{i+}) $$
It should be a few relatively straightforward matrix operations, but I'm a bit stuff.
I would be happy to open a PR with this and the other metrics once I have sorted this out!