Code Monkey home page Code Monkey logo

Comments (3)

Marigold avatar Marigold commented on July 30, 2024

This is often caused by bad data. I'd check if you don't have any insane outliers in your data. I can't look into this if you don't post a replicable example.

from universal-portfolios.

catgrandpas avatar catgrandpas commented on July 30, 2024

I want to explore the impact of different metrics on the BCRP model. I found that, except for 'return,' which consistently converges to the optimal solution, other metrics tend to converge to local optima.

Below is a part of my code:
@metrics = ['return', 'drawdown', 'ulcer', 'sharpe','sortino']
for metric in metrics:
# Run the BCRP model and calculate weights
algo = BCRP(metric=metric)
result = algo.run(predicted_prices)
weights = result.weights
# Calculate returns
returns = pyfolio_backtest(weights, dff_test.set_index('date'))[0]['Annual return']
# Update the best metric
if returns > best_return:
best_return = returns
best_metric = metric
best_metric_per_period.append(best_metric)

from universal-portfolios.

Marigold avatar Marigold commented on July 30, 2024

I found that, except for 'return,' which consistently converges to the optimal solution, other metrics tend to converge to local optima.

That's how BCRP works by definition - it finds weights that maximize return. There are no guarantees for other metrics.

from universal-portfolios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.