https://github.com/cvxgrp/cptopt

Portfolio Optimization with Cumulative Prospect Theory Utility via Convex Optimization

https://github.com/cvxgrp/cptopt

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary

Keywords

convex-optimization cumulative-prospect-theory portfolio-optimization
Last synced: 6 months ago · JSON representation

Repository

Portfolio Optimization with Cumulative Prospect Theory Utility via Convex Optimization

Basic Info
  • Host: GitHub
  • Owner: cvxgrp
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 26.4 KB
Statistics
  • Stars: 33
  • Watchers: 4
  • Forks: 4
  • Open Issues: 1
  • Releases: 0
Topics
convex-optimization cumulative-prospect-theory portfolio-optimization
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme

README.md

Portfolio Optimization with Cumulative Prospect Theory Utility via Convex Optimization

This repo accompanies our paper.

Installation

The cptopt package can be installed using pip as follows

python pip install git+https://github.com/cvxgrp/cptopt.git

Minimum working example

We are unable to provide the full data set used in the paper for licensing reasons. We, therefore, give a minimum working example using simulated data below. ```python import numpy as np from scipy.stats import multivariate_normal as normal

from cptopt.optimizer import MinorizationMaximizationOptimizer, ConvexConcaveOptimizer, \ MeanVarianceFrontierOptimizer, GradientOptimizer from cptopt.utility import CPTUtility

Generate returns

corr = np.array([ [1, -.2, -.4], [-.2, 1, .5], [-.4, .5, 1] ]) sd = np.array([.01, .1, .2]) Sigma = np.diag(sd) @ corr @ np.diag(sd)

np.random.seed(0) r = normal.rvs([.03, .1, .193], Sigma, size=100)

Define utility function

utility = CPTUtility( gammapos=8.4, gammaneg=11.4, deltapos=.77, deltaneg=.79 )

initial_weights = np.array([1/3, 1/3, 1/3])

Optimize

mv = MeanVarianceFrontierOptimizer(utility) mv.optimize(r, verbose=True)

mm = MinorizationMaximizationOptimizer(utility) mm.optimize(r, initialweights=initialweights, verbose=True)

cc = ConvexConcaveOptimizer(utility) cc.optimize(r, initialweights=initialweights, verbose=True)

ga = GradientOptimizer(utility) ga.optimize(r, initialweights=initialweights, verbose=True) The optimal weights can then be accessed via the `weights` property. py mv.weights mm.weights cc.weights ga.weights ```

Citing

If you want to reference our paper in your research, please consider citing us by using the following BibTeX:

BibTeX @article{luxenberg2024cptopt, title={Portfolio Optimization with Cumulative Prospect Theory Utility via Convex Optimization}, author={Luxenberg, Eric and Schiele, Philipp and Boyd, Stephen}, journal={Computational Economics}, pages={1--21}, year={2024}, doi = {https://doi.org/10.1007/s10614-024-10556-x}, publisher={Springer}, url = {https://web.stanford.edu/\%7Eboyd/papers/pdf/cpt_opt.pdf}, }

Owner

  • Name: Stanford University Convex Optimization Group
  • Login: cvxgrp
  • Kind: organization
  • Location: Stanford, CA

GitHub Events

Total
  • Watch event: 5
  • Fork event: 2
Last Year
  • Watch event: 5
  • Fork event: 2

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 3
  • Total pull requests: 0
  • Average time to close issues: about 2 months
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ricnov (2)
  • andrewcz (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi