calculate_attenuation: Diffuse attenuation coefficient of downwelling irradiance

View source: R/calculate_attenuation.R

calculate_attenuationR Documentation

Diffuse attenuation coefficient of downwelling irradiance

Description

calculate_attenuation fits a loess model between depth and light using an AICc-based span selection model adapated from fANCOVA::loess.as, then estimates the first derivative of the resultant model slope to approximate the diffuse attenuation coefficient of downwelling irradiance (vertical attenuation coefficient).

Usage

calculate_attenuation(
  x,
  light.col = "trans_llight",
  depth.col = "cdepth",
  loess.criterion = "aicc",
  loess.degree = 1,
  kz.binsize = 0.2,
  min.range = 10,
  light.predict = F,
  ...
)

Arguments

x

Data frame containing depth and light for a single cast.

loess.criterion

Criterion for choosing the most parsimonious model. Options are bias-corrected Akaike's Information Criterion ("aicc") or generalized cross-validation ("gcv").

loess.degree

Degrees for loess model. Default = 1.

kz.binsize

Depth interval for estimating instantaneous diffuse attenuation coefficient of downwelling irradiance. Default = 0.2.

min.range

Minimum range of depths necessary for model fitting. Default = 10.

light.predict

Logical indicating whether predicted values for light should be returned.

...

Additional arguments passed to loess fitting function

Value

Returns a list containing three data frames: attenuation contains depth and fitted values of vertical diffuse attenuation coefficient, loess.fit contains the model summary statistics, and fit_residuals contains model fit residuals.

Author(s)

Sean Rohan sean.rohan@noaa.gov

References

Hurvich, C.M., Simonoff, J.S., and Tsai, C.-L. 1998. Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion. J. R. Stat. Soc. B 60(2): 271-293.

Xiao-Feng Wang (2010). fANCOVA: Nonparametric Analysis of Covariance. R package version 0.5-1. https://CRAN.R-project.org/package=fANCOVA


sean-rohan/trawllight documentation built on Jan. 13, 2023, 10:43 p.m.