Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206473

when you need a Kinhom rather than a Kest?

$
0
0

envelope of the K funcition (and its derivative such as L) is very useful for validating a fitted spatial points process model. for instance, I fit a poisson model for a data J1a2, which is as following:

J1a2.points:
#  X.1        X        Y
1    1  118.544 1638.445
2    2  325.995 1761.223
3    3  681.625 1553.771
4    4  677.392 1816.261
5    5  986.451 1685.016
6    6 1469.093 1354.787
7    7 1608.805 1625.744
8    8 1994.071 1782.391
9    9 1968.669 1375.955
10  10 2362.403 1337.852
11  11 2701.099 1773.924
12  12 2900.083 1820.495
13  13 2963.588 1668.081
14  14 3412.360 1676.549
15  15 3378.490 1456.396
16  16 3721.420 1464.863
17  17 3823.028 1701.951
18  18 4072.817 1790.859
19  19 4089.751 1388.656
20  20   97.375  715.497
21  21  376.799 1033.025
22  22  563.082 1126.166
23  23  935.647 1206.607
24  24  512.277  486.876
25  25  935.647  757.834
26  26 1409.821  410.670
27  27 1435.223  639.290
28  28 1706.180 1045.726
29  29 1968.669  876.378
30  30 2307.365  711.263
31  31 2624.892  897.546
32  32 2654.528 1236.243
33  33 2857.746  423.371
34  34 3039.795  639.290
35  35 3298.050  707.029
36  36 3111.767 1011.856
37  37 3361.555 1227.775
38  38 4047.414 1185.438
39  39 3569.007  508.045
40  40 4250.632  469.942
41  41 4386.110  872.144
42  42   93.141  237.088
43  43  554.614  186.283
44  44  757.832  148.180
45  45  965.283  220.153
46  46 1723.115  296.360
47  47 1744.283  423.371
48  48 1913.631  203.218
49  49 2167.653  292.126
50  50 2629.126  211.685
51  51 3217.610  283.658
52  52 3827.262  325.996

and: J1a2.Win<-owin(c(0, 4500.42),c(0, 1917.87)) if you draw evelope for the data with Lest:

library(spatstat)
env.data<-envelope(J1a2, Lest,correction="border", 
                   nsim=19, global=TRUE)
plot(env.data,.-r~r, shade=NULL, legend=FALSE, 
     xlab=expression(paste("r(",mu,"m)")),ylab="L(r)-r",  main = "") 

the Lest() curve goes out of the envelope. however, if you use Linhom instead of Lest, you will find the Linhom() are all inside of the envelope. it seems that this suggest a inhomogenous density kernel of the data. so I use y as covariate in fitting:

poisson.J1a2<-ppm(J1a2~1,Poisson(),correction="border")
y1.J1a2<-ppm(J1a2~y,correction="border")
anova(poisson.J1a2,y.J1a2,test="LR")    #p=0.6484 

I don't find any evidence of a spatial trend of density along y, or x, or their combinations. then why the Linhom() outperform the Lest() in this case? furthermore, when should one decide to use Linhom() instead of Lest?


Viewing all articles
Browse latest Browse all 206473

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>