# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

# portvrisk

Portfolio value at risk (VaR)

## Syntax

```ValueAtRisk = portvrisk(PortReturn, PortRisk, RiskThreshold,PortValue)
```

## Arguments

 `PortReturn` Number of portfolios (`NPORTS`)-by-`1` vector or scalar of the expected return of each portfolio over the period. ` PortRisk` `NPORTS`-by-`1` vector or scalar of the standard deviation of each portfolio over the period. `RiskThreshold` (Optional) `NPORTS`-by-`1` vector or scalar specifying the loss probability. Default = `0.05` (5%). `PortValue` (Optional) `NPORTS`-by-`1` vector or scalar specifying the total value of asset portfolio. Default = `1`.

## Description

```ValueAtRisk = portvrisk(PortReturn, PortRisk, RiskThreshold, PortValue)``` returns the maximum potential loss in the value of a portfolio over one period of time (that is, monthly, quarterly, yearly, etc.) given the loss probability level `RiskThreshold`.

`ValueAtRisk` is an `NPORTS`-by-`1` vector of the estimated maximum loss in the portfolio, predicted with a confidence probability of 1 − `RiskThreshold`. `portvrisk` calculates `ValueAtRisk` using a normal distribution.

If `PortValue` is not given, `ValueAtRisk` is presented on a per-unit basis. A value of `0` indicates no losses.

## Examples

collapse all

This example shows how to return the maximum potential loss in the value of a portfolio over one period of time, where `ValueAtRisk` is computed on a per-unit basis.

```PortReturn = 0.29/100; PortRisk = 3.08/100; RiskThreshold = [0.01;0.05;0.10]; PortValue = 1; ValueAtRisk = portvrisk(PortReturn,PortRisk,... RiskThreshold,PortValue) ```
```ValueAtRisk = 0.0688 0.0478 0.0366 ```

This example shows how to return the maximum potential loss in the value of a portfolio over one period of time, where `ValueAtRisk` is computed with actual values.

```PortReturn = [0.29/100;0.30/100]; PortRisk = [3.08/100;3.15/100]; RiskThreshold = 0.10; PortValue = [1000000000;500000000]; ValueAtRisk = portvrisk(PortReturn,PortRisk,... RiskThreshold,PortValue) ```
```ValueAtRisk = 1.0e+07 * 3.6572 1.8684 ```