explore_startparams: Function to explore starting value parameter space

View source: R/explore_startparams.r

explore_startparamsR Documentation

Function to explore starting value parameter space

Description

Shotgun method to find better starting values by exploring starting value parameter space

Usage

explore_startparams(
  space,
  startsr,
  dev,
  func,
  catch,
  choice,
  distance,
  otherdat,
  changevec
)

Arguments

space

Number of starting value permutations to test (the size of the space to explore). The greater the dev parameter the larger the space parameter should be.

startsr

Average starting value parameters for revenue/location-specific covariates then cost/distance. The best guess at what the starting value parameters should be (e.g. all ones). Should correspond to the likelihood and data that you want to test.

dev

How far to deviate from the average parameter values when exploring (random normal deviates). The less certain the average parameters are, the greater the dev parameter should be.

func

Name of likelihood function to test.

catch

Data corresponding to actual zonal choice.

choice

Data corresponding to actual catch.

distance

Data corresponding to distance.

otherdat

Other data (as a list, corresponding to the likelihood function you want to test.)

changevec

Which params to change (equals 1).

Value

newstart: Chosen starting values with smallest likelihood
saveLLstarts: Likelihood values for each starting value permutation
savestarts: Starting value permuations (corresponding to each saved likelihood value)

Examples

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

space <- 15
startsr <- rep(1,7)
dev <- 3
func <- epm_normal

otherdat <- list(griddat=list(si=as.matrix(cbind(si,si,si,si))),
    intdat=list(zi=as.matrix(zi)),
    pricedat=list(prices=as.matrix(prices)))

explore_startparams(space,startsr,dev,func,catch,choice,distance,
    otherdat)

startsr <- c(0.5, 0.4, 0.3, 0.2, -0.4, 2, 1)
explore_startparams(space,startsr,dev,func,catch,choice,distance,
    otherdat)

space <- 100
dev <- 1

results <- explore_startparams(space,startsr,dev,func,catch,choice,
    distance,otherdat)
results$newstart
min(unlist(results$saveLLstarts))
match(min(unlist(results$saveLLstarts)),unlist(results$saveLLstarts))


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