变异性在 spatstat envelope() 结果中。

huangapple go评论81阅读模式
英文:

variability in spatstat envelope() results

问题

I使用envelope()创建同时的关键包络。我注意到,在运行39次模拟时,我创建的包络在重复多次模拟时改变了CSR的解释。我期望蒙特卡洛模拟方法会有些变异性,但不足以改变超过关键包络水平(这里是0.05)的解释。在下面的可复现代码中,您可以看到每次模拟包络和Y轴的变化。在我的例子中,这改变了CSR的解释。我想知道是否有人能够解释这种变异性给我。

英文:

I am using envelope() to create simultaneous critical envelopes. I noticed that when I ran 39 simulations that the envelope I created changed the interpretation for CSR when I repeated the simulation several times. I would expect some variability with the Monte Carlo simulation method but not enough to change the interpretation more than the critical envelope level (here .05). In the following reproducible code below, you can see the envelope and Y axis change for each simulation. In my example, this alters the interpretation for CSR. I am wondering if someone can explain this variability to me.

library(spatstat)
X <- rpoislpp(5, simplenet)
linearK(X)
plot(envelope(X, linearK,  global=TRUE, nsim=39))

答案1

得分: 1

简短回答: 尝试使用 fix.n=TRUE, nsim=199, nrank=5

长答案:

首先,蒙特卡洛测试是一个随机过程,因此重复该过程可能会产生不同的结果。在您的示例中,数据点模式中只有很少的点,因此模拟结果会有很大的变异性,在envelope命令的不同重复之间会有很大的变异性。

envelope 的结果变异性可以通过增加模拟次数来减小(例如,您可以将nsim=39增加到nsim=199, nrank=5)。

其次,蒙特卡洛测试在严格意义上是无效的,如果零假设是复合的(即如果零模型依赖于必须从数据中估计的参数)。CSR是一个复合假设,因为它依赖于强度参数。示例中生成的包络对于这个问题并不完全正确,并且由于模拟的变异性很高,这个问题被放大了。

幸运的是,您可以通过设置fix.n=TRUE来生成有效的包络。这会使得模拟模式具有与数据模式相同数量的点。这个技巧只对CSR有效。(对于其他零模型,请使用两阶段蒙特卡洛包络,参见bits.envelope)。

英文:

Short answer: try fix.n=TRUE, nsim=199, nrank=5.

Long answer:

Firstly a Monte Carlo test is a random procedure, so that repetitions of the procedure can produce different results. In your working example, there are only a few points in the data point pattern, so there will be a lot of variability in the simulations, and high variability between different repetitions of the envelope command.

The variability in the results of envelope can be reduced by taking a larger number of simulations (e.g. instead of nsim=39 you could take nsim=199, nrank=5).

Secondly, Monte Carlo tests are strictly speaking invalid if the null hypothesis is composite (i.e. if the null model depends on parameters that have to be estimated from the data). CSR is a composite hypothesis because it depends on the intensity parameter. The envelopes generated in the example are not exactly correct for this problem, and since the variability of the simulations is high, this problem is magnified.

Fortunately, you can produce valid envelopes by setting fix.n=TRUE. This causes the simulated patterns to have the same number of points as the data pattern. This trick is only valid for CSR. (For other null models, use a two-stage Monte Carlo envelope, see bits.envelope)

huangapple
  • 本文由 发表于 2023年4月11日 01:40:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75979377.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定