offsetErrorDecayFit: Fit an asymptotic decay model to reach deviations.

View source: R/models.R

offsetErrorDecayFitR Documentation

Fit an asymptotic decay model to reach deviations.

Description

This function is part of a set of functions to fit and evaluate an exponential error decay function to reach errors.

Usage

offsetErrorDecayFit(
  signal,
  timepoints = length(signal),
  gridpoints = 11,
  gridfits = 10,
  spanRange = NULL
)

Arguments

signal

A vector of length N with reach deviation data. These should start around 0 and go up (ideally they are baselined).

timepoints

NULL or a vector of length N with the timepoints at which to evaluate the exponential. If NULL, the N values in 'signal' are placed at: 0, 1, ... N-2, N-1.

gridpoints

Number of values for rate of change and asymptote, that are tested in a grid.

gridfits

Number of best results from gridsearch that are used for optimizing a fit.

spanRange

The boundaries for the fit, specifying the minimum and maximum difference between the starting value and asympotic level of the exponential decay function.

Value

A named numeric vector with the optimal parameter that fits an offset exponential decay function to the given timeseries. It hes these parameters: 'r': rate (of decay / learning) of the function 's': the span of the function 'o': offset of the function from zero The starting point of the function is the offset + span. For any other points you can run the ‘offsetErrorDecayModel()' with the time points you’re interested in, as well as the fitted parameters.


thartbm/handlocs documentation built on Feb. 18, 2025, 10:53 p.m.