Skip to content

Index standardization

Jim Thorson edited this page May 8, 2023 · 4 revisions

Example of using VAST with high-level wrapper functions

I here demonstrate my efforts to develop high-level functions to simplify running VAST for several common model purposes. The default structure shown here is for "index standardization."

# Load package
library(VAST)

# load data set
# see `?load_example` for list of stocks with example data 
# that are installed automatically with `FishStatsUtils`. 
example = load_example( data_set="EBS_pollock" )

# Make settings (turning off bias.correct to save time for example)
settings = make_settings( n_x = 100, 
  Region = example$Region, 
  purpose = "index2", 
  bias.correct = FALSE )

# Run model
fit = fit_model( settings = settings, 
  Lat_i = example$sampling_data[,'Lat'], 
  Lon_i = example$sampling_data[,'Lon'], 
  t_i = example$sampling_data[,'Year'], 
  b_i = example$sampling_data[,'Catch_KG'], 
  a_i = example$sampling_data[,'AreaSwept_km2'] )

# Plot results
plot( fit )

This should provide an abundance index for whichever species is chosen in load_example, which loads Alaska pollock in the eastern Bering Sea by default. To use VAST with a new data set, input new data in the same format as example data and see ?make_data for more details.

Clone this wiki locally