katzfuss-group / GPvecchia

Fast Gaussian-process inference using Vecchia approximations
19 stars 6 forks source link

maxmin ordering in 1d doesn't seem to work as expected #37

Closed marcinjurek closed 5 years ago

marcinjurek commented 5 years ago

Everyone please let me know if you can replicate this error, but it seems to me that there is some problem with the maxmin ordering function. When I use n=3 in 1D the middle location is not selected as the first one. I used seed 1988.

I imagine this might be because this is an approximate maxmin ordering, but I'm no expert on this and I just wanted to report it. Let me know please if you can or cannot replicate it.

katzfuss commented 5 years ago

Yes, this is almost certainly because of the approximate nature of the current maxmin algorithm. This issue will be solved by #35

marcinjurek commented 5 years ago

Hm... so I'm not sure what you guys think about it, but I'm still a little iffy about this maxmin ordering.

Here is a vector with locations: locs = c(0.1494348, 0.1852040, 0.3139893, 0.3676648, 0.4167928, 0.4492080, 0.5539822) The order that I'm getting is ord = c(2, 6, 5, 1, 7, 4, 3). I thought it would be, for example 6, 2, 5, 1, 7, 3, 4 which is what would allow to take advantage of the screening effect (the key difference is that 0.18 comes second and 0.44 third). Is this a bug or a feature?

@dzilber , @jingjiezh what are your thoughts on this?

dzilber commented 5 years ago

I think you are running order() on a vector which is already the order. The output I get is

> MaxMincpp(locs)
[1] 4 1 7 6 3 2 5

but if you run order on that output, you will get the output you mention.