ocx_sse: OCx SSE

View source: R/CHLA_OCX.R

ocx_sseR Documentation

OCx SSE

Description

Calculate the sum of squared error between in situ chl and satellite OCx chl. Called from within optimize_ocx_coefs() with the optim() function to minimize the error and get the optimal set of coefficients for the set of in situ chl / band ratios.

Usage

ocx_sse(params, insitu_chl, bandratio, alg_degree = 4, reg_method = 3)

Arguments

params

Named numeric vector (names must be a0,a1,a2,a3,a4, or fewer if using a smaller alg_degree) - coefficients of the polynomial

insitu_chl

Numeric vector of log10(in_situ_chla)

bandratio

Numeric vector of log10(band_ratio), same length as insitu_chl

alg_degree

Numeric value between 1 and 4 inclusive, polynomial degree of the algorithm (note that a 4th degree polynomial requires 5 coefficients, including the intercept term)

reg_method

Number of the regression method used in lmodel2 (see ?lmodel2 for details, default = 3, Standard Major Axis)

Value

Numeric value, sum of squared error between in situ chl and satellite chl generated using the user-specified polynomial degree and coefficients


BIO-RSG/oceancolouR documentation built on April 30, 2024, 7:54 a.m.