Newer
Older
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_Analogs.R
\name{Analogs}
\alias{Analogs}
\title{Search for analogs based on large scale fields.}
\usage{
Analogs(expL, obsL, time_obsL, expVar = NULL, obsVar = NULL,
region = NULL, nAnalogs = 1, return_list = FALSE)
}
\arguments{
\item{expL}{an array of N named dimensions containing the experimental field
on the large scale for which the analog is aimed. This field is used to in
all the criterias. If parameter 'expVar' is not provided, the function will
return the expL analog. The element 'data' in the 's2dv_cube' object must
have, at least, latitudinal and longitudinal dimensions. The object is
expect to be already subset for the desired large scale region.}
\item{obsL}{an array of N named dimensions containing the observational field
on the large scale. The element 'data' in the 's2dv_cube' object must have
the same latitudinal and longitudinal dimensions as parameter 'expL' and a
temporal dimension with the maximum number of available observations.}
\item{expVar}{an array of N named dimensions containing the experimental
field on the local scale, usually a different variable to the parameter
'expL'. If it is not NULL (by default, NULL), the returned field by this
function will be the analog of parameter 'expVar'.}
\item{obsVar}{an array of N named dimensions containing the field of the same variable as the passed in parameter 'expVar' for the same region.}
\item{criteria}{a character string indicating the criteria to be used for the selection of analogs:
\itemize{
\item{Large_dist} minimal distance in the large scale pattern;
\item{Local_dist} minimal distance in the large scale pattern and minimal
distance in the local scale pattern; and
\item{Local_cor} minimal distance in the large scale pattern, minimal
distance in the local scale pattern and maxima correlation in the
local variable to downscale.}}
\item{lonVar}{a vector containing the longitude of parameter 'expVar'.}
\item{latVar}{a vector containing the latitude of parameter 'expVar'.}
\item{region}{a vector of length four indicating the minimum longitude,
the maximum longitude, the minimum latitude and the maximum latitude.}
\item{nAnalogs}{number of Analogs to be selected to apply the criterias (this
is not the necessary the number of analogs that the user can get, but the number
of events with minimal distance in which perform the search of the best Analog.
The default value for the Large_dist criteria is 1, the default value for
the Local_dist criteria is 10 and same for Local_cor. If return_list is
False you will get just the first one for downscaling purposes. If return_list
is True you will get the list of the best analogs that were searched in nAnalogs
under the selected criterias.}
\item{return_list}{TRUE if you want to get a list with the best analogs FALSE
#'if not.}
values dowscaled values of the best analogs for the criteria selected.
This function perform a downscaling using Analogs. To compute
the analogs, the function search for days with similar large scale conditions
to downscaled fields in the local scale.
The large scale and the local scale regions are defined by the user.
The large scale is usually given by atmospheric circulation as sea level
pressure or geopotential height (Yiou et al, 2013) but the function gives the
possibility to use another field. The local scale will be usually given by
precipitation or temperature fields, but might be another variable.
The analogs function will find the best analogs based in three criterias:
(1) Minimal distance in the large scale pattern (i.e. SLP)
(2) Minimal distance in the large scale pattern (i.e. SLP) and minimal
distance in the local scale pattern (i.e. SLP).
(3) Minimal distance in the large scale pattern (i.e. SLP), minimal
distance in the local scale pattern (i.e. SLP) and maxima correlation in the
local variable to downscale (i.e Precipitation).
The search of analogs must be done in the longest dataset posible. This is
important since it is necessary to have a good representation of the
possible states of the field in the past, and therefore, to get better
analogs. Once the search of the analogs is complete, and in order to used the
three criterias the user can select a number of analogsi, using parameter
'nAnalogs' to restrict
the selection of the best analogs in a short number of posibilities, the best
ones.
This function has not constrains of specific regions, variables to downscale,
or data to be used (seasonal forecast data, climate projections data,
reanalyses data).
The regrid into a finner scale is done interpolating with CST_Load.
Then, this interpolation is corrected selecting the analogs in the large
and local scale in based of the observations.
The function is an adapted version of the method of Yiou et al 2013.
}
\examples{
# Example 1:
expL <- 1:20
dim(expL) <- c(lat = 4, lon = 5)
obsL <- 1:120
dim(obsL) <- c(lat = 4, lon = 5, time = 6)
time_obsL <- paste(rep("01", 6), rep("01", 6), 1998 : 2003, sep = "-")
Analogs(expL, obsL, time_obsL)
# Example 2:
expL <- 1 : (1 * 1 * 4 * 8 * 8)* 16
dim(expL) <- c(dataset = 1, member = 1, sdate = 1, ftime = 4,
lat = 8, lon = 8)
obsL <- 1 : (1 * 1 * 4 * 8 * 8) * 14
dim(obsL) <- c(dataset = 1, member = 1, sdate = 1, ftime = 4,
lat = 8, lon = 8)
time_obsL <- paste(paste0(rep("0", 4), 1 : 4), rep("05", 4),
rep("2017", 4), sep = "-")
res <- Analogs(expL, obsL, time_obsL)
# Example 3:
library(CSTools)
expL <- lonlat_data$exp$data
obsL <- lonlat_data$obs$data
time_obsL <- lonlat_data$obs$Dates$start
res <- Analogs(expL, obsL, time_obsL)
}
\references{
Yiou, P., T. Salameh, P. Drobinski, L. Menut, R. Vautard,
and M. Vrac, 2013 : Ensemble reconstruction of the atmospheric column
from surface pressure using analogues. Clim. Dyn., 41, 1419-1437.
\email{pascal.yiou@lsce.ipsl.fr}
}
\author{
Carmen Alvarez-Castro, \email{carmen.alvarez-castro@cmcc.it}
Nuria Perez-Zanon \email{nuria.perez@bsc.es}
}