Cumulative Returns

**The total change in the price of an investment over a set time period**

cumulative_return = (price[t] / prince[0] ) - 1

-or-

cumulative_return = (price at end / price the beginning ) - 1 price[t] is any particular day and price[0] is the price at the beginning

*Lecture 01-04-12*

Bollinger Bands (r)

Bands that are 2 standard deviations above and below the rolling mean.

Rolling mean +/- std deviation * 2

*Lecture 01-04-07*

Why is data not pristine

###
- Data is an amalgamation of different sources and prices.
- Not all stocks trade every day.

*Lecture 01-05-02*

Why does data go missing?

Some stocks stop trading and start trading. Some stock trade under the same ticker but different name. Some stocks trade erratically due to low market cap. 01-05-03

How do you fill gaps when there are gaps in data of a stock.

###
- Fill forward first,
- fill backwards second
- do not interpolate a trend.

Why are Bollinger Bands important.

The theory states that if the stock crosses the bands then it may be a point to pay attention.

*Lecture 01-04-07*

Daily Returns

How much did the price go up or down on a particular day.

- daily_return[t] = (price[t] / prince[t-1] ) - 1
*t = day t*

*Lecture 01-04-10*

How do you use a histogram to plot daily returns?

Take the daily return over a plot in time and fill the histogram values based on the number of occurrences of the daily returns.

*Lecture 01-06-02*

What would you expect a histogram of daily returns to look like?

A normal or Gaussian distribution.

*Lecture 01-06-03*

Kurtosis

The difference between a normal Gaussian distribution and the distribution of the.

Kurtosis is positive with larger tails and negative with skinny tails.

*Lecture 01-06-06*

beta (scatter plot)

###
- When fitting a line to scatter plot, beta the slope of the line..
- This indicates how reactive is the stock to the market.

Lecture 01-06-10

alpha (scatter plot)

###
- When fitting a line to scatter plot, Alpha is where the line intercepts the vertical axis (y=0).
- This indicates how the stock is returning compared to the market as a whole.

*Lecture 01-06-10*

How do you use a scatter plot to plot daily returns?

When comparing two stocks, take the daily returns of two stocks and plot (x, y) as (stock_a, stock_b).

Using linear regression plot the mean as a line to find beta and alpha.

E.G. when comparing a stock against the market as a whole

*Lecture 01-06-09*

Slope vs correlation.

Correlation is how tight the points are to the mean, where as the slope is just the slope of the line.

*Lecture 01-07-11*

What is a portfolio?

Allocation of funds to a set of stocks

*Lecture 01-07-01*

How do you calculate the total value of the portfolio day by day?

###
- normalize the prices
- multiply normalized values x portfolio allocations
- Take that and multiply it by starting values
- sum each row

*Lecture 01-07-02*

Sharpe Ratio

**Risk adjusted Return **

- Lower Risk is better
- Higher return is better

(Rp - Rf) / σp

*ex ante *E[Rp - Rf] / STD[Rp]

- Rp: portfolio return
- Rf: risk free rate of return
- σp: Standard Deviation of portfolio return

*Lectures 01-07-05; 01-07-06*

What is Risk free rate of return and where can you get it?

**Return if you put your money into a bank **

Can get it from

- LIBOR
- 3 Month Tbill
- or Just use 0%

*Lecture 01-07-05; 01-07-11*

How do you calculate daily risk free rate if using Libor or 3 month tbill.

###
- Take the APR of the risk free option, (Libor, tbill)
- Add 1 to the APR
- Take the 252 root of that sum
- subtract 1

*Lecture 01-07-07*

What is the annualized version of the sharpe ratio.

Since it was intended to be an annual measurement but can change based on frequencey of the sample SR

- Annualized Sharpe Ratio = K * SR
- K = sqrt(# of samples per year)
- Daily K = sqrt(252)
- Weekly K = sqrt(52)
- Monthly K = sqrt(12)

*Lecture 01-07-11*

What is an optimizer?

###
- Finds minimum Values of functions using convex polyogns
- Build parameterized models based on data.
- Refine allocations to stocks in portfolios.

*Lecture 01-08-01*

How to use an optimizer?

###
- Provide a function to minimize
- Provide an initial guess
- Optimizer searches for the minima

*Lecture 01-08-01*

What are the methods do minimizers use?

Gradient Descent...

*Lecture 01-08-02*

How can minimizers be defeated?

###
- Lines with no gradient
- Many local minima
- More than 1 global minimal
- discontinuous lines

*Lecture 01-08-03; 01-08-04*

What are the easiest type of problems for minimizers and why?

Convex Problems

*Lecture 01-08-05*

What is a convex function?

In mathematics, a real-valued function defined on an n-dimensional interval is called convex (or convex downward or concave upward) if the line segment between any two points on the graph of the function lies above or on the graph. Must have one minima.

*Wiki https://en.wikipedia.org/wiki/Convex_function *

*Lecture 01-08-06*

What is a parameterized model?

A model that take parameters or coefficients.

*Lecture 01-08-07*

What is a good error metric for models?

###
- sum of all abs error
- sum of square error

*Lecture 01-08-08, 01-08-09*

What is portfolio optimization?

###
- Given a set of assets and a time period.
- Find an allocation of funds to assets that maximizes performance.

*Lecture 01-09-01*

How do you measure performance in portfolio optimization?

###
- Cumulative return
- Volatility or risk
- Sharpe Ratio (Risk adjusted return)

*Lecture 01-09-01 *