int __stdcall NDK_PORTFOLIO_VARIANCE | ( | double * | weights, |
size_t | nAssets, | ||
double ** | covar, | ||
double * | variance | ||
) |
Calculates the overall portfolio variance (volatility squared).
- Returns
- status code of the operation
- Return values
-
NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
- Remarks
-
- The weights array size must equal to the number of risky assets.
- The assets order in must be identical in the covariance and assets weights arrays.
- By definition, the covariance matrix is a square symmetric matrix with order equals to number of assets in the portfolio.
- The number of unique elements in the covariance matrix is equal to: \[\frac{N \times (N+1)}{2}\] Where \(N\) is the number of risky assets in the portfolio.
- Requirements
-
Header SFSDK.H Library SFSDK.LIB DLL SFSDK.DLL