% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DieboldMarianoTest.R
\name{DieboldMarianoTest}
\alias{DieboldMarianoTest}
\title{Diebold-Mariano test}
\usage{
DieboldMarianoTest(
  skill_A,
  skill_B,
  time_dim = "sdate",
  test.type = "two.sided",
  alpha = 0.05,
  N.eff = FALSE,
  ncores = NULL
)
}
\arguments{
\item{skill_A}{A numerical array of the time series of the scores obtained
with the forecaster A.}

\item{skill_B}{A numerical array of the time series of the scores obtained
with the forecaster B. The dimensions should be identical as parameter
'skill_A'.}

\item{time_dim}{A character string indicating the name of the dimension along
which the tests are computed. The default value is 'sdate'.}

\item{test.type}{A character string indicating the type of significance test.
It can be "two.sided" (to assess whether forecaster A and forecaster B are 
significantly different in terms of skill) or "one.sided" (to assess whether
forecaster A shows significantly better skill than forecaster B using a 
one-sided test for positively oriented scores). The default value is 
"two.sided".}

\item{alpha}{A numeric of the significance level to be used in the statistical
significance test (output "sign"). The default value is 0.05.}

\item{N.eff}{Effective sample size to be used in the statistical significance
test. It can be FALSE (and the length of the time series will be used), a
numeric value (which is used for all cases), or an array with the same 
dimensions as "skill_A" except "time_dim" (for a particular N.eff to be used
for each case). The default value is FALSE.}

\item{ncores}{An integer indicating the number of cores to use for parallel
computation. The default value is NULL.}
}
\value{
a logical multidimensional array with the same dimensions as the score
inputs except for the dimension specified in parameter 'time_dim'.
}
\description{
Forecast comparison of the skill obtained with 2 forecasts (with respect to a 
common observational reference) based on Diebold and Mariano (2012; 
https://doi.org/10.2307/1392185)
}
\examples{
set.seed(1)
fcst_A <- array(rnorm(40, 2), dim = c(sdate = 10, lat = 2, lon = 2))
fcst_B <- array(rnorm(40), dim = c(sdate = 10, lat = 2, lon = 2))
reference <- array(data = 1:40, dim = c(sdate = 10, lat = 2, lon = 2))
scores_A <- abs(fcst_A - reference)
scores_B <- abs(fcst_B - reference)
res1 <- DieboldMarianoTest(skill_A = scores_A, skill_B = scores_B)
res2 <- DieboldMarianoTest(skill_A = scores_A, skill_B = scores_B, 
                           test.type = 'one.sided')

}
\references{
Diebold and Mariano (2012): https://doi.org/10.2307/1392185
}
