obs_filter: Sample Observed States

Description Usage Arguments Value

View source: R/3b_obs_filter_function.R

Description

Based on the observed states obtained using obs_sim, introduce a sampling frequency (i.e., insert missing years of data)

Usage

1
obs_filter(params, obs, mimic = NULL, minSRobs = 3, p_age = 0.5)

Arguments

params

A list created using init_sim.

obs

A list created using obs_sim.

mimic

A data frame with columns "stock" (a stock identifier) and "obs" (a binary indicator for whether that stock was monitored that year). This function attempts to mimic this pattern of observation frequency. If NULL (default), then each year and stock will have a 60% of being monitored.

minSRobs

Numeric vector of length 1: the minimum number of fully observed spawner and recruit brood year pairs allowed for any given stock. Defaults to 3.

p_age

Numeric vector of length 1: the fraction of the stocks to be randomly-assigned to have age composition monitored in the same years they have escapement monitored. Defaults to 0.5, and the number of stocks is rounded up if a fractional number is specified.

Value

A list containing the filtered observed states. Any year not sampled will be stored as an NA.


bstaton1/SimSR documentation built on Aug. 20, 2019, 9:43 a.m.