# 13.14. Calculation algorithm “*QuantileRegression*”¶

## 13.14.1. Description¶

This mono-objective optimization algorithm allows to estimate the conditional quantiles of the state parameters distribution, expressed with a model of the observed variables. These are then the quantiles on the observed variables which will allow to determine the model parameters that satisfy to the quantiles conditions.

## 13.14.2. Some noteworthy properties of the implemented methods¶

To complete the description, we summarize here a few notable properties of the algorithm methods or of their implementations. These properties may have an influence on how it is used or on its computational performance. For further information, please refer to the more comprehensive references given at the end of this algorithm description.

The optimization methods proposed by this algorithm perform a

**local search for the minimum**, theoretically enabling a locally optimal state (as opposed to a “*globally optimal*” state) to be reached.

The methods proposed by this algorithm

**require the derivation of the objective function or of one of the operators**. It requires that at least one or both of the observation or evolution operators be differentiable, and this implies an additional cost in the case where the derivatives are calculated numerically by multiple evaluations.

The methods proposed by this algorithm

**achieve their convergence on one or more residue or number criteria**. In practice, there may be several convergence criteria active simultaneously.The residue can be a conventional measure based on a gap (e.g. “

*calculation-measurement gap*”), or be a significant value for the algorithm (e.g. “*nullity of gradient*”).The number is frequently a significant value for the algorithm, such as a number of iterations or a number of evaluations, but it can also be, for example, a number of generations for an evolutionary algorithm.

Convergence thresholds need to be carefully adjusted, to reduce the gobal calculation cost, or to ensure that convergence is adapted to the physical case encountered.

## 13.14.3. Optional and required commands¶

The general required commands, available in the editing user graphical or textual interface, are the following:

- Background
*Vector*. The variable indicates the background or initial vector used, previously noted as . Its value is defined as a “*Vector*” or “*VectorSerie*” type object. Its availability in output is conditioned by the boolean “*Stored*” associated with input.

- Observation
*List of vectors*. The variable indicates the observation vector used for data assimilation or optimization, and usually noted . Its value is defined as an object of type “*Vector*” if it is a single observation (temporal or not) or “*VectorSeries*” if it is a succession of observations. Its availability in output is conditioned by the boolean “*Stored*” associated in input.

- ObservationOperator
*Operator*. The variable indicates the observation operator, usually noted as , which transforms the input parameters to results to be compared to observations . Its value is defined as a “*Function*” type object or a “*Matrix*” type one. In the case of “*Function*” type, different functional forms can be used, as described in the section Requirements for functions describing an operator. If there is some control included in the observation, the operator has to be applied to a pair .

The general optional commands, available in the editing user graphical or
textual interface, are indicated in List of commands and keywords for data assimilation or optimization case.
Moreover, the parameters of the command “*AlgorithmParameters*” allows to
choose the specific options, described hereafter, of the algorithm. See
Description of options of an algorithm by “AlgorithmParameters” for the good use of this
command.

The options are the following:

- Bounds
*List of pairs of real values*. This key allows to define pairs of upper and lower bounds for every state variable being optimized. Bounds have to be given by a list of list of pairs of lower/upper bounds for each variable, with a value of`None`

each time there is no bound. The bounds can always be specified, but they are taken into account only by the constrained optimizers. If the list is empty, there are no bounds.Example:

`{"Bounds":[[2.,5.],[1.e-2,10.],[-30.,None],[None,None]]}`

- CostDecrementTolerance
*Real value*. This key indicates a limit value, leading to stop successfully the iterative optimization process when the cost function decreases less than this tolerance at the last step. The default is 1.e-6, and it is recommended to adapt it to the needs on real problems. One can refer to the section describing ways for Convergence control for calculation cases and iterative algorithms for more detailed recommendations.Example:

`{"CostDecrementTolerance":1.e-6}`

- InitializationPoint
*Vector*. The variable specifies one vector to be used as the initial state around which an iterative algorithm starts. By default, this initial state is not required and is equal to the background . Its value must allow to build a vector of the same size as the background. If provided, it replaces the background only for initialization.Example :

`{"InitializationPoint":[1, 2, 3, 4, 5]}`

- MaximumNumberOfIterations
*Integer value*. This key indicates the maximum number of internal iterations allowed for iterative optimization. The default is 15000, which is very similar to no limit on iterations. It is then recommended to adapt this parameter to the needs on real problems. For some optimizers, the effective stopping step can be slightly different of the limit due to algorithm internal control requirements. One can refer to the section describing ways for Convergence control for calculation cases and iterative algorithms for more detailed recommendations.Example:

`{"MaximumNumberOfIterations":100}`

- Quantile
*Real value*. This key allows to define the real value of the desired quantile, between 0 and 1. The default is 0.5, corresponding to the median.Example:

`{"Quantile":0.5}`

- StoreSupplementaryCalculations
*List of names*. This list indicates the names of the supplementary variables, that can be available during or at the end of the algorithm, if they are initially required by the user. Their availability involves, potentially, costly calculations or memory consumptions. The default is then a void list, none of these variables being calculated and stored by default (excepted the unconditional variables). The possible names are in the following list (the detailed description of each named variable is given in the following part of this specific algorithmic documentation, in the sub-section “*Information and variables available at the end of the algorithm*”): [ “Analysis”, “BMA”, “CostFunctionJ”, “CostFunctionJb”, “CostFunctionJo”, “CurrentIterationNumber”, “CurrentState”, “Innovation”, “OMA”, “OMB”, “SimulatedObservationAtBackground”, “SimulatedObservationAtCurrentState”, “SimulatedObservationAtOptimum”, ].Example :

`{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}`

*Tips for this algorithm:*

As the

“BackgroundError”and“ObservationError”commands are required for ALL the calculation algorithms in the interface, you have to provide a value, even if these commands are not required for this algorithm, and will not be used. The simplest way is to give “1” as a STRING for both.

## 13.14.4. Information and variables available at the end of the algorithm¶

At the output, after executing the algorithm, there are information and
variables originating from the calculation. The description of
Variables and information available at the output show the way to obtain them by the method
named `get`

, of the variable “*ADD*” of the post-processing in graphical
interface, or of the case in textual interface. The input variables, available
to the user at the output in order to facilitate the writing of post-processing
procedures, are described in the Inventory of potentially available information at the output.

**Permanent outputs (non conditional)**

The unconditional outputs of the algorithm are the following:

- Analysis
*List of vectors*. Each element of this variable is an optimal state in optimization, an interpolate or an analysis in data assimilation.Example:

`xa = ADD.get("Analysis")[-1]`

- CostFunctionJ
*List of values*. Each element is a value of the chosen error function .Example:

`J = ADD.get("CostFunctionJ")[:]`

- CostFunctionJb
*List of values*. Each element is a value of the error function , that is of the background difference part. If this part does not exist in the error function, its value is zero.Example:

`Jb = ADD.get("CostFunctionJb")[:]`

- CostFunctionJo
*List of values*. Each element is a value of the error function , that is of the observation difference part.Example:

`Jo = ADD.get("CostFunctionJo")[:]`

**Set of on-demand outputs (conditional or not)**

The whole set of algorithm outputs (conditional or not), sorted by alphabetical order, is the following:

- Analysis
*List of vectors*. Each element of this variable is an optimal state in optimization, an interpolate or an analysis in data assimilation.Example:

`xa = ADD.get("Analysis")[-1]`

- BMA
*List of vectors*. Each element is a vector of difference between the background and the optimal state.Example:

`bma = ADD.get("BMA")[-1]`

- CostFunctionJ
*List of values*. Each element is a value of the chosen error function .Example:

`J = ADD.get("CostFunctionJ")[:]`

- CostFunctionJb
*List of values*. Each element is a value of the error function , that is of the background difference part. If this part does not exist in the error function, its value is zero.Example:

`Jb = ADD.get("CostFunctionJb")[:]`

- CostFunctionJo
*List of values*. Each element is a value of the error function , that is of the observation difference part.Example:

`Jo = ADD.get("CostFunctionJo")[:]`

- CurrentIterationNumber
*List of integers*. Each element is the iteration index at the current step during the iterative algorithm procedure. There is one iteration index value per assimilation step corresponding to an observed state.Example:

`cin = ADD.get("CurrentIterationNumber")[-1]`

- CurrentState
*List of vectors*. Each element is a usual state vector used during the iterative algorithm procedure.Example:

`xs = ADD.get("CurrentState")[:]`

- Innovation
*List of vectors*. Each element is an innovation vector, which is in static the difference between the optimal and the background, and in dynamic the evolution increment.Example:

`d = ADD.get("Innovation")[-1]`

- OMA
*List of vectors*. Each element is a vector of difference between the observation and the optimal state in the observation space.Example:

`oma = ADD.get("OMA")[-1]`

- OMB
*List of vectors*. Each element is a vector of difference between the observation and the background state in the observation space.Example:

`omb = ADD.get("OMB")[-1]`

- SimulatedObservationAtBackground
*List of vectors*. Each element is a vector of observation simulated by the observation operator from the background . It is the forecast from the background, and it is sometimes called “*Dry*”.Example:

`hxb = ADD.get("SimulatedObservationAtBackground")[-1]`

- SimulatedObservationAtCurrentState
*List of vectors*. Each element is an observed vector simulated by the observation operator from the current state, that is, in the observation space.Example:

`hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]`

- SimulatedObservationAtOptimum
*List of vectors*. Each element is a vector of observation obtained by the observation operator from simulation on the analysis or optimal state . It is the observed forecast from the analysis or the optimal state, and it is sometimes called “*Forecast*”.Example:

`hxa = ADD.get("SimulatedObservationAtOptimum")[-1]`