0

This is the first time I'm using co-kriging in gstat. My problem is that I'm not sure how to prepare the data frame to supply to co-kriging when the variable of interest and auxiliary variables are not measured at the same locations.

Data frame with the variable of interest, z_ar, is voi_gs

> head(voi_gs)
             x        y     z_ar
8974  312216.6 530439.8 49.03470
8283  312084.6 530559.8 57.15355
5057  311772.6 530883.8 49.13453
1551  311976.6 531207.8 44.73679
10116 312168.6 530163.8 50.45549
6155  312528.6 530787.8 62.70750

Data frame with the auxiliary variable, z_pts, is aux_gs

> head(aux_gs)
            x        y    z_pts
9564 312198.6 530313.8 75.91368
6584 311766.6 530745.8 38.87462
2138 311562.6 531153.8 58.62555
9110 312534.6 530421.8 68.35654
9525 312366.6 530325.8 54.26653
7497 311442.6 530649.8 38.95024

I combined them into one data frame to supply to variogram() and krige() functions. Since non of the locations are same between voi_gs and aux_gs, I introduced NA values and combined them in the following way

> aux_gs$z_ar=NA
> voi_gs$z_pts=NA
> comb_gs=rbind(aux_gs,voi_gs)
> head(comb_gs)
            x        y    z_pts z_ar
9564 312198.6 530313.8 75.91368   NA
6584 311766.6 530745.8 38.87462   NA
2138 311562.6 531153.8 58.62555   NA
9110 312534.6 530421.8 68.35654   NA
9525 312366.6 530325.8 54.26653   NA
7497 311442.6 530649.8 38.95024   NA
> tail(comb_gs)
            x        y z_pts     z_ar
180  312468.6 531363.8    NA 70.54528
8633 312264.6 530511.8    NA 44.34631
7694 312492.6 530631.8    NA 57.30173
1079 312108.6 531255.8    NA 46.96482
2230 311124.6 531135.8    NA 40.36449
2201 312312.6 531147.8    NA 44.85896

and then I tried to construct the cross-variogram

> coordinates(comb_gs) = ~x+y
> g = gstat(formula=z_pts~z_ar, data=comb_gs)
> vg = variogram(g)

but variogram function does not accept NA values and gives me an error. I know I can't have NA values in the data, but I don't know how else I can create the data frame to construct the cross-variogram. Any help is really appreciated. Thanks.

rm167
  • 1,185
  • 2
  • 10
  • 26

1 Answers1

0

The two ideas that come to mind are syncing the data points or kriging separately, sampling the kriged surfaces and co-kriging from the samples.

If you points are similarly distributed then maybe you pick all points within some maximum separation distance and combine them as a single sample. That assumes the general pattern of points is similar, i.e. the coordinates aren't the same but the nearest neighbor from a point in your ancillary variables tends to be closer than the nearest neighbor in your response variable.

Conversely, if your points are all randomly distributed across a similar area with little or no relation to each other (spatially, not necessarily response wise), then perhaps making individual kriged surfaces from the variables and then sampling the kriged surfaces would provide you with a working data model.

kpierce8
  • 15,977
  • 2
  • 23
  • 25