Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting spherical coordinates? #23

Closed
mike-lawrence opened this issue Apr 1, 2021 · 1 comment
Closed

Supporting spherical coordinates? #23

mike-lawrence opened this issue Apr 1, 2021 · 1 comment

Comments

@mike-lawrence
Copy link

I'm currently using mgcv::gam with spherical data where I can formulate a model as y ~ s(latitude,longitude,bs='sos',dim=2). Since, as far as I understand, the main thing that differentiates this from an isotropic smooth in cartesian coordinates is the use of great-circle distance rather than euclidean, it strikes me as something that should be fairly straightforward to implement?

@jtimonen
Copy link
Owner

jtimonen commented Apr 2, 2021

lgpr does support terms with two continuous variables, so you can only define a model like
lgp(y ~ gp(latitude) + gp(longitude) in this case. Therefore you don't have a kernel with Euclidean distance in a 2D space, just a kernel which is a sum of two one-dimensional kernels. It is possible for the user to transform coordinates to a different system and use a model like lgp(y ~ gp(transformed_coord1) + gp(transformed_coord2) but the model will still be additive for the two coordinates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants