Open heshriti opened 5 years ago
Hi @heshriti. You can download the YAML file you requested from this link.
If you would like to generate it yourself, you need to follow these steps:
dumpfile
; this will create a MAT file with the problem dataproblem_to_yaml
to export the problem in YAML formatHere is the code:
%% Run the portfolio selection problem
density = 0.1;
rc = 0.5; % estimated reciprocal condition number
n = 100000;
m = 100;
mu = exp(0.01 * randn(n, 1)) - 1; % returns
D = rand(n,1) / 10; % idiosyncratic risk
F = sprandn(n, m, density, rc) / 10; % factor model
gamma = 1;
B = 1;
cvx_begin
cvx_solver scs
cvx_solver_settings('eps', 1e-4,...
'do_super_scs', 1,...
'direction', 100,...
'memory', 100, ...
'dumpfile', 'portfolio.mat')
variable x(n)
maximize(mu'*x - gamma*(sum_square(F'*x) + sum_square(D.*x)))
sum(x) == B
x >= 0
cvx_end
%% Serialize the problem
load('portfolio.mat');
problem_to_yaml('portfolio.yml', 'MyPortfolio', data, K);
@alphaville Thanks Pantellis.
Is it possible to share python or c example to generate this yaml? I don't have matlab unfortunately.
Hi,
do you have a YAML file of the portfolio selection problem in the cvx page? (https://kul-forbes.github.io/scs/page_cvx_examples.html)
Thank you.