View source: R/epm_lognormal.r
epm_lognormal | R Documentation |
Expected profit model lognormal catch function
epm_lognormal(starts3, dat, otherdat, alts)
starts3 |
Starting values as a vector (num). For this likelihood,
the order takes: c([catch-function parameters], [travel-distance
parameters], [catch sigma(s)], [scale parameter]). |
dat |
Data matrix, see output from shift_sort_x, alternatives with distance. |
otherdat |
Other data used in model (as a list containing objects
'intdat', 'griddat', and 'prices'). |
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(prices)
catch[catch<0] <- 0.00001
#Note lognormal catch distribution.
optimOpt <- c(1000,1.00000000000000e-08,1,0)
methodname <- 'BFGS'
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)),
pricedat=list(prices=as.matrix(prices)))
initparams <- c(0.25, 0.0, -0.15, -0.25, 0.35, 0.1, -0.25, -0.35, -0.8,
-0.4, .3, .2, .35, .25, 1)
func <- epm_lognormal
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.