CGr {ECG} | R Documentation |
Creates a CGr object
Description
Builds a CGr (center of gravity) object for a series of replicated observations.
Usage
CGr(data, from=min(data$x), to=max(data$x), columns, responseFraction = 0.50,
useConstantDelta=FALSE, fixedResponseFraction=0.5, useFixedResponseFraction=FALSE,
replaceOutliers=TRUE, responseLowerLimit=min(data[, columns]),
responseUpperLimit=max(data[, columns]), alpha=0.05,
kp=if(length(columns)<=1) qnorm(1-alpha/2) else
qt(1-alpha/2, length(columns)-1),
signifDigits=2, useRobustStatistics = TRUE, ...)
Arguments
data |
a data frame structure containing (date, x, y1, ..., yn) columns, it may contain some other 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. |
columns |
a vector of indexes of the columns to be considered in the profile. |
responseFraction |
numeric, fraction of the maximum height to be considered in the analysis, |
useConstantDelta |
boolean flag, if true constant increment in the x values is assumed, otherwise the difference is computed for each increment of x. |
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 |
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
|
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. |
Value
x |
numeric, the estimated value |
u |
numeric, the estimated uncertainty associated to x |
moments |
numeric vector, the estimated mean, variance, skweness and kurtosis |
input |
list, contains the current input parameters, including the default values
additional parameters passed through |
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:
|
Author(s)
H. Gasca-Aragon
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)
d2<- 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),
y1=100*(d1-min(d1))/(max(d1)-min(d1)),
y2=100*(d2-min(d2))/(max(d2)-min(d2))
)
CGres<- CGr(dat, columns=c(2,3))
CGres