optimum_param {doremi} | R Documentation |
Function to find the optimum parameter for derivative estimation (embedding or spar according to derivative estimation method chosen)
Description
optimum_param
calculates the optimum parameter for derivative estimation by varying the latter in a range introduced as input and keeping the parameter and
coefficients having the $R^2$ closest to 1.
Usage
optimum_param(
data,
id = NULL,
input = NULL,
time,
signal,
dermethod = "gold",
model = "1order",
order = 2,
pmin = 3,
pmax = 21,
pstep = 2,
verbose = FALSE
)
Arguments
data |
Is a data frame containing at least one column, that is the signal to be analyzed. |
id |
Is a CHARACTER containing the NAME of the column of data containing the identifier of the individual. If this parameter is not entered when calling the function, a single individual is assumed and a linear regression is done instead of the linear mixed-effects regression. |
input |
Is a CHARACTER or a VECTOR OF CHARACTERS containing the NAME(s) of data column(s) containing the EXCITATION vector(s). If this parameter is not entered when calling the function, the excitation is assumed to be unknown. In this case, the linear mixed-effect regression is still carried out but no coefficient is calculated for the excitation term. The function then uses the parameters estimated by the regression to carry out an exponential fit of the signal and build the estimated curve. The function will consider as an excitation each column of data having a name contained in the input vector. The function will return a coefficient for each one of the excitation variables included in the input vector. |
time |
Is a CHARACTER containing the NAME of the column of data containing the time vector. If this parameter is not entered when calling the function, it is assumed that time steps are of 1 unit and the time vector is generated internally in the function. |
signal |
Is a CHARACTER containing the NAME of the column of the data frame containing the SIGNAL to be studied. |
dermethod |
is the derivative estimation method. The methods currently available are: "gold","glla" and "fda" (see their respective function for more details) |
model |
is the model to be used for analysis of the signal. The models available are "1order" and "2order" |
order |
is the maximum order of the derivative estimated when using |
pmin |
is the minimum of the interval in which to vary the parameter (embedding number or spar according to derivative method chosen) |
pmax |
is the maximum of the interval in which to vary the parameter (embedding number or spar according to derivative method chosen) |
pstep |
is the step that will be considered when varying the parameter. For instance pmin=3, pmax=7 and pstep=2 and dermethod="gold" will make the embedding number take the values 3,5 and 7. |
verbose |
Is a boolean that displays status messages of the function (and functions it calls) when set to TRUE. |
Value
Returns a list of three objects:
analysis is a data.frame containing the resultmean object of the analysis made (result of the analyze.1order or analyze.2order function according to model chosen) with the different values of embedding/spar and the resulting $R^2$.
summary_opt is a data.frame containing the analysis that had the best $R^2$ from the analysis data.frame previously mentioned
d contains the optimum value of the embedding/spar
See Also
analyze.1order
and analyze.2order
for the estimation of equation coefficients in signals following a first and second order differential equation respectively
Examples
s2 <- generate.panel.2order(time = 0:100,
excitation = c(rep(0,25),rep(1,76)),
y0 = 0,
v0= 0,
xi = 0.05,
period=10,
k=1,
yeq=0,
nind=4,
internoise = 0.2,
intranoise = 8)
resgold <- optimum_param (data=s2,
id="id",
input="excitation",
time="time",
signal="signal",
model = "2order",
dermethod = "gold",
pmin = 3,
pmax = 13,
pstep = 2,
verbose = TRUE)