plotfit.x: Plot fitted hazard and perpendicular denisty distribution

Description Usage Arguments Details Value See Also Examples

View source: R/2DLTfunctions.r

Description

Plot fitted hazard and perpendicular denisty distribution resulting from a call of fityx. When simulating, true hazard functions and perpendicular density distribution can also be added to the plot.

Usage

1
2
3
plotfit.x(x, est, nclass = 10, nint = 100, plot = TRUE,
  dotitle = "FALSE", addTruth = FALSE, true.pi.x = NULL,
  true.logphi = NULL, true.hr = NULL, true.b = NULL, N = NULL, ...)

Arguments

x

perpendicular distance observations

nclass

number of histogram classes

nint

number of intervals in numerical integration

plot

boolean, plot results

addTruth

boolean add true hazard and perp. density when simulating

true.pi.x

true perpendicular density distribution function used when simulating

true.logphi

true perpendicular density distribution function parameters used when simulating

true.hr

true hazard rate function used when simulating.

true.b

true hazard rate function parameters used when simulating.

N

true number of animals in simulated distribution, used to calculate bias (see details).

fit

return from a call of fityx

true.legend

If true (and addTruth) plots legend for true functions in bottom left.

Details

When N is specified, bias in estimated number of animals ,\hat N, is calculated.

Value

list with: $gridx = x values used in plotting $p.xpifit = product of perpendicular distance det probability p(x) and perpendicular animal distribution π(x). $mufit = effective strip width \hat p $f.xfit = $p.xfit = $ptot = $p.xfit.std = $adbn = $N = true number of animals in population $n = number of seen animals $Nhat = estimated number of animals. $bias = \hat N bias.

See Also

fityx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
ystart=4;w=1
hr=h2; b=log(c(0.75,1))
pi.x=pi.norm; logphi=c(0.5,log(0.2))
N=50 #true number of animals
#generate some observations
simDat=simXY(N=N,pi.x=pi.x,logphi=logphi,
hr=hr,b=b,w=w,ystart=ystart)
x=simDat$locs$x; y=simDat$locs$y 
est.yx=fityx(y,x,b,hr,ystart,pi.x,logphi,w)
plotdat.yx=plotfit.x(x,est.yx,addTruth=TRUE,true.logphi=logphi,true.b=b,N=N)

## End(Not run)

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