fityx: Maximum likelihood estimation for unknown hazard and...

Description Usage Arguments Details Value See Also Examples

View source: R/2DLTfunctions.r

Description

Uses optim to obtain a MLE for the hazard function and animal perpendicular distance distribution. Functional forms for the hazard and perpendicular distance distribution must be specified.

Usage

1
2
fityx(y, x, b, hr, ystart, pi.x, logphi, w, control = list(),
  hessian = FALSE, corrFlag = 0.7, debug = FALSE, ...)

Arguments

y

scalar or vector; forward distance observations

x

scale or vector; perp. distance observations

b

two-element vector of hazard rate parameters, some of whihc may be logged

hr

hazard rate function

ystart

max forward distance at which could possibly detect animal (see details).

pi.x

perpendicular distance density distribution

logphi

parameters for pi.x (some maybe logged)

w

perpendicular truncation distance.

control

see optim control

hessian

return hessian. See also optim.

...

arguments to be passed into optim

corrFlag=0.7

Absolute parameter correlation value above which a warning is issued.

Details

Must to ensure the hazard function has decayed to (very close to) zero by ystart.

Value

optim fit object and
$hr = hazard rate function used.
$pi.x = perpendicular distance function used.
$ystart = ystart max forward distance detection used.
$w = perpendicular truncation distance used.
$b = estimated hazard parameters
$dat = data frame with data ($x and $y)
$logphi
AIC AIC value
And if hessian=TRUE:
vcov variance covariance matrix. Will warn if there is a problem inverting the hessian.
CVpar Coefficient of variation for each paramter estimate.
error Boolean, TRUE if convergence!=0 or problem inverting the hessian, or parameter correlation is exceeded.

See Also

negloglik.yx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 
fityx(y,x,b,hr,ystart,pi.x,logphi,w)

## End(Not run)

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