[R-sig-Geo] (no subject)

Nikolaos Tziokas n|ko@@tz|ok@@ @end|ng |rom gm@||@com
Fri Feb 18 17:01:58 CET 2022


Hi, I tried to perform *Area-to-Area Regression CoKriging (AtACoK)* for
raster downscaling using the package *atakrig*. My dataset consists of 1
dependent variable with spatial resolution 400m and 2 covariates with 100m
pixel size. After performing  *AtACoK* the resulting raster's image values
are from 0:Infinity (I followed the steps included in the *atakrig*
package). Any ideas why those values? For comparison, when I tried
Area-to-Area Kriging (using 1 independent variable) the downscaled image
was fine. Thank you. Here is the code:

library(atakrig)
library(raster)
library(beepr)

ntl = raster("path/atacok/ntl_nov.tif") #dependent var
ndvi = raster("path/ndvi.tif") #independent var (any combination can be used)
pop = raster("path/pop.tif") #independent var

ntl.d <- discretizeRaster(ntl, 100);
ndvi.d <- discretizeRaster(ndvi, 100);
pop.d <- discretizeRaster(pop, 100);
grid.pred <- discretizeRaster(ndvi, 100, type = "value");

pop.d$areaValues$value <- log(pop.d$areaValues$value)
ntl.d$areaValues$value <- log(ntl.d$areaValues$value)
ndvi.d$areaValues$value <- log(ndvi.d$areaValues$value)
## area-to-area Kriging ----# point-scale variogram from combined ndvi and ntl
aod.combine <- rbindDiscreteArea(ndvi.d, ntl.d)
sv.ok_combine <- deconvPointVgm(aod.combine,
                                model = "Gau",
                                rd = 0.5,
                                maxIter = 20); beep(7)
# point-scale cross-variogram (for AtACoK)
aod.list <-list(ndvi = ndvi.d, ntl = ntl.d, pop = pop.d)sv.ck
<-deconvPointVgmForCoKriging(aod.list,
                                   model = "Exp", #Sph, Exp, Gau
                                   rd = 0.7,
                                   maxIter = 20); beep(7)
# prediction
pred.ataok <- ataKriging(ntl.d,
                         grid.pred,
                         sv.ck$ntl,
                         showProgress = TRUE); beep(7)


pred.atack <- ataCoKriging(aod.list,
                           unknownVarId = "ntl",
                           unknown = grid.pred,
                           ptVgms = sv.ck,
                           oneCondition = F,
                           auxRatioAdj = F,
                           showProgress = T); beep(7)

# convert result to raster
pred.ataok.r <-rasterFromXYZ(pred.ataok[,-1]);
plot(pred.ataok.r)

pred.atack.r <-rasterFromXYZ(pred.atack[,-1]);
plot(pred.atack.r)


-- 
Tziokas Nikolaos
GIS Technician

Tel:(+44)07561120302
LinkedIn <http://linkedin.com/in/nikolaos-tziokas-896081130>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list