AMK {DSWE} | R Documentation |
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
)
trainX |
a matrix or dataframe of input variable values in the training dataset. |
trainY |
a numeric vector for response values in the training dataset. |
testX |
a matrix or dataframe of test input variable values to compute predictions. |
bw |
a numeric vector or a character input for bandwidth. If character, bandwidth computed internally; the input should be either |
nMultiCov |
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: |
fixedCov |
an integer vector specifying the fixed covariates column number(s), default value is |
cirCov |
an integer vector specifying the circular covariates column number(s) in |
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.
a numeric vector for predictions at the data points in testX
.
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, 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)