search.rfunc {ldt} | R Documentation |
Create a Model Set for an R Function
Description
Use this model to create a model set for an R function.
Usage
search.rfunc(
data = get.data(),
combinations = get.combinations(),
metrics = get.search.metrics(),
modelChecks = get.search.modelchecks(),
items = get.search.items(),
options = get.search.options(),
rFuncName,
length1,
isInnerExogenous
)
Arguments
data |
A list that determines data and other required information for the search process.
Use |
combinations |
A list that determines the combinations of endogenous and exogenous variables in the search process.
Use |
metrics |
A list of options for measuring performance. Use get.search.metrics function to get them. |
modelChecks |
A list of options for excluding a subset of the model set. See and use get.search.modelchecks function to get them. |
items |
A list of options for specifying the purpose of the search. See and use get.search.items function to get them. |
options |
A list of extra options for performing the search. See and use get.search.options function to get them. |
rFuncName |
Name of a function that uses column indices and number of endogenous variables with respect to |
length1 |
An integer for the length of requested information. This can be the number of exogenous variables. |
isInnerExogenous |
If |
Details
The central part of calling this function is to write a function with rFuncName
name.
This function must have the following arguments:
-
columnIndices
: determines the variables to be used in the current iteration. These indices point to the column ofdata$data
matrix. E.g., you can create a matrix of available data by usingdata$data[,colIndices]
. It contains weight column index (atnumEndo+1
), ifdata$hasWeight
isTRUE
. -
numEndo
: can be used to divide thecolumnIndices
into endogenous and exogenous indices. -
data, metrics, modelChecks, items
: The arguments of current function which are passed to this function.
The rFuncName
function should use these arguments and estimate or predict by using any available R function.
This function must return a List
with the following items:
-
error
(Character string or NULL): It notNULL
or empty, it is considered as a failed estimation with the given message. -
metrics
(Numeric Matrix): Model performance for each target variable. Available target variables must be in the columns and metrics in the rows. -
extra
(Numeric Vector or NULL): Extra information in form of integers, which defines the current model. -
type1means
(Numeric Matrix or NULL): Means oftype1
(coefficients or predictions) for each target variable. Target variables must be in the columns. Make sure to skip the rows which the model does not present any information. -
type1vars
(Numeric Matrix or NULL): similar totype1means
but for reporting the variances.
Value
A nested list with the following members:
counts |
Information about the expected number of models, number of estimated models, failed estimations, and some details about the failures. |
results |
A data frame with requested information in |
info |
The arguments and some general information about the search process such as the elapsed time. |
Note that the output does not contain any estimation results, but minimum required data to estimate the models (Use summary()
function to get the estimation).