Portfolio optimization & backtesting

We evaluate, compare, and demonstrate different packages for performing portfolio optimization. There are several options available

  1. Optimization using scipy.optimize
  2. Optimization with cvxopt
  3. Optimiation with cvxpy

To compare the validity of our results, we will replicate the dataset and time window applied by DeMiguel et al. (2009) and its accompanying appendix.

We will replicate the Sharpe Ratios in in (Table 3) of DeMiguel et al. (2009). As long as the results are reasonably close, they will be deemed acceptable. This is because minor changes are made to the Ken French's dataset, and optimization is sensitive to changes in the input data.

Import modules

In [1]:
import os

import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from pprint import pprint

from scipy.optimize import minimize

import pandas_datareader.data as web  # module for reading datasets directly from the web
from pandas_datareader.famafrench import get_available_datasets

Reading data from Ken French's website

I print out all of the available datasets and find that there are 286 of them

In [2]:
datasets = get_available_datasets()
print('No. of datasets:{0}'.format(len(datasets)))
#datasets #comment out if you want to see all the datasets
No. of datasets:286

I am looking for the 10 industry portfolio, and want to find which are the right keywords

In [3]:
df_10_industry = [dataset for dataset in datasets if '10' in dataset and 'Industry' in dataset]
print(df_10_industry)
['10_Industry_Portfolios', '10_Industry_Portfolios_Wout_Div', '10_Industry_Portfolios_daily']

Note that if you do not insert start or end dates, the default will obtain portfolios from approximately 2010 to the latest datapoints available.

In [4]:
ds_industry = web.DataReader(df_10_industry[0],'famafrench',start='1963-07-01',end='2004-11-01') # Taking [0] as extracting '10_Industry_Portfolios'

Obtaining data from the datareader returns a dict. Thus we want to see what is inside the dict.

In [5]:
print(type(ds_industry))
ds_industry.keys()
<class 'dict'>
Out[5]:
dict_keys([0, 1, 2, 3, 4, 5, 6, 7, 'DESCR'])

We see that there is a DESCR. This tells us what the different datasets inside the dictionary refer to.

In [6]:
print(ds_industry['DESCR'])
10 Industry Portfolios
----------------------

This file was created by CMPT_IND_RETS using the 201902 CRSP database. It contains value- and equal-weighted returns for 10 industry portfolios. The portfolios are constructed at the end of June. The annual returns are from January to December. Missing data are indicated by -99.99 or -999. Copyright 2019 Kenneth R. French

  0 : Average Value Weighted Returns -- Monthly (497 rows x 10 cols)
  1 : Average Equal Weighted Returns -- Monthly (497 rows x 10 cols)
  2 : Average Value Weighted Returns -- Annual (42 rows x 10 cols)
  3 : Average Equal Weighted Returns -- Annual (42 rows x 10 cols)
  4 : Number of Firms in Portfolios (497 rows x 10 cols)
  5 : Average Firm Size (497 rows x 10 cols)
  6 : Sum of BE / Sum of ME (42 rows x 10 cols)
  7 : Value-Weighted Average of BE/ME (42 rows x 10 cols)

In order to replicate DeMiguel et al. (2009), we will use dataset 0.

In [7]:
ds_industry[0].head()
Out[7]:
NoDur Durbl Manuf Enrgy HiTec Telcm Shops Hlth Utils Other
Date
1963-07 -0.49 -0.22 -1.41 2.29 -0.69 -0.23 -1.03 0.56 0.80 -1.61
1963-08 4.89 6.55 6.20 3.93 5.14 4.29 6.43 9.56 4.20 5.49
1963-09 -1.69 -0.24 -0.76 -3.64 0.13 2.36 0.97 -4.06 -2.50 -3.16
1963-10 2.65 9.72 2.58 -0.32 8.29 3.40 0.52 3.38 -0.67 1.38
1963-11 -1.13 -4.84 0.30 -1.15 -0.29 4.16 -1.23 -1.65 -1.02 0.23

We perform the same process for the industry portfolios as for the FF risk factor portfolio dataset

In [8]:
df_5_factor = [dataset for dataset in datasets if '5' in dataset and 'Factor' in dataset]
print(df_5_factor)
ds_factors = web.DataReader(df_5_factor[0],'famafrench',start='1963-07-01',end='2004-11-01') # Taking [0] as extracting 1F-F-Research_Data_Factors_2x3')
print('\nKEYS\n{0}'.format(ds_factors.keys()))
print('DATASET DESCRIPTION \n {0}'.format(ds_factors['DESCR']))
ds_factors[0].head()
['F-F_Research_Data_5_Factors_2x3', 'F-F_Research_Data_5_Factors_2x3_daily', 'Global_5_Factors', 'Global_5_Factors_Daily', 'Global_ex_US_5_Factors', 'Global_ex_US_5_Factors_Daily', 'Europe_5_Factors', 'Europe_5_Factors_Daily', 'Japan_5_Factors', 'Japan_5_Factors_Daily', 'Asia_Pacific_ex_Japan_5_Factors', 'Asia_Pacific_ex_Japan_5_Factors_Daily', 'North_America_5_Factors', 'North_America_5_Factors_Daily']

KEYS
dict_keys([0, 1, 'DESCR'])
DATASET DESCRIPTION 
 F-F Research Data 5 Factors 2x3
-------------------------------

This file was created by CMPT_ME_BEME_OP_INV_RETS using the 201902 CRSP database. The 1-month TBill return is from Ibbotson and Associates Inc.

  0 : (497 rows x 6 cols)
  1 : Annual Factors: January-December (41 rows x 6 cols)
Out[8]:
Mkt-RF SMB HML RMW CMA RF
Date
1963-07 -0.39 -0.47 -0.83 0.66 -1.15 0.27
1963-08 5.07 -0.79 1.67 0.39 -0.40 0.25
1963-09 -1.57 -0.48 0.18 -0.76 0.24 0.27
1963-10 2.53 -1.29 -0.10 2.75 -2.24 0.29
1963-11 -0.85 -0.84 1.71 -0.45 2.22 0.27
In [9]:
dfAsset = ds_industry[0]/100
dfFactor = ds_factors[0]/100

Creating excess returns by subtracting the risk-free rate from the industry porfolio returns.

In [10]:
dfXsAsset = dfAsset.sub(dfFactor['RF'],axis=0)
dfXsAsset.head()
Out[10]:
NoDur Durbl Manuf Enrgy HiTec Telcm Shops Hlth Utils Other
Date
1963-07 -0.0076 -0.0049 -0.0168 0.0202 -0.0096 -0.0050 -0.0130 0.0029 0.0053 -0.0188
1963-08 0.0464 0.0630 0.0595 0.0368 0.0489 0.0404 0.0618 0.0931 0.0395 0.0524
1963-09 -0.0196 -0.0051 -0.0103 -0.0391 -0.0014 0.0209 0.0070 -0.0433 -0.0277 -0.0343
1963-10 0.0236 0.0943 0.0229 -0.0061 0.0800 0.0311 0.0023 0.0309 -0.0096 0.0109
1963-11 -0.0140 -0.0511 0.0003 -0.0142 -0.0056 0.0389 -0.0150 -0.0192 -0.0129 -0.0004

Portfolio performance metrics

In [11]:
def sharpe(returns, rf=0, days=1):
    volatility = returns.std() * np.sqrt(days) 
    sharpe_ratio = (returns.mean() - rf) / volatility
    return sharpe_ratio

def information_ratio(returns, benchmark_returns, days=252):
    return_difference = returns - benchmark_returns 
    volatility = return_difference.std() * np.sqrt(days) 
    information_ratio = return_difference.mean() / volatility
    return information_ratio

Equal-weighted portfolio (1/N) (re-balancing)

In [12]:
M = 120
pfRet=[]
pfStratRet = dict()
pfSharpeR = dict()

for date,assRet in dfXsAsset[M:].iterrows():      
    N = len(assRet)
    tgtWtg = 1/N*np.ones(N)
    
    assRet = np.array(assRet.values)
    pfRet.append(float(tgtWtg@assRet))
    
dfStratRet = pd.DataFrame(pfRet,index=dfXsAsset[M:].index,columns=['ew-rebal']) 
In [13]:
dfStratRet.head()
Out[13]:
ew
Date
1973-07 0.04497
1973-08 -0.04267
1973-09 0.04897
1973-10 -0.01565
1973-11 -0.12171

Equal-weighted portfolio (1/N) (buy & hold)

In [ ]:
for date,assRet in dfXsAsset[M:].iterrows():      
    N = len(assRet)
    tgtWtg = 1/N*np.ones(N)
    
    assRet = np.array(assRet.values)
    pfRet.append(float(tgtWtg@assRet))
    
dfStratRet = pd.DataFrame(pfRet,index=dfXsAsset[M:].index,columns=['ew-rebal'])
In [38]:
dfStratRet.head()
Out[38]:
ew mv_oos mv_oos_opt mv_oos_cvxopt
Date
1973-07 0.04497 0.123733 0.062300 0.0623
1973-08 -0.04267 -0.190477 -0.076100 -0.0761
1973-09 0.04897 -0.152751 0.001100 0.0011
1973-10 -0.01565 0.208402 0.011800 0.0118
1973-11 -0.12171 -0.062717 -0.082415 -0.0833

Mean-variance portfolio, Out-of-sample, Matrix Calculus

In [14]:
mean_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).mean().dropna()
cov_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).cov().dropna()
Target weights
In [15]:
pfTgtWts = []


for date, cov_df in cov_OOS.groupby(level=0):
    N = cov_df.shape[0]
    cov = cov_df.values
    mean = mean_OOS.loc[date,:].values
    inv_cov =  np.linalg.pinv(cov)
    
    tgtWts_num = inv_cov@mean
    tgtWts_denom =  np.ones((1,N))@inv_cov@mean
    
    pfTgtWts.append(tgtWts_num/tgtWts_denom)

pfTgtWts = np.array(pfTgtWts)    
pfTgtWts = pfTgtWts[:-1,:]

dfTgtWts = pd.DataFrame(pfTgtWts,index=dfXsAsset[M:].index,columns=list(cov_df)) 
dfTgtWts['Strategy'] = 'mv_oos'
dfTgtWts.set_index('Strategy',append=True,inplace=True)
Portfolio returns
In [16]:
pfRet = []

for date,assRet in dfXsAsset[M:].iterrows():      
    N = len(assRet)
    tgtWtg = dfTgtWts.loc[date,:].values
    
    pfRet.append(float(tgtWtg@assRet.values))
    
dfStratRet['mv_oos'] = pfRet

Mean-variance portfolio, Out-of-sample, Optimization (scipy package)

In [17]:
mean_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).mean().dropna()
cov_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).cov().dropna()
Target weights
In [18]:
# Calculates portfolio mean return
def port_mean(W, R):
    return sum(R * W)

# Calculates portfolio variance of returns
def port_var(W, C):
    return np.dot(np.dot(W, C), W)

def port_mean_var(W, R, C):
    return port_mean(W, R), port_var(W, C)

def mvo_objFunc(W, R, C, rf):
    mean, var = port_mean_var(W, R, C) 
    util = (mean - rf) / np.sqrt(var)  
    return 1 / util  

def opt_weights(R, C, rf):   
    n = len(R)
    W = np.ones([n]) / n  
    b_ = [(0, 1.0) for i in range(n)]  
    c_ = ({'type': 'eq', 'fun': lambda W: np.sum(W)-1.0}) 
    
    optimized = minimize(mvo_objFunc, W, (R, C, rf), method='SLSQP', constraints=c_, bounds=b_)

    return optimized.x
In [19]:
pfTgtWts = []

for date, cov_df in cov_OOS.groupby(level=0):
    N = cov_df.shape[0]
    cov = cov_df.values
    mean = mean_OOS.loc[date,:].values
   
    pfTgtWts.append(opt_weights(mean,cov,0))
In [20]:
pfTgtWts = np.array(pfTgtWts)   
pfTgtWts[pfTgtWts<10**-6] = 0
pfTgtWts = pfTgtWts[:-1,:]
In [21]:
dfTgtWts = pd.DataFrame(pfTgtWts,index=dfXsAsset[M:].index,columns=list(cov_df)) 
dfTgtWts['Strategy'] = 'mv_oos_opt'
dfTgtWts.set_index('Strategy',append=True,inplace=True)
Portfolio returns
In [22]:
pfRet = []

for date,assRet in dfXsAsset[M:].iterrows():      
    N = len(assRet)
    tgtWtg = dfTgtWts.loc[date,:].values
    
    pfRet.append(float(tgtWtg@assRet.values))
    
dfStratRet['mv_oos_opt'] = pfRet

Mean-variance portfolio, Out-of-sample, Optimization (cvopt package)

In [23]:
mean_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).mean().dropna()
cov_OOS = dfXsAsset.rolling(M,min_periods=M,win_type=None).cov().dropna()
Target weights
In [24]:
import cvxopt as opt
from cvxopt import blas, solvers


def optimal_portfolio(meanRet, cov):
    n = len(meanRet)
    N = 100 #number of points on efficient frontier
    mus = [10**(5.0 * t/N - 1.0) for t in range(N)] # mean returns for efficient frontier
    
    # Convert to cvxopt matrices
    S = opt.matrix(cov)
    pbar = opt.matrix(meanRet)
    
    
    # Create constraint matrices
    G = -opt.matrix(np.eye(n))   # negative n x n identity matrix
    h = opt.matrix(0.0, (n ,1))
    A = opt.matrix(1.0, (1, n))
    b = opt.matrix(1.0)
    
    # Calculate efficient frontier weights using quadratic programming
    portfolios = [solvers.qp(mu*S, -pbar, G, h, A, b)['x'] for mu in mus]
    
    ## CALCULATE RISKS AND RETURNS FOR FRONTIER
    returns = [blas.dot(pbar, x) for x in portfolios]
    risks = [np.sqrt(blas.dot(x, S*x)) for x in portfolios]
    
    ## CALCULATE THE 2ND DEGREE POLYNOMIAL OF THE FRONTIER CURVE
    m1 = np.polyfit(returns, risks, 2)
    x1 = np.sqrt(m1[2] / m1[0])
    
    # CALCULATE THE OPTIMAL PORTFOLIO
    solvers.options['show_progress']= False
    wt = solvers.qp(opt.matrix(x1 * S), -pbar, G, h, A, b)['x']
    return wt
In [25]:
pfTgtWts = []

for date, cov_df in cov_OOS.groupby(level=0):
    N = cov_df.shape[0]
    cov = cov_df.values
    mean = mean_OOS.loc[date,:].values

    wtg = optimal_portfolio(mean,cov)
    wtg = list(wtg)
    wtg = np.asarray(wtg)
    
    pfTgtWts.append(wtg)
     pcost       dcost       gap    pres   dres
 0: -3.1081e-03 -1.0083e+00  1e+00  1e-17  3e+00
 1: -3.1218e-03 -1.8268e-02  2e-02  2e-16  5e-02
 2: -3.8994e-03 -8.3626e-03  4e-03  5e-17  1e-02
 3: -7.2065e-03 -1.0067e-02  3e-03  5e-16  4e-03
 4: -8.1644e-03 -8.2617e-03  1e-04  2e-16  1e-04
 5: -8.2427e-03 -8.2437e-03  1e-06  1e-16  1e-06
 6: -8.2435e-03 -8.2435e-03  1e-08  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.1000e-03 -1.0083e+00  1e+00  2e-16  3e+00
 1: -3.1137e-03 -1.8261e-02  2e-02  6e-17  5e-02
 2: -3.8909e-03 -8.3550e-03  4e-03  4e-17  1e-02
 3: -7.2014e-03 -1.0058e-02  3e-03  8e-16  4e-03
 4: -8.1546e-03 -8.2518e-03  1e-04  2e-16  1e-04
 5: -8.2328e-03 -8.2338e-03  1e-06  4e-16  1e-06
 6: -8.2336e-03 -8.2336e-03  1e-08  4e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0910e-03 -1.0083e+00  1e+00  1e-16  3e+00
 1: -3.1047e-03 -1.8253e-02  2e-02  1e-16  5e-02
 2: -3.8814e-03 -8.3465e-03  4e-03  1e-16  1e-02
 3: -7.1958e-03 -1.0048e-02  3e-03  8e-16  4e-03
 4: -8.1436e-03 -8.2407e-03  1e-04  3e-16  1e-04
 5: -8.2216e-03 -8.2226e-03  1e-06  2e-16  1e-06
 6: -8.2224e-03 -8.2224e-03  1e-08  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0808e-03 -1.0082e+00  1e+00  6e-17  3e+00
 1: -3.0945e-03 -1.8244e-02  2e-02  8e-17  5e-02
 2: -3.8707e-03 -8.3369e-03  4e-03  2e-16  1e-02
 3: -7.1894e-03 -1.0037e-02  3e-03  4e-16  4e-03
 4: -8.1312e-03 -8.2282e-03  1e-04  1e-16  1e-04
 5: -8.2091e-03 -8.2101e-03  1e-06  1e-16  1e-06
 6: -8.2099e-03 -8.2099e-03  1e-08  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0695e-03 -1.0082e+00  1e+00  3e-16  3e+00
 1: -3.0831e-03 -1.8234e-02  2e-02  7e-17  5e-02
 2: -3.8588e-03 -8.3261e-03  4e-03  5e-17  1e-02
 3: -7.1822e-03 -1.0025e-02  3e-03  3e-16  4e-03
 4: -8.1174e-03 -8.2141e-03  1e-04  8e-18  1e-04
 5: -8.1951e-03 -8.1960e-03  1e-06  2e-16  1e-06
 6: -8.1958e-03 -8.1959e-03  1e-08  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0567e-03 -1.0082e+00  1e+00  1e-16  3e+00
 1: -3.0704e-03 -1.8223e-02  2e-02  7e-17  5e-02
 2: -3.8453e-03 -8.3141e-03  4e-03  1e-16  1e-02
 3: -7.1740e-03 -1.0012e-02  3e-03  6e-16  4e-03
 4: -8.1019e-03 -8.1984e-03  1e-04  1e-16  1e-04
 5: -8.1793e-03 -8.1803e-03  1e-06  3e-16  1e-06
 6: -8.1801e-03 -8.1801e-03  1e-08  6e-17  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0424e-03 -1.0082e+00  1e+00  2e-16  3e+00
 1: -3.0560e-03 -1.8210e-02  2e-02  1e-16  5e-02
 2: -3.8303e-03 -8.3005e-03  4e-03  7e-17  1e-02
 3: -7.1649e-03 -9.9961e-03  3e-03  1e-15  4e-03
 4: -8.0845e-03 -8.1808e-03  1e-04  1e-16  1e-04
 5: -8.1616e-03 -8.1626e-03  1e-06  2e-16  1e-06
 6: -8.1624e-03 -8.1624e-03  1e-08  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0263e-03 -1.0082e+00  1e+00  1e-16  3e+00
 1: -3.0399e-03 -1.8196e-02  2e-02  1e-16  5e-02
 2: -3.8134e-03 -8.2854e-03  4e-03  4e-17  1e-02
 3: -7.1546e-03 -9.9788e-03  3e-03  1e-15  4e-03
 4: -8.0650e-03 -8.1609e-03  1e-04  1e-16  1e-04
 5: -8.1418e-03 -8.1428e-03  1e-06  3e-16  1e-06
 6: -8.1426e-03 -8.1426e-03  1e-08  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -3.0083e-03 -1.0082e+00  1e+00  6e-17  3e+00
 1: -3.0219e-03 -1.8181e-02  2e-02  7e-17  5e-02
 2: -3.7944e-03 -8.2683e-03  4e-03  1e-16  1e-02
 3: -7.1429e-03 -9.9594e-03  3e-03  9e-16  4e-03
 4: -8.0431e-03 -8.1387e-03  1e-04  1e-16  1e-04
 5: -8.1195e-03 -8.1205e-03  1e-06  2e-16  1e-06
 6: -8.1203e-03 -8.1203e-03  1e-08  4e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.9881e-03 -1.0082e+00  1e+00  3e-17  3e+00
 1: -3.0017e-03 -1.8163e-02  2e-02  1e-16  5e-02
 2: -3.7732e-03 -8.2492e-03  4e-03  3e-17  1e-02
 3: -7.1297e-03 -9.9375e-03  3e-03  7e-16  4e-03
 4: -8.0186e-03 -8.1138e-03  1e-04  1e-16  1e-04
 5: -8.0946e-03 -8.0955e-03  1e-06  3e-16  1e-06
 6: -8.0953e-03 -8.0953e-03  1e-08  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.9654e-03 -1.0081e+00  1e+00  3e-16  3e+00
 1: -2.9789e-03 -1.8143e-02  2e-02  2e-16  5e-02
 2: -3.7493e-03 -8.2278e-03  4e-03  8e-17  1e-02
 3: -7.1148e-03 -9.9130e-03  3e-03  3e-16  4e-03
 4: -7.9911e-03 -8.0858e-03  9e-05  2e-16  1e-04
 5: -8.0666e-03 -8.0675e-03  1e-06  2e-16  1e-06
 6: -8.0673e-03 -8.0673e-03  1e-08  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.9400e-03 -1.0081e+00  1e+00  2e-16  3e+00
 1: -2.9535e-03 -1.8121e-02  2e-02  1e-16  5e-02
 2: -3.7226e-03 -8.2037e-03  4e-03  2e-16  1e-02
 3: -7.0980e-03 -9.8854e-03  3e-03  1e-15  4e-03
 4: -7.9602e-03 -8.0544e-03  9e-05  1e-16  1e-04
 5: -8.0351e-03 -8.0361e-03  9e-07  2e-16  1e-06
 6: -8.0359e-03 -8.0359e-03  9e-09  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.9114e-03 -1.0081e+00  1e+00  2e-16  3e+00
 1: -2.9249e-03 -1.8096e-02  2e-02  7e-17  5e-02
 2: -3.6927e-03 -8.1767e-03  4e-03  6e-17  1e-02
 3: -7.0789e-03 -9.8543e-03  3e-03  3e-16  4e-03
 4: -7.9256e-03 -8.0191e-03  9e-05  3e-16  1e-04
 5: -7.9999e-03 -8.0008e-03  9e-07  3e-16  1e-06
 6: -8.0006e-03 -8.0006e-03  9e-09  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.8794e-03 -1.0081e+00  1e+00  0e+00  3e+00
 1: -2.8928e-03 -1.8068e-02  2e-02  2e-16  5e-02
 2: -3.6591e-03 -8.1464e-03  4e-03  8e-17  1e-02
 3: -7.0573e-03 -9.8194e-03  3e-03  5e-16  3e-03
 4: -7.8868e-03 -7.9796e-03  9e-05  1e-16  1e-04
 5: -7.9603e-03 -7.9612e-03  9e-07  1e-16  1e-06
 6: -7.9610e-03 -7.9610e-03  9e-09  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.8435e-03 -1.0080e+00  1e+00  2e-16  3e+00
 1: -2.8568e-03 -1.8037e-02  2e-02  6e-17  5e-02
 2: -3.6214e-03 -8.1124e-03  4e-03  4e-17  1e-02
 3: -7.0327e-03 -9.7800e-03  3e-03  8e-16  3e-03
 4: -7.8433e-03 -7.9352e-03  9e-05  2e-16  1e-04
 5: -7.9159e-03 -7.9168e-03  9e-07  2e-16  1e-06
 6: -7.9166e-03 -7.9166e-03  9e-09  2e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.8031e-03 -1.0080e+00  1e+00  2e-16  3e+00
 1: -2.8164e-03 -1.8002e-02  2e-02  7e-17  5e-02
 2: -3.5792e-03 -8.0742e-03  4e-03  7e-17  1e-02
 3: -7.0048e-03 -9.7358e-03  3e-03  2e-16  3e-03
 4: -7.7945e-03 -7.8855e-03  9e-05  2e-16  1e-04
 5: -7.8661e-03 -7.8670e-03  9e-07  3e-16  1e-06
 6: -7.8668e-03 -7.8668e-03  9e-09  1e-16  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.7579e-03 -1.0080e+00  1e+00  1e-16  3e+00
 1: -2.7711e-03 -1.7963e-02  2e-02  5e-17  5e-02
 2: -3.5319e-03 -8.0314e-03  4e-03  1e-16  1e-02
 3: -6.9730e-03 -9.6859e-03  3e-03  3e-16  3e-03
 4: -7.7399e-03 -7.8296e-03  9e-05  3e-16  1e-04
 5: -7.8102e-03 -7.8111e-03  9e-07  1e-16  1e-06
 6: -7.8109e-03 -7.8109e-03  9e-09  1e-18  1e-08
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.7072e-03 -1.0079e+00  1e+00  7e-17  3e+00
 1: -2.7203e-03 -1.7918e-02  2e-02  8e-17  5e-02
 2: -3.4788e-03 -7.9834e-03  5e-03  2e-16  1e-02
 3: -6.9368e-03 -9.6297e-03  3e-03  6e-16  3e-03
 4: -7.6785e-03 -7.7669e-03  9e-05  1e-16  9e-05
 5: -7.7474e-03 -7.7483e-03  9e-07  3e-16  9e-07
 6: -7.7481e-03 -7.7481e-03  9e-09  1e-16  9e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.6502e-03 -1.0079e+00  1e+00  6e-17  3e+00
 1: -2.6633e-03 -1.7869e-02  2e-02  5e-17  5e-02
 2: -3.4194e-03 -7.9295e-03  5e-03  1e-16  1e-02
 3: -6.8954e-03 -9.5664e-03  3e-03  3e-16  3e-03
 4: -7.6097e-03 -7.6966e-03  9e-05  2e-16  9e-05
 5: -7.6771e-03 -7.6779e-03  9e-07  3e-16  9e-07
 6: -7.6777e-03 -7.6778e-03  9e-09  1e-16  9e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.5864e-03 -1.0078e+00  1e+00  4e-16  3e+00
 1: -2.5994e-03 -1.7813e-02  2e-02  8e-17  5e-02
 2: -3.3529e-03 -7.8691e-03  5e-03  1e-16  1e-02
 3: -6.8481e-03 -9.4950e-03  3e-03  6e-16  3e-03
 4: -7.5326e-03 -7.6177e-03  9e-05  1e-16  8e-05
 5: -7.5981e-03 -7.5990e-03  9e-07  2e-16  8e-07
 6: -7.5988e-03 -7.5988e-03  9e-09  1e-16  8e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.5147e-03 -1.0078e+00  1e+00  1e-16  3e+00
 1: -2.5277e-03 -1.7751e-02  2e-02  7e-17  5e-02
 2: -3.2783e-03 -7.8013e-03  5e-03  5e-17  1e-02
 3: -6.7938e-03 -9.4144e-03  3e-03  4e-16  3e-03
 4: -7.4461e-03 -7.5292e-03  8e-05  5e-17  7e-05
 5: -7.5095e-03 -7.5104e-03  8e-07  2e-16  7e-07
 6: -7.5102e-03 -7.5102e-03  8e-09  1e-16  7e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.4344e-03 -1.0077e+00  1e+00  6e-17  3e+00
 1: -2.4472e-03 -1.7681e-02  2e-02  7e-17  5e-02
 2: -3.1948e-03 -7.7252e-03  5e-03  7e-17  1e-02
 3: -6.7316e-03 -9.3234e-03  3e-03  6e-16  2e-03
 4: -7.3490e-03 -7.4299e-03  8e-05  2e-17  7e-05
 5: -7.4101e-03 -7.4109e-03  8e-07  2e-16  7e-07
 6: -7.4107e-03 -7.4107e-03  8e-09  2e-16  7e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.3442e-03 -1.0076e+00  1e+00  1e-16  3e+00
 1: -2.3570e-03 -1.7602e-02  2e-02  1e-16  5e-02
 2: -3.1013e-03 -7.6398e-03  5e-03  1e-16  1e-02
 3: -6.6599e-03 -9.2207e-03  3e-03  2e-16  2e-03
 4: -7.2400e-03 -7.3184e-03  8e-05  3e-16  6e-05
 5: -7.2986e-03 -7.2994e-03  8e-07  2e-17  6e-07
 6: -7.2992e-03 -7.2992e-03  8e-09  3e-16  6e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.2431e-03 -1.0075e+00  1e+00  2e-16  3e+00
 1: -2.2558e-03 -1.7514e-02  2e-02  7e-17  5e-02
 2: -2.9966e-03 -7.5440e-03  5e-03  5e-17  1e-02
 3: -6.5773e-03 -9.1046e-03  3e-03  6e-16  2e-03
 4: -7.1178e-03 -7.1933e-03  8e-05  1e-16  5e-05
 5: -7.1734e-03 -7.1742e-03  8e-07  1e-16  5e-07
 6: -7.1740e-03 -7.1740e-03  8e-09  2e-16  5e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.1297e-03 -1.0074e+00  1e+00  2e-16  3e+00
 1: -2.1422e-03 -1.7415e-02  2e-02  1e-16  5e-02
 2: -2.8795e-03 -7.4365e-03  5e-03  7e-17  1e-02
 3: -6.4819e-03 -8.9732e-03  2e-03  6e-16  2e-03
 4: -6.9805e-03 -7.0530e-03  7e-05  7e-17  4e-05
 5: -7.0330e-03 -7.0338e-03  7e-07  1e-16  4e-07
 6: -7.0336e-03 -7.0336e-03  7e-09  1e-16  4e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.0025e-03 -1.0073e+00  1e+00  2e-16  3e+00
 1: -2.0149e-03 -1.7304e-02  2e-02  1e-16  5e-02
 2: -2.7484e-03 -7.3160e-03  5e-03  2e-16  1e-02
 3: -6.3715e-03 -8.8246e-03  2e-03  6e-16  1e-03
 4: -6.8263e-03 -6.8955e-03  7e-05  8e-17  3e-05
 5: -6.8755e-03 -6.8762e-03  7e-07  1e-16  3e-07
 6: -6.8760e-03 -6.8760e-03  7e-09  4e-17  3e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -1.8598e-03 -1.0072e+00  1e+00  3e-16  3e+00
 1: -1.8721e-03 -1.7179e-02  2e-02  9e-17  5e-02
 2: -2.6018e-03 -7.1807e-03  5e-03  5e-17  1e-02
 3: -6.2435e-03 -8.6563e-03  2e-03  3e-16  9e-04
 4: -6.6531e-03 -6.7188e-03  7e-05  2e-16  2e-05
 5: -6.6987e-03 -6.6994e-03  7e-07  2e-16  2e-07
 6: -6.6992e-03 -6.6992e-03  7e-09  1e-16  2e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -1.6998e-03 -1.0070e+00  1e+00  1e-16  3e+00
 1: -1.7119e-03 -1.7039e-02  2e-02  7e-17  5e-02
 2: -2.4379e-03 -7.0290e-03  5e-03  8e-17  1e-02
 3: -6.0951e-03 -8.4655e-03  2e-03  2e-16  5e-04
 4: -6.4584e-03 -6.5205e-03  6e-05  3e-17  1e-05
 5: -6.5004e-03 -6.5010e-03  6e-07  2e-16  1e-07
 6: -6.5008e-03 -6.5008e-03  6e-09  2e-16  1e-09
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -1.5203e-03 -1.0069e+00  1e+00  6e-17  3e+00
 1: -1.5323e-03 -1.6883e-02  2e-02  4e-17  5e-02
 2: -2.2547e-03 -6.8588e-03  5e-03  4e-17  1e-02
 3: -5.9226e-03 -8.2492e-03  2e-03  2e-16  9e-05
 4: -6.2396e-03 -6.2980e-03  6e-05  2e-16  2e-06
 5: -6.2778e-03 -6.2784e-03  6e-07  2e-16  2e-08
 6: -6.2782e-03 -6.2782e-03  6e-09  7e-17  2e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -1.3190e-03 -1.0067e+00  1e+00  1e-16  3e+00
 1: -1.3310e-03 -1.6707e-02  2e-02  1e-16  5e-02
 2: -2.0500e-03 -6.6679e-03  5e-03  7e-17  1e-02
 3: -5.6467e-03 -7.9622e-03  2e-03  3e-16  4e-18
 4: -5.9831e-03 -6.0479e-03  6e-05  5e-17  4e-18
 5: -6.0280e-03 -6.0287e-03  7e-07  2e-16  2e-18
 6: -6.0285e-03 -6.0285e-03  7e-09  1e-16  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -1.0934e-03 -1.0065e+00  1e+00  6e-17  3e+00
 1: -1.1052e-03 -1.6509e-02  2e-02  8e-17  5e-02
 2: -1.8214e-03 -6.4538e-03  5e-03  5e-17  1e-02
 3: -5.3200e-03 -7.6313e-03  2e-03  6e-16  5e-18
 4: -5.6924e-03 -5.7672e-03  7e-05  2e-16  6e-18
 5: -5.7477e-03 -5.7484e-03  8e-07  1e-16  5e-18
 6: -5.7483e-03 -5.7483e-03  8e-09  2e-16  6e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -8.4034e-04 -1.0063e+00  1e+00  3e-16  3e+00
 1: -8.5209e-04 -1.6288e-02  2e-02  8e-17  5e-02
 2: -1.5662e-03 -6.2137e-03  5e-03  6e-17  1e-02
 3: -4.9609e-03 -7.2647e-03  2e-03  7e-16  3e-18
 4: -5.3666e-03 -5.4525e-03  9e-05  2e-16  4e-18
 5: -5.4331e-03 -5.4340e-03  9e-07  2e-16  4e-18
 6: -5.4338e-03 -5.4338e-03  9e-09  1e-16  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -5.5664e-04 -1.0060e+00  1e+00  2e-16  3e+00
 1: -5.6834e-04 -1.6039e-02  2e-02  1e-16  5e-02
 2: -1.2815e-03 -5.9444e-03  5e-03  2e-16  1e-02
 3: -4.5669e-03 -6.8588e-03  2e-03  3e-16  7e-18
 4: -5.0017e-03 -5.0997e-03  1e-04  1e-16  4e-18
 5: -5.0801e-03 -5.0812e-03  1e-06  1e-16  6e-18
 6: -5.0811e-03 -5.0811e-03  1e-08  3e-16  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0: -2.3861e-04 -1.0058e+00  1e+00  6e-17  3e+00
 1: -2.5029e-04 -1.5761e-02  2e-02  7e-17  5e-02
 2: -9.6398e-04 -5.6426e-03  5e-03  1e-16  1e-02
 3: -4.1353e-03 -6.4101e-03  2e-03  2e-16  4e-18
 4: -4.5937e-03 -4.7042e-03  1e-04  9e-17  5e-18
 5: -4.6837e-03 -4.6854e-03  2e-06  1e-16  4e-18
 6: -4.6852e-03 -4.6853e-03  2e-08  1e-17  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.1789e-04 -1.0055e+00  1e+00  4e-17  3e+00
 1:  1.0615e-04 -1.5448e-02  2e-02  7e-17  5e-02
 2: -6.1014e-04 -5.3042e-03  5e-03  1e-16  1e-02
 3: -3.6634e-03 -5.9145e-03  2e-03  1e-16  7e-18
 4: -4.1392e-03 -4.2617e-03  1e-04  2e-16  6e-18
 5: -4.2383e-03 -4.2413e-03  3e-06  2e-16  4e-18
 6: -4.2411e-03 -4.2411e-03  3e-08  1e-16  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.1746e-04 -1.0051e+00  1e+00  2e-16  3e+00
 1:  5.0558e-04 -1.5097e-02  2e-02  7e-17  5e-02
 2: -2.1603e-04 -4.9250e-03  5e-03  2e-16  1e-02
 3: -3.1484e-03 -5.3681e-03  2e-03  2e-16  8e-18
 4: -3.6357e-03 -3.7675e-03  1e-04  1e-16  6e-18
 5: -3.7381e-03 -3.7433e-03  5e-06  1e-16  4e-18
 6: -3.7426e-03 -3.7428e-03  2e-07  1e-16  4e-18
 7: -3.7428e-03 -3.7428e-03  2e-09  2e-16  3e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  9.6525e-04 -1.0047e+00  1e+00  5e-16  3e+00
 1:  9.5312e-04 -1.4704e-02  2e-02  7e-17  5e-02
 2:  2.2263e-04 -4.5003e-03  5e-03  1e-16  1e-02
 3: -2.5877e-03 -4.7667e-03  2e-03  3e-16  7e-18
 4: -3.0821e-03 -3.2180e-03  1e-04  1e-16  6e-18
 5: -3.1844e-03 -3.1888e-03  4e-06  5e-17  4e-18
 6: -3.1868e-03 -3.1869e-03  1e-07  1e-16  3e-18
 7: -3.1868e-03 -3.1868e-03  1e-09  1e-17  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.4670e-03 -1.0043e+00  1e+00  2e-16  3e+00
 1:  1.4545e-03 -1.4262e-02  2e-02  7e-17  5e-02
 2:  7.1054e-04 -4.0245e-03  5e-03  5e-17  1e-02
 3: -1.9783e-03 -4.1062e-03  2e-03  2e-16  9e-18
 4: -2.4790e-03 -2.6115e-03  1e-04  1e-16  5e-18
 5: -2.5842e-03 -2.5872e-03  3e-06  1e-16  6e-18
 6: -2.5868e-03 -2.5869e-03  3e-08  1e-16  6e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.0291e-03 -1.0038e+00  1e+00  3e-17  3e+00
 1:  2.0160e-03 -1.3767e-02  2e-02  2e-16  5e-02
 2:  1.2528e-03 -3.4920e-03  5e-03  1e-16  1e-02
 3: -1.3173e-03 -3.3825e-03  2e-03  2e-16  4e-18
 4: -1.8119e-03 -1.9912e-03  2e-04  2e-16  6e-18
 5: -1.9366e-03 -1.9397e-03  3e-06  2e-16  2e-18
 6: -1.9390e-03 -1.9391e-03  3e-08  3e-16  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.6588e-03 -1.0032e+00  1e+00  8e-17  3e+00
 1:  2.6448e-03 -1.3211e-02  2e-02  1e-16  6e-02
 2:  1.8551e-03 -2.8962e-03  5e-03  8e-17  1e-02
 3: -6.0136e-04 -2.5919e-03  2e-03  9e-17  5e-18
 4: -1.0828e-03 -1.3321e-03  2e-04  1e-16  5e-18
 5: -1.2302e-03 -1.2360e-03  6e-06  8e-17  5e-18
 6: -1.2348e-03 -1.2348e-03  6e-08  1e-16  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.3640e-03 -1.0026e+00  1e+00  3e-16  3e+00
 1:  3.3487e-03 -1.2588e-02  2e-02  1e-16  6e-02
 2:  2.5234e-03 -2.2300e-03  5e-03  1e-16  1e-02
 3:  1.7335e-04 -1.7309e-03  2e-03  2e-16  8e-18
 4: -3.0848e-04 -5.6124e-04  3e-04  1e-16  7e-18
 5: -4.5867e-04 -4.6594e-04  7e-06  8e-17  5e-18
 6: -4.6473e-04 -4.6480e-04  7e-08  2e-16  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  4.1536e-03 -1.0019e+00  1e+00  2e-16  3e+00
 1:  4.1366e-03 -1.1889e-02  2e-02  1e-16  6e-02
 2:  3.2644e-03 -1.4858e-03  5e-03  5e-17  1e-02
 3:  1.0112e-03 -7.9593e-04  2e-03  2e-16  7e-18
 4:  5.2303e-04  3.0922e-04  2e-04  1e-16  4e-18
 5:  3.8868e-04  3.8029e-04  8e-06  2e-16  6e-18
 6:  3.8137e-04  3.8124e-04  1e-07  2e-16  4e-18
 7:  3.8124e-04  3.8124e-04  1e-09  3e-16  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.0374e-03 -1.0011e+00  1e+00  4e-17  3e+00
 1:  5.0182e-03 -1.1105e-02  2e-02  6e-17  6e-02
 2:  4.0853e-03 -6.5523e-04  5e-03  1e-16  1e-02
 3:  1.9172e-03  2.1635e-04  2e-03  7e-16  7e-18
 4:  1.4259e-03  1.2660e-03  2e-04  2e-16  6e-18
 5:  1.3180e-03  1.3110e-03  7e-06  1e-16  3e-18
 6:  1.3137e-03  1.3133e-03  4e-07  1e-16  6e-18
 7:  1.3136e-03  1.3136e-03  9e-09  2e-16  5e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  6.0266e-03 -1.0002e+00  1e+00  2e-16  3e+00
 1:  6.0044e-03 -1.0226e-02  2e-02  8e-17  6e-02
 2:  4.9939e-03  2.7071e-04  5e-03  8e-17  1e-02
 3:  2.8972e-03  1.3096e-03  2e-03  2e-16  5e-18
 4:  2.4107e-03  2.2924e-03  1e-04  8e-17  9e-18
 5:  2.3206e-03  2.3166e-03  4e-06  2e-16  9e-18
 6:  2.3170e-03  2.3170e-03  4e-08  1e-16  4e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  7.1332e-03 -9.9925e-01  1e+00  8e-17  3e+00
 1:  7.1071e-03 -9.2399e-03  2e-02  8e-17  6e-02
 2:  5.9987e-03  1.3015e-03  5e-03  1e-16  1e-02
 3:  3.9577e-03  2.4876e-03  1e-03  2e-16  9e-18
 4:  3.4843e-03  3.3713e-03  1e-04  1e-17  9e-18
 5:  3.3935e-03  3.3914e-03  2e-06  2e-16  1e-17
 6:  3.3916e-03  3.3916e-03  2e-08  2e-16  6e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  8.3710e-03 -9.9814e-01  1e+00  7e-17  3e+00
 1:  8.3397e-03 -8.1341e-03  2e-02  7e-17  6e-02
 2:  7.1091e-03  2.4470e-03  5e-03  7e-17  1e-02
 3:  5.1064e-03  3.7548e-03  1e-03  1e-16  1e-17
 4:  4.6532e-03  4.5102e-03  1e-04  1e-16  8e-18
 5:  4.5551e-03  4.5513e-03  4e-06  2e-16  1e-17
 6:  4.5518e-03  4.5518e-03  4e-08  8e-17  7e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  9.7548e-03 -9.9690e-01  1e+00  2e-16  4e+00
 1:  9.7169e-03 -6.8943e-03  2e-02  9e-17  6e-02
 2:  8.3352e-03  3.7176e-03  5e-03  7e-17  1e-02
 3:  6.3530e-03  5.1161e-03  1e-03  2e-16  9e-18
 4:  5.8988e-03  5.7841e-03  1e-04  1e-16  9e-18
 5:  5.8162e-03  5.8124e-03  4e-06  1e-16  8e-18
 6:  5.8129e-03  5.8128e-03  8e-08  1e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.1301e-02 -9.9551e-01  1e+00  3e-17  4e+00
 1:  1.1255e-02 -5.5041e-03  2e-02  7e-17  6e-02
 2:  9.6885e-03  5.1235e-03  5e-03  5e-17  1e-02
 3:  7.7104e-03  6.5787e-03  1e-03  1e-16  1e-17
 4:  7.2564e-03  7.1760e-03  8e-05  1e-16  1e-17
 5:  7.1939e-03  7.1904e-03  4e-06  1e-16  7e-18
 6:  7.1918e-03  7.1914e-03  3e-07  1e-16  7e-18
 7:  7.1916e-03  7.1915e-03  4e-08  8e-17  9e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.3029e-02 -9.9396e-01  1e+00  1e-16  4e+00
 1:  1.2972e-02 -3.9457e-03  2e-02  6e-17  6e-02
 2:  1.1182e-02  6.6752e-03  5e-03  2e-16  1e-02
 3:  9.1958e-03  8.1543e-03  1e-03  2e-16  1e-17
 4:  8.7576e-03  8.6841e-03  7e-05  2e-16  1e-17
 5:  8.7031e-03  8.7006e-03  3e-06  2e-16  1e-17
 6:  8.7021e-03  8.7020e-03  6e-08  1e-16  9e-18
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.4958e-02 -9.9221e-01  1e+00  1e-16  4e+00
 1:  1.4887e-02 -2.1989e-03  2e-02  8e-17  6e-02
 2:  1.2830e-02  8.3829e-03  4e-03  8e-17  1e-02
 3:  1.0830e-02  9.8616e-03  1e-03  1e-16  2e-17
 4:  1.0408e-02  1.0343e-02  7e-05  6e-17  2e-17
 5:  1.0359e-02  1.0358e-02  1e-06  6e-17  1e-17
 6:  1.0359e-02  1.0359e-02  1e-08  1e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.7111e-02 -9.9025e-01  1e+00  1e-16  4e+00
 1:  1.7023e-02 -2.4112e-04  2e-02  6e-17  6e-02
 2:  1.4651e-02  1.0257e-02  4e-03  5e-17  1e-02
 3:  1.2637e-02  1.1727e-02  9e-04  2e-16  1e-17
 4:  1.2229e-02  1.2171e-02  6e-05  1e-16  1e-17
 5:  1.2184e-02  1.2183e-02  9e-07  8e-17  2e-17
 6:  1.2183e-02  1.2183e-02  9e-09  2e-16  1e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.9513e-02 -9.8897e-01  1e+00  1e-16  4e+00
 1:  1.9403e-02  1.1432e-03  2e-02  8e-17  6e-02
 2:  1.6738e-02  1.2254e-02  4e-03  5e-17  1e-02
 3:  1.4657e-02  1.3736e-02  9e-04  1e-17  9e-18
 4:  1.4247e-02  1.4189e-02  6e-05  1e-16  1e-17
 5:  1.4201e-02  1.4200e-02  9e-07  6e-17  2e-17
 6:  1.4200e-02  1.4200e-02  9e-09  8e-17  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.2190e-02 -9.8762e-01  1e+00  1e-16  4e+00
 1:  2.2053e-02  2.5181e-03  2e-02  7e-17  7e-02
 2:  1.9060e-02  1.4448e-02  5e-03  6e-17  1e-02
 3:  1.6903e-02  1.5960e-02  9e-04  7e-17  2e-17
 4:  1.6485e-02  1.6426e-02  6e-05  1e-16  1e-17
 5:  1.6437e-02  1.6436e-02  1e-06  2e-16  2e-17
 6:  1.6436e-02  1.6436e-02  1e-08  6e-17  1e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.5173e-02 -9.8609e-01  1e+00  2e-16  4e+00
 1:  2.5003e-02  4.0875e-03  2e-02  3e-17  7e-02
 2:  2.1606e-02  1.6868e-02  5e-03  1e-16  1e-02
 3:  1.9395e-02  1.8443e-02  1e-03  2e-16  2e-17
 4:  1.8971e-02  1.8910e-02  6e-05  2e-16  2e-17
 5:  1.8921e-02  1.8920e-02  1e-06  2e-16  2e-17
 6:  1.8920e-02  1.8920e-02  1e-08  1e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.8494e-02 -9.8435e-01  1e+00  3e-16  4e+00
 1:  2.8282e-02  5.8811e-03  2e-02  6e-17  8e-02
 2:  2.4435e-02  1.9539e-02  5e-03  5e-17  1e-02
 3:  2.2171e-02  2.1206e-02  1e-03  8e-17  2e-17
 4:  2.1738e-02  2.1676e-02  6e-05  6e-17  2e-17
 5:  2.1688e-02  2.1686e-02  1e-06  2e-16  2e-17
 6:  2.1686e-02  2.1686e-02  1e-08  2e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.2188e-02 -9.8236e-01  1e+00  3e-17  4e+00
 1:  3.1927e-02  7.9329e-03  2e-02  2e-16  8e-02
 2:  2.7587e-02  2.2494e-02  5e-03  9e-17  1e-02
 3:  2.5267e-02  2.4285e-02  1e-03  1e-16  2e-17
 4:  2.4824e-02  2.4760e-02  6e-05  1e-16  3e-17
 5:  2.4772e-02  2.4771e-02  2e-06  6e-17  2e-17
 6:  2.4771e-02  2.4771e-02  2e-08  2e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.6296e-02 -9.8008e-01  1e+00  4e-16  4e+00
 1:  3.5973e-02  1.0282e-02  3e-02  2e-16  9e-02
 2:  3.1105e-02  2.5773e-02  5e-03  1e-16  1e-02
 3:  2.8723e-02  2.7721e-02  1e-03  6e-17  3e-17
 4:  2.8269e-02  2.8203e-02  7e-05  1e-16  3e-17
 5:  2.8216e-02  2.8214e-02  2e-06  2e-16  3e-17
 6:  2.8214e-02  2.8214e-02  2e-08  1e-16  2e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  4.0858e-02 -9.7748e-01  1e+00  2e-16  4e+00
 1:  4.0462e-02  1.2975e-02  3e-02  1e-16  1e-01
 2:  3.5036e-02  2.9423e-02  6e-03  5e-17  9e-03
 3:  3.2587e-02  3.1559e-02  1e-03  1e-16  4e-17
 4:  3.2119e-02  3.2051e-02  7e-05  1e-16  3e-17
 5:  3.2065e-02  3.2063e-02  2e-06  9e-17  4e-17
 6:  3.2063e-02  3.2063e-02  3e-08  8e-17  4e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  4.5923e-02 -9.7451e-01  1e+00  1e-16  4e+00
 1:  4.5438e-02  1.6063e-02  3e-02  5e-17  1e-01
 2:  3.9437e-02  3.3500e-02  6e-03  6e-17  9e-03
 3:  3.6909e-02  3.5851e-02  1e-03  1e-16  5e-17
 4:  3.6425e-02  3.6354e-02  7e-05  9e-17  3e-17
 5:  3.6370e-02  3.6367e-02  3e-06  2e-16  3e-17
 6:  3.6367e-02  3.6367e-02  4e-08  3e-17  4e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.1539e-02 -9.7110e-01  1e+00  6e-17  4e+00
 1:  5.0951e-02  1.9607e-02  3e-02  8e-17  1e-01
 2:  4.4364e-02  3.8069e-02  6e-03  8e-17  8e-03
 3:  4.1745e-02  4.0655e-02  1e-03  9e-17  4e-17
 4:  4.1243e-02  4.1171e-02  7e-05  8e-17  5e-17
 5:  4.1188e-02  4.1184e-02  3e-06  2e-16  3e-17
 6:  4.1185e-02  4.1185e-02  7e-08  1e-16  3e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.7764e-02 -9.6719e-01  1e+00  1e-16  4e+00
 1:  5.7053e-02  2.3675e-02  3e-02  6e-17  1e-01
 2:  4.9884e-02  4.3203e-02  7e-03  7e-17  8e-03
 3:  4.7159e-02  4.6037e-02  1e-03  7e-17  3e-17
 4:  4.6638e-02  4.6564e-02  7e-05  3e-17  4e-17
 5:  4.6582e-02  4.6579e-02  4e-06  1e-16  4e-17
 6:  4.6579e-02  4.6579e-02  2e-07  8e-17  5e-17
 7:  4.6579e-02  4.6579e-02  2e-09  2e-16  3e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  6.4656e-02 -9.6272e-01  1e+00  1e-16  4e+00
 1:  6.3803e-02  2.8347e-02  4e-02  8e-17  1e-01
 2:  5.6067e-02  4.8983e-02  7e-03  5e-17  8e-03
 3:  5.3224e-02  5.2069e-02  1e-03  2e-16  8e-17
 4:  5.2681e-02  5.2605e-02  8e-05  1e-16  7e-17
 5:  5.2626e-02  5.2622e-02  4e-06  6e-17  5e-17
 6:  5.2623e-02  5.2622e-02  3e-07  1e-16  3e-17
 7:  5.2622e-02  5.2622e-02  5e-09  9e-17  5e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  7.2281e-02 -9.5758e-01  1e+00  2e-16  4e+00
 1:  7.1266e-02  3.3712e-02  4e-02  6e-17  1e-01
 2:  6.2992e-02  5.5500e-02  7e-03  8e-17  8e-03
 3:  6.0017e-02  5.8832e-02  1e-03  1e-16  7e-17
 4:  5.9452e-02  5.9375e-02  8e-05  9e-17  7e-17
 5:  5.9397e-02  5.9393e-02  4e-06  1e-16  6e-17
 6:  5.9395e-02  5.9394e-02  4e-07  6e-17  5e-17
 7:  5.9395e-02  5.9394e-02  5e-08  2e-16  3e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  8.0711e-02 -9.5170e-01  1e+00  2e-16  4e+00
 1:  7.9514e-02  3.9871e-02  4e-02  2e-16  1e-01
 2:  7.0744e-02  6.2850e-02  8e-03  2e-16  9e-03
 3:  6.7628e-02  6.6418e-02  1e-03  1e-16  7e-17
 4:  6.7041e-02  6.6964e-02  8e-05  1e-16  6e-17
 5:  6.6987e-02  6.6983e-02  4e-06  8e-17  7e-17
 6:  6.6985e-02  6.6985e-02  4e-07  1e-16  8e-17
 7:  6.6985e-02  6.6985e-02  4e-08  8e-17  5e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  9.0025e-02 -9.4494e-01  1e+00  3e-16  4e+00
 1:  8.8627e-02  4.6939e-02  4e-02  6e-17  1e-01
 2:  7.9418e-02  7.1141e-02  8e-03  9e-17  1e-02
 3:  7.6157e-02  7.4926e-02  1e-03  7e-17  6e-17
 4:  7.5548e-02  7.5471e-02  8e-05  9e-17  6e-17
 5:  7.5495e-02  7.5491e-02  4e-06  1e-16  1e-16
 6:  7.5494e-02  7.5494e-02  3e-07  1e-16  6e-17
 7:  7.5494e-02  7.5494e-02  4e-09  1e-16  7e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.0031e-01 -9.3720e-01  1e+00  8e-17  4e+00
 1:  9.8695e-02  5.5043e-02  4e-02  9e-17  2e-01
 2:  8.9120e-02  8.0488e-02  9e-03  8e-17  1e-02
 3:  8.5715e-02  8.4472e-02  1e-03  2e-16  9e-17
 4:  8.5086e-02  8.5010e-02  8e-05  4e-16  8e-17
 5:  8.5035e-02  8.5032e-02  3e-06  1e-16  7e-17
 6:  8.5034e-02  8.5034e-02  1e-07  6e-17  1e-16
 7:  8.5034e-02  8.5034e-02  1e-09  1e-16  6e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.1166e-01 -9.2833e-01  1e+00  2e-16  4e+00
 1:  1.0982e-01  6.4325e-02  5e-02  3e-16  2e-01
 2:  9.9969e-02  9.1020e-02  9e-03  2e-16  1e-02
 3:  9.6429e-02  9.5180e-02  1e-03  9e-17  7e-17
 4:  9.5782e-02  9.5707e-02  7e-05  2e-16  5e-17
 5:  9.5733e-02  9.5730e-02  3e-06  1e-16  8e-17
 6:  9.5732e-02  9.5732e-02  6e-08  1e-16  7e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.2417e-01 -9.1817e-01  1e+00  7e-17  4e+00
 1:  1.2211e-01  7.4944e-02  5e-02  2e-16  2e-01
 2:  1.1209e-01  1.0288e-01  9e-03  1e-16  1e-02
 3:  1.0844e-01  1.0719e-01  1e-03  4e-17  1e-16
 4:  1.0778e-01  1.0771e-01  7e-05  5e-17  5e-17
 5:  1.0773e-01  1.0773e-01  2e-06  1e-16  7e-17
 6:  1.0773e-01  1.0773e-01  3e-08  2e-16  6e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.3797e-01 -9.0655e-01  1e+00  7e-17  4e+00
 1:  1.3571e-01  8.7075e-02  5e-02  5e-17  2e-01
 2:  1.2565e-01  1.1622e-01  9e-03  1e-16  2e-02
 3:  1.2190e-01  1.2067e-01  1e-03  6e-17  9e-17
 4:  1.2123e-01  1.2116e-01  7e-05  1e-16  1e-16
 5:  1.2119e-01  1.2118e-01  2e-06  6e-17  7e-17
 6:  1.2119e-01  1.2119e-01  2e-08  1e-16  1e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.5319e-01 -8.9326e-01  1e+00  2e-16  4e+00
 1:  1.5075e-01  1.0091e-01  5e-02  3e-16  2e-01
 2:  1.4079e-01  1.3123e-01  1e-02  2e-16  2e-02
 3:  1.3700e-01  1.3579e-01  1e-03  8e-17  2e-16
 4:  1.3632e-01  1.3626e-01  6e-05  7e-17  1e-16
 5:  1.3628e-01  1.3628e-01  2e-06  1e-16  1e-16
 6:  1.3628e-01  1.3628e-01  2e-08  1e-16  6e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.6997e-01 -8.7810e-01  1e+01  3e+00  4e+00
 1:  1.9209e-01 -6.8956e-01  9e-01  8e-16  5e-16
 2:  1.8382e-01  1.0280e-01  8e-02  2e-16  4e-16
 3:  1.6074e-01  1.4334e-01  2e-02  8e-17  2e-16
 4:  1.5450e-01  1.5186e-01  3e-03  9e-17  1e-16
 5:  1.5331e-01  1.5317e-01  1e-04  1e-16  1e-16
 6:  1.5321e-01  1.5321e-01  3e-06  8e-17  1e-16
 7:  1.5321e-01  1.5321e-01  3e-08  9e-17  9e-17
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.8847e-01 -8.6082e-01  1e+01  3e+00  4e+00
 1:  2.1431e-01 -6.7182e-01  9e-01  4e-16  8e-16
 2:  2.0454e-01  1.1903e-01  9e-02  8e-17  6e-16
 3:  1.8043e-01  1.6216e-01  2e-02  7e-17  1e-16
 4:  1.7358e-01  1.7085e-01  3e-03  6e-17  1e-16
 5:  1.7231e-01  1.7216e-01  1e-04  1e-16  1e-16
 6:  1.7221e-01  1.7220e-01  2e-06  8e-17  1e-16
 7:  1.7220e-01  1.7220e-01  2e-08  1e-16  2e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.0887e-01 -8.4115e-01  1e+01  3e+00  4e+00
 1:  2.3889e-01 -6.5149e-01  9e-01  6e-16  8e-16
 2:  2.2744e-01  1.3776e-01  9e-02  9e-17  5e-16
 3:  2.0244e-01  1.8335e-01  2e-02  9e-17  2e-16
 4:  1.9496e-01  1.9217e-01  3e-03  1e-16  2e-16
 5:  1.9362e-01  1.9347e-01  1e-04  1e-16  1e-16
 6:  1.9351e-01  1.9351e-01  2e-06  9e-17  1e-16
 7:  1.9351e-01  1.9351e-01  2e-08  6e-17  2e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.3137e-01 -8.1881e-01  1e+01  3e+00  4e+00
 1:  2.6605e-01 -6.2825e-01  9e-01  5e-16  6e-16
 2:  2.5275e-01  1.5937e-01  9e-02  2e-16  4e-16
 3:  2.2705e-01  2.0717e-01  2e-02  2e-16  2e-16
 4:  2.1894e-01  2.1610e-01  3e-03  7e-17  2e-16
 5:  2.1752e-01  2.1738e-01  1e-04  6e-17  2e-16
 6:  2.1742e-01  2.1742e-01  2e-06  9e-17  1e-16
 7:  2.1742e-01  2.1742e-01  2e-08  9e-17  1e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.5621e-01 -7.9347e-01  1e+01  3e+00  4e+00
 1:  2.9603e-01 -6.0171e-01  9e-01  6e-16  6e-16
 2:  2.8075e-01  1.8425e-01  1e-01  2e-16  4e-16
 3:  2.5452e-01  2.3394e-01  2e-02  3e-17  2e-16
 4:  2.4581e-01  2.4296e-01  3e-03  9e-17  2e-16
 5:  2.4434e-01  2.4420e-01  1e-04  1e-16  1e-16
 6:  2.4424e-01  2.4424e-01  2e-06  8e-17  2e-16
 7:  2.4424e-01  2.4424e-01  2e-08  1e-16  2e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.8364e-01 -7.6479e-01  1e+01  3e+00  4e+00
 1:  3.2912e-01 -5.7147e-01  9e-01  6e-16  4e-16
 2:  3.1175e-01  2.1284e-01  1e-01  1e-16  5e-16
 3:  2.8517e-01  2.6401e-01  2e-02  7e-17  2e-16
 4:  2.7594e-01  2.7311e-01  3e-03  9e-17  3e-16
 5:  2.7442e-01  2.7430e-01  1e-04  9e-17  3e-16
 6:  2.7433e-01  2.7433e-01  1e-06  8e-17  2e-16
 7:  2.7433e-01  2.7433e-01  1e-08  1e-16  3e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.1395e-01 -7.3238e-01  1e+01  3e+00  4e+00
 1:  3.6564e-01 -5.3707e-01  9e-01  6e-16  1e-15
 2:  3.4612e-01  2.4561e-01  1e-01  7e-17  9e-16
 3:  3.1937e-01  2.9780e-01  2e-02  6e-17  2e-16
 4:  3.0971e-01  3.0695e-01  3e-03  1e-16  2e-16
 5:  3.0817e-01  3.0806e-01  1e-04  1e-16  2e-16
 6:  3.0809e-01  3.0809e-01  1e-06  1e-16  3e-16
 7:  3.0809e-01  3.0809e-01  1e-08  1e-16  2e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.4747e-01 -6.9582e-01  1e+01  3e+00  4e+00
 1:  4.0593e-01 -4.9803e-01  9e-01  5e-16  6e-16
 2:  3.8429e-01  2.8305e-01  1e-01  2e-16  5e-16
 3:  3.5751e-01  3.3578e-01  2e-02  2e-16  3e-16
 4:  3.4756e-01  3.4494e-01  3e-03  5e-17  3e-16
 5:  3.4604e-01  3.4594e-01  1e-04  7e-17  2e-16
 6:  3.4597e-01  3.4597e-01  1e-06  2e-16  3e-16
 7:  3.4597e-01  3.4597e-01  1e-08  1e-16  2e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.8456e-01 -6.5466e-01  1e+01  3e+00  4e+00
 1:  4.5042e-01 -4.5381e-01  9e-01  4e-16  9e-16
 2:  4.2676e-01  3.2571e-01  1e-01  5e-16  5e-16
 3:  4.0003e-01  3.7850e-01  2e-02  1e-16  4e-16
 4:  3.8999e-01  3.8757e-01  2e-03  1e-16  2e-16
 5:  3.8852e-01  3.8844e-01  8e-05  1e-16  3e-16
 6:  3.8846e-01  3.8846e-01  8e-07  1e-16  3e-16
 7:  3.8846e-01  3.8846e-01  8e-09  1e-16  3e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  4.2564e-01 -6.0840e-01  1e+01  4e+00  4e+00
 1:  4.9956e-01 -4.0383e-01  9e-01  3e-16  1e-15
 2:  4.7407e-01  3.7414e-01  1e-01  6e-17  5e-16
 3:  4.4745e-01  4.2658e-01  2e-02  2e-16  4e-16
 4:  4.3756e-01  4.3541e-01  2e-03  5e-17  4e-16
 5:  4.3619e-01  4.3613e-01  6e-05  3e-16  3e-16
 6:  4.3615e-01  4.3615e-01  6e-07  2e-16  3e-16
 7:  4.3615e-01  4.3615e-01  6e-09  2e-16  4e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  4.7117e-01 -5.5649e-01  1e+01  4e+00  4e+00
 1:  5.5389e-01 -3.4747e-01  9e-01  5e-16  6e-16
 2:  5.2686e-01  4.2897e-01  1e-01  1e-16  5e-16
 3:  5.0038e-01  4.8071e-01  2e-02  8e-17  3e-16
 4:  4.9091e-01  4.8905e-01  2e-03  6e-17  4e-16
 5:  4.8968e-01  4.8963e-01  4e-05  1e-16  3e-16
 6:  4.8964e-01  4.8964e-01  4e-07  9e-17  4e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.2166e-01 -4.9832e-01  1e+01  4e+00  4e+00
 1:  6.1399e-01 -2.8406e-01  9e-01  3e-16  1e-15
 2:  5.8584e-01  4.9083e-01  1e-01  6e-17  8e-16
 3:  5.5947e-01  5.4162e-01  2e-02  1e-16  6e-16
 4:  5.5076e-01  5.4920e-01  2e-03  7e-17  6e-16
 5:  5.4969e-01  5.4966e-01  3e-05  1e-16  5e-16
 6:  5.4967e-01  5.4967e-01  3e-07  1e-16  7e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  5.7772e-01 -4.3325e-01  1e+01  4e+00  4e+00
 1:  6.8056e-01 -2.1291e-01  9e-01  3e-16  1e-15
 2:  6.5181e-01  5.6045e-01  9e-02  1e-16  6e-16
 3:  6.2555e-01  6.1014e-01  2e-02  6e-17  4e-16
 4:  6.1788e-01  6.1667e-01  1e-03  1e-16  5e-16
 5:  6.1703e-01  6.1701e-01  2e-05  1e-16  6e-16
 6:  6.1702e-01  6.1702e-01  2e-07  8e-17  4e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  6.4000e-01 -3.6055e-01  1e+01  4e+00  4e+00
 1:  7.5435e-01 -1.3310e-01  9e-01  5e-16  5e-16
 2:  7.2564e-01  6.3860e-01  9e-02  1e-16  8e-16
 3:  6.9971e-01  6.8714e-01  1e-02  1e-16  7e-16
 4:  6.9320e-01  6.9235e-01  8e-04  1e-16  6e-16
 5:  6.9259e-01  6.9258e-01  1e-05  1e-16  6e-16
 6:  6.9258e-01  6.9258e-01  1e-07  3e-16  7e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  7.0924e-01 -2.7942e-01  2e+01  4e+00  4e+00
 1:  8.3622e-01 -4.3705e-02  9e-01  4e-16  1e-15
 2:  8.0832e-01  7.2616e-01  8e-02  2e-16  7e-16
 3:  7.8311e-01  7.7345e-01  1e-02  1e-16  5e-16
 4:  7.7776e-01  7.7723e-01  5e-04  2e-16  6e-16
 5:  7.7737e-01  7.7737e-01  6e-06  8e-17  6e-16
 6:  7.7737e-01  7.7737e-01  6e-08  1e-16  5e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  7.8629e-01 -1.8897e-01  2e+01  4e+00  4e+00
 1:  9.2669e-01  5.5779e-02  9e-01  1e-02  1e-02
 2:  9.0266e-01  8.2110e-01  8e-02  8e-04  8e-04
 3:  8.7791e-01  8.6900e-01  9e-03  1e-05  1e-05
 4:  8.7282e-01  8.7238e-01  4e-04  1e-07  1e-07
 5:  8.7250e-01  8.7250e-01  5e-06  1e-09  1e-09
 6:  8.7250e-01  8.7250e-01  5e-08  1e-11  1e-11
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  8.7209e-01 -8.8244e-02  2e+01  4e+00  4e+00
 1:  1.0262e+00  1.6592e-01  1e+00  4e-02  4e-02
 2:  1.0115e+00  9.2210e-01  9e-02  3e-03  3e-03
 3:  9.8583e-01  9.7457e-01  1e-02  1e-04  2e-04
 4:  9.7968e-01  9.7907e-01  6e-04  2e-06  2e-06
 5:  9.7924e-01  9.7923e-01  7e-06  2e-08  2e-08
 6:  9.7923e-01  9.7923e-01  7e-08  2e-10  2e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  9.6769e-01  2.3848e-02  2e+01  4e+00  4e+00
 1:  1.1366e+00  2.8890e-01  1e+00  7e-02  7e-02
 2:  1.1336e+00  1.0359e+00  1e-01  5e-03  5e-03
 3:  1.1066e+00  1.0934e+00  1e-02  3e-04  3e-04
 4:  1.0995e+00  1.0988e+00  8e-04  4e-06  4e-06
 5:  1.0990e+00  1.0990e+00  9e-06  4e-08  4e-08
 6:  1.0990e+00  1.0990e+00  9e-08  4e-10  4e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.0743e+00  1.4851e-01  2e+01  4e+00  4e+00
 1:  1.2590e+00  4.2610e-01  1e+00  1e-01  1e-01
 2:  1.2708e+00  1.1637e+00  1e-01  6e-03  6e-03
 3:  1.2419e+00  1.2271e+00  2e-02  4e-04  4e-04
 4:  1.2340e+00  1.2331e+00  9e-04  5e-06  5e-06
 5:  1.2334e+00  1.2334e+00  1e-05  5e-08  5e-08
 6:  1.2334e+00  1.2334e+00  1e-07  5e-10  5e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.1933e+00  2.8707e-01  2e+01  4e+00  4e+00
 1:  1.3948e+00  5.7906e-01  1e+00  1e-01  1e-01
 2:  1.4253e+00  1.3073e+00  1e-01  5e-03  5e-03
 3:  1.3936e+00  1.3772e+00  2e-02  4e-04  4e-04
 4:  1.3848e+00  1.3839e+00  1e-03  5e-06  4e-06
 5:  1.3841e+00  1.3841e+00  1e-05  5e-08  4e-08
 6:  1.3841e+00  1.3841e+00  1e-07  5e-10  4e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.3261e+00  4.4104e-01  2e+01  4e+00  4e+00
 1:  1.5455e+00  7.4951e-01  1e+00  2e-01  2e-01
 2:  1.5993e+00  1.4686e+00  1e-01  2e-03  2e-03
 3:  1.5635e+00  1.5460e+00  2e-02  2e-04  2e-04
 4:  1.5540e+00  1.5530e+00  1e-03  2e-06  2e-06
 5:  1.5533e+00  1.5533e+00  1e-05  2e-08  2e-08
 6:  1.5533e+00  1.5533e+00  1e-07  2e-10  2e-10
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.4746e+00  6.1207e-01  2e+01  4e+00  4e+00
 1:  1.7125e+00  9.3937e-01  2e+00  2e-01  2e-01
 2:  1.7941e+00  1.6408e+00  2e-01  9e-17  2e-15
 3:  1.7544e+00  1.7345e+00  2e-02  1e-16  1e-15
 4:  1.7439e+00  1.7428e+00  1e-03  1e-16  1e-15
 5:  1.7431e+00  1.7431e+00  1e-05  2e-16  1e-15
 6:  1.7431e+00  1.7431e+00  1e-07  8e-17  9e-16
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.6405e+00  8.0204e-01  2e+01  4e+00  4e+00
 1:  1.8977e+00  1.1508e+00  2e+00  3e-01  3e-01
 2:  2.0109e+00  1.8274e+00  2e-01  1e-16  1e-15
 3:  1.9687e+00  1.9452e+00  2e-02  7e-17  2e-15
 4:  1.9570e+00  1.9556e+00  1e-03  1e-16  1e-15
 5:  1.9561e+00  1.9561e+00  2e-05  9e-17  2e-15
 6:  1.9561e+00  1.9561e+00  2e-07  1e-16  2e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  1.8262e+00  1.0130e+00  2e+01  4e+00  4e+00
 1:  2.1030e+00  1.3861e+00  2e+00  3e-01  3e-01
 2:  2.2531e+00  2.0416e+00  2e-01  1e-16  2e-15
 3:  2.2086e+00  2.1824e+00  3e-02  7e-17  2e-15
 4:  2.1960e+00  2.1945e+00  1e-03  6e-17  2e-15
 5:  2.1950e+00  2.1950e+00  2e-05  7e-17  2e-15
 6:  2.1950e+00  2.1950e+00  2e-07  8e-17  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.0340e+00  1.2474e+00  2e+01  4e+00  4e+00
 1:  2.3303e+00  1.6479e+00  2e+00  4e-01  4e-01
 2:  2.5234e+00  2.2870e+00  2e-01  1e-16  5e-15
 3:  2.4772e+00  2.4491e+00  3e-02  1e-16  2e-15
 4:  2.4641e+00  2.4626e+00  1e-03  9e-17  2e-15
 5:  2.4631e+00  2.4631e+00  2e-05  1e-16  3e-15
 6:  2.4631e+00  2.4631e+00  2e-07  1e-16  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.2667e+00  1.4974e+00  2e+01  5e+00  4e+00
 1:  2.5835e+00  1.9314e+00  2e+00  4e-01  4e-01
 2:  2.8264e+00  2.5638e+00  3e-01  2e-16  4e-15
 3:  2.7783e+00  2.7487e+00  3e-02  8e-17  2e-15
 4:  2.7649e+00  2.7634e+00  1e-03  1e-16  2e-15
 5:  2.7639e+00  2.7639e+00  2e-05  1e-16  1e-15
 6:  2.7639e+00  2.7639e+00  2e-07  1e-16  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.5274e+00  1.7723e+00  2e+01  5e+00  4e+00
 1:  2.8646e+00  2.2446e+00  2e+00  5e-01  5e-01
 2:  3.1651e+00  2.8778e+00  3e-01  1e-16  3e-15
 3:  3.1157e+00  3.0852e+00  3e-02  1e-16  2e-15
 4:  3.1023e+00  3.1009e+00  1e-03  1e-16  2e-15
 5:  3.1015e+00  3.1014e+00  2e-05  1e-16  3e-15
 6:  3.1015e+00  3.1015e+00  2e-07  1e-16  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  2.8195e+00  2.0790e+00  2e+01  5e+00  4e+00
 1:  3.1761e+00  2.5939e+00  3e+00  6e-01  5e-01
 2:  3.5438e+00  3.2340e+00  3e-01  8e-17  4e-15
 3:  3.4938e+00  3.4634e+00  3e-02  7e-17  2e-15
 4:  3.4809e+00  3.4796e+00  1e-03  7e-17  3e-15
 5:  3.4802e+00  3.4802e+00  2e-05  1e-16  3e-15
 6:  3.4802e+00  3.4802e+00  2e-07  2e-16  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.1471e+00  2.4215e+00  2e+01  5e+00  4e+00
 1:  3.5216e+00  2.9833e+00  3e+00  6e-01  6e-01
 2:  3.9672e+00  3.6371e+00  3e-01  1e-16  3e-14
 3:  3.9176e+00  3.8881e+00  3e-02  2e-16  4e-15
 4:  3.9057e+00  3.9045e+00  1e-03  7e-17  3e-15
 5:  3.9051e+00  3.9051e+00  1e-05  1e-16  3e-15
 6:  3.9051e+00  3.9051e+00  1e-07  8e-17  3e-15
Optimal solution found.
     pcost       dcost       gap    pres   dres
 0:  3.5144e+00  2.8040e+00  2e+01  5e+00  4e+00
 1:  3.9048e+00  3.4172e+00  3e+00  7e-01  6e-01
 2:  4.4412e+00  4.0922e+00  3e-01  8e-17  2e-14
 3:  4.3928e+00  4.3649e+00  3e-02  7e-17  4e-15
 4:  4.3823e+00  4.3813e+00  1e-03  7e-17  3e-15
 5:  4.3818e+00  4.3818e+00  1e-05  1e-16  3e-15
 6:  4.3818e+00  4.3818e+00  1e-07  7e-17  3e-15
Optimal solution found.
In [26]:
pfTgtWts = np.array(pfTgtWts)  
pfTgtWts[pfTgtWts<10**-6] = 0
pfTgtWts = pfTgtWts[:-1,:]
In [27]:
dfTgtWts = pd.DataFrame(pfTgtWts,index=dfXsAsset[M:].index,columns=list(cov_df)) 
dfTgtWts['Strategy'] = 'mv_oos_cvxopt'
dfTgtWts.set_index('Strategy',append=True,inplace=True)
Portfolio returns
In [28]:
pfRet = []

for date,assRet in dfXsAsset[M:].iterrows():      
    N = len(assRet)
    tgtWtg = dfTgtWts.loc[date,:].values
    
    pfRet.append(float(tgtWtg@assRet.values))
    
dfStratRet['mv_oos_cvxopt'] = pfRet

Portfolio results

The results below show that our ew (1/N) portfolio is very similar to Table 3 results, and so is the mv_oos_cvxopt. Only the implementation in scipy.optimize.minimize is quite different and we will need to investigate further

In [29]:
dfStratRet.apply(sharpe,axis=0)
Out[29]:
ew               0.138493
mv_oos           0.086276
mv_oos_opt       0.117953
mv_oos_cvxopt    0.060213
dtype: float64
In [30]:
dfStratRet.describe()
Out[30]:
ew mv_oos mv_oos_opt mv_oos_cvxopt
count 377.000000 377.000000 377.000000 377.000000
mean 0.006041 0.017153 0.005849 0.004184
std 0.043617 0.198812 0.049588 0.069480
min -0.217190 -0.980870 -0.202083 -0.263400
25% -0.018740 -0.043664 -0.023593 -0.029900
50% 0.008130 0.003486 0.007561 0.006500
75% 0.034950 0.048891 0.035606 0.046300
max 0.150520 2.473620 0.236000 0.290100
In [31]:
dfStratRet.head()
Out[31]:
ew mv_oos mv_oos_opt mv_oos_cvxopt
Date
1973-07 0.04497 0.123733 0.062300 0.0623
1973-08 -0.04267 -0.190477 -0.076100 -0.0761
1973-09 0.04897 -0.152751 0.001100 0.0011
1973-10 -0.01565 0.208402 0.011800 0.0118
1973-11 -0.12171 -0.062717 -0.082415 -0.0833
In [37]:
dfStratRet['mv_oos'].mean()
Out[37]:
0.017152795191928957
In [32]:
dfStratRet.plot(title='Return series')
Out[32]:
<matplotlib.axes._subplots.AxesSubplot at 0x23b329055f8>
In [33]:
((1*dfStratRet+1).cumprod()-1).plot(title='Cumulative Wealth')
Out[33]:
<matplotlib.axes._subplots.AxesSubplot at 0x23b32ee69e8>
In [ ]:
 

Comments

Comments powered by Disqus