问题标签 [spatstat]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
207 浏览

r - Extrapolating spatial point patterns using R

I was wondering if there's a built-in function to extrapolate a point pattern outside the 'parent' window in R. For instance, let's generate a spatial point pattern 'X':

Let's resample the data:

But the the new points are generated within the same area/spatial window

My question is: how would I resample the 200 points within a new window bigger than the original window (1 by 1 m); in other words, how would I extrapolate the small set of 200 spatial points to a larger scale while keeping the same resampling density; say I want to see a total of 1,000 data points in a 5 by 5 m extent?

0 投票
2 回答
1241 浏览

r - 带有R的spatstat:定义空间点模式的窗口时出错

请看下图。该图像是通过首先使用 as.owin 将两列数据框转换为研究窗口(称为 study_win),然后在窗口顶部绘制另一个两列数据框(称为 study_points)来创建的。

很明显,这些点位于窗口内!但是,当我打电话时

它说我的大部分观点都被拒绝为躺在窗外。有人可以告诉我发生了什么吗?

谢谢!

在此处输入图像描述

0 投票
1 回答
221 浏览

owin - 如何绘制等高线图并显示每个等高线级别的标记平均值(与 x,y 相关)

我在 spatstat 中有一个由点模式 X 的强度函数生成的等高线图(如“树木的位置”)。该点模式中的每个 x,y 坐标都标有相应的第三个向量(如“树的直径”)。-->cf image(当然代表树的竖线可以省略)

我想用不同的颜色显示轮廓每个级别的标记(直径)的平均值。建议?谢谢!

0 投票
1 回答
107 浏览

r - 查找由不规则多边形窗口限制的独立但链接点之间的欧几里德距离

我按照帖子在 R{spatstat} 中查找欧几里得距离,由不规则多边形窗口限制到最后,并使其一切正常,非常好。但是,就我而言,我想获取数据 A 中的点到数据 B 中的点的距离,但前提是两个数据集具有相同的 ID 值。我的问题可以遵循在点之间查找 R{spatstat} 中的欧几里得距离中的示例,由不规则多边形窗口限制但具有两个 Pts 数据框,而不是查找 Pts 中的点之间的距离,我想找到点之间的距离Pts1 和 Pts2 如果 Pts1$ID == Pts2$ID (假设您添加和 ID 列)。在 Pts1 和 Pts2 中都有许多级别的 ID。

0 投票
1 回答
629 浏览

r - 使用人口栅格对 r 中的数据进行归一化

我有两个使用创建的像素图像spatstat,一个是由一组点创建的密度图像(使用函数density.ppp),另一个是从人口栅格创建的像素图像。我想知道是否有办法使用人口栅格来标准化密度图像。基本上,我有一个包含美国 10000 多个网络攻击起源位置的数据集,使用spatstat我希望调查空间模式的函数。然而,一个明显的问题是,人口较多的地区由于人口较多,因此网络攻击的来源较多。我想使用人口栅格来解决这个问题。任何想法,将不胜感激。

0 投票
1 回答
131 浏览

r - 聚类点过程模型的引导标准误差 (kppm)

我想报告我在 spatstat 中拟合的非均匀 Thomas 点过程模型的聚类参数(kappa、sigma)的标准误差。Yue 和 Loh (2015)报告了通过参数引导来做到这一点。我对这个概念不是很有经验,或者将它应用于点过程模型。我该怎么做?

我的第一个猜测是多次模拟我的 kppm,并用相同的协变量重新拟合得到的模拟点。然后,根据每个后续拟合的聚类参数计算标准误差。这个对吗?如果是这样,在这种情况下有多少模拟被认为是可以接受的?提前感谢您的任何指点!

0 投票
1 回答
1672 浏览

r - 如何生成带有图案的空间点

我正在做一些工作,我需要在多边形上生成 a) 随机空间点 b) 非随机空间点,即 b) 点概率取决于例如东西梯度或与某个点源的距离或者是其他东西

spsample()对于 a) 我可以使用包中的命令在多边形上生成随机点sp,如下所示:

这正是我想要的 a)。但是,这是否可以针对 b) 进行修改,例如,东方的点比西方更有可能?(虽然仍然能够指定我想要 100 分?)

0 投票
1 回答
84 浏览

r - 计算改进的 kppm 模型的方差协方差矩阵

如果我在vcov = TRUE函数中包含参数,则在尝试改进 kppm 对象的强度估计时出现以下错误improve.kppm

如果我不包含参数,函数会运行,但我不能summary()在改进的 kppm 对象上使用该函数。我收到与上述相同的错误消息。当我使用vcov().

我用来创建我的 kppm 对象的调用是(为清楚起见,协变量的数量已减少):

wherefitcov(2)是一个返回im对象列表的函数。这可能是问题吗?我注意到,如果我在原始kppm调用中使用此函数,则 kppm 对象上的一些 spatstat 函数会引发错误。通常它会说一些类似的东西Error: Covariates ‘nest’ and ‘nest2’ were not found

0 投票
1 回答
225 浏览

spatial - Spatstat - comparing spatial patterns

Never used R before but have spent the last few months working through Spatstat to analyse cell distributions in cancer tissue. I extract xy co-ordinates of positively stained cells for two different cell populations to generate a marked ppp. Exploring the data visually through density plots and K/G cross functions etc identifies some cases where distribution of the two cell populations are different in terms of intensity. furthermore, in some cases the cells appear to be exclusive of each other whilst other cases are characterised by 'hotspots' shared by both populations. However, I can't work out how best to demonstrate this apart from having side-by-side images as illustrations. Is there any way to integrate two density plots or create a graphic of shared regions of intensity? Or another function in Spatstat that I have missed?

Apologies if this is a silly question but struggling to progress things and would be very grateful for advice.

Regards, Matt

0 投票
1 回答
75 浏览

r - adaptative.density() (spatstat) 如何管理重复点和默认 f 值

我在参考文献中找不到此信息[1]

1)adaptive.density()(spatstat 包)如何管理重复的空间点。我在同一位置复制了完全相同的点,因为我结合了不同年份的测量值,并且我期望这些区域的密度曲线更高,但我不确定。

2)adaptive.density()中f的默认值是f=0还是f=1?我的猜测是它是 f=0,所以它通过计算每个位置的强度估计等于平均强度(点数除以窗口面积)来进行自适应估计

感谢您的时间和投入!