Episode 14

Robo Advisors - Rob Reider & Alex Michalka - HS#14

Published on: 13th July, 2024

Exploring Robo Advisors with Python Experts: Rob Reider & Alex Michalka

Get their book 45% OFF with code hockeystick24 here: https://mng.bz/ngjd

Join Miko Pawlikowski on this episode of HockeyStick as he dives into the world of robo advisors with industry heavyweights Rob Reider and Alex Michalka, authors of "Build a Robo Advisor with Python from Scratch". Discover their fascinating career paths from hedge funds to robo advising, the intricacies of Python programming for finance, and the evolution of financial planning and optimization techniques. Gain insights into asset allocation, tax-loss harvesting, Monte Carlo simulations, reinforcement learning, and the future of robo advising. An essential watch for anyone interested in the intersection of finance and technology!

0:00 Introduction to Robo Advisors

0:50 Rob Reider's Career Journey

01:40 Quantopian and the Love for Python

04:19 The Birth of a Book Collaboration

05:11 Alex's Journey and Weather Derivatives

08:08 Understanding Hedge Funds vs. Robo Advisors

11:13 The Rise of Robo Advisors

17:30 Tax Efficiency and Asset Allocation

24:51 Target Audience and Book Insights

28:21 Monte Carlo Simulations Explained

31:15 Monte Carlo Simulations Explained

32:01 Applications of Monte Carlo Simulations

33:34 Introduction to AI and Reinforcement Learning

35:25 Reinforcement Learning in Finance

39:38 The Power of Python in Finance

42:23 Challenges in Measuring Returns

1:01:35 Conclusion and Final Thoughts

Transcript
Speaker:

I'm Miko Pawlikowski and this is HockeyStick.

Speaker:

Today we're talking about robo advisors, a topic in between tech and finance.

Speaker:

To do that I'm bringing in some heavy hitters, the authors of "Build a Robo

Speaker:

Advisor with Python from Scratch", Rob Reider and Aleksander Michalka.

Speaker:

Rob has been a quantitative hedge fund portfolio manager for over 15 years.

Speaker:

He holds a PhD in finance from the Wharton School and is an adjunct professor at

Speaker:

NYU, where he teaches a graduate course in the math finance department called Time

Speaker:

Series Analysis and Statistical Arbitrage.

Speaker:

Alex leads the investment research group at Wealthfront.

Speaker:

He holds a BA in Applied Mathematics from UC Berkeley and a PhD in Operations

Speaker:

Research from Columbia University.

Speaker:

Welcome to this episode, and thank you for flying HockeyStick.

Speaker:

All right, Rob, we're going to start with you.

Speaker:

when I read your resume, I felt very small,

Speaker:

not only to mention your extensive experience, but also

Speaker:

all the right names on it.

Speaker:

The Wharton, a PhD in finance, NYU, adjunct professor.

Speaker:

Can you tell us a little bit about what you're teaching and what you're doing?

Speaker:

after my PhD, I, worked at a bank.

Speaker:

I worked on, derivative securities, then I moved to their proprietary trading group.

Speaker:

then, I moved to, an actual hedge fund, Millennium Partners, big hedge fund.

Speaker:

went to another hedge fund, which blew up.

Speaker:

it's a very sad story.

Speaker:

It was started by a medical doctor and, wanted to, But then somebody

Speaker:

on the medical side, the health care side, committed insider trading.

Speaker:

It was a front page of Wall Street Journal.

Speaker:

and the hedge fund basically, blew up.

Speaker:

but then after that I had a very interesting, experience.

Speaker:

I worked at a wonderful company called Quantopian.

Speaker:

a backtesting platform in Python.

Speaker:

So you can go into their platform, backtest different trading strategies.

Speaker:

They supply data.

Speaker:

They had a lot of built in code.

Speaker:

and then their basic business model was they were going to try to be

Speaker:

the first crowdsourced hedge fund.

Speaker:

So if you thought you had a good strategy, you could just hit a button

Speaker:

and be considered for actual money.

Speaker:

And they actually got an investor to see their hedge funds.

Speaker:

and it was interesting for me because I started my life as an

Speaker:

engineer and did a lot of coding.

Speaker:

And then I moved away from coding for years.

Speaker:

Like when I worked at millennium, I had people work for me and

Speaker:

they would do all the coding.

Speaker:

So my coding skills atrophied, but when I, went back into Quantopia and I had

Speaker:

to learn Python, like I'm so old that I learned Fortran as my first language.

Speaker:

I picked up a Python book and I just loved Python.

Speaker:

so that sparked my interest, in doing Python.

Speaker:

and then I actually had A stint at a robo advisor as well, which

Speaker:

was a startup robo advisor.

Speaker:

I think it's very hard to be a startup anything, especially when you're

Speaker:

competing against large incumbents like, Vanguard and Schwab and things like that.

Speaker:

and then I teach at NYU, so I've been teaching for, over 15 years.

Speaker:

I teach a course on quantitative trading for a master's program,

Speaker:

it's a one and a half year master's in mathematical finance.

Speaker:

then you also have that online course time series analysis in Python.

Speaker:

So I guess you, taught yourself Python.

Speaker:

now you're teaching everybody else.

Speaker:

yeah, so when I was at Quantopian, there's this company called Datacamp.

Speaker:

Quantopian was in Boston.

Speaker:

Datacamp used to be in Boston, now they're in New York.

Speaker:

I guess their offices were near Quantopians, and they

Speaker:

were just starting out.

Speaker:

And they said: we need somebody to teach a course in time series analysis in Python.

Speaker:

So Quantopian suggested that I do it.

Speaker:

And that's actually related to our, origin story, because once I did that

Speaker:

online course, which became fairly popular, a few publishers reached out

Speaker:

to me and said, do you want to do a book on time series analysis in Python?

Speaker:

And at the time I was busy, I was bored of the subject, so I turned it down.

Speaker:

the publisher Manning said, Do you, we pick somebody else to do it.

Speaker:

Do you want to edit what they're doing?

Speaker:

and then, I started like editing somebody else's work.

Speaker:

And so like, why am I spending all this time, editing somebody else's work?

Speaker:

Maybe I should just write my own book.

Speaker:

And the next kind of offer that came along was this book on robo advising and

Speaker:

Python, which I know something about.

Speaker:

And then I knew I know stuff takes me a long time to do.

Speaker:

I'm a perfectionist.

Speaker:

Things take me three times longer than it would take somebody else.

Speaker:

So I knew it would take me forever to write a book.

Speaker:

So I knew I had to find a co author.

Speaker:

And I basically just cold called Alex.

Speaker:

I didn't know who he was.

Speaker:

I just saw that he was head of research at a Wealthfront.

Speaker:

He had the perfect background, a PhD, worked at a robo advisor.

Speaker:

So I just reached out to him and said, would you be interested?

Speaker:

And we hit it off and that's how we started collaborating.

Speaker:

I

Speaker:

So you were roped in Alex.

Speaker:

Is that right?

Speaker:

One day you just wake up, you get a call.

Speaker:

It's Oh, fine.

Speaker:

I'll write a book with you.

Speaker:

yeah, I had kind of always wanted to write a book.

Speaker:

never was sure what the topic would be, had a few candidates in mind.

Speaker:

But then, when I met Rob, I thought it was the perfect fit, like you

Speaker:

mentioned, I've been working at Wealthfront, as the head of research

Speaker:

for about two years at that point.

Speaker:

And, Rob had basically already written the book.

Speaker:

He had a full outline of all the chapters and the sub chapters and all this stuff.

Speaker:

So it made it really easy for me to say yes.

Speaker:

I also saw that you worked at weather bill to do weather derivative pricing models.

Speaker:

that sounds very interesting to me.

Speaker:

can you talk a little bit about what that actually means in practice?

Speaker:

Yeah.

Speaker:

So the company was started, in 2006.

Speaker:

It was a friend that I knew from college.

Speaker:

and he roped me into it.

Speaker:

To use that term, I was going to go straight through to grad school, but right

Speaker:

before I was graduating, he convinced me to come on and work for him for a year.

Speaker:

And the weather derivative thing isn't the most important part.

Speaker:

really what we were trying to do is build a, basically an insurance solution for

Speaker:

businesses that were affected by weather.

Speaker:

So you can think of things like golf courses or events, if you're having a

Speaker:

big outdoor concert or sports event and expecting to sell a lot of tickets, sell

Speaker:

a lot of merchandise and it gets rained out, you could lose a lot of money.

Speaker:

Or if there's a, really warm winter and you're a power utility,

Speaker:

you might not sell as much gas.

Speaker:

so you could use a weather derivative contract to, hedge against whatever

Speaker:

weather peril you're facing.

Speaker:

the market had been mostly in that kind of utility sector that I mentioned.

Speaker:

for the longest time, but it was a very manual process.

Speaker:

If you wanted to hedge weather risk, you had to get your team of lawyers and

Speaker:

go to a bank and talk to their team of lawyers and get the details hammered out.

Speaker:

what we did was use technology to make the process a lot simpler, cheaper, faster.

Speaker:

And, let's see, it was all online.

Speaker:

So you never actually had to talk to anybody could go online and

Speaker:

configure a contract and just buy it right there on the spot.

Speaker:

So how much of that was actual weather modeling?

Speaker:

There was a good amount.

Speaker:

So there are multiple ways to price a weather contract.

Speaker:

you can buy historical weather data, which is what we did.

Speaker:

And, the simplest way is just model the payouts that would have happened.

Speaker:

historically and figure out a fair value for the contract based on that.

Speaker:

Another way that you can do it is actually simulate the underlying weather processes,

Speaker:

like the daily temperature values and the daily precipitation values, and then run

Speaker:

lots and lots of simulations and, take the average compute payouts for the contract

Speaker:

based on those weather simulations, and then, come up with a price based on that.

Speaker:

So we started with the easier method, that was my first task on the job,

Speaker:

and then later we started moving into the more complex methods where you're

Speaker:

actually modeling the underlying, weather processes, which is a lot of work,

Speaker:

especially when you have thousands of, locations, which are usually airports, but

Speaker:

not always, thousands of locations across the US, across Europe, Canada, pretty

Speaker:

large scale, pretty difficult problem.

Speaker:

So for anybody listening to this, you'll probably notice that it's

Speaker:

not our typical technical, episode.

Speaker:

We're going to expand our horizons a little bit and try to understand an entire

Speaker:

new environment, the finance environment.

Speaker:

But before we jump into the robot advisors, I want to use this opportunity

Speaker:

because I don't usually get people with, 15 years, experience in a hedge

Speaker:

funds portfolio manager role to a lot of people listening to this, they're going

Speaker:

to be coming from software engineering background and probably their exposure

Speaker:

of how hedge funds actually work is shaped primarily by things like billions.

Speaker:

how does it compare to real life?

Speaker:

from your experience, are there elements of billions that you would say are

Speaker:

representative, or is it all Hollywood?

Speaker:

only watched a handful of episodes of Billions, so I can't speak to that.

Speaker:

But of the few episodes I watched, I thought it was actually pretty realistic.

Speaker:

And I think the writers, know Wall Street.

Speaker:

this like sort of two types of hedge funds.

Speaker:

There's, Traders that use fundamental information.

Speaker:

So they'll, analyze companies, products and their financial statements, and

Speaker:

they'll listen to earnings calls and they'll talk to sell side analysts.

Speaker:

And those are like the fundamental traders.

Speaker:

And then you have the quantitative traders that don't know, anything

Speaker:

about what the company does.

Speaker:

They just, use statistics and computers to come up with trading strategies

Speaker:

and in billions, they had both.

Speaker:

and that's millennium was like that too.

Speaker:

Millennium, had something like, 150 different little tiny groups

Speaker:

or silos and each group might be two, three, four people.

Speaker:

and some of them traded based on fundamentals and usually focused on

Speaker:

a single sector, because you can only really be an expert on one little area.

Speaker:

And then they also had a large number of quantitative traders as well.

Speaker:

and I should say that.

Speaker:

Millennium is considered a multi strategy hedge fund, but there's lots of other

Speaker:

types of hedge funds, there's some hedge funds that have large groups,

Speaker:

like there's a known hedge fund, Two Sigma, that has instead of small

Speaker:

silos of two, three, four people, they have large groups of a hundred people

Speaker:

and they work in a different way.

Speaker:

They also do quantitative stuff, but in a large collaborative environment.

Speaker:

Millennium was very secretive, groups didn't talk to each other, give away

Speaker:

their secret sauce, which solves some problems and creates other problems.

Speaker:

on one hand, when you work in small silos, you have to reinvent the wheel.

Speaker:

You have to come up with your own trading algorithms.

Speaker:

So there's no common algorithms that everyone could use, but

Speaker:

also it aligns incentives.

Speaker:

You don't have to worry about people like stealing your stuff

Speaker:

and going to another hedge fund.

Speaker:

And, Also, at Millennium, every little group pays for their own data.

Speaker:

So when I worked at, J.

Speaker:

P.

Speaker:

Morgan, we subscribe to all these different data sources.

Speaker:

And we don't even know why we subscribe.

Speaker:

somebody at some point may have said, Oh, I need this, data.

Speaker:

And 10 years later, we're still subscribing to it.

Speaker:

Whereas at Millennium, it comes out of our own P&L.

Speaker:

So we have the incentive to try to, just, get the data that we need so

Speaker:

it solves a lot of incentive issues.

Speaker:

So there's a lot of them and there's going to be a lot of variation.

Speaker:

And then is it true to say that in the recent decades, we've seen this

Speaker:

rise of this new breed of, investment, funds that we call robo advisors,

Speaker:

like an umbrella term for all of them, or is it older of an invention?

Speaker:

the hedge fund world is very different from the robo advisor world.

Speaker:

The hedge fund world tries to figure out ways to beat the market.

Speaker:

Whereas I would say the robo advisor world is investing in kind of

Speaker:

low cost index funds in the way.

Speaker:

They try to beat the market is through, saving money on taxes and

Speaker:

having higher after tax returns.

Speaker:

So robo advisors typically don't try to, figure out like hedge funds

Speaker:

do, like which stocks to buy, which stocks are better, which one's going

Speaker:

to outperform the market, what their hedge funds look for different anomalies

Speaker:

and try to take advantage of that.

Speaker:

Robo advisors take a totally different approach and say we're

Speaker:

just going to invest in index funds.

Speaker:

We're going to do in a very tax efficient way

Speaker:

So what was the thing that got you interested in robo advisors coming

Speaker:

from the background of, of hedge funds and beating the markets and doing all

Speaker:

this ambitious things to moving on to, something more for everybody, the

Speaker:

average Joe's, robo advisor thing.

Speaker:

What was the trigger, that got you interested in that?

Speaker:

even working at hedge funds.

Speaker:

I've always been interested in personal taxes ways to save money on taxes.

Speaker:

20 years ago, I was telling people at work about this concept of asset

Speaker:

location, not asset allocation, but something called asset location, which

Speaker:

we could talk about later, but this was something that I was espousing

Speaker:

many years before it was popular.

Speaker:

So I've always been interested in personal finance.

Speaker:

I do my own taxes on TurboTax.

Speaker:

So as a result, I've learned a lot about the tax code by

Speaker:

being a 'do it yourself' person.

Speaker:

And this idea of trying to, save money on taxes, for example, is something

Speaker:

that I've always been interested in.

Speaker:

And what about you, Alex, you work at Wealthfront, which is, one of the

Speaker:

more easily recognizable, at least from where I'm sitting, robo advisors.

Speaker:

What was the journey for you to, get interested in that?

Speaker:

Yeah.

Speaker:

So let's see, like I mentioned before, I started in tech, but

Speaker:

the company that I was working for had a financial slam to it.

Speaker:

We were risk management company, where in particular, the risk that we were

Speaker:

helping people manage against was weather.

Speaker:

And then after grad school, I actually worked at a, hedge fund

Speaker:

also called AQR Capital Management.

Speaker:

It ran a variety of strategies, some were hedge fund strategies where, you're

Speaker:

going along a bunch of stocks and short a bunch of stocks and, trying to, Hedge

Speaker:

out market risk, make a return and somewhere along only strategies where,

Speaker:

we're buying stocks, getting full exposure to the stock market, but we're trying

Speaker:

to beat the market, like Rob mentioned.

Speaker:

And I heard about Wealthfront at some point.

Speaker:

I don't know why my wife and I we were on the websites of Wealthfront.

Speaker:

And I noticed that the chief investment officer was Bert Malkiel, who's a very

Speaker:

famous, name in the world of finance.

Speaker:

He wrote a book called "a random walk down wall street".

Speaker:

he's been a long time proponent of indexing, not trying to

Speaker:

beat the market, low costs.

Speaker:

tax efficiency and their, VP of research at the time, the person who

Speaker:

I ended up replacing, had spent a year at AQR also back in the early 2000s.

Speaker:

So I noticed they had some very talented researchers, very talented personnel.

Speaker:

I started reading, some of the white papers that they'd written

Speaker:

in blog posts, and I was just very impressed by the company.

Speaker:

And I think a phrase that you mentioned earlier before was one other driver for

Speaker:

me, which was the average Joe thing.

Speaker:

I really like the idea of having a, serving a client base that was,

Speaker:

much more directly retail at a QR.

Speaker:

A lot of our clients were big institutions like pension funds, and

Speaker:

endowments, sovereign wealth funds.

Speaker:

And there are individuals that are benefiting from those investments.

Speaker:

but it's just a lot more direct at wealth front.

Speaker:

We're very directly serving the end investor.

Speaker:

And what I found after joining was it was even more rewarding.

Speaker:

You'd get these emails from clients telling us how much they love our

Speaker:

product and, love the service.

Speaker:

that always helps,

Speaker:

that helps you sleep at night.

Speaker:

so if we were to try to draw a little bit of a landscape for robo

Speaker:

advisors, where does it start?

Speaker:

What would be considered like the first robo advisor that hit the market?

Speaker:

I think, Betterment actually claims that title.

Speaker:

but Betterment and Wallfront were the two earliest ones back in, I don't

Speaker:

know, 10, 12 years or so ago, I think.

Speaker:

And then over time, more have entered, I think a number have failed.

Speaker:

Like Rob mentioned, it's tough to start as a robo advisor.

Speaker:

You really need to reach scale to make it work.

Speaker:

And then over the years, there've also been a number

Speaker:

of robo advisors launched by.

Speaker:

larger incumbents.

Speaker:

so places like Vanguard, Schwab, like the big advisory and brokerage houses,

Speaker:

have launched their own versions of robo advisors to compliment the human financial

Speaker:

advisors that they've had for decades.

Speaker:

So you mentioned Vanguard and I think at least from my experience, when I

Speaker:

speak to other techies and software engineers, the one thing that they all

Speaker:

know about investing is that they should.

Speaker:

Put some money on S&P 500 and keep it forever.

Speaker:

And that's the smart way to do it.

Speaker:

So from that point of view, if you were to explain to a five year old software

Speaker:

engineer, what's the real difference between using something like a robot

Speaker:

advisor, versus just putting some money on S&P and hoping that the US doesn't

Speaker:

stop being one of the best markets.

Speaker:

I would say, first of all, even if you're going to use Vanguard, you still have

Speaker:

to make a decision about Which Vanguard funds to buy There's S&P 500, but you

Speaker:

might want to hold some bonds too.

Speaker:

and how do you figure out the mix between stocks and bonds?

Speaker:

And that's probably the most important decision an individual investor would

Speaker:

make, more important than trying to beat the market by 1%, there's no right

Speaker:

or wrong answer, but what you choose for your asset allocation is probably

Speaker:

the most consequential decision.

Speaker:

and we do in the book have several chapters on this whole, idea of asset

Speaker:

allocation, but, as we talked about, there's other ways to even do better

Speaker:

than just a straight Vanguard index 500 through various tax savings techniques.

Speaker:

let's talk about this tax savings techniques a little bit.

Speaker:

I think you used the expression free lunch a few times as we spoke about it.

Speaker:

What's the main draw?

Speaker:

What can you offer as a robo advisor that, people might not know about?

Speaker:

there's a few different chapters on these.

Speaker:

I'll talk about two and then I'll let Alex talk about one of them.

Speaker:

let's say you're in the, decumulation phase of your life where you're retired

Speaker:

and you have to draw down on your savings to pay for your expenses.

Speaker:

you're faced with the decision of, which accounts should I draw down

Speaker:

from, Constantly throughout the book.

Speaker:

We thought about how is what we're writing going to be different from what you

Speaker:

would get with something like ChatGPT?

Speaker:

And if you ask ChatGPT, this question, if you said, I'm an individual, I

Speaker:

have $2 million in an IRAI have a million dollars in a brokerage account.

Speaker:

Some of that money has, low cost basis, some of it has high cost basis.

Speaker:

I also have a small Roth account with a half a million dollars.

Speaker:

I'm in this particular tax bracket.

Speaker:

I have to take, required minimum distributions in

Speaker:

a certain number of years.

Speaker:

Oh, I also have an inherited IRA that I have to deplete in 10 years.

Speaker:

how should I start withdrawing money?

Speaker:

It would give you some very generic, general advice.

Speaker:

It's not really designed for giving custom tailored, and that's what I

Speaker:

think is one of the interesting things, why I think the book was a little bit

Speaker:

more interesting because you can't just ask these questions for ChatGPT.

Speaker:

and it does make a huge difference.

Speaker:

Like we showed in the book that depending on which strategy you choose

Speaker:

for withdrawing your assets, it could extend your assets by, a decade or more.

Speaker:

So these are consequential decisions that actually have a big impact.

Speaker:

and it's all based on taxes.

Speaker:

a second area that I mentioned in the book, which is like the sort of free

Speaker:

lunch, is this idea of asset location.

Speaker:

suppose you have, a few different types of accounts, which I just mentioned,

Speaker:

maybe you have a 401k or an IRA, maybe you have a taxable account, maybe you

Speaker:

also have, a Roth account, and then you have different assets, maybe you have,

Speaker:

US stocks, international stocks, you have different, money market, a bond account.

Speaker:

how do you place those different assets into which accounts?

Speaker:

And it's a really interesting optimization problem.

Speaker:

it's not the same for everybody.

Speaker:

It depends on different factors.

Speaker:

And again, it's really a free lunch.

Speaker:

one of the basic concepts is that if you have money in stocks, it

Speaker:

already is somewhat tax advantage.

Speaker:

if you're not constantly trading the stocks, if you are, a buy and hold

Speaker:

investor, then the capital gains on those stocks get deferred anyway, you're

Speaker:

not realizing those capital gains.

Speaker:

So in some ways, it might not make sense to put those stocks in an

Speaker:

IRA, which is also tax deferred.

Speaker:

And even more importantly, if you have the stocks in a regular taxable,

Speaker:

Vanguard account, once you finally do realize those capital gains, you pay the

Speaker:

lower capital gains tax rates, whereas if you had put the money in an IRA,

Speaker:

when you finally take the money out, you pay ordinary income taxes on that.

Speaker:

but it's also not as simple as saying, all right, I'm going to shift bonds into my

Speaker:

IRA and stocks into my taxable account.

Speaker:

It's much more complicated.

Speaker:

we go through in the book, how you would do an optimization like that.

Speaker:

so just a very quick, detour for people who are listening to this,

Speaker:

who are not US-based, you mentioned things like 401k, IRA, and Roth.

Speaker:

Would you mind very quickly explaining what these things mean?

Speaker:

Yes, and in fact, we did recognize when drafts of our book were sent to

Speaker:

different, reviewers that some people were in other countries and saying,

Speaker:

why is it so focused on the US?

Speaker:

So we added a couple of lines in there to say that, even though we're

Speaker:

US-centric, a lot of these same concepts apply in other countries and

Speaker:

we gave, an example or two of that.

Speaker:

so in an IRA and 401k, and they're very similar to each other, So you

Speaker:

don't pay taxes when the money goes into the IRA, but then when you

Speaker:

deplete the IRA, you pay taxes.

Speaker:

for a taxable account, you've already paid taxes on the money.

Speaker:

So you're using after tax money for just a regular brokerage account.

Speaker:

And at a Roth account, you also pay, taxes up front, but then when you take

Speaker:

the money out of the end, unlike an IRA, a rough IRA, you pay no taxes at the end.

Speaker:

And then there's other types of accounts, like there's a health

Speaker:

savings account where you don't pay taxes in the beginning or at the end.

Speaker:

so there's lots of different types of accounts with different tax treatments.

Speaker:

You said it was basically an optimization problem.

Speaker:

So you end up with some kind of choice of parameters of what you

Speaker:

think is more important to you.

Speaker:

And then you basically can write a program that solves that for you.

Speaker:

is that roughly where it is?

Speaker:

Yes, yes.

Speaker:

So everybody should go to manning.com and get the book now and go and write

Speaker:

some code to optimize their money.

Speaker:

Should we end the episode here then?

Speaker:

it's actually a complicated problem.

Speaker:

and a lot of robo advisors, do something called taxless harvesting,

Speaker:

which Alex will talk about next.

Speaker:

but very few actually do asset location because it is a very complicated

Speaker:

thing to do and it is very customized.

Speaker:

So surprisingly, even though this could be a huge tax savings,

Speaker:

it's not really widely done.

Speaker:

and I think that's one of the exciting things about the book is that, I think

Speaker:

there will be a hockey stick, to use that term, pattern where kind of these things,

Speaker:

it might not be like a steep hockey stick, maybe a lower slope hockey stick, but

Speaker:

where these ideas start to take hold and more and more people do them, over time.

Speaker:

What's a glide path?

Speaker:

so there's a whole industry of, something called target date funds.

Speaker:

Vanguard offers many of these.

Speaker:

These are funds that, change your asset allocation over time.

Speaker:

So the kind of theory is that as you get older, you should be

Speaker:

holding, less stocks and more bonds.

Speaker:

And we actually cover this in one part of one chapter about how to

Speaker:

actually do that optimization as well.

Speaker:

and I think we didn't explicitly say it, but between the lines, there are

Speaker:

different restrictions, all these accounts, there are only certain amounts

Speaker:

and you can put in them at different time periods and stuff like that, which

Speaker:

makes it a level more complicated.

Speaker:

Is that right?

Speaker:

Yes.

Speaker:

And there's so many complications with all this stuff.

Speaker:

we cover required minimum distribution, so when you hold an IRA, at some point,

Speaker:

you have to start taking money out of it, and there's certain rules on that,

Speaker:

and it gets even more complicated when you talk about the rules for inherited

Speaker:

IRAs, and then we mostly focused on federal taxes, but there's also state

Speaker:

taxes and every state has different rules.

Speaker:

So like New York, for example, you can take out $20k every year of an IRA without

Speaker:

being subject to New York State taxes.

Speaker:

So that also affects your decision about how to start

Speaker:

withdrawing money from your IRAs.

Speaker:

You might want to go right up to that limit every year, for example.

Speaker:

so Monopoly all of a sudden sounds like it's pretty

Speaker:

straightforward and pretty boring.

Speaker:

They should update the version that has all of this added to it.

Speaker:

I

Speaker:

can definitely see the draw of why somebody would go and pick

Speaker:

up the book to learn about that.

Speaker:

and we're going to get into the technical part of the book in a sec,

Speaker:

but we didn't say it explicitly either.

Speaker:

Who is really your target audience?

Speaker:

I think that was a really tricky thing for Alex and I.

Speaker:

So we had in mind a widely varying audience.

Speaker:

On one hand, for developers that were interested in saving money in finance,

Speaker:

or making money, it reminds me, I was just reading the obituary of Jim

Speaker:

Simons, who was like this quant guru, and he was a Brilliant mathematician.

Speaker:

And at some point in his life, he decided, rather than working on math

Speaker:

theorems, I actually want to make money.

Speaker:

So part of the audience is for people that are, coders that want to turn

Speaker:

their skills into making money.

Speaker:

and they have one set of skills, which is they're really probably great at Python,

Speaker:

but don't know much about the finance.

Speaker:

Then we also had in mind, a segment that maybe our, financial advisors

Speaker:

that maybe, know a lot about the finance part, but a lot of them

Speaker:

actually do stuff in spreadsheets, and they don't know any Python.

Speaker:

and that's making it even more complicated.

Speaker:

The book has a little bit of math in it.

Speaker:

if you were to draw a Venn diagram where one circle is people who know Python and

Speaker:

other circles, people who know finance and other circles, people who know math,

Speaker:

like the intersection of that is small.

Speaker:

so we try to make it so that if you don't know any Python and don't care to learn

Speaker:

it, you could just skip the Python parts.

Speaker:

If you don't know, any math, we try to emphasize that, we include

Speaker:

the math for completeness for those people that are interested in it,

Speaker:

but we could just skip that part.

Speaker:

We put some of that stuff in the appendix.

Speaker:

so it does have a wide audience and in fact, I know that you

Speaker:

wrote a book for Manning.

Speaker:

so you're aware of this, when we had a draft of the book, the Manning

Speaker:

sends out the draft to something like 15 reviewers and Manning's staple of

Speaker:

reviewers are people that are software developers, not financial advisors,

Speaker:

because that's just not their world.

Speaker:

So we got, reviews from mostly software developers.

Speaker:

And in general, the reviews were great, but obviously it's human nature to

Speaker:

focus on what are some of the critiques.

Speaker:

so like we had a throwaway line in the first chapter about why we

Speaker:

chose, Python over other languages.

Speaker:

And they were all over that.

Speaker:

we got a million comments about that.

Speaker:

And then we would also get comments like, what is a T bill or what

Speaker:

does it mean to short sale?

Speaker:

Alex and I had a lot of discussions about do we want to explain these concepts?

Speaker:

and usually where we landed was that you could easily Google

Speaker:

some of the financial terms.

Speaker:

we didn't intend for this book to be teaching the basics of everything.

Speaker:

So we assume that people.

Speaker:

have a minimum understanding of Python.

Speaker:

We're not trying to teach people Python from scratch or have a minimum

Speaker:

understanding of finance and know some of the terms and if you don't

Speaker:

you just have to look those up.

Speaker:

So did your target audience drift a little bit from where you initially started

Speaker:

as you were writing the book or are you roughly where you were at the beginning?

Speaker:

I think we thought a lot about drifting, but in the end I think we ended up,

Speaker:

either out of laziness, or because this was, our philosophy, we did not

Speaker:

change it that much in terms of trying to cater to every single segment of

Speaker:

the population we definitely did make changes to try to accommodate what some

Speaker:

of the reviewers were complaining about.

Speaker:

I tried to make the math a little bit simpler, but I didn't eliminate the math,

Speaker:

so yeah, we definitely did a few things to try to accommodate, some of the critiques.

Speaker:

I definitely see because this really is different to your typical manning book.

Speaker:

There is just more of a completely different domain coming in.

Speaker:

So they must have been a little bit confused at least okay, so let's move a

Speaker:

little bit towards the technical bit then.

Speaker:

And maybe let's talk about some of this maths.

Speaker:

I think one of the things that a lot of software engineers have heard here and

Speaker:

there, but never actually fully understood what it's for and why it's useful, is

Speaker:

things like Monte Carlo simulations.

Speaker:

Can you give us like a quick, you know, again, five year old software

Speaker:

engineer listening to this wondering what should I do with my life?

Speaker:

Should I be an astronaut or should I be a software engineer?

Speaker:

Tell them about Monte Carlo.

Speaker:

Monte Carlo is a hugely useful technique for solving all sorts of problems.

Speaker:

In fact, when I worked as an engineer before I got my PhD in

Speaker:

finance, I actually did Monte Carlo simulations on radar systems.

Speaker:

And then my dissertation was related to Monte Carlo simulations.

Speaker:

that was actually the title, was, had the word Monte Carlo simulation

Speaker:

in the title of the dissertation.

Speaker:

so it's used in many different fields.

Speaker:

and I could get into this a little bit more later, but I think one of our

Speaker:

hopes when we wrote this book is that a lot of the techniques that we use

Speaker:

are just general techniques that could be used in a lot of different realms.

Speaker:

So hopefully, the AI chapter that I have also can be used and

Speaker:

it's not specific to finance.

Speaker:

it's much more general.

Speaker:

so Monte Carlo is very general technique, but it's particularly useful for solving

Speaker:

certain financial planning problems, and I show in the book that, for a

Speaker:

few reasons, you might be tempted to say, all right, stocks have an average

Speaker:

return of, let's say, 10%, bonds maybe have an average return of 4%.

Speaker:

if you take a 50/50 mix of 10 percent stocks, 4 percent bonds, that's,

Speaker:

on average, 7 percent returns.

Speaker:

if I'm trying to do financial planning, can I just assume that, I, on average,

Speaker:

earn 7 percent a year and just skip the whole Monte Carlo simulation part.

Speaker:

But the reasons why You can't really do that is, first of all, you might

Speaker:

want to answer questions like what's the probability of running out of money

Speaker:

in retirement, for example, and it's not just a yes or no, it's actually

Speaker:

a probability distribution of what your final assets are going to be.

Speaker:

Some of them you will run out.

Speaker:

if you don't do a simulation, you won't be able to answer probability questions.

Speaker:

Also, it turns out that the order of returns makes a difference

Speaker:

when you have withdrawals.

Speaker:

So if you have a good year and then a bad year, that might

Speaker:

actually be different than having a bad year and then a good year.

Speaker:

And you actually need to do Monte Carlo simulation to

Speaker:

pick up subtleties like that.

Speaker:

and then, there might be certain complications that you just can't

Speaker:

figure out analytically, like with tax rates and, things like that.

Speaker:

there's no analytic closed form solutions to figure out how much money you're going

Speaker:

to have in a certain amount of time.

Speaker:

it's just too complicated.

Speaker:

you have to resort to Monte Carlo simulations where you simulate, a

Speaker:

whole bunch of random paths, random stock returns, random bond returns.

Speaker:

You could do anything random.

Speaker:

You could have, The inflation rate be, a random variable.

Speaker:

you can even make tax brackets.

Speaker:

you could randomize that and say, there's a certain probability

Speaker:

that tax brackets could change.

Speaker:

So you can incorporate all those things in a Monte Carlo simulation, generate,

Speaker:

10.000 different paths, and then see what happens, at the end of those 10.000 paths.

Speaker:

So what does it actually tell you?

Speaker:

if you design this and generate 10.000 different paths, and then

Speaker:

you look at them in aggregate and this is happening, most of them.

Speaker:

So maybe I should worry about this.

Speaker:

what output information does it give you?

Speaker:

you could get a whole probability distribution.

Speaker:

You can answer questions like, I have.

Speaker:

$2.000.000, what's the probability that I'm going to

Speaker:

run out of money in retirement?

Speaker:

so it could give you, a probability.

Speaker:

you could try different policies and run them through Monte Carlo simulation.

Speaker:

And it could tell you: on average, policy X does better than policy Y.

Speaker:

And outside of finance, what would be some, famous

Speaker:

applications that you can tell us?

Speaker:

as the name implies, gambling is always one.

Speaker:

so Monte Carlo.

Speaker:

but it's used all over, in multiple fields.

Speaker:

When I worked on radar systems, there's a lot of, randomness, involved and

Speaker:

there were no closed form solutions.

Speaker:

the only way to, figure out, how many targets can you track with a certain

Speaker:

radar was through Monte Carlo simulation.

Speaker:

we used it when I worked in weather risk management too.

Speaker:

there were underlying processes say daily temperature and it's daily

Speaker:

temperature at all these thousands of locations across the US and the

Speaker:

quantities that we were interested in were derivations of daily temperature.

Speaker:

They might be like.

Speaker:

the average temperature in Chicago over the winter, but we were also cared

Speaker:

about the number of days where the temperature dropped below zero degrees.

Speaker:

some places in the Midwest where people are farming and

Speaker:

they're worried about frost.

Speaker:

And those things are all related to each other through the temperature values.

Speaker:

but deriving closed form or analytic solutions for those joint

Speaker:

distributions, number of frost days in location X and average temperature

Speaker:

in location Y, is extremely difficult.

Speaker:

and so running lots and lots of simulations is a kind of a brute

Speaker:

force way of doing things that are too hard to do analytically.

Speaker:

I think that makes sense.

Speaker:

And that's probably going to resonate with a lot of people.

Speaker:

too much math.

Speaker:

Let's just simulate some of the things and look at it in the aggregate.

Speaker:

That makes perfect sense.

Speaker:

You mentioned AI.

Speaker:

and I know that your book is talking a little bit about

Speaker:

the reinforcement learning.

Speaker:

Can you give us a sneak peek of what we're going to find in the book on that?

Speaker:

I know this may disappoint people because everyone just wants to talk about AI now.

Speaker:

And that's the only thing people want to talk about.

Speaker:

I was just watching, Berkshire Hathaway's annual meeting, recently,

Speaker:

and people were asking the 93 year old Warren Buffett, who doesn't even

Speaker:

own a computer, what he thinks of AI.

Speaker:

this is the topic that everyone wants to talk about.

Speaker:

And in fact, in the book, it was one chapter and we didn't cover,

Speaker:

generative AI in the book at all.

Speaker:

And it certainly there's uses for generative AI and financial planning.

Speaker:

Like I've seen use cases where, Generative AI can summarize meetings.

Speaker:

so financial advisors love meetings with clients and it can take the

Speaker:

transcript and summarize it for people.

Speaker:

it's interesting.

Speaker:

I actually was listening to a webinar, last week where, they used, a survey,

Speaker:

a financial literacy survey of 38 questions that financial advisors

Speaker:

sometimes give to, their clients just to gage how financially literate they are.

Speaker:

And these authors decided, let me see how ChatGPT does with

Speaker:

these set of 38 questions.

Speaker:

And, ChatGPT has been famous for, acing the bar exam and getting a

Speaker:

four out of five and AP chemistry and doing well in the MCATs.

Speaker:

And it actually only got a 45% correct on this financial literacy, which was

Speaker:

about the same as how, high net worth individuals were doing on the test that

Speaker:

were not financial experts themselves.

Speaker:

we didn't cover generative AI, and I mentioned this earlier, like

Speaker:

for customized non generic advice, whether it's the best tool for that.

Speaker:

there's a lot of uses for generative AI in the, financial planning process

Speaker:

and for financial advisors, but I'm not sure it's great at certain things.

Speaker:

So what I focused on was, another branch of AI, which is, reinforcement learning.

Speaker:

and one of the things I like about the chapter is that first of all, for

Speaker:

anyone who just wants to know about what reinforcement learning is, I

Speaker:

think it's a pretty good introduction to it and a good tutorial, and I give

Speaker:

several examples so you can get your hands dirty with some really easy to

Speaker:

understand examples in the finance world of how reinforcement learning works.

Speaker:

The other thing that I think is interesting about the chapter is that

Speaker:

this type of stuff is not being used at all right now by financial advisors,

Speaker:

to the extent that financial advisors want to, it's a very competitive

Speaker:

area, to the extent they want to, differentiate themselves, I think

Speaker:

it's an interesting area to do that.

Speaker:

I basically go through how reinforcement learning works.

Speaker:

a lot of the chapters start with simple examples and then they

Speaker:

go to more complicated examples.

Speaker:

So I start with a really simple example of suppose that you have a million dollars

Speaker:

And you have a goal that you want to have two million dollars in ten years from now.

Speaker:

What's the best way to allocate assets between stocks and bonds to maximize

Speaker:

the probability of achieving that goal?

Speaker:

So the first thing I did was actually, this type of problem

Speaker:

has been solved for decades in the economics realm using dynamic

Speaker:

programming with backward recursion.

Speaker:

So you would start at the terminal state 10 years from now, and then work

Speaker:

backwards and go through every node.

Speaker:

you create this, state space grid where your state might be what's

Speaker:

your wealth, in any given year.

Speaker:

And what year are we talking about between years zero and 10?

Speaker:

and then you have choice variables, which is how much money do I

Speaker:

allocate between stocks and bonds?

Speaker:

this kind of problem was solved using dynamic programming, and I go

Speaker:

through the actual dynamic programming solution for comparison, and then I

Speaker:

solve it using reinforcement learning.

Speaker:

But then I point out that the nice thing about reinforcement learning

Speaker:

and why it's such a powerful tool is that There's several deficiencies

Speaker:

of using dynamic programming.

Speaker:

one of the biggest ones is the so called curse of dimensionality, that if you

Speaker:

have a lot more state variables and a lot more decision variables, then dynamic

Speaker:

programming would just be impossible to run, it would just take too long.

Speaker:

whereas you can solve those kinds of problems using reinforcement learning.

Speaker:

you may have more state variables instead of just what your wealth is.

Speaker:

You might have state variables of.

Speaker:

What's your taxable wealth, and your wealth in IRAs, you can have your

Speaker:

income as a state variable, you can have whether you've chosen, to start

Speaker:

collecting Social Security yet, so you can have all sorts of different state

Speaker:

variables, and then you're forced to do reinforcement learning if you want

Speaker:

to solve that more complicated problem.

Speaker:

And then in the chapter I go through more and more complicated examples.

Speaker:

And just one example that I, highlight.

Speaker:

one decision that people have to make is when to claim Social Security.

Speaker:

you can tell the government anytime between 62 and 70, when you want to start

Speaker:

getting your Social Security payout.

Speaker:

And the longer you wait, the higher the payout is.

Speaker:

And you can Google this, over a dozen calculators.

Speaker:

In the book I give an example of Schwab's calculator.

Speaker:

And they all pretty much do the exact same thing.

Speaker:

They do this kind of break even analysis.

Speaker:

You could do this analysis in a, two column spreadsheet.

Speaker:

you basically say that, if you're going to live to a ripe old age, and they compute

Speaker:

what that cutoff is, let's say it's 84 years old, then you're better off waiting

Speaker:

till you're 70 to take Social Security.

Speaker:

If you're not in great health and you think you are not going

Speaker:

to live as long, either through genetics or your own health, then

Speaker:

you should try to claim at 62.

Speaker:

And it's a simple calculation, but it's a risk neutral calculation.

Speaker:

It doesn't take risk into account.

Speaker:

It doesn't take longevity risk into account.

Speaker:

So the techniques that I cover in that chapter actually uses utility functions

Speaker:

and takes risk into account and it can be applied to all sorts of problems.

Speaker:

some people have a defined benefit pension plan and when you leave the

Speaker:

company or retire, you're given a choice.

Speaker:

Do you want it in a lump sum or in an annuity where you get

Speaker:

money for the rest of your life?

Speaker:

You could solve a problem like that, which is better using the same

Speaker:

techniques in that in this chapter.

Speaker:

And all of that, all the code is in Python, right?

Speaker:

Yes.

Speaker:

and surprisingly the Python code for this is ridiculously simple.

Speaker:

even like neural networks, the code is not that complicated, sometimes it's

Speaker:

a little more complicated to model the environment, but the actual reinforcement

Speaker:

learning code is just a handful of lines.

Speaker:

And there's a few helper functions that are also just a handful of lines.

Speaker:

So I think it's actually fairly accessible to people to actually do this in Python.

Speaker:

what's your take on why Python seems to have completely dominated

Speaker:

anything to do with finance or stats or anything like that, it seems to

Speaker:

be just obvious choice Python you touched on it when you just threw one

Speaker:

line to explain why you chose Python and you got grief from the reviewers.

Speaker:

but why do you think is that?

Speaker:

it's very easy to get started with.

Speaker:

the Hello World program is literally just one line, print Hello World.

Speaker:

It's popular and lots of very useful packages have been written for it.

Speaker:

So for example, in the book, we use a convex optimization package called CVXPy.

Speaker:

We use NumPy and SciPy, which are used by so many people.

Speaker:

So there's lots of support, lots of very useful, well supported packages.

Speaker:

it's not the most high performance language in the world, but it

Speaker:

can also be made pretty fast.

Speaker:

if you care about that, if you're careful with things and use some,

Speaker:

again, some packages that have been written to speed things up one other

Speaker:

nice thing about Python is that it plays pretty well with other languages.

Speaker:

I've also used R a lot throughout my career, and there's a lot of

Speaker:

useful packages for R as well.

Speaker:

but using R like within a system with other programming languages

Speaker:

is a lot harder than with Python.

Speaker:

Okay, so I buy some of that, but to go back to what you just said, print hello

Speaker:

world is one line, so is in Fortran.

Speaker:

You have to add program and end program, but you could argue the

Speaker:

same thing, and making Python fast is typically not using Python under the

Speaker:

hood, just using a C++ library that was implemented in something else.

Speaker:

So is it really just that it looks more approachable and

Speaker:

that's why everybody runs with it?

Speaker:

Because I have this theory that it's really all about brackets You

Speaker:

don't use curly brackets and that's what people typically don't see.

Speaker:

And you use white space.

Speaker:

So it just looks easier.

Speaker:

But when you look into that, is it that much easier to

Speaker:

handle programming languages?

Speaker:

We use pandas a lot in the book, and there's a lot of things that

Speaker:

are made easier when you use pandas.

Speaker:

it just seems like a lot of the tasks are just much easier done

Speaker:

I know the ecosystem is fantastic, but I suspect that the ecosystem is fantastic

Speaker:

because, it got popular and because everybody just started using that.

Speaker:

So I always wonder, is it just because of the curly brackets, but Anyway,

Speaker:

so going back to your book, I was also going to ask you why measuring

Speaker:

returns is so difficult to begin with.

Speaker:

Because like you said all those things and I never really truly understood It's

Speaker:

typically just some percentages, right?

Speaker:

That you estimate it doesn't sound that difficult, but then the moment

Speaker:

you open a chapter about that, it's all like variances, covariances and

Speaker:

all kinds of things that either a simple programmer like myself is

Speaker:

getting a little bit intimidated by.

Speaker:

So to a five year old software engineer, can you just tell us briefly

Speaker:

why it's not as simple as it looks?

Speaker:

Yeah, so it's actually a rather complicated thing, surprisingly.

Speaker:

And I have, one full chapter on it, and I cover some other issues in

Speaker:

another chapter, but just returns.

Speaker:

so first of all, One complication with measuring returns in any kind

Speaker:

of brokerage account, let's say you have inflows and outflows.

Speaker:

Maybe you deposit money, maybe you withdraw money, maybe you have dividends.

Speaker:

if you didn't have inflows and outflows, it would be much

Speaker:

simpler to compute returns.

Speaker:

You could just look at the final value of your assets, the beginning value,

Speaker:

and that's all you need to know.

Speaker:

but it turns out that, with inflows and outflows, there's

Speaker:

two methods to computing returns.

Speaker:

There's, time weighted returns and money or dollar weighted returns.

Speaker:

So imagine as a simple example that you, started out with some amount

Speaker:

of money, let's say a million dollars and had great returns.

Speaker:

you earn 20 percent that year.

Speaker:

And then let's say you add it to your account.

Speaker:

Let's say you deposited another million dollars and then you have a bad year.

Speaker:

Maybe you were down...

Speaker:

15% what would you say your return is?

Speaker:

on one hand you had a 20 percent return and then a 15 percent return.

Speaker:

So your returns seem to be positive.

Speaker:

On the other hand, your ending value is lower than your starting value.

Speaker:

It could be, than the amount of money you put in because when

Speaker:

you had the bad returns, it was on a larger amount of money.

Speaker:

So that basically is the difference between, In the first case,

Speaker:

it's time weighted returns.

Speaker:

In the second case, it's dollar weighted returns.

Speaker:

people might not notice this, but when you look at your Vanguard statement,

Speaker:

it will tell you your returns, and there's, a little footnote.

Speaker:

And if you go into the footnote, it will say, in Vanguard's case,

Speaker:

they use Dollar weighted returns.

Speaker:

In other cases, they use time weighted returns.

Speaker:

and people probably don't even look at the footnotes.

Speaker:

You don't even understand what it is, but it actually makes a difference.

Speaker:

The second issue is if you're evaluating investments, and that's a huge thing

Speaker:

in my other sort of career of hedge fund strategies, that's a huge issue.

Speaker:

But even if you're looking at robo advisors and some robo

Speaker:

advisors says, we perform better.

Speaker:

you have to evaluate performance and you can't simply look at returns.

Speaker:

You have to look at risk adjusted returns.

Speaker:

it may be the case that, one advisor has, on average, 10 percent

Speaker:

returns, but wildly volatile.

Speaker:

And another advisor maybe only has 6 percent returns, but they're basically

Speaker:

like a bond, and bonds are only paying 5%.

Speaker:

So they're outperforming bonds with actually no extra risk.

Speaker:

So you have to factor risk into account when you're evaluating returns.

Speaker:

And there's several methods for doing that.

Speaker:

in a chapter, I cover, sharp ratio, which is one of the more common measures of

Speaker:

risk adjusted returns, and alpha, which is, made it to the popular press as well.

Speaker:

And alpha is also another way of evaluating risk adjusted returns.

Speaker:

In fact, when Google announced that they changed their name from Google to

Speaker:

Alphabet, in their press release, they said, part of the reason is because

Speaker:

we're trying to catalog the entire, alphabet of the world, but also we think

Speaker:

of, of our company taking Alpha bets.

Speaker:

so that's another reason why they call their company Alphabet.

Speaker:

So all the chasing alpha that all comes from that theory.

Speaker:

yes.

Speaker:

And I give an example in the book where I actually apply this principle.

Speaker:

one very popular, area of investing now is ESG investing,

Speaker:

environmental, social, and governance.

Speaker:

So people who feel like they want to not just invest in the S&P 500, but they

Speaker:

want to invest in companies that do good, either in terms of the environment, in

Speaker:

terms of how they pay their workers, etc.

Speaker:

And there's several funds that cater to those investors.

Speaker:

So I actually go through a case study of trying to evaluate the returns of an

Speaker:

ESG fund that's been around for a while.

Speaker:

One good way to intimidate your reader is to name a chapter after a model or a

Speaker:

theorem that has two names, hyphenated.

Speaker:

In your case, it's the Black-Litterman model.

Speaker:

a challenge for you to explain that in 30 seconds or less,

Speaker:

Okay.

Speaker:

and then send people to the actual chapter.

Speaker:

So the goal of the Black-Litterman model was to accomplish two things.

Speaker:

One is to overcome the sensitivity that's inherent to portfolio optimization.

Speaker:

if you're using portfolio optimization and you tweak the inputs just

Speaker:

slightly, you can end up with two completely different portfolios.

Speaker:

And the other goal was to be able to allow.

Speaker:

Investors to specify their views about how they think certain assets will perform,

Speaker:

either in an absolute sense or relative to one another, the model supports both.

Speaker:

the way the model works is by starting with kind of a reference portfolio

Speaker:

from which the investors derive equilibrium returns, and then they

Speaker:

add in and blend in their views about returns to those equilibrium returns.

Speaker:

The equilibrium returns keep the investors optimized portfolio anchored

Speaker:

to the reference portfolio, but then the views, the second part of the

Speaker:

model, allowing the investor to specify, their views on the, future returns

Speaker:

of the assets that they're investing in, allow them, some deviation from

Speaker:

just The standard reference portfolio,

Speaker:

Okay, I'm not gonna lie, you did lose me a little bit there.

Speaker:

Is there a way to explain it in even simpler terms?

Speaker:

let's see a way to allow investors to build portfolios that incorporate

Speaker:

their views about the expected returns of the assets they're

Speaker:

investing in while combating some of the Input sensitivity that's just

Speaker:

inherent to portfolio optimization.

Speaker:

Got it.

Speaker:

Another thing I was gonna ask you about is, tax loss harvesting, because it makes

Speaker:

sense to me, it sounds fruit harvesting, and that's a good thing, but at the

Speaker:

same time, why would you harvest loss?

Speaker:

Why is it a good idea?

Speaker:

What does it give you?

Speaker:

So the phrase that you always hear in finances is buy low, sell high.

Speaker:

And that's typically what you want to do, but with tax loss

Speaker:

harvesting, what you're actually doing is selling low intentionally.

Speaker:

but that can actually be a good thing.

Speaker:

I think maybe the best way to explain it is through an example.

Speaker:

Oh, you mentioned the S&P 500 before that's, an index of large cap US stocks.

Speaker:

And there's another index out there called the Russell 1000.

Speaker:

it's 1000, stocks instead of 500, but those two things are

Speaker:

super, super highly correlated.

Speaker:

If the S&P is down 2 percent one day, you can bet that the Russell 1000

Speaker:

is going to be down also, around 2%.

Speaker:

So the idea of tax loss harvesting is opportunistically selling assets at

Speaker:

a loss to reduce your current taxes.

Speaker:

And the way that most robo advisors do it is by using pairs of funds or

Speaker:

pairs of ETFs that follow different indices, but indices that are very

Speaker:

highly correlated so that when you sell one and buy the other, your economic

Speaker:

exposure really doesn't change very much.

Speaker:

So going back to our example, if you bought S&P 500 at a hundred dollars,

Speaker:

and then a few months later, it was down to 90, you sell $90 of that

Speaker:

fund, you've realized $10 in losses.

Speaker:

Then you buy $90 worth of their Russell 1000 fund.

Speaker:

Your economic exposure is basically unchanged.

Speaker:

You're still invested in $90 worth of, US large cap stocks.

Speaker:

Oh, but you've realized $10 in losses.

Speaker:

So you can multiply that by your tax rate that applies to that loss, which

Speaker:

might be like 40 percent because it's a short term loss, that means that if

Speaker:

you have capital gains elsewhere in your portfolio, you can use those losses to

Speaker:

offset those gains and then decrease your tax bill in the current year.

Speaker:

So you save money on your current taxes.

Speaker:

And that's the very short, simple goal of tax loss harvesting.

Speaker:

and that sounds like a, a free lunch, but it actually isn't because, if

Speaker:

you fast forward 10 years, what happens, let's say the price of

Speaker:

., either of those index funds has gone up to $200.

Speaker:

If you had just stuck with your original investment, you would have had a gain

Speaker:

of $100 right over that, that 10 years, because you've harvested the loss.

Speaker:

You bought the second ETF for $90.

Speaker:

So now 10 years later, you have a gain of $110 instead.

Speaker:

So you've decreased your current

Speaker:

taxes, but that comes at the cost of increasing your

Speaker:

taxes way off in the future.

Speaker:

but that's still a good thing because the other phrase that you

Speaker:

hear in finances, A dollar today is worth, more than a dollar tomorrow.

Speaker:

It's just kinda the opposite with taxes.

Speaker:

Paying $110 in taxes 10 years in the future it's worth paying the extra

Speaker:

taxes 10 years later to save money on taxes now because you can reinvest

Speaker:

that money now and then in the future, you'll have more money than you would

Speaker:

have if you had not done the tax loss harvesting followed by the reinvestment.

Speaker:

Creating kind of almost artificial loss that, lets you defer some of the

Speaker:

taxes that you, we would have to pay otherwise, and you can invest them in

Speaker:

the meantime and, be more efficient.

Speaker:

That sounds pretty creative.

Speaker:

and that's another thing that you can learn from the book.

Speaker:

The book is called "build a robo advisor with Python.

Speaker:

From scratch" and it's available at manning.com a quick question.

Speaker:

I've been wondering about it for probably at least last 45 minutes.

Speaker:

Is it true that like that tech people, I'm going to just bundle everybody,

Speaker:

software engineers, all the programmers.

Speaker:

There's definitely this trend where this people like optimizing things

Speaker:

in their lives, whether it's diet, maybe working out and stuff like that.

Speaker:

But from where you sit, are they any better at optimizing their savings and

Speaker:

their personal finance than the average Joe who doesn't happen to be a programmer?

Speaker:

to optimize this stuff is very hard to do on your own, which is why it's good

Speaker:

to have, this done in an automated way.

Speaker:

We didn't cover this, but in the first chapter of the book, we talk

Speaker:

about how, individual investors suffer from various behavioral biases.

Speaker:

and I think tech investors probably suffer from the same

Speaker:

behavioral biases as any investors.

Speaker:

And some of those examples, and there's been studies on this.

Speaker:

First of all, Individual investors tend to overtrade.

Speaker:

it's generally not a great idea to trade too much.

Speaker:

You pay taxes, you pay transaction costs.

Speaker:

Even if there's no commissions, there's bid ask spreads and things like that.

Speaker:

so overtrading is typically a bad thing and individual investors

Speaker:

typically do too much of it.

Speaker:

there's also another, behavioral bias that individual investors

Speaker:

suffer from is herding.

Speaker:

So it's typical that when things keep going up and up, people want

Speaker:

to buy it and when things go down, people panic and want to sell.

Speaker:

And that's not necessarily, empirically the best strategy to follow.

Speaker:

So again, a robo advisor can, eliminate some of these behavioral biases.

Speaker:

if some things.

Speaker:

gone down, they might buy a little bit of it.

Speaker:

They're not going to sell it as a panic sell, and they might actually buy a little

Speaker:

bit, to rebalance, which empirically works out, better than, this herding mentality.

Speaker:

and there's other behavioral biases, individual investors, and again, I don't

Speaker:

think tech investors are any different.

Speaker:

They don't like to, realize losses.

Speaker:

if they've had a stock that's gone down, they, it's like admitting

Speaker:

defeat by selling it at a loss.

Speaker:

They just don't like doing it.

Speaker:

There's a lot of studies on this.

Speaker:

and, but for Robo Advisor, they actually say, Oh, we actually

Speaker:

do want to sell it at a loss.

Speaker:

We're going to buy something back similar.

Speaker:

but we don't have any problem realizing this loss.

Speaker:

so I think that I'm not sure that tech investors are any better

Speaker:

doing this than anyone else.

Speaker:

And we know that general investors are not very good at this.

Speaker:

I think tech people might be more willing to embrace tools that

Speaker:

help them avoid those sorts of biases than other people might.

Speaker:

So there might be overly represented in the client base of

Speaker:

robo advisors at the very least.

Speaker:

that's what we see.

Speaker:

All right, great.

Speaker:

where do you see all of this going?

Speaker:

So to me, it sounds like there are certain things that can be automated and you

Speaker:

can be more efficient with your taxes.

Speaker:

You can harvest some of those losses.

Speaker:

You can do all kinds of things to, to optimize the way, the timing and

Speaker:

the things that we just discussed.

Speaker:

what's the next step for robo advisors?

Speaker:

Is that the final destination?

Speaker:

Is that what they're going to stay, doing or is there like the next step

Speaker:

where they can provide even more value for like the next generation of it?

Speaker:

I have one small comment and then I'll let Alex do the rest.

Speaker:

so when I had a brief, stint at a robo advisor, we would do these focus

Speaker:

groups where we would, have people come in, we pay them a hundred dollars

Speaker:

for a few hours and we would show them our website and have them comment.

Speaker:

And it was fascinating for me to actually hear what like individual

Speaker:

investors, what they care about.

Speaker:

And a lot of them actually care about.

Speaker:

beating the market.

Speaker:

And we would try to say no, that's not our thing,

Speaker:

Rightly or wrongly, I think that's what people want.

Speaker:

they already go maybe into what's called smart beta ETFs.

Speaker:

These are ETFs that, claim that they, based on historical anomalies,

Speaker:

try to outperform the market.

Speaker:

So I think that could be an area.

Speaker:

I think, besides just investments, perhaps expansion into more financial

Speaker:

products that can benefit from technology, either to lower the cost or the

Speaker:

efficiency or the headache for people.

Speaker:

would be one way that I could see robo advisors expanding.

Speaker:

probably another thing to consider that we've touched on during this

Speaker:

call is that there's some things that robo advisors just will never do.

Speaker:

There are certain situations that really need hands on, advice, like

Speaker:

a state planning, things like that, where it's very specific to the person.

Speaker:

It can be lots of rules, regulations, very specific in

Speaker:

that you're hard for a program.

Speaker:

To consider all of the possible variations and, specific situations of people.

Speaker:

so I think there's always going to be a place for human, very

Speaker:

hands-on, tailored advice.

Speaker:

but, hopefully robo advisors gain a wider share in what can

Speaker:

be automated, a lot more easily.

Speaker:

So would you say that In, the famous 80/20 rule, you get 80 percent of the

Speaker:

benefits that you can get from, just being a bit more aware of what you do with your

Speaker:

money with 20 percent of effort or is it maybe even better in 90/10, just by

Speaker:

using something like that to begin with.

Speaker:

Yeah, I don't know about the exact split, but I'd say that

Speaker:

rule definitely applies, right?

Speaker:

Most of my life I'm going to be saving and investing, and then there's

Speaker:

only going to be one point in my life where I have to, plan for what

Speaker:

happens after I die, for example.

Speaker:

No robo advisor can help me with the whole thing up until the

Speaker:

point where I have to decide

Speaker:

Rob, a question to you, probably more given, you're educating people in finance.

Speaker:

Would you say that the trend of people getting more aware of what happens to

Speaker:

their money and being, more financially savvy, and invest in different

Speaker:

things is the financial literacy.

Speaker:

I guess it's the word really to use here, getting more widespread or

Speaker:

is it still staying something that the biggest chunk of the population

Speaker:

will probably never bother with.

Speaker:

I've been teaching at NYU for, 16 years or so, and I've definitely

Speaker:

noticed differences over the years I don't know if I could speak to like

Speaker:

whether the general population is getting more financially savvy or not.

Speaker:

my guess would be no, but there's definitely been changes in what students

Speaker:

bring to the table over the years.

Speaker:

When I started out in finance, it was really hard to like,

Speaker:

know the institutional details of how markets worked.

Speaker:

It was like almost there were like a few people that kind of understood how like

Speaker:

the specialist system in the New York Stock Exchange worked and, the professors

Speaker:

that knew that you would look up to them, like, how did they figure all this out,

Speaker:

like how they know both the academics and like the institutional knowledge.

Speaker:

And now I think the institutional knowledge is just much more

Speaker:

widely known, through, the internet and things like that.

Speaker:

So is the right word to say commoditizing that kind of knowledge, or is it

Speaker:

just the internet doing its thing?

Speaker:

People talk and secrets spread out,

Speaker:

that's also true.

Speaker:

when I started, it was much harder to even know, like what some hedge funds do now

Speaker:

there's still a lot of secrecy in hedge funds, like nobody knows how Jim Simons,

Speaker:

earns 66 percent returns every year, like he doesn't go out and, tell people like

Speaker:

exactly the secret sauce of what he does, but I think there's a lot more knowledge

Speaker:

about what hedge funds do and how they make money, for a variety of reasons.

Speaker:

yeah, there was, something called the quant crash in 2007 and

Speaker:

all the hedge funds got killed, over this three day period.

Speaker:

And then people reverse engineered it and figured out, Oh, all these hedge funds

Speaker:

are doing the, very similar strategies.

Speaker:

I think thas che other thing with in the hedge fund world is

Speaker:

it's getting much harder to find, great opportunities to make money.

Speaker:

I guess this is always the case.

Speaker:

Like when I started out, in the hedge fund world, I traded many different

Speaker:

strategies, but one strategy I traded was an index rebalancing strategy.

Speaker:

So all the indices like the S&P 500 would periodically rebalance and

Speaker:

you could predict what the S&P 500 would have to do, in one week's time.

Speaker:

And there's a whole cottage industry of hedge funds that would try to They'd say,

Speaker:

Oh, the hedge funds need to buy the stock.

Speaker:

We're going to buy this in advance of them.

Speaker:

that was like some knowledge that a lot of people know

Speaker:

about now it's just widespread.

Speaker:

they talk about it on CNBC, it's everywhere.

Speaker:

So a lot of these types of things just become much more well known.

Speaker:

got it.

Speaker:

Your book.

Speaker:

I see that the publication is estimated for June, 2024.

Speaker:

So I'm guessing it's all finished.

Speaker:

You're doing the final touches.

Speaker:

Do you know when it's supposed to hit Amazon?

Speaker:

I think the end of June, 24th or 25th is the date.

Speaker:

we had the copy editor go through the whole book, which she did a

Speaker:

very good job, and now we have the typesetter going through the book.

Speaker:

awesome.

Speaker:

So sometime in July if you're on LinkedIn, you're going to see plenty

Speaker:

of selfies with the book I was like, oh, it's real Looks like this

Speaker:

Congratulations.

Speaker:

So

Speaker:

to write good reviews on it and do all that stuff.

Speaker:

Yeah.

Speaker:

you can have a lot of explaining of how to write a review on Amazon.

Speaker:

So I'm hoping you ready for that

Speaker:

What's next after that?

Speaker:

Do you have an eye for the next adventure?

Speaker:

Are you teaming up for another book?

Speaker:

Or taking a breather?

Speaker:

I would consider another book.

Speaker:

I haven't figured out the topic yet.

Speaker:

It's like that Steven Wright joke.

Speaker:

It's an old joke, but I've written the page numbers now.

Speaker:

I just have to fill in the rest.

Speaker:

but I'm also, I got the domain name pynancial.com and I hope

Speaker:

to do some kind of blog where I periodically post, Interesting.

Speaker:

articles on the intersection of finance and Python.

Speaker:

I'm excited about, posting to there, too.

Speaker:

Pynantial.

Speaker:

Yeah, I like financial, but PYNANCIAL.

Speaker:

PYNANCE was PYNANCIAL was the next best thing.

Speaker:

we'll be on the lookout for that.

Speaker:

What about you, Alex?

Speaker:

let's see, this book was way more work than I thought it was going to be.

Speaker:

maybe I'll do another one, but it'll probably be a while.

Speaker:

one thing I am interested in though, is, teaching along the

Speaker:

lines of what Rob is doing.

Speaker:

So that might be my next adventure.

Speaker:

Yeah, I had the same thing.

Speaker:

So I was writing my first book with manning over the pandemic period.

Speaker:

And, I would just wake up at five and I have a few hours before I

Speaker:

started working and working from home.

Speaker:

So I basically use my commute time to write the bulk of it, really.

Speaker:

And then, one day it was finished, and I didn't have to wake up at 5,

Speaker:

and I felt a little weird about it.

Speaker:

And I'm missing that, so I'm guessing that's gonna kick in

Speaker:

soon enough for the two of you.

Speaker:

We'll see when it kicks in.

Speaker:

All right, guys.

Speaker:

It's been an absolute pleasure to talk to you.

Speaker:

I think, you've achieved in educating, at least at the very minimum, myself

Speaker:

about a lot of these things and hopefully some of our listeners as well.

Speaker:

once again, the book's available at manning.com at the moment, it's still

Speaker:

in the early access, program, but all the chapters are available right now.

Speaker:

You can go and have a browse.

Speaker:

And, from what it sounds like in a couple of months, you too will be able

Speaker:

to take a selfie with it and go on LinkedIn and look absolutely fabulous.

Speaker:

Build a robo advisor with Python from scratch.

Speaker:

Thank you guys.

Next Episode All Episodes Previous Episode
Show artwork for HockeyStick Show

About the Podcast

HockeyStick Show
Breakthroughs in tech, business and performance
Explore the moments leading to exponential growth in technology, business, science and more.

About your host

Profile picture for Miko Pawlikowski

Miko Pawlikowski