ECGdata {ECG}R Documentation

Creates a ECGdata object

Description

Builds a ECGdata object to estimate an extrapolation of the local minimum in the response for a series of single observations.

Usage

ECGdata(data, from=min(data$x), to=max(data$x), useConstantDelta = FALSE, 
maxResponseFraction = 0.5, minResponseFraction = 0.05, 
byResponseFraction = -0.05, fixedResponseFraction = 0.5, 
useFixedResponseFraction = FALSE, replaceOutliers = TRUE, 
responseLowerLimit=min(data$y), responseUpperLimit=max(data$y),
 alpha = 0.05,  kp = qnorm(1-alpha/2), signifDigits = 2,  
 useRobustStatistics = TRUE, ...)

Arguments

data

a data frame structure containing (x, y) columns.

from

a numeric value with the initial value of x to search for a local minimum.

to

a numeric value with the final value of x to search for a local minimum.

useConstantDelta

a logical value, if true then it uses the mean value of the differences in x, otherwise, it uses the differences in x to estimate the expected value. in the analysis.

maxResponseFraction

a real value with the fraction (0,1) of the maximum height to be considered in the analysis.

minResponseFraction

a real value with the fraction (0,1) of the minimum height to be considered in the analysis.

byResponseFraction

a real value with the fraction (0,1) of the decrement of height to be considered in the analysis. The extrapolation analysis uses the sequence: maxResponseFraction, maxResponseFraction+byResponseFraction, ..., minResponseFraction

fixedResponseFraction

a numeric with the fraction of hieght to be used as a reference to normilize.

useFixedResponseFraction

a logical value, if true then it uses the value of f.fixed to normalize all the computations, otherwise it uses the values of extrapolation sequence of fractions to normalize.

replaceOutliers

a logic value, if true then it uses the value of responseLowerLimit and responseUpperLimit to replace outlier values. Default value is TRUE.

responseLowerLimit

a real value to be used as the default to replace outlier values lower than expected, its default value is 0.

responseUpperLimit

a real value to be used as the default to replace outlier values larger than expected, its default value is 1.

alpha

a real value, define the level of significance for building confidence interval.

kp

a real value, it defines the coverage factor to be used to estimate the expanded uncertainty. It is build based on the level of significance alpha and assumes normal distribution of the error terms, its default value is qnorm(1-alpha/2).

signifDigits

number of significant digits used to display the result.

useRobustStatistics

a logical value, if true then median and mad are used to estimate location and dispersion otherwise the mean and standard deviation are used.

...

additional parameters.

Details

The data at each step is a subset of the previous step hence the estimates are correlated. However by specifying useFixedResponseFraction=FALSE they are normalized against distinct fraction of the height.

Value

x

numeric, the estimated value

u

numeric, the estimated uncertainty associated to x

input

list, contains the input parameters

frame

list, contains the reference values of the analysis. This information is used to build a verbosed version of its plot. The content of the list is:
kp the updated coverage factor considering the reduced degrees of freedom from using the model used. y.x.band.min the local maximum found in the lower region of the analysis region.
x.max the value of x where the local maximum y.x.max occurs.
x.min the value of x where the local maximum y.x.min occurs.
solutions a matrix with the solutions found for each analyzed fraction of the data.
The contained columns are:
the location estimate,
the standard uncertainty,
the response fraction used,
the value of the minimum response in the considered band,
the maximum response in the considered band, and
the number of data points used.
type an integer representing the degree of the polynomial model (0=constant model, 1=polynomial model of first degree, 2=polynomial model of second degree).
model a linear model summary object.

Author(s)

H. Gasca-Aragon

See Also

See Also as CGdata, print.ECGdata, plot.ECGdata

Examples

require(ECG)
N<- 1000
set.seed(12345)
d1<- 1-sin(seq(1:(5/2*N))/N*pi-pi*3/4)+rnorm(5/2*N, 0, 0.01)
dat<- data.frame(x=1:length(d1), 
	y=100*(d1-min(d1))/(max(d1)-min(d1)))

ECGdata(dat)
ECGdata

[Package ECG version 0.5.2 Index]