-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | ||
``` |