Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
| personal:portfolio:portopt [2015/03/30 12:20] – [Theorical Background] antonello | personal:portfolio:portopt [2016/02/15 10:19] – antonello | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| In portfolio theory agents attempts to maximise portfolio expected return for a given amount of portfolio risk, or equivalently to minimise risk for a given level of expected return. | In portfolio theory agents attempts to maximise portfolio expected return for a given amount of portfolio risk, or equivalently to minimise risk for a given level of expected return. | ||
| - | {{ : | + | {{ : |
| The portfolio management can be portrayed graphically as in the above Figure, where the feasible set of variance-profitability combinations in enclosed by the blue curve and the B-D segment represents the efficient frontier, where no variance can be lowered at productivity' | The portfolio management can be portrayed graphically as in the above Figure, where the feasible set of variance-profitability combinations in enclosed by the blue curve and the B-D segment represents the efficient frontier, where no variance can be lowered at productivity' | ||
| Line 81: | Line 81: | ||
| g++ -std=c++0x -O -shared -Wl, | g++ -std=c++0x -O -shared -Wl, | ||
| (then please refer to the python example for usage) | (then please refer to the python example for usage) | ||
| + | |||
| + | If you want to change the output library name (e.g. you want to create _portopt_p3.so for python3 alongside _portopt.so for python2), do it in the %module variable of portopt.i and in the -soname and -o options of the linking command (and don't forget to use the right python included directory in the compilation command).\\ | ||
| + | You can then load the correct module in your script with something like: | ||
| + | import sys | ||
| + | if sys.version_info < (3, 0): | ||
| + | import portopt | ||
| + | else: | ||
| + | import portopt_p3 as portopt | ||
| ===== Usage ===== | ===== Usage ===== | ||
| + | |||
| + | :!: Please notice that the API changed from version 1.1, with the introduction of the '' | ||
| + | |||
| + | |||
| == Linux == | == Linux == | ||
| ./portopt [options] | ./portopt [options] | ||
| Line 93: | Line 105: | ||
| Call: | Call: | ||
| - | double solveport (const vector< vector < | + | double solveport (const vector< vector < |
| | | ||
| == As a lib using Python: == | == As a lib using Python: == | ||
| Line 102: | Line 114: | ||
| errorcode | errorcode | ||
| errormessage = results[3] | errormessage = results[3] | ||
| + | opt_mean | ||
| + | opt_var | ||
| === Options === | === Options === | ||
| < | < | ||
| - | -h --help | + | -h --help |
| -v --var-file [input_var_file_name] | -v --var-file [input_var_file_name] | ||
| -m --means-file [input_means_file_name] | -m --means-file [input_means_file_name] | ||
| Line 133: | Line 147: | ||
| You should have received a copy of the GNU Lesser General Public License along with PortOpt. | You should have received a copy of the GNU Lesser General Public License along with PortOpt. | ||
| + | |||
| + | ===== Citations ===== | ||
| + | If you use this program or a derivative of it in an academic framework, please cite it!\\ | ||
| + | Please cite as: | ||
| + | * A. Dragicevic, A. Lobianco, | ||
| ===== Acknowledgements ===== | ===== Acknowledgements ===== | ||
