FindWithinParams: FindWithinParams

View source: R/PulseWaveform.R

FindWithinParamsR Documentation

FindWithinParams

Description

FindWithinParams generates a 13x12 matrix for each waveform in an inputted batch of waveforms. Each row is a unique parameter set for the waveform in question, while columns 1:12 correspond to each of the 12 parameters (baseline1, baseline2, systolic time, systolic amplitude, systolic width, 2nd reflectance wave time, 2nd reflectance wave amplitude, 2nd reflectance wave width, 1st reflectance wave time, 1st reflectance wave amplitude, 1st reflectance wave width, and decay rate).

Each populated row differs from the top row by a single parameter. The specific value that differs in each row represents the optimised value for that parameter when all other parameters are held constant. Rows corresponding to changes in parameters which are to be fixed across beats are unpopulated (NA). The matrices outputted by FindWithinParams are the building blocks for the final matrix that will be inputted into the downhill simplex routine.

Usage

FindWithinParams(beats_in, ppg, beat, gs = model2.GetSegment, fp = model2.FixParams3, ms = simplex.MakeSimplex3, m2 = model2.ChiSq3, beat_vector = beat_vector, renal_param = renal_param, dias_param = dias_param, sys_time, w)

Arguments

beats_in

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

ppg

the preprocessed ppg time series

beat

the dataframe of model parameter outputs populated with initial starting parameters

gs

model2.GetSegment function

fp

model2.FixParams3 function

ms

simplex.MakeSimplex3 function

m2

model2.ChiSq3 function

beat_vector

a list consisting of 1. the number of beats in the batch 2. the starting points of each beat on the ppg time series 3. the end points of each beat on the ppg time series

renal_param

the starting parameter for 1st reflectance peak timing (inputted to prevent drastic deviations from this value)

dias_param

the starting parameter for 2nd reflectance peak timing (inputted to prevent drastic deviations from this value)

sys_time

the starting parameter for systolic peak timing (inputted to prevent drastic deviations from this value)

w

the timing of the 1st derivative peaks on the ppg time series

Value

a

list of n 13x12 matrices, where n = number of beats in the inputted batch

Examples

within_params <- FindWithinParams(beats_in, ppg, beat = new_beat, gs = model2.GetSegment,
                                                fp = model2.FixParams3, ms = simplex.MakeSimplex3,
                                                m2 = model2.ChiSq3, beat_vector = beat_vector,
                                                renal_param = renal_param, dias_param = dias_param,
                                                sys_time = sys_time, w = w)










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