[R-sig-Geo] Formula in UK and distance in km

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Mar 20 09:56:02 CET 2011



On 03/20/2011 03:30 AM, JIN HUR wrote:
> Hi All,
> 
> I'm working on prediction analysis using Universal Kriging (UK).
> I have two questions.
> 
> 1) Formula in UK
>    My input data are latitude and longitude and wind speed to predict wind
> speed at unmeasured points.
>    In this case, how do I make the formula in krige function of UK?  For
> example, in meuse case, usually, formula is "log(zinc)~sqrt(dist)".

Wind.speed ~ Longitude+Latitude

> 
> 2) Distance in km
>    In semivariance, how do I calculate the distance (h) in km in
> semivariogram using longitude (degree) and latitude (degree)?

If you set the CRS such that is.projected reports FALSE, great distances
will be computed assuming long/lat values. For instance:

> library(rgdal)
> proj4string(meuse) <- CRS("+init=epsg:28992")
> meuse.ll = spTransform(meuse, CRS("+init=epsg:4326"))
> is.projected(meuse.ll)
[1] FALSE
> variogram(log(zinc)~dist+x+y,meuse)[1:3,]
   np      dist     gamma dir.hor dir.ver   id
1  57  79.29244 0.0945474       0       0 var1
2 299 163.97367 0.1576838       0       0 var1
3 419 267.36483 0.1837920       0       0 var1

Distances reported are in m.

> 
> My data are as follows:
> 
>    Longitude Latitude Wind.Speed
> 1    -87.545   41.757   2.387500
> 2    -87.669   41.979   2.925000
> 3    -87.568   41.708   2.137500
> 4    -87.726   41.739   2.87500
> 5    -87.558   41.616   3.025000
> 6    -87.792   41.984   3.242857
> 7    -87.990   41.668   3.950000
> 8    -87.753   41.855   1.687500
> 9    -87.898   42.039   3.687500
> 10   -87.676  42.062   3.700000
> 
> 
> Thanks,
> 
> Best Regards,
> Jin
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list