Issue pasing arguments to kernel functions through `density.ppp`

老子叫甜甜 提交于 2019-12-13 03:23:47

问题


I am currently working intensively with the density.ppp function, calling it with different kernel functions of my own design. For this, I need to pass some arguments through density.ppp to my kernel functions via the ... arglist.

There is one case in which this does not work, namely if I want to calculate at = "points" with edge correction.

In densitypointsengine it says

# evaluate edge correction weights at points 
  if(edge) {
    win <- x$window
    if(isgauss && is.null(varcov) && win$type == "rectangle") {
      # evaluate Gaussian probabilities directly
      xr <- win$xrange
      yr <- win$yrange
      xx <- x$x
      yy <- x$y
      xprob <-
        pnorm(xr[2L], mean=xx, sd=sigma) - pnorm(xr[1L], mean=xx, sd=sigma)
      yprob <-
        pnorm(yr[2L], mean=yy, sd=sigma) - pnorm(yr[1L], mean=yy, sd=sigma)
      edgeweight <- xprob * yprob
    } else {
      edg <- second.moment.calc(x, sigma=sigma,
                                kernel=kernel,
                                scalekernel=scalekernel,
                                what="edge", varcov=varcov)
      edgeweight <- safelookup(edg, x, warn=FALSE)
}

so here the call for second.moment.calc does not support additional parameters hidden in ....

I would like to know whether this might be a bug or if it is done this way on purpose.


回答1:


This is a bug. There should be a ... in the call to second.moment.calc.

It will be fixed in the development version of spatstat shortly.



来源:https://stackoverflow.com/questions/51757923/issue-pasing-arguments-to-kernel-functions-through-density-ppp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!