As input data, you are given a nObs-by-nAssets matrix portRet of return series for assets in a portfolio along with an nAssets-by-1 vector portWeights of portfolio weights. Example:
>> nObs = 504; % Number of observations
>> nAssets = 5; % Number of assets in the portfolio
>> portRet = randn(nObs, nAssets); % Sample portfolio return series
>> portWeights = rand(nAssets, 1);
>> portWeights = portWeights/sum(portWeights); % Portfolio weights are >=0 and sum to 1.
The task is to compute the portfolio cokurtosis , which is a scalar statistic associated with the portfolio. A full description of this statistic, along with sample MATLAB code for computing it, can be found here:
http://www.quantatrisk.com/2013/01/20/coskewness-and-cokurtosis/
Write a function that accepts portRet and portWeights as input arguments and returns the scalar statistic portCokurt as its output. You can use the code at the website above as a starting point, but try to simplify and shorten it in the spirit of Cody.
Remove any row in which a NaN appears
5974 Solvers
28 Solvers
151 Solvers
Gauss Eliminate 2-by-2 example
113 Solvers
263 Solvers
Problem Tags