raff-k / RainSlide

Rainfall-induced landslide analysis tools
GNU General Public License v3.0
3 stars 0 forks source link

Z scores #7

Closed ernesto561 closed 1 year ago

ernesto561 commented 1 year ago

Sorry for so many issues. I have been checking the z scores in thresh, which are calculated with this formula:

sigma.coef <- stats::qnorm((1 + (1 - prob.thresh * 2))/2)

Which is here: thresh.R#L50.

I have tried to compare them with the ones in CTRL-T, which are hardcoded:

sigma.coef<-c(0.7552,.8415,.9345,1,1.0364,1.1504,1.2817,1.34,1.405,1.4398,1.475, 1.555,1.6452,1.6958,1.7511,1.8123,1.8812,1.9607,2,2.0542,2.1705,2.3268,2.5762,3.0905,3.91,0.3849)

I have tried different non-exceedance probabilities and I don't get the same results. I don't know If I am missing something.

raff-k commented 1 year ago

I remember that I was also wondering where they got these values from (and I found it out, but forgot it in the meanwhile). Anyway, if you check stats::qnorm(percentage.values) or stats::qnorm((1 + (1 - quant *2))/2) (variables from CTRL-T), you will find that the values they toke correspond to a given probability value.

For example, for 0.05 -> 1.644854; there are also some Standard Normal Distribution Z-Score Calculator to get the score.

Maybe you ask the authors of CTRL-T where the values come from.

ernesto561 commented 1 year ago

Thanks for your answer. You are right. If qnorm(0.95) is calculated, the result is 1.644854, but the closest value in the CTRL-T hardcoded values is 1.6452. As you said, this is related to the CTRL-T code implementation, so I'll close this issue.