RBSM: Reverse Broken Stick Algorithm

View source: R/rbsm.R

RBSMR Documentation

Reverse Broken Stick Algorithm

Description

Function to retrieve latent variables of the BSM (values that were generated onboard the tag but has not been transmitted)

Usage

RBSM(dive, retrieve = "order")

Arguments

dive

A dive profile summarized by a Broken Stick Algorithm and transmitted via ARGOS (SMRU format)

retrieve

character determining what we want to have returned of:

  • order: It returns the order of selection of the BSM inflection points

  • minresid: It returns the smallest residual

  • both: it returns both

  • all: returns all four residuals and the order

Details

This function is based on the recursively application of linear models through each summarized dive to get the order in which the inflection points have been selected by the BSM. This function,if requested, will return the smallest residual that may or may not be the residual of the last point. It usually is, but not always. This functions works at dive level, and asume some naming conventions from the SMRU generated files. The column names requested are: D1,D2,D3,D4,T1,T2,T3,T4 and DIVE_DUR. This funcion is not intended to be used directly by an end user, but if needed to be applied directly trough a data.frame object, function RBSM should be called via apply if want to be applied to a full data.frame.

Value

the exact content will depended on the flag used with retrieve (see above). The returned values are stored in a vector. If more than one outcome is requested via both, minresid will be of class character


farcego/slimmingDive documentation built on April 14, 2024, 8:24 a.m.