Skip to content

Commit

Permalink
add vast example
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes committed Apr 25, 2024
1 parent 3c4c5e1 commit 0260161
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions topics-2024/2024-04-25-vast/index_standardization.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Index Standardization"
editor: visual
---

```{r}
# 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

```{r}
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
```{r}
plot( fit )
```

0 comments on commit 0260161

Please sign in to comment.