.. _model-active_subspace-truncation_method-constantine:

"""""""""""
constantine
"""""""""""


Use the Constantine diagnostic to truncate subspace


.. toctree::
   :hidden:
   :maxdepth: 1



**Specification**

- *Alias:* None

- *Arguments:* None


**Description**


Uses a criterion based on the variability of the subspace estimate.
Eigenvectors are computed for bootstrap samples of the gradient matrix. The
subspace size associated with the minimum distance between bootstrap
eigenvectors and the nominal eigenvectors is the estimated active subspace
size.

*Usage Tips*

If this automated diagnostic does not yield desirable results, consider
using the explicit :dakkw:`model-active_subspace-dimension` truncation option or one of the other
truncation methods.



**Theory**


Below is a brief outline of the Constantine method of active subspace
identification. The first two steps are common to all active subspace
truncation methods.

1. Compute the gradient of the quantity of interest, :math:`q = f(\mathbf{x})` ,
    at several locations sampled from the input space,
    
.. math:: \nabla_{\mathbf{x}} f_i = \nabla f(\mathbf{x}_i).

2. Compute the eigendecomposition of the matrix :math:`\hat{\mathbf{C}}` ,
    
.. math:: \hat{\mathbf{C}} = \frac{1}{M}\sum_{i=1}^{M}\nabla_{\mathbf{x}} f_i\nabla_{\mathbf{x}} f_i^T = \hat{\mathbf{W}}\hat{\mathbf{\Lambda}}\hat{\mathbf{W}}^T,

where :math:`\hat{\mathbf{W}}`  has eigenvectors as columns,
    :math:`\hat{\mathbf{\Lambda}} = \text{diag}(\hat{\lambda}_1,\:\ldots\:,\hat{\lambda}_N)` 
    contains eigenvalues, and :math:`N`  is the total number of parameters.

3. Use bootstrap sampling of the gradients found in step 1 to compute replicate
    eigendecompositions,
    
.. math:: \hat{\mathbf{C}}_j^* = \hat{\mathbf{W}}_j^*\hat{\mathbf{\Lambda}}_j^*\left(\hat{\mathbf{W}}_j^*\right)^T.

4. Compute the average distance between nominal and bootstrap subspaces,
    
.. math:: e^*_n = \frac{1}{M_{boot}}\sum_j^{M_{boot}} \text{dist}(\text{ran}(\hat{\mathbf{W}}_n), \text{ran}(\hat{\mathbf{W}}_{j,n}^*)) = \frac{1}{M_{boot}}\sum_j^{M_{boot}} \left\| \hat{\mathbf{W}}_n\hat{\mathbf{W}}_n^T - \hat{\mathbf{W}}_{j,n}^*\left(\hat{\mathbf{W}}_{j,n}^*\right)^T\right\|,

where :math:`M_{boot}`  is the number of bootstrap samples,
    :math:`\hat{\mathbf{W}}_n`  and :math:`\hat{\mathbf{W}}_{j,n}^*`  both contain
    only the first :math:`n`  eigenvectors, and :math:`n < N` .

5. The estimated subspace rank, :math:`r` , is then,
    
.. math:: r = \operatorname*{arg\,min}_n \, e^*_n.

For additional information, see Constantine, Paul G. "Active Subspaces: Emerging Ideas for Dimension Reduction in Parameter Studies". Vol. 2. SIAM, 2015.


