View source: R/logit_correction_polyint.r
logit_correction_polyint | R Documentation |
Full information model with Dahl's correction function
logit_correction_polyint(starts3, dat, otherdat, alts)
starts3 |
Starting values as a vector (num). For this likelihood,
the order takes: c([marginal utility from catch], [catch-function
parameters], [polynomial starting parameters], [travel-distance
parameters], [catch sigma]). |
dat |
Data matrix, see output from shift_sort_x, alternatives with distance. |
otherdat |
Other data used in model (as a list containing objects
'griddat', 'intdat', 'startloc', 'polyn', and 'distance'). |
alts |
Number of alternative choices in model as length equal to unity (as a numeric vector). |
ld: negative log likelihood
data(zi)
data(catch)
data(choice)
data(distance)
data(si)
data(startloc)
optimOpt <- c(1000,1.00000000000000e-08,1,0)
methodname <- 'BFGS'
polyn <- 3
kk <- 4
si2 <- sample(1:5,dim(si)[1],replace=TRUE)
zi2 <- sample(1:10,dim(zi)[1],replace=TRUE)
otherdat <- list(griddat=list(si=as.matrix(si),si2=as.matrix(si2)),
intdat=list(zi=as.matrix(zi),zi2=as.matrix(zi2)),
startloc=as.matrix(startloc),polyn=polyn,
distance=as.matrix(distance))
initparams <- c(3, 0.5, 0.4, 0.3, 0.2, 0.55, 0.45, 0.35, 0.25,
rep(0, (((polyn+1)*2) + 2)*kk), -0.3,-0.4, 3)
func <- logit_correction
results <- discretefish_subroutine(catch,choice,distance,otherdat,
initparams,optimOpt,func,methodname)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.