Pandora-IsoMemo / DSSM

Pandora & IsoMemo spatiotemporal modeling (DSSM)
https://pandora-isomemo.github.io/DSSM/
GNU General Public License v3.0
4 stars 1 forks source link

Missing border correction for Bayes models #175

Closed arunge closed 11 months ago

arunge commented 1 year ago

@mgross There is an issue with the border correction for Bayes models. As you can see in following figure it seems not to be working. This issue was already present in a version from May 2022, so no recent changes are relevant for this bug. Could you please check what is missing, and why the border correction is not working for Bayes models and fix the issue?

image

The data that was used for testing you can find here: upload.xlsx

For testing you may run the AverageR model (dependent variable ΔR.14C.yr).

@isomemo asked if you could check the spherical modelling also?

From https://github.com/Pandora-IsoMemo/iso-app/issues/168#issuecomment-1607704905

isomemo commented 1 year ago

@mgross I suspect that spherical modelling is also likely not working.

mgross commented 1 year ago

@arunge @isomemo

the spherical model works perfectly fine.

This is actually not a bug, but can happen if we use too few MCMC iterations and not so much observations in the area around 180° longitude. We are employing a work-around using an augmented data approach to make that border on 180° longitude disappear (a planar spline on a planet surface is always having this problem, so we are artificially). The problem occurs, because of the randomness of the MCMC the "two loose ends" do not match perfectly -> imagine you fit the same model twice and you won't get exactly the same results due to MCMC randomness

It can be mitigated by increasing the number of MCMC iterations + chains (i.e. the problem gets better with higher number of iterations, but which might not be always an option due to time constraints). With 25000 iterations (1chain) it is much less visible: grafik

or just using the spherical spline model, which I recommend for data that spans a large part of the globe anyways (as it correctly accounts for the spherical shape of the earth and thus employing correct distances..): grafik

isomemo commented 1 year ago

@mgross @arunge

Great that the spherical option works! However, as you know this can be very computationally demanding. This is why we needed the border correction albeit accepting that this will not perform well at map border regions.

I had tested the Pacific correction a few times in the past and did not notice an issue. Had I known that this was sensitive to the number of iterations, I would have requested a different implementation.

A map centred in the Pacific should be generated in a similar way as a map centred in the Atlantic. After all, this is just a transposition/re-centring along the x-axis.

I probably have asked this previously, but why cannot the following be done:

1) When the user selects the option to centre in the Pacific one keeps using the "Atlantic" modelling approach but one redefines the x variable as x' variable which is simply transposed by 180 degrees (or the equivalent in whatever unit you are using). That is: x' = x +180

2) The modelling is now done on x' as it would be done on x

3) Once the results are generated transpose these back so that display correctly for the Pacific

arunge commented 1 year ago

We are checking the option to remove "planar modelling" together with the "border correction", see https://github.com/Pandora-IsoMemo/iso-app/issues/180#issuecomment-1715607128.

Before removing anything, I want to

arunge commented 11 months ago

We are continuing with this issue in:

I am closing here.