Unless I'm mistaken sigma is the residual standard deviation, so the denominator should be the d.o.f. i.e. sample_size - number_params which in this case will be 2 * k + 1 if there is no trend or 2 * k + 2 if there is a trend.
It seems it was hardcoded to the case where there is a trend, so this should fix it.
I am unsure about the futhark implementation: it seems to into account the fact that there are fewer parameters when not calculating a trend, but frankly it's greek to me so I am unsure if it's actually being used.
Hi,
Unless I'm mistaken sigma is the residual standard deviation, so the denominator should be the d.o.f. i.e.
sample_size - number_params
which in this case will be2 * k + 1
if there is no trend or2 * k + 2
if there is a trend.It seems it was hardcoded to the case where there is a trend, so this should fix it.
I am unsure about the futhark implementation: it seems to into account the fact that there are fewer parameters when not calculating a trend, but frankly it's greek to me so I am unsure if it's actually being used.