@ExtremeStats @gaborcsardi many thanks for the package! Apologies if it is currently unmaintained, but I am encountering an error when trying to apply the kgvar function. Interestingly, khetmeans works fine for the same data.
My dataset consists of maximum annual rainfall, as recorded at 74 Irish weather stations from 1990 to 2011. When running khetmeans for any number of clusters, I get the error message:
Rendering
=========
1
Error in clasification[i] <- which.min(dist) :
replacement has length zero
Upon investigation, the error appears to be occurring within the call to Varfshere. Within Varfs, it appears that (y[, l] > y.ord[T - K]) returns all FALSE, leading to a log of 0 being taken. The first two values of G((s - (I/T))/h) are non-zero. When trying with a larger dataset (1980 - 2022) (linked below), I did get some TRUEs from (y[, l] > y.ord[T - K]) (at location 7), but they did not match with the non-zeros in G((s - (I/T))/h) (entries 0 - 6!), again resulting in log(0) = -Inf.
Any help at all would be greatly appreciated! Please see the below code as an example:
@ExtremeStats @gaborcsardi many thanks for the package! Apologies if it is currently unmaintained, but I am encountering an error when trying to apply the
kgvar
function. Interestingly,khetmeans
works fine for the same data.My dataset consists of maximum annual rainfall, as recorded at 74 Irish weather stations from 1990 to 2011. When running
khetmeans
for any number of clusters, I get the error message:Upon investigation, the error appears to be occurring within the call to
Varfs
here. WithinVarfs
, it appears that(y[, l] > y.ord[T - K])
returns all FALSE, leading to a log of 0 being taken. The first two values ofG((s - (I/T))/h)
are non-zero. When trying with a larger dataset (1980 - 2022) (linked below), I did get some TRUEs from(y[, l] > y.ord[T - K])
(at location 7), but they did not match with the non-zeros inG((s - (I/T))/h)
(entries 0 - 6!), again resulting in log(0) = -Inf.Any help at all would be greatly appreciated! Please see the below code as an example:
And for a greater number of years, if it proves helpful: