An additive multiplicative kernel regression based on Lee et al. (2015).
AMK(
trainX,
trainY,
testX,
bw = "dpi_gap",
nMultiCov = 3,
fixedCov = c(1, 2),
cirCov = NA
)
a numeric vector for predictions at the data points in testX
.
a matrix or dataframe of input variable values in the training dataset.
a numeric vector for response values in the training dataset.
a matrix or dataframe of test input variable values to compute predictions.
a numeric vector or a character input for bandwidth. If character, bandwidth computed internally; the input should be either 'dpi'
or 'dpi_gap'
. Default is 'dpi_gap'
. See details
for more information.
an integer or a character input specifying the number of multiplicative covariates in each additive term. Default is 3 (same as Lee et al., 2015). The character inputs can be: 'all'
for a completely multiplicative model, or 'none'
for a completely additive model. Ignored if the number of covariates is 1.
an integer vector specifying the fixed covariates column number(s), default value is c(1,2)
. Ignored if nMultiCov
is set to 'all'
or 'none'
or if the number of covariates is less than 3.
an integer vector specifying the circular covariates column number(s) in trainX
, default value is NA
.
This function is based on Lee et al. (2015). Main features are:
Flexible number of multiplicative covariates in each additive term, which can be set using nMultiCov
.
Flexible number and columns for fixed covariates, which can be set using fixedCov
. The default option c(1,2)
sets the first two columns as fixed covariates in each additive term.
Handling the data with gaps when the direct plug-in estimator used in Lee et al. fails to return a finite bandwidth. This is set using the option bw = 'dpi_gap'
for bandwidth estimation.
Lee, Ding, Genton, and Xie, 2015, “Power curve estimation with multivariate environmental factors for inland and offshore wind farms,” Journal of the American Statistical Association, Vol. 110, pp. 56-67, tools:::Rd_expr_doi("10.1080/01621459.2014.977385").
data = data1
trainX = as.matrix(data[c(1:100),2])
trainY = data[c(1:100),7]
testX = as.matrix(data[c(101:110),2])
AMK_prediction = AMK(trainX, trainY, testX, bw = 'dpi_gap', cirCov = NA)
Run the code above in your browser using DataLab