origin.density: Create a table of densities about the origin

Description Usage Arguments Value Examples

View source: R/visualise.density.R

Description

For a given window, randomly place 1:num.pts in a window and measure the density at (0,0) using the bandwidth sigma. This can be used to understand the density for randomly distributed populations when setting the crowding parameters for the model.

Usage

1
origin.density(win, num.pts = 20, trials = 10, sigma = 1)

Arguments

win

Spatial window of type owin

num.pts

Maximum number of points to randomly place in the window

trials

Number of times to resample points

sigma

The bandwidth used for density.ppp

Value

Matrix with number of rows as points increase from 1:num.pts, each column is the measured density at (0,0) for the particular number of points for each trial.

Examples

1
2
3
4
# Create a window centred on (0,0)
win <- owin(xrange=c(-2,2),yrange=c(-2,2),unitname="metres")
den <- origin.density(win,num.pts=20,trials=50)
boxplot(t(den),xlab="Number Points",ylab="Density")

pwhigham/spatibm documentation built on Aug. 30, 2019, 1:16 p.m.