Exercise

# Calculation of portfolio returns

For your first exercise on calculating portfolio returns, you will verify that a portfolio return can be computed as the weighted average of the portfolio component returns. In other words, this means that a **portfolio return** is calculated by taking the sum of simple returns multiplied by the portfolio weights. Remember that simple returns are calculated as the final value minus the initial value, divided by the initial value.

Assume that you invested in three assets. Their initial values are 1000 USD, 5000 USD, 2000 USD, respectively. Over time, the values change to 1100 USD, 4500 USD, and 3000 USD.

Instructions

**100 XP**

- Create a vector of the initial asset values
`in_values`

. - Create a vector of the final values,
`fin_values`

. - Create a vector of the initial weights,
`weights`

. - Use the simple return definition to compute the vector of returns on the three component assets. Assign return values to
`returns`

. - Assign the portfolio returns to
`preturns`

.