# pcalims

Linear inequalities for individual asset allocation

## Syntax

``[A,b] = pcalims(AssetMin,AssetMax)``
``[A,b] = pcalims(___,NumAssets)``

## Description

As an alternative to `pcalims`, use the Portfolio object (`Portfolio`) for mean-variance portfolio optimization. This object supports gross or net portfolio returns as the return proxy, the variance of portfolio returns as the risk proxy, and a portfolio set that is any combination of the specified constraints to form a portfolio set. For information on the workflow when using Portfolio objects, see Portfolio Object Workflow.

example

````[A,b] = pcalims(AssetMin,AssetMax)` specifies the lower and upper bounds of portfolio allocations in each of `NumAssets` available asset investments. `pcalims` specifies the lower and upper bounds of portfolio allocations in each of `NASSETS` available asset investments. NoteIf `pcalims` is called with fewer than two output arguments, the function returns `A` concatenated with `b` `[A,b]`. ```

example

````[A,b] = pcalims(___,NumAssets)` specifies options using an optional argument in addition to the input arguments in the previous syntax.```

## Examples

collapse all

Set the minimum weight in every asset to `0` (no short-selling), and set the maximum weight of IBM stock to `0.5` and CSCO to `0.8`, while letting the maximum weight in INTC float.

Minimum weight:

• IBM — 0

• INTC — 0

• CSCO — 0

Maximum weight:

• IBM — 0.5

• INTC —

• CSCO — 0.8

`AssetMin = 0`
```AssetMin = 0 ```
`AssetMax = [0.5 NaN 0.8]`
```AssetMax = 1×3 0.5000 NaN 0.8000 ```
`[A,b] = pcalims(AssetMin, AssetMax)`
```A = 5×3 1 0 0 0 0 1 -1 0 0 0 -1 0 0 0 -1 ```
```b = 5×1 0.5000 0.8000 0 0 0 ```

Portfolio weights of 50% in IBM and 50% in INTC satisfy the constraints

Set the minimum weight in every asset to `0` and the maximum weight to `1`.

Minimum weight:

• IBM — 0

• INTC — 0

• CSCO — 0

Maximum weight:

• IBM — 1

• INTC — 1

• CSCO — 1

`AssetMin = 0`
```AssetMin = 0 ```
`AssetMax = 1`
```AssetMax = 1 ```
`NumAssets = 3`
```NumAssets = 3 ```
`[A,b] = pcalims(AssetMin, AssetMax, NumAssets)`
```A = 6×3 1 0 0 0 1 0 0 0 1 -1 0 0 0 -1 0 0 0 -1 ```
```b = 6×1 1 1 1 0 0 0 ```

Portfolio weights of 50% in IBM and 50% in INTC satisfy the constraints.

## Input Arguments

collapse all

Minimum allocations in each asset, specified as a scalar numeric or `NASSETS` vector. `NaN` indicates no constraint.

Data Types: `double`

Maximum allocations in each asset, specified as a scalar numeric or `NASSETS` vector. `NaN` indicates no constraint.

Data Types: `double`

(Optional) Number of assets, specified as a scalar numeric.

Data Types: `double`

## Output Arguments

collapse all

Lower bound, returned as a matrix such that ```A*PortWts' <= b```, where `PortWts` is a `1`-by-`NASSETS` vector of asset allocations.

Upper bound, returned as a vector such that ```A*PortWts' <= b```, where `PortWts` is a `1`-by-`NASSETS` vector of asset allocations.

Introduced before R2006a