logit_avgcat: Average catch multinomial logit procedure

View source: R/logit_avgcat.r

logit_avgcatR Documentation

Average catch multinomial logit procedure

Description

Average catch multinomial logit procedure

Usage

logit_avgcat(starts3, dat, otherdat, alts)

Arguments

starts3

Starting values as a vector (num). For this likelihood, the order takes: c([average-catch parameters], [travel-distance parameters]).

The average-catch and travel-distance parameters are of length (# of average-catch variables)*(k-1) and (# of travel-distance variables respectively, where (k) equals the number of alternatives.

dat

Data matrix, see output from shift_sort_x, alternatives with distance.

otherdat

Other data used in model (as a list containing objects 'intdat' and 'griddat').

For this likelihood, 'intdat' are "travel-distance variables", which are alternative-invariant variables that are interacted with travel distance to form the cost portion of the likelihood. Each variable name therefore corresponds to data with dimensions (number of observations) by (unity), and returns a single parameter.

In 'griddat' are "average-catch variables" that do not vary across alternatives, e.g. vessel gross tonnage. Each variable name therefore corresponds to data with dimensions (number of observations) by (unity), and returns (k-1) parameters where (k) equals the number of alternatives, as a normalization of parameters is needed as the probabilities sum to one. Interpretation is therefore relative to the first alternative.

For both objects any number of variables are allowed, as a list of matrices. Note the variables (each as a matrix) within 'griddat' and 'intdat' have no naming restrictions. "Average-catch variables" may correspond to variables that impact average catches by location, or "travel-distance variables" may be vessel characteristics that affect how much disutility is suffered by traveling a greater distance. Note in this likelihood the "average-catch variables" vary across observations but not for each location: they are allowed to affect alternatives differently due to the location-specific coefficients.

If there are no other data, the user can set 'griddat' as ones with dimension (number of observations) by (unity) and 'intdat' variables as ones with dimension (number of observations) by (unity).

alts

Number of alternative choices in model as length equal to unity (as a numeric vector).

Value

ld: negative log likelihood

Graphical examples

Figure: logit\_avgcat\_grid.png
Figure: logit\_avgcat\_travel.png

Examples

data(zi)
data(catch)
data(choice)
data(distance)
data(si)

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)))

initparams <- c(1.5, 1.25, 1.0, 0.9, 0.8, 0.75, -1, -0.5)

func <- logit_avgcat

results <- discretefish_subroutine(catch,choice,distance,otherdat,
    initparams,optimOpt,func,methodname)


allen-chen-noaa-gov/barebones.FishSET documentation built on March 1, 2024, 8:19 a.m.