How to perfom numerical integration over not closed forms

by LFRC   Last Updated April 22, 2017 19:19 PM

I want to integrate the following function:

$\int_{W}\eta^{1-B(u)}du$, where $\eta$ is a constant, $W$ corresponds to the observation window for the point process and

$B(u)=\frac{A_{w}(\textbf{x})-A_{w}(\textbf\{x\} \setminus \{u\}) }{\pi r^2}$

$A$ represents the area of a point pattern $\textbf{x}$ on $W$, $\eta$ is a constant and $u$ is a point on $W$

This is a cartoon of the thing:

enter image description here I am trying to do this using the package polyCub from R, but is not working, I appreciate any help

My attempt:

source("figurelayout.R")
source("startup.R")
library(spatstat)


requireversion(spatstat, "1.41-1.073")

W <- as.owin(swedishpines)
x <- c(28,29,55,60,66)
#xp<-seq(W$xrange[1],)
y <- c(70,38,32,72,59)
X <- ppp(x=x,y=y, window = W)
u <- list(x=48,y=50)
u <- as.ppp(u, W)
rad <- 14
Xplusr <- dilation(X, rad) # 
uplusr <- disc(rad, u) 
ovlap <- intersect.owin(uplusr, Xplusr)
AIdemo <- layered(W, 
                  ovlap,
                  Xplusr,
                  uplusr,
                  X,
                  u)
layerplotargs(AIdemo) <- list(list(),
                              list(col="darkgrey", border=NA),
                              list(lwd=2),
                              list(lwd=2, lty=2),
                              list(pch=16),
                              list(pch=3))
newplot(6, 0.7)
setmargins(0)

plot(AIdemo, main="")

library(polyCub)

f2<-function(s,etap=2){etap^{1-area(setminus.owin(disc(rad, s),Xplusr))/(pi*rad*rad)}}

polyCub.SV(W,f2,nGQ=20)


Related Questions


Best way to obtain prediction equation

Updated July 17, 2017 10:19 AM

T distribution state space models

Updated April 04, 2015 18:08 PM

Univariate State Space Model using R

Updated July 14, 2015 14:08 PM

Formulation of State Space Models

Updated February 16, 2016 02:23 AM

Representation power of State Space Models

Updated August 16, 2016 08:08 AM