SSJ  3.3.1 Stochastic Simulation in Java
Package umontreal.ssj.stat.list.lincv

## Classes

class  FunctionOfMultipleMeansTallyWithCV
Represents a function of multiple means tally for an estimator with linear control variables. More...

class  ListOfTalliesWithCV
Represents a list of tallies with control variables that inherits the functionalities of a list of tallies, and accepts vectors of length $$p+q$$. More...

## Detailed Description

Provides facilities for computing estimators with linear control variables [117], [72] . Let $$\mathbf{X}\in\mathbb{R}^p$$ be a vector of estimators, and $$\mathbf{C}\in\mathbb{R}^q$$ be a vector of control variables with known expectation $$E[\mathbf{C}]$$. The estimator $$\mathbf{X}$$ can be replaced by the linearly controlled estimator

$\mathbf{X}_{\mathrm{C}}=\mathbf{X}- \boldsymbol{\beta}^{\mathsf{t}}(\mathbf{C}- E[\mathbf{C}]),$

where $$\boldsymbol{\beta}$$ is a constant $$q\times p$$ matrix. The covariance matrix of this estimator is

$\mathrm{Cov}(\mathbf{X}_{\mathrm{C}}) = \boldsymbol{\Sigma}_{\mathrm{X}}+ \boldsymbol{\beta}^{\mathsf{t}}\boldsymbol{\Sigma}_{\mathrm{C}}\boldsymbol{\beta}- \boldsymbol{\beta}^{\mathsf{t}}\boldsymbol{\Sigma}_{\mathrm{CX}}- \boldsymbol{\Sigma}_{\mathrm{CX}}^{\mathsf{t}}\boldsymbol{\beta},$

where $$\boldsymbol{\Sigma}_{\mathrm{CX}}$$ is the $$q\times p$$ covariance matrix of $$\mathbf{C}$$ and $$\mathbf{X}$$, $$\boldsymbol{\Sigma}_{\mathrm{C}}$$ is the $$q\times q$$ covariance matrix of $$\mathbf{C}$$, and $$\boldsymbol{\Sigma}_{\mathrm{X}}$$ is the $$p\times p$$ covariance matrix of $$\mathbf{X}$$. The matrix $$\boldsymbol{\beta}$$ can be set for $$|\mathrm{Cov}(\mathbf{X}_{\mathrm{C}})|\le|\mathrm{Cov}(\mathbf{X})|$$, where $$|\boldsymbol{\Sigma}|$$ is the determinant of the matrix $$\boldsymbol{\Sigma}$$. The optimal $$\boldsymbol{\beta}$$ matrix, which minimizes the determinant (or the trace) of the covariance matrix, is

$\boldsymbol{\beta}^* = \boldsymbol{\Sigma}_{\mathrm{C}}^{-1}\boldsymbol{\Sigma}_{\mathrm{CX}}.$

If $$\boldsymbol{\mu}=E[\mathbf{X}]$$, $$\boldsymbol{\nu}=E[\mathbf{C}]$$, and $$g(\boldsymbol{\mu})$$ is a continuous function in the neighborhood of $$\boldsymbol{\mu}$$, let $$h(\boldsymbol{\mu}, \boldsymbol{\nu})=g(\boldsymbol{\mu})-\boldsymbol{\beta}_{\mathrm{f}}^{\mathsf{t}}(\mathbf{C}- \boldsymbol{\nu})$$ be the corresponding function with control variables. Here, $$\boldsymbol{\beta}_{\mathrm{f}}$$ is a $$q$$-dimensional vector being set to reduce the variance of the function of averages with control variables. The optimal $$\boldsymbol{\beta}_{\mathrm{f}}$$ vector that minimizes the variance is

$\boldsymbol{\beta}_{\mathrm{f}}^* = \boldsymbol{\beta}^*\nabla g(\boldsymbol{\mu}) = \boldsymbol{\Sigma}_{\mathrm{C}}^{-1}\boldsymbol{\Sigma}_{\mathrm{CX}}\nabla g(\boldsymbol{\mu}).$

This package provides classes that can help one implement such control variables. During the simulation, or during pilot runs, one adds observations of the estimators and the control variables to a list of tallies specialized for control variables. This list computes the covariances, and can compute an estimate of $$\boldsymbol{\beta}^*$$ by using matrices of sample covariances. The vector of controlled averages, and the sample controlled covariance matrix can then be obtained. Alternatively, one can reset the list of tallies, keep the $$\boldsymbol{\beta}$$ matrix, and add independent vectors of observations.

The package also provides a class for applying control variables on a function of multiple averages. A tally for a function of multiple means with control variables encapsulates a list of tallies with control variables, and an object computing $$g(\boldsymbol{\mu})$$ and its gradient $$\nabla g(\boldsymbol{\mu})$$. A method is available to estimate the $$\boldsymbol{\beta}_{\mathrm{f}}$$ vector minimizing the variance of the function of averages.