## Security Risk

A security's risk comes in different flavors: total risk (standard deviation), and risk decomposition (factor & specific variance).

These values are retrievable from the security risk node from the Omega Point API (which drives all the data displayed within the web application):

``# The security's risk values as Std Dev & Variance Decompositiontype SecurityRisk {  # The security's predicted risk (std dev)  standardDeviation: {    # The security's total predicted risk    total: Float  }  # The risk decomposition of the security, as a % of total risk  varianceDecomposition:{    # The aggregate decompositions of the security's risk    summary:{      # The % of the security's risk attributed to specific risk (as       a variance decomposition to total risk)      specific: Float            # The % of the security's risk attributed to factor risk (as a       variance decomposition to total risk)      factors: Float    }  }}``

The total risk value itself comes directly from the underlying risk model, though the definition of total risk across models remains consistent, and can be thought of in the following terms:

``factor variance = X * F * X.Twhere X are the exposures, X.T is the transposeF is the factor covariance matrixspecific variance = W * S * W.TwhereW = security weightsS = security covarianceW.T  = weight transposetotal variance = factor variance + specific variancetotal risk = sqrt(total variance)``

## Portfolio Risk

Portfolio risk is calculated using the standard deviation of each security in the portfolio and the correlation between securities in the portfolio. This number is displayed as a portfolio's total risk.

We can back out the factor and specific decomposition in terms of standard deviation of (total) risk, as follows:

``variance = (standard std risk)^2variance(total)= variance(factor) + variance(specific)variance(total)= (%variance factor) * variance(total) + (%variance specific) * variance(total)(std risk total)^2 = (std factor risk)^2 + (std idio risk)^2= (%variance factor) * variance(total) + (%variance specific) * variance(total)(std factor risk)^2= (% variance factor) * variance(total)``
``Note that % variance can be negative. % variance should always be positive for factor vs idiosyncratic since idiosyncratic and total are always positive.``