kp.pwcurv: Predict Wind Power Output by Using a Multivariate Power Curve

Description Usage Arguments Value Note References See Also Examples

Description

Takes multiple environmental variable inputs measured on an operating wind farm and predicts the wind power output under the given environmental condition.

Usage

1
kp.pwcurv(y, x, x.new = x, id.spd = 1, id.dir = NA)

Arguments

y

An n-dimensional vector or a matrix of size n by 1 containing wind power output data. This along with x trains the multidimensional power curve model.

x

An n by p matrix or a data frame containing the input data for p predictor variables (wind and weather variables). This x must have the same number of rows as y, i.e., n.

x.new

A matrix or a data frame containing new input conditions of the p predictor variables for which a prediction of wind power output will be made. This is an optional parameter and will be set to x by default, if it is not supplied.

id.spd

The column number of x (and of x.new, if supplied) indicating wind speed data . Default to 1.

id.dir

The column number of x (and of x.new, if supplied) indicating wind direction data. Default to NA, but this parameter needs to be set if x includes wind direction data.

Value

A vector representing the predicted power output for the new wind/weather condition specified in x.new. If x.new is not supplied, this function returns the fitted power output for the given x.

Note

References

Lee, G., Ding, Y., Genton, M.G., and Xie, L. (2015) Power Curve Estimation with Multivariate Environmental Factors for Inland and Offshore Wind Farms, Journal of the American Statistical Association 110(509):56-67.

See Also

windpw, ksmooth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
head(windpw)


### Power curve estimation.

# By using a single input of wind speed.
pwcurv.est <- kp.pwcurv(windpw$y, windpw$V)

# By using wind speed and direction: id.dir needs to be set.
pwcurv.est <- kp.pwcurv(windpw$y, windpw[, c('V', 'D')], id.dir = 2)

# By using full covariates: confirm whether id.spd and id.dir are correctly specified.
pwcurv.est <- kp.pwcurv(windpw$y, windpw[, c('V', 'D', 'rho', 'I', 'Sb')], id.spd = 1, id.dir = 2)


### Wind power prediction.

# Suppose only 90% of data are available and use the rest 10% for prediction.
df.tr <- windpw[1:900, ]
df.ts <- windpw[901:1000, ]
id.cov <- c('V', 'D', 'rho', 'I', 'Sb')
pred <- kp.pwcurv(df.tr$y, df.tr[, id.cov], df.ts[, id.cov], id.dir = 2)


### Evaluation of wind power prediction based on 10-fold cross validation.

# Partition the given dataset into 10 folds.
index <- sample(1:nrow(windpw), nrow(windpw))
n.fold <- round(nrow(windpw) / 10)
ls.fold <- rep(list(c()), 10)
for(fold in 1:9) {
  ls.fold[[fold]] <- index[((fold-1)*n.fold+1):(fold*n.fold)]
}
ls.fold[[10]] <- index[(9*n.fold+1):nrow(windpw)]

# Predict wind power output.
pred.res <- rep(list(c()), 10)
id.cov <- c('V', 'D', 'rho', 'I', 'Sb')
for(k in 1:10) {
  id.fold <- ls.fold[[k]]
  df.tr <- windpw[-id.fold, ]
  df.ts <- windpw[id.fold, ]
  pred <- kp.pwcurv(df.tr$y, df.tr[, id.cov], df.ts[, id.cov], id.dir = 2)
  pred.res[[k]] <- list(obs = df.ts$y, pred)
}

# Calculate rmse and its mean and standard deviation.
rmse <- sapply(pred.res, function(res) with(res, sqrt(mean((obs - pred)^2))))
mean(rmse)
sd(rmse)

Example output

kernplus 0.1.2 (2019-02-25)
Copyright <U+00A9> 2019 Y. Ding, H. Hwangbo, and Texas A&M University
      V      D      rho          I         Sb      y
1  6.95 173.60 1.159438 0.14244604 0.08469058  40.42
2  5.60  24.72 1.258566 0.08571429 0.06847489  14.44
3  9.17 270.60 1.177190 0.10359869 0.40546263  64.02
4 10.41 171.50 1.141209 0.07780980 0.46597980  77.96
5 17.11  48.11 1.230691 0.08065459 0.14205708 101.41
6  9.85 294.10 1.242199 0.07817259 0.15405456  73.07
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
Estimating (%)
0..........100
[1] 42.5865
[1] 12.04998

kernplus documentation built on May 1, 2019, 6:32 p.m.

Related to kp.pwcurv in kernplus...