Kernel spectral estimator of a multivatiate (multitype) point pattern
Source:R/estimator.R
periodogram_smooth.RdComputes the kernel spectral estimator for a multivatiate (multitype) point pattern.
Usage
periodogram_smooth(
ppp,
i = NULL,
j = i,
inten.formula = "~1",
data.covariate = NULL,
bandwidth,
correct = TRUE,
a = 0.025,
A1 = NULL,
A2 = A1,
endpt = 1.5,
equal = TRUE,
kern = bartlett_uni
)Arguments
- ppp
A point pattern of class
"ppp".- i
Mark index. An element in
levels(spatstat.geom::marks(ppp)).- j
Mark index. An element in
levels(spatstat.geom::marks(ppp)).- inten.formula
A
formulasyntax in character format specifying the log-liner model for the intensity function, which is passed toppm(). The default is constant intensityinten.formula = "~1".- data.covariate
Optional. The values of spatial covariates passed to the
dataargument inppm.- bandwidth
A positive value indicating the bandwidth of kernel, determined by
select_band().- correct
Logical. If
TRUE(default), conduct edge correction when computing the kernel spectral estimator.- a
Taper coefficient, a value within \((0,1/2)\). If
a = 0, then taper is not applied. Default isa = 0.025.- A1, A2
Optional. Side lengths of the observation window.
- endpt
A positive value indicating the scale factor of the endpoint frequency.
- equal
Logical. If
TRUE, then use the same bandwidth for both x and y direction.- kern
Univariate scaled kernel function. The default is Barrlett kernel.
Details
The minimal required arguments are ppp, inten.formula, and bandwidth.
If you use any spatial covariate other than the Cartesian coordinates in inten.formula, then
data.covariate is also needed. All the other arguments can be left by default setting.
periodogram_smooth() computes all the pairwise (marginal and cross-) kernel
spectral estimators automatically when the mark indices i and j are
unspecified. If i and j are specified, then it only computes the result
for that mark combination.
The bandwidth can be determined by select_band().
Examples
library(spatstat)
lam <- function(x, y, m) {(x^2 + y) * ifelse(m == "A", 2, 1)}
spp <- rmpoispp(lambda = lam, win = square(5), types = c("A","B"))
# Compute kernel spectral estimator with intensity fitted by log-linear model
# with Cartesian coordinates
ksde = periodogram_smooth(spp, inten.formula = "~ x + y", bandwidth = 1.2)
lapply(ksde, round, 2)
#> $`A, A`
#> -4.71238898038469 -3.76991118430775 -2.82743338823081
#> -4.71238898038469 0.67 0.57 0.44
#> -3.76991118430775 0.33 0.41 0.27
#> -2.82743338823081 0.32 0.48 0.47
#> -1.88495559215388 0.62 0.42 0.32
#> -0.942477796076938 0.44 0.39 0.30
#> 0 0.47 0.43 0.77
#> 0.942477796076938 0.94 0.51 0.63
#> 1.88495559215388 0.77 0.51 0.53
#> 2.82743338823081 0.67 1.11 1.68
#> 3.76991118430775 0.58 0.51 0.80
#> 4.71238898038469 0.78 0.93 0.72
#> -1.88495559215388 -0.942477796076938 0 0.942477796076938
#> -4.71238898038469 0.53 0.21 0.57 2.14
#> -3.76991118430775 0.23 0.32 0.29 1.07
#> -2.82743338823081 0.24 0.32 0.20 0.34
#> -1.88495559215388 0.28 0.86 0.62 0.27
#> -0.942477796076938 0.76 2.05 0.70 0.40
#> 0 1.08 0.72 0.29 0.72
#> 0.942477796076938 1.00 0.40 0.70 2.05
#> 1.88495559215388 0.47 0.27 0.62 0.86
#> 2.82743338823081 1.01 0.34 0.20 0.32
#> 3.76991118430775 1.11 1.07 0.29 0.32
#> 4.71238898038469 1.24 2.14 0.57 0.21
#> 1.88495559215388 2.82743338823081 3.76991118430775
#> -4.71238898038469 1.24 0.72 0.93
#> -3.76991118430775 1.11 0.80 0.51
#> -2.82743338823081 1.01 1.68 1.11
#> -1.88495559215388 0.47 0.53 0.51
#> -0.942477796076938 1.00 0.63 0.51
#> 0 1.08 0.77 0.43
#> 0.942477796076938 0.76 0.30 0.39
#> 1.88495559215388 0.28 0.32 0.42
#> 2.82743338823081 0.24 0.47 0.48
#> 3.76991118430775 0.23 0.27 0.41
#> 4.71238898038469 0.53 0.44 0.57
#> 4.71238898038469
#> -4.71238898038469 0.78
#> -3.76991118430775 0.58
#> -2.82743338823081 0.67
#> -1.88495559215388 0.77
#> -0.942477796076938 0.94
#> 0 0.47
#> 0.942477796076938 0.44
#> 1.88495559215388 0.62
#> 2.82743338823081 0.32
#> 3.76991118430775 0.33
#> 4.71238898038469 0.67
#>
#> $`A, B`
#> -4.71238898038469 -3.76991118430775 -2.82743338823081
#> -4.71238898038469 0.01-0.16i -0.20-0.14i -0.36+0.07i
#> -3.76991118430775 -0.01-0.17i -0.10-0.02i -0.16+0.17i
#> -2.82743338823081 -0.03-0.08i -0.12+0.25i -0.25+0.14i
#> -1.88495559215388 -0.01-0.25i 0.01+0.05i -0.02+0.09i
#> -0.942477796076938 -0.15-0.07i 0.02-0.16i -0.01-0.07i
#> 0 -0.33-0.12i -0.10-0.17i -0.04-0.31i
#> 0.942477796076938 -0.49+0.08i 0.01+0.37i 0.38-0.07i
#> 1.88495559215388 -0.27+0.28i -0.19+0.31i 0.01+0.17i
#> 2.82743338823081 -0.10-0.28i -0.01+0.00i 0.04+0.08i
#> 3.76991118430775 0.06-0.32i 0.00-0.13i -0.04-0.06i
#> 4.71238898038469 -0.22-0.09i -0.18-0.17i 0.03+0.02i
#> -1.88495559215388 -0.942477796076938 0
#> -4.71238898038469 -0.20+0.22i -0.04+0.14i -0.02+0.21i
#> -3.76991118430775 -0.09+0.13i -0.08+0.02i -0.07+0.10i
#> -2.82743338823081 -0.22+0.03i -0.05-0.06i -0.04+0.01i
#> -1.88495559215388 -0.01+0.05i 0.18+0.19i 0.14+0.19i
#> -0.942477796076938 0.24+0.03i 0.81+0.31i 0.25+0.17i
#> 0 0.22-0.36i 0.32-0.02i 0.13+0.00i
#> 0.942477796076938 0.23-0.22i 0.20-0.04i 0.25-0.17i
#> 1.88495559215388 -0.12+0.01i 0.06-0.06i 0.14-0.19i
#> 2.82743338823081 -0.19+0.22i -0.15-0.01i -0.04-0.01i
#> 3.76991118430775 -0.08+0.10i -0.14-0.18i -0.07-0.10i
#> 4.71238898038469 0.10+0.02i 0.18-0.46i -0.02-0.21i
#> 0.942477796076938 1.88495559215388 2.82743338823081
#> -4.71238898038469 0.18+0.46i 0.10-0.02i 0.03-0.02i
#> -3.76991118430775 -0.14+0.18i -0.08-0.10i -0.04+0.06i
#> -2.82743338823081 -0.15+0.01i -0.19-0.22i 0.04-0.08i
#> -1.88495559215388 0.06+0.06i -0.12-0.01i 0.01-0.17i
#> -0.942477796076938 0.20+0.04i 0.23+0.22i 0.38+0.07i
#> 0 0.32+0.02i 0.22+0.36i -0.04+0.31i
#> 0.942477796076938 0.81-0.31i 0.24-0.03i -0.01+0.07i
#> 1.88495559215388 0.18-0.19i -0.01-0.05i -0.02-0.09i
#> 2.82743338823081 -0.05+0.06i -0.22-0.03i -0.25-0.14i
#> 3.76991118430775 -0.08-0.02i -0.09-0.13i -0.16-0.17i
#> 4.71238898038469 -0.04-0.14i -0.20-0.22i -0.36-0.07i
#> 3.76991118430775 4.71238898038469
#> -4.71238898038469 -0.18+0.17i -0.22+0.09i
#> -3.76991118430775 0.00+0.13i 0.06+0.32i
#> -2.82743338823081 -0.01+0.00i -0.10+0.28i
#> -1.88495559215388 -0.19-0.31i -0.27-0.28i
#> -0.942477796076938 0.01-0.37i -0.49-0.08i
#> 0 -0.10+0.17i -0.33+0.12i
#> 0.942477796076938 0.02+0.16i -0.15+0.07i
#> 1.88495559215388 0.01-0.05i -0.01+0.25i
#> 2.82743338823081 -0.12-0.25i -0.03+0.08i
#> 3.76991118430775 -0.10+0.02i -0.01+0.17i
#> 4.71238898038469 -0.20+0.14i 0.01+0.16i
#>
#> $`B, B`
#> -4.71238898038469 -3.76991118430775 -2.82743338823081
#> -4.71238898038469 0.14 0.20 0.52
#> -3.76991118430775 0.26 0.24 0.55
#> -2.82743338823081 0.21 0.33 0.34
#> -1.88495559215388 0.23 0.14 0.09
#> -0.942477796076938 0.28 0.17 0.08
#> 0 0.81 0.52 0.38
#> 0.942477796076938 0.64 1.17 0.94
#> 1.88495559215388 0.52 0.85 0.80
#> 2.82743338823081 0.60 0.24 0.18
#> 3.76991118430775 0.69 0.16 0.06
#> 4.71238898038469 0.28 0.16 0.13
#> -1.88495559215388 -0.942477796076938 0 0.942477796076938
#> -4.71238898038469 0.33 0.39 0.26 0.20
#> -3.76991118430775 0.46 0.21 0.29 0.19
#> -2.82743338823081 0.41 0.17 0.22 0.27
#> -1.88495559215388 0.13 0.17 0.16 0.23
#> -0.942477796076938 0.16 0.41 0.19 0.23
#> 0 0.28 0.24 0.11 0.24
#> 0.942477796076938 0.32 0.23 0.19 0.41
#> 1.88495559215388 0.42 0.23 0.16 0.17
#> 2.82743338823081 0.24 0.27 0.22 0.17
#> 3.76991118430775 0.09 0.19 0.29 0.21
#> 4.71238898038469 0.10 0.20 0.26 0.39
#> 1.88495559215388 2.82743338823081 3.76991118430775
#> -4.71238898038469 0.10 0.13 0.16
#> -3.76991118430775 0.09 0.06 0.16
#> -2.82743338823081 0.24 0.18 0.24
#> -1.88495559215388 0.42 0.80 0.85
#> -0.942477796076938 0.32 0.94 1.17
#> 0 0.28 0.38 0.52
#> 0.942477796076938 0.16 0.08 0.17
#> 1.88495559215388 0.13 0.09 0.14
#> 2.82743338823081 0.41 0.34 0.33
#> 3.76991118430775 0.46 0.55 0.24
#> 4.71238898038469 0.33 0.52 0.20
#> 4.71238898038469
#> -4.71238898038469 0.28
#> -3.76991118430775 0.69
#> -2.82743338823081 0.60
#> -1.88495559215388 0.52
#> -0.942477796076938 0.64
#> 0 0.81
#> 0.942477796076938 0.28
#> 1.88495559215388 0.23
#> 2.82743338823081 0.21
#> 3.76991118430775 0.26
#> 4.71238898038469 0.14
#>