rmh.ppm(spatstat)
rmh.ppm()所属R语言包:spatstat
Simulate from a Fitted Point Process Model
从安装点过程模型的模拟
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a point process model fitted to data, generate a random simulation of the model, using the Metropolis-Hastings algorithm.
由于数据点处理模型拟合,生成一个随机模拟的模型,使用的Metropolis-Hastings算法。
用法----------Usage----------
## S3 method for class 'ppm'
rmh(model, start=NULL,
control=default.rmhcontrol(model),
...,
project=TRUE, verbose=TRUE)
参数----------Arguments----------
参数:model
A fitted point process model (object of class "ppm", see ppm.object) which it is desired to simulate. This fitted model is usually the result of a call to ppm. See Details below.
已安装点过程模型(对象类"ppm",ppm.object),它是理想的模拟。这的拟合模型通常是由于调用ppm。请参见下面的详细信息。
参数:start
Data determining the initial state of the Metropolis-Hastings algorithm. See rmhstart for description of these arguments. Defaults to list(x.start=data.ppm(model))
数据确定的Metropolis-Hastings算法的初始状态。见rmhstart这些参数的描述。默认为list(x.start=data.ppm(model))
参数:control
Data controlling the iterative behaviour of the Metropolis-Hastings algorithm. See rmhcontrol for description of these arguments.
数据控制的Metropolis-Hastings算法的迭代行为。见rmhcontrol这些参数的描述。
参数:...
Further arguments passed to rmhcontrol, or to rmh.default, or to covariate functions in the model.
更多参数传递给rmhcontrol或rmh.default,或在模型中的协变量的函数。
参数:project
Logical flag indicating what to do if the fitted model is invalid (in the sense that the values of the fitted coefficients do not specify a valid point process). If project=TRUE the closest valid model will be simulated; if project=FALSE an error will occur.
逻辑标志,指示该怎么做,如果合适的模型是无效的(在这个意义上的拟合系数的值没有指定一个有效的点过程)。如果project=TRUE最有效的模型将模拟;如果project=FALSE会发生错误。
参数:verbose
Logical flag indicating whether to print progress reports.
逻辑标志,指示是否打印进度报告。
Details
详细信息----------Details----------
This function generates simulated realisations from a point process model that has been fitted to point pattern data. It is a method for the generic function rmh for the class "ppm" of fitted point process models. To simulate other kinds of point process models, see rmh or rmh.default.
此功能已安装在点模式数据从一个点过程模型的模拟实现。这是一个方法的通用函数rmh类"ppm"点过程模型拟合。为了模拟其他种类的点过程模型,请参阅rmh或rmh.default。
The argument model describes the fitted model. It must be an object of class "ppm" (see ppm.object), and will typically be the result of a call to the point process model fitting function ppm.
参数model介绍合适的模型。它必须是一个类的对象"ppm"(见ppm.object),并通常会点过程模型拟合函数ppm调用的结果。“
The current implementation enables simulation from any fitted model involving the interactions DiggleGratton, Geyer, MultiStrauss, MultiStraussHard, PairPiece, Poisson, Strauss, StraussHard and Softcore, including nonstationary models. See the examples.
目前的实现可以从任何装有模型模拟的互动DiggleGratton,Geyer,MultiStrauss,MultiStraussHard,PairPiece,Poisson,Strauss,StraussHard和Softcore,包括非平稳模型。见的例子。
It is possible that the fitted coefficients of a point process model may be “illegal”, i.e. that there may not exist a mathematically well-defined point process with the given parameter values. For example, a Strauss process with interaction parameter gamma > 1 does not exist, but the model-fitting procedure used in ppm will sometimes produce values of gamma greater than 1. In such cases, if project=FALSE then an error will occur, while if project=TRUE then rmh.ppm will find the nearest legal model and simulate this model instead. (The nearest legal model is obtained by projecting the vector of coefficients onto the set of valid coefficient vectors. The result is usually the Poisson process with the same fitted intensity.)
这可能是一个点的过程模型的拟合系数可能是“非法”的,即,有可能不存在与给定的参数值的数学定义良好的点过程。例如,斯特劳斯过程相互作用参数gamma > 1并不存在,但该模型的拟合程序使用中ppm有时会产生的gamma大于1的值。在这种情况下,如果project=FALSE然后会发生错误,而如果project=TRUE,然后rmh.ppm会发现最近的法律模型和模拟模型,而不是。 (最近的法律模型通过以下方式获得的矢量投影到有效系数矢量的组的系数的结果通常是具有相同的嵌合强度的泊松过程。)
The arguments start and control are lists of parameters determining the initial state and the iterative behaviour, respectively, of the Metropolis-Hastings algorithm.
的参数start和control参数列表确定的初始状态和迭代行为,分别对Metropolis-Hastings算法。
The argument start is passed directly to rmhstart. See rmhstart for details of the parameters of the initial state, and their default values.
参数start直接传递给rmhstart。 rmhstart的初始状态参数的详细信息,以及它们的默认值。
The argument control is first passed to rmhcontrol. Then if any additional arguments ... are given, update.rmhcontrol is called to update the parameter values. See rmhcontrol for details of the iterative behaviour parameters, and default.rmhcontrol for their default values.
参数control首先被传递给rmhcontrol。然后,如果给出任何额外的参数...,update.rmhcontrol被调用来更新的参数值。见rmhcontrol的迭代行为参数的详细信息,并default.rmhcontrol为它们的默认值。
Note that if you specify expansion of the simulation window using the parameter expand (so that the model will be simulated on a window larger than the original data window) then the model must be capable of extrapolation to this larger window. This is usually not possible for models which depend on external covariates, because the domain of a covariate image is usually the same as the domain of the fitted model.
需要注意的是,如果你指定的模拟窗口的扩展使用参数expand(因此,该模型将模拟的一个窗口,比原来的数据窗口),然后外推到更大的窗口模型必须能够。这通常是不可能的,因为依赖于外部协变量的模型协图像域的域的拟合模型通常是相同的。
After extracting the relevant information from the fitted model object model, rmh.ppm invokes the default rmh algorithm rmh.default, unless the model is Poisson. If the model is Poisson then the Metropolis-Hastings algorithm is not needed, and the model is simulated directly, using one of rpoispp, rmpoispp, rpoint or rmpoint.
从拟合模型的对象提取相关信息后,model,rmh.ppm调用默认rmh算法rmh.default,除非该模型是泊松。如果模型是泊松的Metropolis-Hastings算法不需要,和模型模拟,直接使用的rpoispp,rmpoispp,rpoint或rmpoint。
See rmh.default for further information about the implementation, or about the Metropolis-Hastings algorithm.
rmh.default实施的进一步信息,或有关的Metropolis-Hastings算法。
值----------Value----------
A point pattern (an object of class "ppp"; see ppp.object).
点模式(类的一个对象"ppp";看到ppp.object)。
警告----------Warnings----------
See Warnings in rmh.default.
见警告rmh.default。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
simulate.ppm, rmh, rmhmodel, rmhcontrol, default.rmhcontrol, update.rmhcontrol, rmhstart, rmh.default, ppp.object, ppm, PairPiece, Poisson, Strauss, StraussHard, Softcore, Geyer, AreaInter, DiggleGratton
simulate.ppm,rmh,rmhmodel,rmhcontrol,default.rmhcontrol,update.rmhcontrol,rmhstart,rmh.default,ppp.object,ppm,PairPiece,Poisson,Strauss,StraussHard,Softcore,Geyer,AreaInter ,DiggleGratton
实例----------Examples----------
live <- interactive()
op <- spatstat.options()
spatstat.options(rmh.nrep=1e5)
Nrep <- 1e5
data(swedishpines)
X <- swedishpines
plot(X, main="Swedish Pines data")
# Poisson process[泊松过程]
fit <- ppm(X, ~1, Poisson())
Xsim <- rmh(fit)
if(live) plot(Xsim, main="simulation from fitted Poisson model")
# Strauss process [施特劳斯过程]
fit <- ppm(X, ~1, Strauss(r=7))
Xsim <- rmh(fit)
if(live) plot(Xsim, main="simulation from fitted Strauss model")
# Strauss process simulated on a larger window[施特劳斯过程上模拟一个更大的窗口]
# then clipped to original window[然后裁剪到原来的窗口]
Xsim <- rmh(fit, control=list(nrep=Nrep, expand=2, periodic=TRUE))
Xsim <- rmh(fit, nrep=Nrep, expand=2, periodic=TRUE)
# Strauss - hard core process[斯特劳斯 - 硬核过程]
fit <- ppm(X, ~1, StraussHard(r=7,hc=2))
Xsim <- rmh(fit, start=list(n.start=X$n))
if(live) plot(Xsim, main="simulation from fitted Strauss hard core model")
# Geyer saturation process[Geyer的饱和过程]
fit <- ppm(X, ~1, Geyer(r=7,sat=2))
Xsim <- rmh(fit, start=list(n.start=X$n))
if(live) plot(Xsim, main="simulation from fitted Geyer model")
# Area-interaction process[区域互动的过程]
fit <- ppm(X, ~1, AreaInter(r=7))
Xsim <- rmh(fit, start=list(n.start=X$n))
if(live) plot(Xsim, main="simulation from fitted area-interaction model")
# soft core interaction process[软核心的互动过程]
Q <- quadscheme(X, nd=50)
fit <- ppm(Q, ~1, Softcore(kappa=0.1), correction="isotropic")
Xsim <- rmh(fit, start=list(n.start=X$n))
if(live) plot(Xsim, main="simulation from fitted Soft Core model")
data(cells)
if(live) plot(cells)
# Diggle-Gratton pairwise interaction model[Diggle格拉顿对相互作用模型]
fit <- ppm(cells, ~1, DiggleGratton(0.05, 0.1))
Xsim <- rmh(fit, start=list(n.start=cells$n))
if(live) plot(Xsim, main="simulation from fitted Diggle-Gratton model")
X <- rSSI(0.05, 100)
if(live) plot(X, main="new data")
# piecewise-constant pairwise interaction function[分段恒定的两两交互功能]
fit <- ppm(X, ~1, PairPiece(seq(0.02, 0.1, by=0.01)))
Xsim <- rmh(fit)
if(live) plot(Xsim, main="simulation from fitted pairwise model")
# marked point pattern[标记点模式]
data(amacrine)
Y <- amacrine
if(live) plot(Y, main="Amacrine data")
# marked Poisson models [标泊松模型]
fit <- ppm(Y)
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from ppm(Y)")
fit <- ppm(Y,~marks)
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from ppm(Y, ~marks)")
fit <- ppm(Y,~polynom(x,y,2))
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from ppm(Y, ~polynom(x,y,2))")
fit <- ppm(Y,~marks+polynom(x,y,2))
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from ppm(Y, ~marks+polynom(x,y,2))")
fit <- ppm(Y,~marks*polynom(x,y,2))
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from ppm(Y, ~marks*polynom(x,y,2))")
# multitype Strauss models[多类型施特劳斯模型]
MS <- MultiStrauss(types = levels(Y$marks),
radii=matrix(0.07, ncol=2, nrow=2))
fit <- ppm(Y, ~marks, MS)
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from fitted Multitype Strauss")
fit <- ppm(Y,~marks*polynom(x,y,2), MS)
Ysim <- rmh(fit)
if(live) plot(Ysim, main="simulation from fitted inhomogeneous Multitype Strauss")
spatstat.options(op)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|