`FairPortfolio.apply_f_from_2nd_row`

— Method`apply_f_from_2nd_row(prices::Matrix, f::Function, top_row_value)`

Per column, apply function f to the prices row-by-row, depending on current and prev value Good data from 2nd row.

`FairPortfolio.calc_dret`

— Method`calc_lnret(prices::Matrix)`

Input: prices Output: nominal returns, good from 2nd row https://en.wikipedia.org/wiki/Continuously*compounded*nominal*and*real_returns

`FairPortfolio.calc_lnret`

— Method`calc_lnret(prices::Matrix)`

Input: prices Output: continuous returns, good from 2nd row https://en.wikipedia.org/wiki/Continuously*compounded*nominal*and*real_returns

`FairPortfolio.calc_new_variance`

— Method`calc_new_variance`

Running variance calculation of time series data. Calculates the variance given the prev one, the prev point and the new point.

`FairPortfolio.calc_norm_dret`

— Method`calc_norm_dret(dret::Matrix, running_var_homogenizer::Matrix)`

Given the nominal returns (dret) and running variance homogenizer, calculate the homogenized nominal returns. Good data from 1 rows after input

`FairPortfolio.calc_running_homogenizer`

— Method`calc_running_homogenizer`

Given running variance, calculates the homogenizing factor required to have a stable variance across assets and time (heteroskadasticity -> homoskadasticity). Good data same as input.

`FairPortfolio.calc_running_variance`

— Method`calc_running_variance(lnret::Matrix)`

Output: Matrix of running variances with VAR*WINDOW. Good data from 1+VAR*WINDOW ≤ nrows

`FairPortfolio.create_constant_diagonals!`

— Method`create_constant_diagonals!(C)`

Takes a Assets that C is square and replaces it's diagonal with the mean of it's diagonal

`FairPortfolio.explain`

— Method`explain(weights, running_var_homogenizer, prices_matrix)`

User friendly results.

`FairPortfolio.optimize`

— Method`optimize(C)`

(nassets, nassets) = size(C) Takes a full (square) covariance matrix (C) (symmetric and positive semi-definite) and with constant diagonals. Output: optimal weights per asset.

`FairPortfolio.optimize`

— Method`optimize(prices...)`

Expects a vector per asset, rows are per time period. Each asset has the same # of rows. Calculates the homogenized and shrunk covariance matrix before running the core optimization. Output: optimal weights per asset.

`FairPortfolio.separate_cov_matrix`

— Method`separate_cov_matrix(C)`

(nassets, nassets) = size(C) Takes a full (square) covariance matrix (C) (symmetric and positive semi-definite) and with constant diagonals. Returns C split into four parts as required by the optimization.

`FairPortfolio.shrink`

— Method`shrink(C)`

Statistical Shrinkage stabilizes the covariance matrix C https://en.wikipedia.org/wiki/Shrinkage_(statistics)

`FairPortfolio.tuple_to_matrix`

— Method`tuple_to_matrix(prices::Tuple)`

Input are prices vectors per asset as a tuple or separated as arguments. E.g. tuple*to*matrix(asset*1*prices, asset*2*prices, asset*3*prices, ...) Returns a Matrix with a column per asset and a row per time period.