简体   繁体   English

信封函数(spatstat)-错误“未使用的参数”

[英]envelope function (spatstat) - error “unused arguments”

I would like to ask your help for finding the reason why when I use the function envelope, my arguments are not accepted, but defined "unused arguments". 我想请您帮忙寻找使用函数信封时为什么我的参数不被接受,而是定义了“未使用的参数”的原因。 The data I'm using are ppp without marks and I would like to create a L function graph with simulated data and my data. 我正在使用的数据是不带标记的ppp,我想用模拟数据和我的数据创建一个L函数图。 Here the code for my ppp data: 这是我的ppp数据的代码:

 map2008MLW = ppp(xy2008_BNGppp$x, xy2008_BNGppp$y, window = IoM_polygon_MLWowin)

And then: 接着:

L2008 = Lest(map2008MLW,correction="Ripley")
OP = par(mar=c(5,5,4,4))
plot(L2008, . -r ~ r, ylab=expression(hat("L")), xlab = "d (m)"); par(OP)
L2008$iso  = L$iso  - L$r
L2008$theo = L$theo - L$r

Desired number of simulations 所需的模拟数量

n = 9999

Desired p significance level to display 显示所需的p显着性水平

 p  = 0.05

And at this point the envelope function doesnt seem very happy: 在这一点上,信封功能似乎并不令人满意:

    EL2008 = envelope(map2008MLW[W], Lest, nsim=n, rank=(p * (n + 1)))
    Error in envelope(map2008MLW[W], Lest, nsim = n, rank = (p * (n + 1))) : 
  unused arguments (nsim = n, rank = (p * (n + 1)))

It seems a generic error and I am not sure it is caused by the package spatstat. 看来是一般错误,但我不确定这是由包spatstat引起的。 Please, help me in finding a solution to this, as I can't proceed with my analyses. 请帮我找到解决方案,因为我无法继续进行分析。

Thank you very much, 非常感谢你,

Martina 玛蒂娜(Martina)

The argument rank should be nrank . 参数rank应该为nrank

Also the relationship between the significance level and the argument nrank is not correct in the example. 在示例中,重要性级别和参数nrank之间的关系也不正确。 For a two-sided test, the significance level is alpha = 2 * nrank/(nsim+1) , so nrank= alpha * (nsim+1)/2 . 对于双向测试,显着性水平为alpha = 2 * nrank/(nsim+1) ,因此nrank= alpha * (nsim+1)/2

You have chosen a significance level of 0.95 but I assume you mean 0.05 . 您选择的显着性水平为0.95,但我认为您的意思是0.05 So with nsim=9999 you want nrank=0.05 * 10000/2 = 250 to get a test with significance level 0.05. 因此,对于nsim=9999您希望nrank=0.05 * 10000/2 = 250来获得显着性水平为0.05的检验。

Such a large number of simulations (9999) is unnecessary in this kind of application. 在这种应用中,无需进行如此大量的仿真(9999)。 Monte Carlo tests are valid with small values of nsim . 蒙特卡洛检验对nsim较小值有效。 In your example I would normally use nsim=39 and nrank=1 . 在您的示例中,我通常使用nsim=39nrank=1

See Chapter 10 of the spatstat book . 请参阅spatstat书的第10章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM