Package 'MTDrh'

Title: Mass Transportation Distance Rank Histogram
Description: The Mass Transportation Distance rank histogram was developed to assess the reliability of scenarios with equal or different probabilities of occurrence <doi:10.1002/we.1872>.
Authors: Didem Sari<[email protected]>, Sarah M. Ryan <[email protected]>
Maintainer: Didem Sari <[email protected]>
License: GPL-2
Version: 0.1.0
Built: 2024-10-31 22:21:02 UTC
Source: CRAN

Help Index


Wind power scenarios generated by epi-spline approximation

Description

This data set provides 24-hour wind power scenarios, each with a different probability, and observations for 345 instances (days)

Usage

data("EPI")

Format

A list containing wind power scenarios for 345 days, where each day includes 27 scenarios, their corresponding probabilities, and one observation of dimension 24, representing hourly values.

References

[2]D. Sari, S.Ryan. Reliability of wind power scenarios and stochastic unit commitment cost. Under review.

Examples

data(EPI)
epi_ranks <- MTDrh(EPI$scen,EPI$obs,EPI$prob,FALSE,FALSE)

#with different probabilities;
s.prob<-array(rep(c(0.7,rep(0.3/26,times=26)),times=345),dim=c(27,345))
epi_ranks <- MTDrh(EPI$scen,EPI$obs,s.prob,FALSE,FALSE)
  
#or
s.prob2<-array(rep(c(0.35,rep(0.3/25,times=25),0.35),times=345),dim=c(27,345))
epi_ranks <- MTDrh(EPI$scen,EPI$obs,s.prob2,FALSE,FALSE)

Construct Mass Transportation Distance Rank Histogram

Description

Constructs a mass transportation distance rank histogram to assess the reliability of probabilistic scenarios using observations for a set of instances [1].

Usage

MTDrh(scenarios, observation, prob = NULL, debias = FALSE, transformation = FALSE)

Arguments

scenarios

A dataset that contains scenarios. It should be a 3 dimensional array: (dimension of each scenario)x(number of scenarios per instance)x(number of instances)

observation

A dataset that contains observations. The dimension of each observation and the number of instances should match the dimension and number of instances of the scenarios. It should be a matrix:

(dimension of each observation)x(number of instances)

prob

A dataset that contains the probability of each scenario for each instance. If prob is not given, the default that the scenarios have equal probabilities. It should be a matrix: (number of scenarios)x(number of instances)

debias

If debias=TRUE, the data are debiased for each instance [1].

transformation

If transformation=TRUE, the data are transformed with Mahalanobis transformation for each instance [1].

Value

Returns an array of mass transportation ranks and a histogram plot.

Author(s)

Didem Sari, Sarah M. Ryan

References

[1] D. Sari, Y. Lee, S. Ryan, D. Woodruff. Statistical metrics for assessing the quality of wind power scenarios for stochastic unit commitment. Wind Energy 19, 873-893 (2016) doi:10.1002/we.1872

Examples

#Generate 1000 instances of 10 scenarios and observation with dimension 8 
#from the same normal distribution.

scen <- array(rnorm(8*10*1000,0,1),dim=c(8,10,1000)) 
obs <- array(rnorm(8*1000,0,1),dim=c(8,1000))
ranks <- MTDrh(scen,obs,prob=NULL,debias=FALSE,transformation=FALSE)

#Generate 1000 instances of 27 scenarios and observation with dimension 8 
#from AR(1) processes. The marginal distributions of the scenarios and observation
#are the same but the autocorrelation levels are different. The Mahalanobis
#transformation is applied. See Figure 8 [1].

scen <- array(arima.sim(list(order=c(1,0,0),ar=0.10),n=8*27*1000,sd=1),dim=c(8,27,1000))
obs <- array(arima.sim(list(order=c(1,0,0),ar=0.90),n=8*1000,sd=0.45),dim=c(8,1000))
ranks<-MTDrh(scen,obs,prob=NULL,debias=FALSE,transformation=TRUE)
hist(ranks, breaks=c(0:28),xlab="bin",ylab="frequency",col="gray",main="MTD rh")

#Generate 1000 instances of 27 scenarios that have heterogeneous autocorrelation
#levels and corresponding observations with autocorrelation different
#from the scenarios.
#The marginal standard deviations of scenarios and observation match.  See Figure 9 [1]

scen1 <- array(arima.sim(list(order=c(1,0,0),ar=0.10),n=8*10*1000,sd=1),dim=c(8,10,1000))
scen2 <- array(arima.sim(list(order=c(1,0,0),ar=0.80),n=8*17*1000,sd=0.64),dim=c(8,17,1000))
scen <- array(NA,dim=c(8,27,1000))
scen[,1:10,]<-scen1
scen[,11:27,]<-scen2
obs <- array(arima.sim(list(order=c(1,0,0),ar=0.50),n=8*1000,sd=0.86),dim=c(8,1000))
ranks<-MTDrh(scen,obs,prob=NULL,debias=FALSE,transformation=TRUE)
hist(ranks, breaks=c(0:28),xlab="bin",ylab="frequency",col="gray",main="MTD rh")

Wind power scenarios generated by Quantile Regression with Gaussian copula approach

Description

This data set provides 24-hour wind power scenarios and observations for 345 instances (days)

Usage

data("QR")

Format

A list containing wind power scenarios for 345 days, where each day includes 27 scenarios and one observation of dimension 24, representing hourly values.

References

[2]D. Sari, S.Ryan. Reliability of wind power scenarios and stochastic unit commitment cost. Under review.

Examples

data(QR)
qr_ranks <- MTDrh(QR$scen,QR$obs,NULL,FALSE,FALSE)