FindStartParams: FindStartParams

FindStartParamsR Documentation

FindStartParams

Description

FindStartParams generates starting parameters for the HED model, using estimates derived from the data itself. Since the HED model assumes both decay and excess elements, an approximation of the decay is removed from the original waveform data to infer the excess. Once the excess is defined, peaks in the excess are searched for within empirically defined ranges. Values for width, timing and amplitude for each peak can then be inferred.

Usage

FindStartParams(batch_number, beats_in, beat, ppg, gs = model2.GetSegment, e = model2.Excess, sep = model2.SubtractExcessPeak, o_points = inflexX[o_orig], wuv = wuv, inflexX = inflexX, all_beats = FALSE, plot = FALSE)

Arguments

batch_number

the number of batches of waves to process

beats_in

the number of beats in a batch, over which the width, reflectance timing, and decay rate parameters will be fixed

beat

empty dataframe to be filled with starting parameters

ppg

ppg time series (unsegmented)

gs

model2.GetSegment function

e

model2.Excess function

sep

model2.SubtractExcessPeak function

o_points

vector of locations of the o (origin) points for each waveform in the ppg time series

wuv

dataframe of locations of the w, u and v points for each waveform in the ppg time series

inflexX

vector of x coordinates for each inflection point on the ppg time series

all_beats

logical, if true ensures all available beats in the time series are modeled

plot

logical, if true plots each beat for which parameters are being estimated

Value

temp

list consisting of the following:

beat

updated dataframe populated with estimated starting parameters, to be used as input for downhill simplex

ppg

additional columns providing parallel time series of inferred baseline, excess and residuals of ppg data

Examples

temp <- FindStartParams(batch_number, beats_in, beat, ppg, gs = model2.GetSegment,
                                  e = model2.Excess, sep = model2.SubtractExcessPeak,
                                  o_points = inflexX[o_orig], wuv = wuv, inflexX = inflexX, all_beats)










stw32/PulseWaveform documentation built on Dec. 6, 2022, 2:50 a.m.