首页 > 解决方案 > mppm 和 Geyer-Hardcore 混合交互的两个问题

问题描述

我正在尝试将混合交互模型拟合到一组点模式,我想对其进行进一步处理和检查,但我遇到了两个不同的(?)问题:

首先,我尝试让 mppm 为我选择 Hardcore 截止距离:

data("demohyper")
res1 <- mppm(Points ~ 1, interaction = Hybrid(Geyer(r=.1, sat=3), Hardcore(NA)), data=demohyper)

...但我收到以下错误:

Error in crosspaircounts(U, X, r) : 
  is.numeric(r) && length(r) == 1 is not TRUE

相反,我手动确定了 Hardcore 距离,并将模型安装在 Hyperframe 上:

# find minimum hardcore distance in data set
res1 <- lapply(demohyper$Points, FUN = function(x) ppm(x~1, interaction = Hybrid(Geyer(r=.1, sat=3), Hardcore(NA))) )
minhc <- min(sapply(res1, FUN = function(x) { x$interaction$par$HybridComponent2$par$hc }))
minhc # .01166023

# fit mppm model with hc < minhc
res3 <- mppm(Points ~ 1, interaction = Hybrid(Geyer(r=.1, sat=3), Hardcore(.01)), data=demohyper)
sub <- subfits(res3, verbose=T)

...但这一次,subfits返回一个错误:

Extracting stuff...done.
Determining active interactions...done.
Computing implied coefficients...Interaction, done.
Fisher information...Error in check.nvector(w, nrow(x), things = "rows of x") : 
  The length of ‘w’ (=4257) should equal the number of rows of x (=4229)
In addition: Warning message:
In split.default(values, id) :
  data length is not a multiple of split variable

有谁知道这是否与我选择的参数有关?否则,我将不胜感激有关如何subfits使用混合交互过程的任何建议。

非常感谢!

标签: spatstat

解决方案


这些是错误。

它们现在都已修复(我们相信)在spatstat 1.63-3.004github 存储库中提供的最新开发版本 ( ) 中。


推荐阅读