calc.lpars: Calculates scaling parameters required by 'sim.n'

Description Usage Arguments Details Value Examples

View source: R/2DLTfunctions.r

Description

Calculates scaling parameters required by sim.n in order to generate sample of given size.

Usage

1
2
calc.lpars(n, ymin, ymax, W, hfun, b, pi.x, logphi, nx = 100, ny = 100,
  inflate = 1.05)

Arguments

n

expected sample size reqired from NHPP

ymin

smallest forward distance

ymax

largest forward distance

W

perpendicular truncation distance

hfun

detection hazard function

b

vector of detection hazard function parameters

pi.x

perpendicular distance distribution function

logphi

vector with log of pi.x parameters

nx

number of intervals on x-axis at which to calculate intensity

ny

number of intervals on y-axis at which to calculate intensity

inflate:

multiplier by which to increase max intensity in region; this is just a safeguard against the max at some point not calculated being greater than the points at which it was calculated. (The sample generator in rpoispp uses rejection sampling so needs the global max.)

Details

Calls poisint on grid of (x,y) points, calculates total intensity in area and then calculates scaling needed to make this equal to n, and the maximum intensity in the region.

Output from this function can be passed as the lscale argument to sim.n.

Value

Object of class "ppscale", being alist with two parameters: $lscale is the multiplier needed to make the total intensity equal to n, while $lmax is maximum lintensity in the region.

Examples

1
2
3
4
5
6
7
## Not run: 
n=100;ymin=0.01;ymax=5;W=2
b=log(c(0.75,1));logphi=c(0.5,log(0.3))
intscale=calc.lpars(n,ymin,ymax,W,h2,b,pi.norm,logphi)
intscale

## End(Not run)

david-borchers/LT2D documentation built on Aug. 17, 2020, 1:37 a.m.