raff-k / RainSlide

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

Default value for use.normal parameter in thresh #5

Open ernesto561 opened 1 year ago

ernesto561 commented 1 year ago

In RainSlide::thresh there is an option to avoid fitting to a Gaussian function (use.normal = FALSE). If this option is used, the standard error is calculated as m.PDF.sigma <- sqrt(m.dev/m.res.df) # sqrt(stats::deviance(.)/stats::df.residual(.)), as shown in thresh.R#L176

I understand that if I want to get results more similar to the ones by Rossi et al (2017), Peruccacci et al (2012) or Melillo et al (2018), I should set use.normal = TRUE (correct me if I am wrong). Is there any particular reason why this option was added and the default was set as FALSE? Shouldn't the default be set as TRUE?

raff-k commented 1 year ago

You are right about the results using use.normal = TRUE. The reason is that I see this approach as a kind of non-efficient detour. Residuals are (approximately) normal distributed. Why then to approximate the residuals with a normal distribution, when there is a direct way to get sigma? For me, it introduces more sources of potential uncertainty. - With the alternative, of course, each user can decide for themselves how this is calculated.

Nevertheless, more package documentation would help^^

ernesto561 commented 1 year ago

Thanks for your answer. I understand now. By the way, in the CTRL-T code, the probability density function is estimated with Kernel Density Estimation, but according what I understand, it's not used later (I have seen that you included and commented this line in thresh.R)

As you said, it would be useful to include in the documentation why this option is available.