surveyAveraging.RE: Smooth/interpolate survey data using a random effects/kalman...

View source: R/surveyAveraging.RE.R

surveyAveraging.RER Documentation

Smooth/interpolate survey data using a random effects/kalman filter model (RE).

Description

Function to smooth/interpolate survey data using a random effects/kalman filter model (RE).

Usage

surveyAveraging.RE(
  maxYr,
  srvData,
  type = "biomass",
  sex = "male",
  category = "mature",
  pdfType = "lognormal",
  ci = 0.95,
  modelPath = getPath2REM(),
  verbose = FALSE,
  showPlot = FALSE
)

Arguments

maxYr
  • max year for output (typically assessment year)

srvData
  • raw survey data dataframe

type
  • data type ('abundance' or 'biomass') to average

sex
  • sex ('male' or 'female') to average

category
  • category ('immature','mature', or 'legal') to average

pdfType
  • distribution for CIs

ci
  • confidence interval for CIs

modelPath
  • path to ADMB RE model used for survey averaging

verbose
  • flag (T/F) to print intermediate output

showPlot
  • flag (T/F) to plot results

Details

This function uses an ADMB random effects model (originally developed by Jim Ianelli and subsequently modified by William Stockhausen) to smooth/interpolate survey data.

Smoothing is done using a Kalman Filter/Random Effects model written in ADMB (C++) code. The single estimated parameter is the ln-scale process error variance for annual changes in survey abundance/biomass modeled as a random walk process. The estimated time series is output.

Value

list with a dataframe ('dfr') and another list ('lst') as elements. T he dataframe is the smoothed survey data, with columns

  • year = survey year

  • type = 'RE'

  • value = averaged or predicted value

  • lci = lower confidence interval

  • uci = upper confidence interval

The list contains other results from the model optimization, including

  • objFun = the final objective function value

  • maxGrad = the max gradient

  • sdrepSdLam = the estimated process error standard deviation, on the arithmetic scale

  • sdrepSdLam.sd = the standard deviation of the estimated process error standard deviation, on the arithmetic scale

  • and others


wStockhausen/rPIBKC documentation built on April 25, 2023, 6:50 p.m.