Skip to content
Back to formatted view

Raw Message

Message-ID: <198A567E-E66E-4184-8EAB-013E41CAE7C0@comcast.net>
Date: 2012-10-01T07:38:00Z
From: David Winsemius
Subject: nlme: spatial autocorrelation on a sphere
In-Reply-To: <072A17AB8F352A418FEE8CE1C1D4763B2D53C6A3@EXCHANGE.earthwatchewe.lan>

On Sep 30, 2012, at 6:48 PM, Dan Bebber wrote:

> I have spatial data on a sphere (the Earth) for which I would like to run an gls model assuming that the errors are autcorrelated, i.e. including a corSpatial correlation in the model specification.
> 
> In this case the distance metric should be calculated on the sphere, therefore metric =  "euclidean" in (for example) corSpher would be incorrect.
> 
> I would be grateful for help on how to write a new distance metric for the corSpatial function.
> I believe there are several ways that distances on a sphere can be calculated in R, for example the "distMeeus" function in the geosphere library. However, I have no idea how to write this into a corSpatial function.
> 
> The aim is to end up with a metric  = "sphere" option that calculates great circle distances between points using latitude and longitude.

LMCTVTFY: http://cran.r-project.org/web/views/Spatial.html

-- 

David Winsemius, MD
Alameda, CA, USA