How to Increase Robustness and Diversification of Markowitz Model using Near Optimal Centering

Hi people, I create this post to share a new portfolio optimization technique, that I developed for my thesis. This technique allows to increase robustness and diversification in investment portfolios. You can check a Python example in this link and the paper in this link. In the following image you can compare the sensibility of assets weights from mean variance portfolio against a near optimal portfolio when we have errors in the estimation of mean vector and covariance matrix.

https://preview.redd.it/ltxyqojqhiy51.png?width=905&format=png&auto=webp&s=8abdfebe38df9bae152b131c62ae8f5688ae9cf9

I would appreciate your comments and thoughts about my model :)

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Hammercito1518
πŸ“…︎ Nov 16 2020
🚨︎ report
[University Finance] Markowitz Portfolio Selection Model + Microsoft Excel

Hello! I am doing a project for my theory of finance course.

We had to select 4 canadian stocks and find returns and covariance matrix, which I did here https://gyazo.com/7e16658a8a7e5d72e20295dabbf59a73

The following question is asking me to calculate the weight of the risky assets (Y) using this formula: https://gyazo.com/dee1987836d4e404ede44d1ec8ad96d3

I am quite Rusty with Excel and have no idea how I would even start breaking down this formula using mmult and transpose functions. I am also confused with the formula itself if someone could please help clarify the parts of the equation, mostly the "1" which is supposed to be a unit of ones unit Vector. RF rate is 1%, Coefficient of risk aversion is 4 Any help to point me in the right direction would be greatly appreciated!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/wisewizard12
πŸ“…︎ Nov 12 2017
🚨︎ report
SERIOUS: This subreddit needs to understand what a "dad joke" really means.

I don't want to step on anybody's toes here, but the amount of non-dad jokes here in this subreddit really annoys me. First of all, dad jokes CAN be NSFW, it clearly says so in the sub rules. Secondly, it doesn't automatically make it a dad joke if it's from a conversation between you and your child. Most importantly, the jokes that your CHILDREN tell YOU are not dad jokes. The point of a dad joke is that it's so cheesy only a dad who's trying to be funny would make such a joke. That's it. They are stupid plays on words, lame puns and so on. There has to be a clever pun or wordplay for it to be considered a dad joke.

Again, to all the fellow dads, I apologise if I'm sounding too harsh. But I just needed to get it off my chest.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/anywhereiroa
πŸ“…︎ Jan 15 2022
🚨︎ report
Factor Investing for Belgians: A Comprehensive Guide

In March 2019, Ben Felix wrote a white paper on factor investing with ETFs for canadians, which opened up the debate about whether publicly avaliable ETFs offer adequate factor exposure to enjoy the potential benefits of factor investing after fees. I've decided to do a similar analysis for Belgians. I'll start out with a brief theoretical explanation of factor investing and an overview of historical risk premiums to then discuss how Belgians can implement this into their portfolios.

Brief History of Factor Investing

Even though financial markets have existed for centuries, the behavior of stock prizes has puzzled investors for a long time, perhaps giving stocks a speculative reputation.

It wasn't until Harry Markowitz came up with his Portfolio Optimization Model in the 50s, through which he basically founded Modern Portfolio Theory, that the pieces of the puzzle slowly started to fall into place. Looking back, his rationale was pretty straight forward: 1) calculate the average return for different stocks, the variance of those returns and the covariance between the returns of different stock, 2) calculate the efficient frontier, which is a graphical representation of all portfolios that maximize returns for a given amount of risk, 3) choose the portfolio that is characterised by the amount of risk that you, as an investor, are comfortable with. Even though Markowitz's approach was revolutionary, it suffers from two major flaws:

  1. It requires the investor to calculate a huge number of metrics, specifically if many stocks are involved (imagine manually building a covariance matrix for thousands of stocks).
  2. It's backward looking and doesn't really tell us much about future expected returns.

Later, in the early 60s, William Sharpe, Jack Treynor, John Lintner and Jan Mossin came up with the Capital Asset Pricing Model (CAPM), which lookes like this:

ERi ​= Rf​ + Ξ²i(ERmβ€‹βˆ’Rf​)

where:

  • ERi ​= expectedΒ returnΒ ofΒ investment
  • Rf​ = risk-freeΒ rate
  • Ξ²i​ = betaΒ ofΒ theΒ investment
  • (ERmβ€‹βˆ’Rf​) = marketΒ riskΒ premium​

They theorized that, if markets are efficient, expected returns should be in line with a security's

... keep reading on reddit ➑

πŸ‘︎ 108
πŸ’¬︎
πŸ‘€︎ u/ChengSkwatalot
πŸ“…︎ Oct 17 2021
🚨︎ report
failed attempt at portfolio optimization

Once I have two efficient portfolios how do I calculate their covariance? I don't think the way I did it is correct.

maxsr<-c(max_sr$Risk,max_sr$Return)

minvar<-c(min_var$Risk,min_var$Return)

p_cov<-cov(minvar,maxsr)

Edit full code:

#loading libraries

install.packages("DT")

install.packages("rmdformats")

install.packages("scales")

install.packages("plotly")

library(plotly)

library(scales)

library(rmdformats)

library(tidyverse)

library(tidyquant)

library(lubridate)

library(timetk)

library(knitr)

library(DT)

library(PerformanceAnalytics)

#load excel file with table 2 Chapter 3

library(readxl)

Chapter3_Table_2 <- read_excel("C:/Users/matti/OneDrive/Desktop/Tesi di laurea/CHapter3_Table_2.xlsx")

View(Chapter3_Table_2)

#isolating a string with the EURO STOXX 50 constituents

eurostoxx <- Chapter3_Table_2 [,2]

View(eurostoxx)

#downloading stock info from Yahoo Finance

stoxx_data <- tq_get(eurostoxx

, get = "stock.prices"

, from = "2020-12-24"

, to = "2021-12-24")

#calculating the stocks's logarithmic returns

stoxx_returns <- stoxx_data %>%

group_by(RIC) %>%

tq_transmute(select = adjusted,

mutate_fun = periodReturn,

period = 'daily',

col_rename = 'returns',

type = 'log')

#transforming the data in a time series

stoxx_returns_xts <- stoxx_returns %>%

spread(RIC, value = returns) %>%

tk_xts()

#eliminating rows with N/A values

stoxx_ret <- na.omit(stoxx_returns_xts)

#calulating daily average returns for each stocks

stoxx_means <- as.data.frame(colMeans(stoxx_ret))

colnames(stoxx_means) = paste("Daily Returns")

view(stoxx_means)

#calculating the var-covar matrix

cov_mat <- cov(stoxx_ret)

view(cov_mat)

#calculating annual returns and annual var-covar matrix

stoxx_means_yearly<- stoxx_means*252

cov_mat_yearly<- cov_mat*252

view(stoxx_means_yearly)

view(cov_mat_yearly)

#creating weights to perform optimization

eurostoxx_wts<-transpose(eurostoxx)

view(eurostoxx_wts)

wts<- runif(n=length(eurostoxx_wts))

print(wts)

print(sum(wts))

#imposing the constraint weights sum = 1

wts<-wts/sum(wts)

print(sum(wts))

#calculating the portfolio's returns

#as indicated in Markowitz's model

port_ret<- sum((wts*stoxx_means_yearly))

print(port_ret)

#calculating portfolio's volatility

port_risk<- sqrt(t(wts)%*%

(cov_mat_yearly%*%wts))

print(port_risk)

#creating 100

... keep reading on reddit ➑

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/sciabalacatanga
πŸ“…︎ Dec 30 2021
🚨︎ report
Blind Girl Here. Give Me Your Best Blind Jokes!

Do your worst!

πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Leckzsluthor
πŸ“…︎ Jan 02 2022
🚨︎ report
This subreddit is 10 years old now.

I'm surprised it hasn't decade.

πŸ‘︎ 14k
πŸ’¬︎
πŸ‘€︎ u/frexyincdude
πŸ“…︎ Jan 14 2022
🚨︎ report
Dropped my best ever dad joke & no one was around to hear it

For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.

I said "hey look, an escaPEA"

No one near me but it didn't half make me laugh for a good hour or so!

Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies πŸ˜‚

πŸ‘︎ 19k
πŸ’¬︎
πŸ‘€︎ u/Vegetable-Acadia
πŸ“…︎ Jan 11 2022
🚨︎ report
What starts with a W and ends with a T

It really does, I swear!

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/PsychedeIic_Sheep
πŸ“…︎ Jan 13 2022
🚨︎ report
What is a a bisexual person doing when they’re not dating anybody?

They’re on standbi

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/Toby-the-Cactus
πŸ“…︎ Jan 12 2022
🚨︎ report
Geddit? No? Only me?
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/shampy311
πŸ“…︎ Dec 28 2021
🚨︎ report
I wanna hear your best airplane puns.

Pilot on me!!

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/Paulie_Felice
πŸ“…︎ Jan 07 2022
🚨︎ report
Google Drive eTextbooks release thread (part-108)!+ Accepting requests every day
  • If you find your book in the thread below, send the number of the book via reddit chat or via telegram .
  • Almost all the books are in their latest editions and some of them are available in multiple editions too
  • Books (pdf) are delivered through Google-Drive link
  • You can also send requests via reddit chat or by telegram .
  • Also, upvote the post if you found it useful

Please find the list below:

  1. (eBook PDF)Principles of Environmental Engineering and Science by Susan J. Masten and Mackenzie L. Davis

  2. (eBook PDF)Building Intelligent Cloud Applications: Develop Scalable Models Using Serverless Architectures with Azure by John Biggs, Vicente Herrera GarcΓ­a, Jose Luis Calvo Salanova

  3. (eBook PDF)Ten Arguments For Deleting Your Social Media Accounts Right Now by Jaron Lanier

  4. (eBook PDF)A Visual Guide to Financial Statements: Overview for Non-Financial Managers & Investors by Thomas R. Ittelson

  5. (eBook PDF)Deep Reinforcement Learning: Frontiers of Artificial Intelligence by Mohit Sewak

  6. (eBook PDF)Java Deep Learning Projects: Implement 10 real-world deep learning applications using Deeplearning4j and open source APIs by MD Rezaul Karim

  7. (eBook PDF)Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems by AurΓ©lien GΓ©ron

  8. (eBook PDF)Risk-Return Analysis Volume 3 by Harry M. Markowitz

  9. (eBook PDF)The Creativity Code: Art and Innovation in the Age of AI by Marcus du Sautoy, Rich Keeble

  10. (eBook PDF)The Golden Dawn: The Original Account of the Teachings, Rites, and Ceremonies of the Hermetic Order by Israel Regardie, John Michael Greer

  11. (eBook PDF)Handbook of Deep Learning Applications by Valentina Emilia Balas, Sanjiban Sekhar Roy, Dharmendra Sharma, Pijush Samui

  12. (eBook PDF)Deep Learning for NLP and Speech Recognition by Uday Kamath, John Liu, Jimmy Whitaker

  13. (eBook PDF)Deep Learning for Search by Tommaso Teofili

  14. (eBook PDF)Introduction to Deep Learning by Eugene Charniak

  15. (eBook PDF)Blitzscaling: The Lightning-Fast Path to Building Massively Valuable Companies by Reid Hoffman, Chris Yeh, Bill Gates

  16. (eBook PDF)Voices for Animal Liberation: Inspirational Accounts by Animal Rights Activists by Brittany Michelson

  17. (eBook PDF)Financial Shenanigans: How to Detect Accoun

... keep reading on reddit ➑

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/textbooks6
πŸ“…︎ Dec 16 2021
🚨︎ report
E or ß?
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Amazekam
πŸ“…︎ Jan 03 2022
🚨︎ report
Don't expect to get rich with a $100 investment in BTC

Yesterday I witnessed a coworker complaining about his investment in BTC. He has bought it for the first time at $49k and it went down to $47k the day after. Talking to him, I discovered he put $100 and was expecting to have $1000 until the end of the year with no additional investment!

Of course, investing in BTC is still very risky, and the returns are much higher, comparing with another assets, as stocks. However, what's riskier? I man buying $100 in BTC in 2011 or a man buying $100 in BTC in 2021?

A man buying $100 in BTC in 2011 theoretically deserves to be more rewarded than a man buying the same amount of BTC nowadays, because he was incurring in much higher risks.

Some of the traditional investment theories and models correlate risks and returns, as the Markowitz Theory and the CAPM model. Both say: higher the risks, higher the returns!

So don't expect to get rich with a $100 investment in BTC. Despite of all the high risk involved, it's not enough to make you rich anymore.

πŸ‘︎ 35
πŸ’¬︎
πŸ‘€︎ u/Del1993BR
πŸ“…︎ Aug 27 2021
🚨︎ report
No spoilers
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Onfour
πŸ“…︎ Jan 06 2022
🚨︎ report
What did Spartacus say when the lion ate his wife?

Nothing, he was gladiator.

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/rj104
πŸ“…︎ Jan 15 2022
🚨︎ report
Pun intended.
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Sharmaji1301
πŸ“…︎ Jan 15 2022
🚨︎ report
Covid problems
πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/theincrediblebou
πŸ“…︎ Jan 12 2022
🚨︎ report
These aren't dad jokes...

Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.

This sub is mostly just NSFW puns now.

If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.

Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.

πŸ‘︎ 12k
πŸ’¬︎
πŸ‘€︎ u/Lance986
πŸ“…︎ Dec 15 2021
🚨︎ report
I had a vasectomy because I didn’t want any kids.

When I got home, they were still there.

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/demotrek
πŸ“…︎ Jan 13 2022
🚨︎ report
What did 0 say to 8 ?

What did 0 say to 8 ?

" Nice Belt "

So What did 3 say to 8 ?

" Hey, you two stop making out "

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/designjeevan
πŸ“…︎ Jan 03 2022
🚨︎ report
Spi__
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Fast_Echidna_8520
πŸ“…︎ Jan 11 2022
🚨︎ report
I dislike karma whores who make posts that imply it's their cake day, simply for upvotes.

I won't be doing that today!

πŸ‘︎ 15k
πŸ’¬︎
πŸ‘€︎ u/djcarves
πŸ“…︎ Dec 27 2021
🚨︎ report
The Ancient Romans II
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/mordrathe
πŸ“…︎ Dec 29 2021
🚨︎ report
I'd like to dedicate this joke to my wisdom teeth.

[Removed]

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/ThoughtPumP
πŸ“…︎ Jan 14 2022
🚨︎ report
How do you stop Canadian bacon from curling in your frying pan?

You take away their little brooms

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Majorpain2006
πŸ“…︎ Jan 09 2022
🚨︎ report
I did it, I finally did it. After 4 years and 92 days I went from being a father, to a dad.

This morning, my 4 year old daughter.

Daughter: I'm hungry

Me: nerves building, smile widening

Me: Hi hungry, I'm dad.

She had no idea what was going on but I finally did it.

Thank you all for listening.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/Sk2ec
πŸ“…︎ Jan 01 2022
🚨︎ report
It this sub dead?

There hasn't been a post all year!

πŸ‘︎ 13k
πŸ’¬︎
πŸ‘€︎ u/TheTreelo
πŸ“…︎ Jan 01 2022
🚨︎ report
School Was Clothed
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Kennydoe
πŸ“…︎ Jan 08 2022
🚨︎ report
Thursday assorted links
πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Dec 02 2021
🚨︎ report
Letting loose with these puns
πŸ‘︎ 6k
πŸ’¬︎
πŸ“…︎ Jan 13 2022
🚨︎ report
Couch potato
πŸ‘︎ 8k
πŸ’¬︎
πŸ“…︎ Dec 31 2021
🚨︎ report
Baka!
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/ridi86
πŸ“…︎ Jan 09 2022
🚨︎ report
All dad jokes are bad and here’s why

Why

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/LordCinko
πŸ“…︎ Jan 13 2022
🚨︎ report
My name is ABCDEFGHIJKMNOPQRSTUVWXYZ

It’s pronounced β€œNoel.”

πŸ‘︎ 14k
πŸ’¬︎
πŸ‘€︎ u/beef_fried_rice
πŸ“…︎ Dec 25 2021
🚨︎ report
concrete πŸ—Ώ
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Fast_Echidna_8520
πŸ“…︎ Jan 07 2022
🚨︎ report
Why are people so surprised and angry about Djokovic being an anti-vaxxer?

After all his first name is No-vac

πŸ‘︎ 4k
πŸ’¬︎
πŸ‘€︎ u/hangryman23
πŸ“…︎ Jan 06 2022
🚨︎ report
If Korean pop is shortened to Kpop and Korean Drama is Kdrama...

What, then, is Chinese rap?

Edit:

Notable mentions from the comments:

  • Spanish/Swedish/Swiss/Serbian hits

  • French/Finnish art

  • Country/Canadian rap

  • Chinese/Country/Canadian rock

  • Turkish/Tunisian/Taiwanese rap

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/hootanahalf
πŸ“…︎ Jan 09 2022
🚨︎ report
That’s Michelle
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/FLEXSEALBREAKER
πŸ“…︎ Jan 10 2022
🚨︎ report
Is this sub still active?

There hasn't been a single post this year!

(Happy 2022 from New Zealand)

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/DonStimpo
πŸ“…︎ Dec 31 2021
🚨︎ report
What did the ocean say to the beach?

Nothing, it just waved

πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/hackerboi1198
πŸ“…︎ Jan 13 2022
🚨︎ report
is Isn't
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/mordrathe
πŸ“…︎ Jan 11 2022
🚨︎ report
My 9 year old son just asked me to pretend I was a police officer arresting him for downloading the entire Wikipedia. Me: Young man, you're under arrest for downloading the entire Wikipedia!

Him: I can explain everything!

(It's his best joke yet I think)

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/MrPJ2020
πŸ“…︎ Jan 14 2022
🚨︎ report
@u/mordrathe - remix
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/SpydrRydr
πŸ“…︎ Jan 12 2022
🚨︎ report
[AMD GPU/CPU] Single GPU passthrough not recognized in Win10 VM

Hi there,

I have been trying to wrap my head around single GPU passthrough for the last week and I fail to see what's wrong here.

First things first , my specs:

  • X570 motherboard (Asus TUF gaming plus, the non-wifi one)
  • Ryzen9 5900X (with PBO enabled but I don't think it matters)
  • Radeon 6900XT
  • BIOS: I enabled everything I could find related to virtualization
  • Host: Arch with 5.14.8 zen kernel

I'm happy with my Arch install but I would like to be able to check out the few rare games that are not working with Proton or any other Wine flavor (looking at you New World).I've followed so many tutorials, most of them being for NVIDIA cards, but from what I gathered we add hook scripts to stop the display manager, unload the drivers using the graphics card, attach it to the VM and do all of those in reverse but exiting the VM.

I've reached a point where I can launch my win10 VM though my GPU with my keybard, mouse and wireless headset. So what's my problem then?

Well, my GPU is not recognized by Windows' devide manager and if I try to install the amd drivers for a 6900XT it basically bricks my VM (black screen past the bios) and I have to erase the volume and reinstall W10.

And here are my config files:

#start.sh
#!/bin/bash
set -x

# Load vars
source "/etc/libvirt/hooks/kvm.conf"
 
# Stop display manager
systemctl stop sddm.service
 
# Avoid race condition
sleep 5

# Unload AMD Kernel modules
modprobe -r amdgpu
 
# Load VFIO Kernel modules
modprobe vfio
modprobe vfio_pci
modprobe vfio_iommu_type1
 
# Unbind GPU
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
virsh nodedev-detach $VIRSH_GPU_USB
virsh nodedev-detach $VIRSH_GPU_SERIAL



#revert.sh
#!/bin/bash
set -x
 
# Load vars
source "/etc/libvirt/hooks/kvm.conf"
 
# Unload vfio modules
modprobe -r vfio_pci
modprobe -r vfio_iommu_type1
modprobe -r vfio
 
# Attach GPU/devices to host
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO
virsh nodedev-reattach $VIRSH_GPU_USB
virsh nodedev-reattach $VIRSH_GPU_SERIAL

# Load AMD Kernel Modules
modprobe amdgpu
 
# Restart DM
systemctl start ssdm.service



#kvm.conf
VIRSH_GPU_VIDEO=pci_0000_0c_00_0
VIRSH_GPU_AUDIO=pci_0000_0c_00_1
VIRSH_GPU_USB=pci_0000_0c_00_2
VIRSH_GPU_SERIAL=pci_00
... keep reading on reddit ➑

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/malko42
πŸ“…︎ Oct 04 2021
🚨︎ report
What do you call a guy with no arms and no legs in a hot tub?

Bob

πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/4fuchssake
πŸ“…︎ Jan 05 2022
🚨︎ report
I named my dog "5 miles."

So that I could frequently say, "I am going to walk 5 miles now."

Edit: My most popular post on Reddit! πŸ˜€ Thank you for the awards.

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/javacafe
πŸ“…︎ Jan 10 2022
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.