earthnet2021 / earthnet-models-pytorch

EarthNet Models PyTorch - Deep Neural Networks for geospatial vegetation forecasting.
https://www.earthnet.tech/
MIT License
29 stars 6 forks source link

Difference on NSE and R2 #45

Closed walking-shadow closed 6 months ago

walking-shadow commented 9 months ago

The calculation formulas for NSE and R2 are essentially the same, but their purposes are different. Why are the values of these two indicators calculated in the paper different?

vitusbenson commented 9 months ago

they are not calculated identically, R2 = r2, with r the pearson correlation coefficient https://en.wikipedia.org/wiki/Pearson_correlation_coefficient#For_a_sample NSE = Sum((Pred-Targ)2) / Sum((Targ-Mean(Targ))**2) https://en.wikipedia.org/wiki/Nash%E2%80%93Sutcliffe_model_efficiency_coefficient

See https://github.com/earthnet2021/earthnet-models-pytorch/blob/main/scripts/score_en21x_v2.py#L45

walking-shadow commented 9 months ago

Thank you for your explanation. I misunderstood the calculation formula for R2 as 1 - SSE/SST, which is the same as the formula for NSE.