软核点过程的最大伪似然估计器

时间:2019-02-24 07:21:06

标签: r statistics mle

我正在尝试使用最大伪似然将soft-core point process model拟合到一组点模式上。我遵循了paper在Baddeley和Turner

中给出的说明。

这是我想出的R代码

`library(deldir)
 library(tidyverse)
 library(fields)

 #MPLE

 # irregular parameter k

 k <- 0.4

 ## Generate dummy points 50X50. "RA" and "DE" are x and y coordinates


dum.x <- seq(ramin, ramax, length = 50)
dum.y <- seq(demin, demax, length = 50)
dum <- expand.grid(dum.x, dum.y)
colnames(dum) <- c("RA", "DE")

## Combine with data and specify which is data point and which is dummy, X is the point pattern to be fitted

bind.x <- bind_rows(X, dum) %>%
mutate(Ind = c(rep(1, nrow(X)), rep(0, nrow(dum))))

## Calculate Quadrature weights using Voronoi cell area

w <- deldir(bind.x$RA, bind.x$DE)$summary$dir.area

## Response
y <- bind.x$Ind/w

# the sum of distances between all pairs of points (the sufficient statistics)

tmp <- cbind(bind.x$RA, bind.x$DE)
t1 <- rdist(tmp)^(-2/k)
t1[t1 == Inf] <- 0
t1 <- rowSums(t1)
t <- -t1

# fit the model using quasipoisson regression

fit <- glm(y ~ t,  family = quasipoisson, weights = w)
`

但是,t的拟合参数为负,这显然不是软核点过程的正确值。另外,我的点模式实际上是从软核过程中模拟的,因此,拟合参数为负并不有意义。我尽力找到了代码中的任何错误,但似乎找不到。我看到的唯一潜在问题是我的足够统计量非常大(大约10 ^ 14),我担心这可能会导致数值问题。但是统计数据很大,因为我的观察窗口跨度很小,一对点之间的平均距离约为0.006。因此,基于此的足够的统计数据肯定会非常大,而我的直觉告诉我,它不应引起数值问题,也不会使拟合的参数为负。

有人可以帮助检查我的代码是否正确吗?非常感谢!

0 个答案:

没有答案