[R-sig-Geo] question for LMC
xi@ojichd m@iii@g oii outiook@com
xi@ojichd m@iii@g oii outiook@com
Thu Feb 4 01:39:05 CET 2021
Dear all lists,
I am xiaoji.
I am interested in your ‘gstat’ package in r for fitting Linear Model of Coregionalization (LMC). But I have some questions and I really need your kind help. Could you please give me a favor?
here is some of my data:
SA2X_CENP SA2Y_CENP crash YP_rate
320428.917 5818141.198 117 0.1063
321879.5695 5817899.382 22 0.1092
318771.7939 5818451.477 11 0.1379
320635.3233 5820539.97 48 0.1649
318364.0546 5820648.928 1 0.2003
326033.2365 5817370.864 23 0.1649
323867.7281 5817573.52 60 0.1655
324383.5969 5819145.236 22 0.1632
316263.0477 5816879.653 17 0.184
315660.7089 5819792.038 27 0.1656
317796.8316 5816153.109 27 0.1578
316917.6342 5818154.401 14 0.1624
321086.4921 5814372.89 85 0.0598
318970.2645 5812389.57 22 0.0732
322330.8284 5812552.395 46 0.0608
316193.3299 5815654.364 2 0.1446
317484.9642 5814980.071 30 0.1473
320657.3469 5812907.924 236 0.0322
319195.008 5814256.7 86 0.0969
319621.6781 5815829.549 53 0.0625
322418.9406 5810079.992 30 0.0778
321120.9463 5811505.149 63 0.0493
317081.5135 5813218.024 10 0
320865.432 5809358.484 79 0.1423
322840.6266 5805484.066 33 0.1397
318295.2402 5810141.976 18 0.14
316698.2992 5810889.514 5 0.3333
320230.4663 5810705.071 44 0.115
322323.3428 5807529.089 77 0.0754
323920.1083 5807043.912 40 0.1312
325877.0663 5808231.436 6 0.1408
323874.6983 5808622.809 57 0.0862
323631.454 5810052.96 73 0.0707
325570.0793 5809906.47 11 0.1161
Here is the code I run :
library(sp)
library(gstat)
CD=read.csv("C:\\Users\\xiaoj\\Documents\\crash_standard_sd.csv")
coordinates (CD) = ~SA2X_CENP+SA2Y_CENP
g <- gstat(formula=crash~1, data = CD)
g <- gstat(g,formula=YP_rate~1, data = CD)
a_range=40000
b_range=59000
v= variogram(crash~SA2X_CENP+SA2Y_CENP, CD)
model<-vgm(NA,"Gau",a_range,NA,add.to = vgm(NA,"Per",b_range))
test<-fit.lmc(v, g, model)
test
The following is my questions.
1. I have some explanation of the data: variable “crash” is a count data and variable “YP_rate” is continuous, how should I run the correct code to fit LMC?
2. How do I to determine the values of a_range and b_range?
I am looking forward to your kindly reply.
Thanks for your time.
Xiaoji
_____________________________________
Sent from http://r-sig-geo.2731867.n2.nabble.com
More information about the R-sig-Geo
mailing list