plotfit.y: Plot fitted f(y) and forward distance distribution

Description Usage Arguments Details Value See Also Examples

View source: R/2DLTfunctions.r

Description

Plot f(y) and forward distance distribution resulting from a call of fityx.

Usage

1
2
3
plotfit.y(y = NULL, x = NULL, est, nclass = 10, breaks = NULL,
  plot = TRUE, dotitle = FALSE, lineonly = FALSE, nint = 100,
  max.obs = TRUE, add = FALSE, ...)

Arguments

y

forward distance observations (if NULL, uses est$dat$y)

x

perpendicular distance observations (if NULL, uses est$dat$x)

est

return from a call of fityx

nclass

number of histogram classes

breaks

break points passed to hist (overrides nclass if not NULL)

plot

boolean, plot results

lineonly

if TRUE plots only f(y), else plots histogram of forward distances too

nint

number of intervals to use in calculating f(y)

max.obs

If TRUE, plots only up to maximum observed forward distance, else plots up to est$ystart (the forward distance beyond which detection is assumed impossible).

add

if TRUE, adds line to existing plot, else creates new plot. Only applicable if lineonly==TRUE.

...

other parameters passed to hist and plot (need to separate these two!)

Details

Plot f(y) and forward distance distribution resulting from a call of fityx, optionall with overlaid histogram of foward distances. Invisibly returns various f(y)'s, as detailed below.

Value

Invisibly returns a list with these elements $gridx = x values used in plotting $fy.x = Unscaled f(y|x) for all the xs observed $fy. = Unscaled mean of f(y|x) for all the xs observed $scaled. fy. = Mean of f(y|x), scaled to integrate to 1

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)
plotfit.y(y,x,est.yx,nclass=10)

## End(Not run)

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