impulse.start.double: Starting Conditions for Impulse Model (double sigmoid)

Description Usage Arguments Value

View source: R/impulse.R

Description

This function determines k sets of initial starting conditions for impulse fitting by choosing combinations of points from the data randomly. h0 and h2 (initial and final values) are taken from points chosen at random from data at the beginning and end of the data series (along the x-axis). h1 is chosen from points in the middle of the data (along the x-axis) that are either greater than both h0 and h2 or less than both h0 and h2. t1 and t2 are then estimated as the midpoints (along x-axis) between points randomly chosen to determine h0, h1, and h2. b1 and b2 are estimated as linear slopes between points chosen to determine h0, h1, and h2. If k is larger than the number of possible combinations that fit these conditions, additional sets of starting conditions are chosen totally randomly that fit within the bounds of the existing data with a small margin of padding.

Usage

1
impulse.start.double(x, y, k, h0.frac = 0.2, h2.frac = 0.2, interpolate = NULL)

Arguments

x

(Numeric vector) Expression data to fit (x)

y

(Numeric vector) Expression data to fit (y)

k

(Numeric) Number of starting conditions to determine

h0.frac

(Numeric, 0 to 1) Portion of data (along x-axis, from beginning) to use to estimate h0

h2.frac

(Numeric, 0 to 1) Portion of data (along x-axis, from end) to use to estimate h2

interpolate

(Numeric or NULL) If low number of data points, can interpolate them linearly to this number of points. Default (NULL) does not do any interpolation.

Value

Returns a data frame of potential starting conditions for fitting functions for double sigmoid ("impulse") model


farrellja/URD documentation built on June 17, 2020, 4:48 a.m.