Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
personal:portfolio:portopt [2014/05/28 14:55]
antonello [Acknowledgements]
personal:portfolio:portopt [2014/06/06 10:22]
antonello [Usage]
Line 93: Line 93:
  
 Call: Call:
-  double solveport (const vector< vector <double> > &VAR, const vector<double> &MEANS, const double &alpha, vector<double> &x_h, int &errorcode)+  double solveport (const vector< vector <double> > &VAR, const vector<double> &MEANS, const double &alpha, vector<double> &x_h, int &errorcode, string &errormessage, const double tollerance = 0.000001)
      
-== As a lib ising Python: ==+== As a lib using Python: ==
   import portopt   import portopt
-  results = portopt.solveport(var,means,alpha)+  results = portopt.solveport(var,means,alpha,tollerance# tollerance is optional, default to 0.000001 
 +  functioncost = results[0] 
 +  shares       = results[1] 
 +  errorcode    = results[2] 
 +  errormessage = results[3]
  
 === Options === === Options ===
Line 106: Line 110:
   -a  --alpha [alpha_coefficient]              Coefficient between production and risk in the linear indifference curves      -a  --alpha [alpha_coefficient]              Coefficient between production and risk in the linear indifference curves   
   -f  --field-delimiter [field_delimiter]      Character to use as field delimiter (default: ';')     -f  --field-delimiter [field_delimiter]      Character to use as field delimiter (default: ';')  
-  -s  --decimal-separator [decimal-separator]  Character to use as decimal delimiter (default: '.')''  +  -s  --decimal-separator [decimal-separator]  Character to use as decimal delimiter (default: '.') 
 +  -t  --tollerance [tolerance]                 A tolerance level to distinguish from zero (default: 0.000001) 
 </code> </code>
  
Line 113: Line 118:
   * Higher the alpha, lower the agent risk aversion;   * Higher the alpha, lower the agent risk aversion;
   * Set a negative alpha to retrieve the portfolio with the lowest possible variance;   * Set a negative alpha to retrieve the portfolio with the lowest possible variance;
-  * Set alpha to zero to retrieve the portfolio with the highest mean, indipendently from variance (solution not guaranteed to be unique); +  * Set alpha to zero to retrieve the portfolio with the highest mean, independently from variance (solution not guaranteed to be unique); 
-  * Assets shares are returned in the x_h vector, eventual error code (0: all fine, 1: input data error, 2: problem has no solutions, 3: internal solver error) in the errorcode parameter. +  * Assets shares are returned in the x_h vector, eventual error code (0: all fine, 1: input data error, 2: no solutions, 3: didn't solve, 4: solver internal error) in the errorcode parameter.  
 +  * Use option "tollerance" with two l up to version 1.1
      
      
personal/portfolio/portopt.txt · Last modified: 2018/06/18 15:11 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0