Saturday, December 11, 2021

Bias (written March 2011, published Dec 2021)

Bias is bad
In the scientific literature, bias seems like something to overcome. See cognitive bias. It is a systematic distortion where we want no distortion. An example: why should women or minorities have to overcome a systematic distortion in the job market? In this case, the biases are collectively known as prejudice and for the interviewer may include framing bias, self-serving bias, belief bias... among others. Where we can, we'd certainly like to make life fair.
Or is bias bad? Optimism > Pessimism
  • "You miss 100% of the shots you don't take"
  • "Keep your heart open"
  • "A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty"
  • "Continue being you because someone out there will love you for you"
We sort of know that every interview isn't going to get us an offer, but we go them anyway. As long as you are going to take your expected value and add a bias to it, it would seem that optimism is better. eg: (Philosophy (western), and Philosophy (eastern), and SelfHelp, and Sciencey-Health). It seems a little silly to calculate an expectation and then purposefully fudge the numbers. The main power of optimism is that it gives you strength (motivation) and the main weakness of pessimism is depression, the state where you do nothing. So we learn to appreciate failure because that means we are trying, executing, learning and above all, living.

And yet: Not every failure is okay. Pessimism > Optimism
  • It's not every day that your child will drown in the swimming pool. (Safe link)
  • You don't expect to die from your next cigarette.
  • What's the chance your sexual partner has aids?
  • Driving drunk doesn't cause an accident a majority of the time
There are two types of risks -- ones that add up (cigarettes) and ones that don't need to (Russian roulette). But in both cases, it is just a matter of time.
It's not expectation, it's expected value
Is one mindset is right over the other? They are used for different things, so next time you are an optimist during planning or a pessimist during action just have a good reason to deviate from the obvious benefit of natural fit (perhaps older people won't try anything unless you are optimistic). You can be more than a happy-go-lucky-idiot or party-pooping negative-nancy. Just one man's opinion here, but you could plan when you are supposed to plan and act when you are supposed to act. 

Monday, May 17, 2010

Off Season

Hi there,

Perhaps you are looking to get into trading. If you are seeing this around the time I wrote it, then you have missed the regular hiring season. The good news is that trading companies hire year round and the smaller ones (which is what you want) hire when they need people, not just when schools have companies visit normally.

For the summer months, I would like to help you get your next trading job. I will help one person from each school based on some sort of random / first arrival / I feel like it basis. I really want people who will work hard and normally do not ask for help (but will hopefully learn that they should).

What do I get? If I help you get a job, you will mail me a sweatshirt with your school's logo on it size M/L and I will be rich. Just email me at igor (dot) schmertlzer (at) gmail with a semi compelling case and we'll get started.

Thanks for reading, Igor

Monday, November 23, 2009

Tense Language

My belief is that we are born humans and made traders. We have some traits that work well in everyday life, but maybe don't carry over well to trading in a team. My intent here is to uncover words that imply. These are unfit for financial markets, namely words with momentum / inertia. There are many reasons why practitioners still speak with such implications in their language:
  • Simple It's just like we talk in everyday life (Dow is going up = I am riding a bike)
  • Powerful It helps you sell things (Gold is going up)
  • Optionality You can argue that you meant something else (Yeah, gold went up)
Discrete Time
In everyday life, there is a bit of inertia to our actions. For example, if I choose to ride a bike I must stop the bike and get off before I can be not riding a bike. My bike is moving so my statement maintains its accuracy for a while. Similarly when I am cooking, my oven stays hot. If I tell you I am cooking, you can predict that in the next second, I'll still be cooking.

Continuous Time
With stocks and prices, this ability to predict does not follow so easily. I cannot make a factual statement that the DOW is going up or that gold price is rising. Instead, I have to be satisfied communicating merely that either went up or hit some price. If I say gold is going up, my words are actually making a prediction about the future price vs the last traded price (or the last quote).

If you make this mistake and you are new to trading, consider the upside of finer speech. Some products really do go on runs. You and your colleagues will know which ones if you save your words. You will also find yourself chasing missed opportunities less. And...

Hammertime
What can happen if we are not careful with our words? My friends at other trading firms provide great examples: say you hear something akin to "The dollar is going up," while (but really after) the dollar has a couple of upticks. Lets also say a guy named Micke Dafehr manages you. If you didn't buy the dollar and the dollar goes up, MD will say he told you it's going up. If you bought the dollar and it proceeds to go down, MD asks you later why your PL is so low downplaying this part and emphasizing your other trades. His "option" is worse than zero-sum for the team. Here is how:

Dollar up Dollar unch Dollar down
You buy I told you so Transaction cost Your PL is lower
You don't buy WHY NOT?! 0 pts You can agitate MD or not
You sell You're fired LISTEN MORE! Manager takes credit

Faced with such a prospect, you will prefer to act only on his decisions and not your own. You might feel less ownership, learn less, and have less motivation. The team becomes just one 'manager' and a scapegoat for if something goes wrong. These mismanagements are only seen from below which makes them difficult to weed out of organizations. Who cares if someone junior to them has a probabilistic chance of raising their voice? The manager is protected because the grievance is small and widespread among others. He / she can just say 'communication is important' a couple of times and then get the unruly scapegoat fired and move on to the next one.

A word to the wise: be sure that your company speaks openly and clearly about issues. Transparency (albeit under a fair system) favors the honest. It is very important to promote only the most honest behavior! My manager does and I hope yours does too!


PS: I haven't posted in about year so let me know if I let you down with this post or you don't mind seeing more like this one.

Monday, September 22, 2008

The devil's advocate

I was recently called the devil [read: open-minded] for considering the merits of lust. I was called naïve [read: disciplined] for believing I should invest now for a promise tomorrow. So, let's examine the merits of lust and naïvety.

What do I do now?
One way to decide on an action is to ask whether you in the future will approve or even applaud the decision.

Objective Function: Max E [x] ; Evaluation: Your future self

Some decisions can really change the way your future self thinks. For example, a drug will change the way you perceive drugs. Becoming religious might change the way you see religion. So barring those reflexive decisions, the future-self-metric yields some consistently desirable results. After all, you are always looking back to decide if you acted correctly. So, yay! right? Well, not exactly. You can't always analyze if you are trying to act and there may be some good opportunities in the 'heat of the moment.'

Lust
One way is to think only in the present. Why? You could choose not to trust tomorrow because the future is uncertain, because analyzing takes too much time, or because ‘that cheesecake looks sooo good.’ This blog post is devoted to the greedy algorithm, hungry people, and in general to the beautiful irresponsibility of brain myopia.

Greedy Algorithm – (minus) Algorithm ≠ Greed
Greedy algorithm is an algorithm that isn't really greedy. An algorithm is a step-by-step process to find a solution. Greed, in the popular lexicon, is the excessive self-interest that tramples other people’s needs. A greedy algorithm, however, is one that ‘gobbles up its favorites first.’ Another way to say the same thing would be, a greedy algorithm is a step by step process that looks at only the payoff from the next step. After all, there might not be a better way to get up the stairs than one at a time. Greedy algorithms seek to maximize instantaneous momentum rather than consider the position it is in once that step is taken. Think about it: position depends on the choices at the next step and those choices depend on the position thereafter, and so on. Greed is a lot less complicated. Greedy algorithms don’t go to college; they don't invest. But don’t feel bad learning all the good things about greedy algorithms. After all, the greedy algorithm is just myopically self-interested, not greedy. This is similar to elitism in that elitism seeks out those who are likely to know (considered experts). Elitism may not reach all the right people, but it might yield a relatively good conversation quickly. That might even be why you subscribe to this blog. : ) <- a lusty smile

Speed
[Get to the trading already!] Most trading opportunities happen fast and last a short time. In finance, we are taught that it is the present value of all cash flows out to time t-approaches-infinity that should determine which step has the highest value. Two questions arise from this approach:

1) How can you be sure that your opportunity will last until tomorrow? Though tomorrow, not today, may be when you have determined this next step is optimally taken, you may not be able to count on tomorrow. In finance and in competition, often you have to be faster than tomorrow. Greedy algorithms may not have gone to college, but they know that you better get yours while the getting is good. That is, short-sightedly, they don’t consider that Lehman Brothers has been around 158 years.

2) How can you be sure that spending time making decisions is going to be worth effort? Though a better solution may exist, it may be too costly to find that solution. Said again, the cost of analysis may be higher than the marginal return on the choice between methods.

Getting to the good stuff, what are greedy algorithms good at?
1) Speed sensitive problems like competitive markets
2) Promoting natural talent. Rather than cultivate a new skill, you could just focus on what you do well.
3) Acting predictably – coming up with solutions easily verified
4) Not assuming anything about position [tomorrow’s opportunities]

Here are some examples of problems to which greedy algorithms may yield the best solution:
1. ‘Egyptian Fractions’
Each fraction can be expressed as a sum of different fractions with unit numerators. Fibonacci proved that this greedy algorithm is guaranteed to halt.

2. ‘Voting Districts’
Given an integer number N, and a map in which each region is assigned an integer number (= population size), the problem asks to create N district with minimal deviation of population. The regions in each district must be connected.

A greedy algorithm can start by choosing the N biggest regions as cores of the different districts. Then, in each iteration, the largest unassigned region, among those that are adjacent to assigned regions, is assigned to the district with the smallest population.

3. ‘0/1 Knapsack’

Some good news about Optiver Recruiting
Last week, I was at the recruiting booth at MIT. One question that came up was how many people we are willing to take to trade. In a no bullshit sense, we have no cap. Taking on every opportunity with a positive NPV maximizes firm value. You can apply at optiver

Blog Posting
How can I share with you if you do not share with me? You can request blog topics (and even recruitment advice) at igor (dot) schmertzler@gmail.com

Friday, August 29, 2008

Advice for two

Since

spoken word is not received thought,

so, meant-ideas are error fraught.

Lonely people speak,

to end at the beginning:

eerily

…because one time,

in just three minutes, two people

had one mind…

Have you heard

the new morality:

save the words!

for sake of clarity

Sunday, May 11, 2008

By Varun

Since quite a few individuals have asked me questions on programming (and related sub-topics), I thought it would be a good idea to write a small primer on the subject, namely:
  1. Why Do I Need Programming? (skippable, if you know why)
  2. What Are My Goals?
  3. Which Language Do I Choose?
  4. How Do I Go About Learning?
  5. Final Thoughts

Why Do I Need Programming?

QuantFS prides itself on the quality of its members, and no doubt that every one of us knows our "theory", be it Econ, Finance, Math, or CompSci; however, if someone told you to implement it, where would you start? Well, maybe that's not fair...If you wanted to implement a regression model on CPI, M3, and Unemployment, that can easily be done in Excel, right? Well, what if you wanted a running regression on prices? Are you really going to sit there and re-run it all the time? No (aside from the point, that no one would pay you to click 'update').

So where does this lead? Programming is the glue to all the theory we learn as aspiring quants. Want to go into pure theory without programming? You'd better be that 4.1 Math/Physics kid from Harvard, otherwise learn some skills. Is programming a cop-out to pure theory? No, on the contrary, it only strengthens certain theories we learn about (CAPM, Optimization, all CompSci theory, etc...). Why should you program if it can be outsourced? The answer to this one lies in the next section.

What Are My Goals?

  • If you want to develop software and sell it
    You should be majoring in Computer Science or Mathematics. Why? For intensive software deployment, it is often necessary to understand how programming works with the computer and how to optimize slow code, not to mention an upper hand of theory and experience from your courses. However, if you have a theoretical idea and want to outsource the programming, then you are an entrepreneur. It really is important to establish your goals within this segment due to the varied paths it leads to down the road...
  • If you want to use programming as a tool in research
    This is what QuantFS is prepping our members for. Scripting is the key here. If you have a large file of stock data and want to run statistics on it in real-time (as we did in one workshop), or you have a bunch of variances/expected returns and want to find the optimal risky portfolio or the global minimum variance portfolio using CAPM (as we did in another workshop), then you need to learn how to script. So, what does this entail? The ideal candidate is learning a technical major with good non-technical background. Scripting revolves around clever ways to minimize running-time and increase accuracy. Courses include: Discrete Math, Algorithms, Probability, Statistics, Regression, Time Series Analysis. The key in scripting is, "you can't be too clever here." Clever workarounds are awesome.

Which Language Do I Choose?

  • If you want to develop software and sell it
    Since programming power is the necessity here, recommended languages for deployment include (but are not limited to) C++/C#/C/Java for standard applications. If you want to network among computers, use .NET framework. If you want to deploy webside stuff think Perl, PHP, Python, Ruby (and MySQL or some variant for databases). If you want some handle on setting up servers to run tasks, think UNIX. Like I said before, this path has a lot of options...
  • If you want to use programming as a tool in research
    I would almost require (4) language TYPES. "Types"? WTF? Yes, I like to think of scripting in four distinct groups: Text, Presentation, Power, and Data. Let's go over a few commonly used languages and see their strengths...
    VBA (Visual Basic for Applications) - Specifically for Microsoft Excel, VBA is great as a presentation language. Why? Most clients want summaries of your research or performance and they love to see stuff in Excel. If you've worked a day in your life in Finance, you'll know that Finance = Excel. Is this the best thing to learn first? No, because it teaches bad programming habits; however, it is ridiculously easy to learn and use and the deployment time for written code is fast.
    Perl - This powerful language is the best text category language. Want to turn a CSV into a TDV (tab delimited)? Want to take a bunch of prices and stocks and sort them by date/ticker? Want to combine 30, 40-meg files and get the common items from all of them into a separate text file? Perl is your choice, hands down. The exact nature of this language (Larry Wall, the creator, is a linguist) makes it very understandable, comprehensive, and light. It also is a light install, is available for any OS and has superfast deployment time. Also works well with CMD, batching, and linked processes
    MATLAB - A common program/language for researchers, this tool is great for initial analysis and minor scripting, but it is not optimal for setting up systematic processes. It is also great as a presentation tool for selective quants who use it (Goldman uses it in case you were wondering). It's much more a theory person's "scripting" language. Deployment time is a little longer; however, it has some great commands for matrix algebra due to its nature of storing everything in matrix form (example, a = 0 is stored as a 1x1 array with the value at [1,1] = 1).
    S-PLUS, SAS, SPSS, S, R - (yes they are all different...kinda) Power. These are a necessary tool in developing your scripting power. These are 'statistical' languges...which means that they are great at doing statistics...What? There's a category for this shit? Yes there is! Deployment time is less than MATLAB and they are also more powerful because they are lighter on the system. "R" is great because it is open-source. S-PLUS has a nice GUI and help file. Make sure you learn one of these...once you have learned one, the others are just syntax differences.
    Bloomberg, Factset, MarketQA - These are tools that allow users to access data from a database (like below). Learning how to get data is just as important as playing with it. One day you will find yourself sitting at a job and your boss could say, "hey, run a regression on the DOW 30 and the S&P 500's monthly total returns." To which you would reply, "sure...where do you have the data?" *BAM* You are fired. It is quintessential!
    Compustat, Worldscope, I/B/E/S, etc... - These are financial databases. No way to "learn" them; you have to work with them in a job and understand (and deal with errors in) the data and this will double your power as a scripter.
    C/C++/C#/Java - These languages are interesting...They are very powerful (they have control over many system capabilities), they can do data mining, they have a large community following (libraries with prewritten code), BUT they have long deploy time unless you re-use code...a lot...

How Do I Go About Learning?

Ahh, the dreaded question...The *BEST* way to learn programming depends (again) on which path you take. To be honest, if you are going into software development, your coding can take time to develop but the theory you learn should come first. However, if you (like me) are a scripter, experience is key. Therefore, I like to suggest that the only way to learn is by doing. It is not an easy thing to say because, face it...where are you going to find interesting things to program? This has always halted the learning process with programming. The typical dialogue is:

Kid: Hey, What language should I learn?
Me : Well, if you are going into Finance and you don't know VBA yet, learn that...it's expected at this point.
Kid: Cool, is there a good book you would recommend?
Me : Sure, get Microsoft Excel VBA Programming for the Absolute Beginner by Birnbaum. He teaches you by making you program games. It's a great way to learn.
Kid: Ok.

This is where the process usually stops because there really is a limited connection between learning how to move a red cell around the spreadsheet and automating a series of regressions. *It does teach you syntax and makes you familiar with the GUI*, so it is necessary. What are some better projects to try out after that book?
  1. Get the current S&P 500 Constituent list (Google that phrase and you should hit S&P's website, there is a link to download the constituents to an excel file...check out the syntax of that link)
  2. Get the closing price (from Yahoo!Finance) of each of those companies. Again, check one company and look at the syntax of the link. There's a fast way to do this also (aka, you don't have to hit their site 500 times...)
  3. Make a frequency table of the log of the prices (=FREQ()) and divide them into buckets of 10.
  4. Make a graph of the buckets and the count to see if prices in the S&P 500 are lognormally distributed...

If anyone actually does this...let me know and show me your code, i'd be happy to check it out since I already have this done in some excel file.

Final Thoughts

I hope I haven't deterred anyone thinking about "trying it out" this summer, but programming is a committment that will pay off in the long-run. Just getting your feet wet is a rewarding experience as it teaches you to think in loops and conditions. Once you understand how long it takes to get good at programming, or how long it takes to complete a tasks, you will have a greater understanding of feasibility within your project workspace.

Tuesday, April 22, 2008

F(un)AQs about the Fed

What can the Fed do to change the Federal Funds rate?

  • Open-market operations
  • Discount rate
  • Reserve requirements
  • Etc.


What are “open-market operations?”
When the trading desk at the Federal Reserve (“the Desk”) buys or sells government securities from Primary Dealers in the open market in order to alter the Federal Funds rate.

How do open-market operations affect the rate charged to banks to borrow funds from another bank?
The Fed does NOT directly transact in the Federal Funds market. Here is an example of the chain of events that occurs when the Fed reduces the amount of liquidity in the market and increases the Federal Funds rate:

1) Pretend the US economy is booming and the Fed decides to increase their target for the Federal Funds rate

2) The trading desk at the Federal Reserve contacts their Primary Dealers and asks them for their bids on an unspecified amount of treasury securities. Primary dealers participate in this auction for two reasons:

a. They are required to participate

b. They have accounts at clearing banks, which are depository institutions that hold reserves at the Fed. When the primary dealers buy Treasury securities from the Fed, the depository institutions’ supply of reserves decreases as primary dealers use the cash they have deposited to pay for the Treasuries. This decreases the amount of available reserves in the Federal Funds market, increases the demand for reserves, and increases the Federal Funds rate.

3) Once all the bids are submitted, the auction price is set by the Desk, securities are sold to primary dealers and liquidity evaporates causing the Federal Funds rate to increase

This process works in the reverse fashion when the Fed is seeking to increase liquidity. This time, the Fed is buying securities from Primary Dealers and giving them cash in exchange for government securities. This cash is deposited at their respective depository institutions, increasing the amount of reserves in the banking system.

Types of Open Market Operations
The Fed can structure their open market operations as repos or outright sales/purchases

Repos: These are the most common types of open market operations conducted by the Fed. They are preferred because they give the Desk much more flexibility in offsetting temporary swings in the level of reserves, which can be very volatile.

Here is an example of why flexibility is so important for the Fed when trying to control the Fed Funds rate:

Every 3rd day of the month the government pays out social security benefits. This causes reserves to shift from the government’s depository account to the bank accounts of private sector banks (note that the government’s reserves are not part of the Federal Funds market until they are given to Social Security beneficiaries and deposited in their accounts at depository institutions). This results in a huge increase in the supply of reserves, but the Federal Funds rate does not change! This is because traders at the Desk conduct defensive operations in the form of repos in order to control the supply of reserves.

Outright sales/purchases: Similar to repos, but result in a more permanent creation/elimination of liquidity, as the transactions are not reversed after a few days, like with repos.

Discount rate: Since the discount rate is above the Federal Funds rate, borrowing from the Discount Window is rare. A relatively high discount rate puts a ceiling on the Federal Funds rate and deters banks from borrowing from the Fed before they have exhausted less expensive alternatives. The stigma of borrowing from the Discount Window is largely a result of this implication.

Reserve requirements: By increasing the reserve requirement ratio, the amount of tradable reserves in the Federal Funds market decreases. Supply goes down so prices go up, i.e. the Federal Funds rate increases.

Saturday, March 29, 2008

Linear Approximations


The shortest distance
Lines have two parts [y = mx+b]: they start somewhere [b] and with unwavering speed [m] they get somewhere. Pretty simple.

Since I am simple, lines describe me pretty nicely too. I have 50 dollars and each redbull vodka costs 10 dollars. 5 redbull vodkas later, I am numb to my net worth.

Relationships can suffer over distance
To estimate how much money you would make investing at 8% a year with 100 dollars, see that you make 8 dollars in your first year. The amount of money that you have changed by only 8% so far, so figuring that you will make about 8 dollars the next year on the same investment is only 8% off. After two years, I have made about $16.

After a greater number of years, the compounding of error would become a problem. After all, what is the difference after 10 years. ($100+$80) - [100*1.08^10]. The error gets worse and worse and we lose love for the line.

Over that line
A threshold is a point where everything changes. I was a jello crazed child. One thing was very clear to me: if there is anything better than one cup of jello, it is two cups of jello (rational by any economic sense). One way or another, I got enough money to satisfy my dreams. I ate an orgy of jello. Unlike the linear promise of joy, I threw up -- violently. The formula for maximizing pleasure can be tricky.

Call me
Some things can be described well linearly. Take for example how much you gain or lose on a stock when it goes up by a dollar, but what happens when you add a threshold to the payoff? A call is similar to holding a stock contract except that it only entitles you to money if the stock is beyond a certain threshold like 100 bucks (when the contract ends). Of course, you could sell your call contract before the end of the contracts life. Instead of getting dollar for dollar returns, you have to value your call with an equation that is much more difficult (at the top of the post). All due to a little threshold. After all, if I can hook up with an 18 yr old, why can't I hook up with a 17 yr old? Thresholding can be difficult to understand.

............................
Igor 'I only post when you make me' Schmertzler

Tuesday, March 18, 2008

Quotations

Just about everyone loves a quotation.
  • A penny saved is a penny earned. (I just made a penny!)
  • Follow your heart. (Yay, I love not going anywhere)
  • Live for the moment. (I was alive every moment writing this blog)
  • And a trading favorite, balls to the wall. (There are too many walls!)
''Keep it simple, stupid"
Imagine following your heart and living for the moment. You see a delicious apple and since you are hungry, you eat it. You see a beautiful girl and you walk up to talk to her. You feel like reading a book or writing a blog. And you rack up points.

"I'm kind of a big deal around here"
You rack up points -- big time -- because everything your heart desires not only helps you in the present, it makes your life better in the future. An apple a day, anyway. And maybe the girl wanted to seize not only the day with you. Sometimes, there is no trade-off between the present and the future. Sometimes, seizing the day is what it's all about. Big opportunities are captured when a person is trying to capture opportunities. That rarely happens when practicing long division.

More likely than not, saving pennies is not something your heart truly desires. Is that how Bill Gates made his money? Certainly, it's not how Trump made his money. It's better to be dollar smart and penny foolish. After all, the more you spend, the more you save.

"Opportunity is missed by most people because it is dressed in overalls and looks like work"
Opportunities can only be seized when they come. Fortunately for you, opportunity can only be seized by those who prepare. So figure out when your opportunity is coming and prepare for that time. It would be hard to do many good trades when the market is closed. Saving that penny in preparation for a once in a lifetime investment; learning how to put on makeup without looking like a prostitute and meeting the love of your life; practicing that jump shot for hours for the important three seconds you'll remember for the rest of your life -- that opportunity will come.

"In a minute there is time / for decisions and revisions which a minute will reverse"
All men are not created equal. In fact, some mothers smoke or drink while pregnant. There are fathers who did not want to create anything at all. The nature is different, the nurture is different, and the randomness is -- random. Minutes in my life were not created equally either. My time was worth about $7 / hour when I was 16. I was just as good at reading Shakespeare then as I am now, but I get paid slightly more these days to focus less on shakespeare and more on trading. Is this the most I will ever make? Are my minutes now deserving of thinking only about the short term?

"To perceive evil, where it exists, is a form of optimism"
My time right now is every bit as important but not every bit as useful ($ / hr) as it will be in the future. When a person thinks like that, he makes his thoughts a self-fulfilling prophecy. If you are in college, invest in yourself and take a harder class. Calculate your grocery bill in your head and add tax. Commit yourself to not borrowing from tomorrow. Debt, anorexia, not putting away the dishes, drugs, and laziness is borrowing from tomorrow. I am an optimist; I think your opportunity will come tomorrow.

"Equality of opportunity is freedom, but equality of outcome is repression"
They say, the gap between the haves and the havenots is growing. I am not sure if that is true on percentage terms, but I am sure that the gap grows between people who live for the moment and people who prepare for their moments. If you have spent your life preparing, we'd love to have you at Optiver trading.

You've worked hard, why not let your investments pay off. Email me.

Saturday, December 8, 2007

More Posts!

Welcome Stephanie
In keeping with the intention of sliding away from Optiver specific material and instead sliding towards new ideas (and increasing post frequency) we officially have a new 'poster girl.' I am excited about her first post, which I think she might put up tonight.

As the name 'poster girl' implies, you will want to be like her and perhaps write for this blog as well. Feel free to contact me if you want posting abilities on this blog. Or you can just leave great comments like these.

Themes
As the blog gets more people posting, the need for separate themes becomes more apparent. Still, separation of finance, math, economics, 'quant,' is largely imaginary. Here are the themes as we have defined them.
  • I will try to maintain my preference for writing about 'MathFinance,' (which is both math and finance and neither math nor finance at the same time). Also, I will be in charge of making up words.
  • Stephanie has promised to write about 'FinanceEconomics.' She has also volunteered to be in charge of blog sarcasm :)
It may seem like in just those two themes we would not be restricted from covering almost everything! I can think of some things we might not cover. Here is a short list of the things that you could potentially write about:
  1. Advances in computer science (algorithmic, software packages, and hardware)
  2. Trading (technicals, new ideas, psychology)
  3. Investments (putting a lot of capital to work)
  4. Strategic theory
  5. Mathematics (what has been proven, what is contested, how do you develop your own framework)
  6. Quantitative Modelling (CAPM, APT, Black-Litterman, Back-testing, Signal Theory, ...)
  7. Computational Finance
  8. Econometrics
  9. Financial Business Decisions
  10. Financial Culture and Lifestyles
  11. etc
Accumulated Topics
Over the past couple of months, I have promised to talk about all sorts of topics that I never got the chance to write about. Here is a list that is meant to serve as an apology:
  1. What is dynamic replication? Can I arbitrage volatility?
  2. Adverse selection
  3. Volatility as the sensitivity of the market to information
  4. Taylor expansion for quick calculations
  5. Fourier series
  6. Principal components analysis
  7. Total least squares vs ordinary least squares (introduced in the last post)
Topics that others have asked for:
  1. What is a broker, prof trade, wholesales trader?
  2. How do I prepare for the Optiver interview?
  3. What is a swap?
  4. What is Beta?
I will do my best to get to all of these and perhaps others will volunteer to write great posts. In the meantime, thanks for reading.

Wednesday, November 14, 2007

Applied Finance

Investing and Trading - Similar but Different

In investing, one must find some security to hold for a relatively long duration. Trading, however, is a bit different. In trading, one must find something that is under- or over- priced for quick (often relative value) market corrections. In particular, traders try to find opportunities which are (1) hard for others to spot, (2) hard for others to exploit, or hard for others to exploit (3) as quickly as the traders can exploit the opportunities.

Speaking generally, in both investing and trading one uses tools to reason which investments / trades will act accordingly. In both cases, one also filters choices based on standardized descriptions. But in trading choices happen fast and relative value needs to be found more and more deeply every year. As implied above, mathematics is important because it:
  1. is a language for common understanding
    1. gives rise to standardized filtering which allows for very quick decision making
    2. allows for standard methods of information discovery (so you can use the same tools for different products)
  2. is a set of tools for reasoning (to see deeply)
  3. is expertise to avoid misunderstanding and to avoid false conclusions (to see clearly)
  4. is much more, but not relevant to the post
This blog starts with 3 and goes backwards.

Expertise to avoid misunderstanding
  • Some math is considered so basic that we take it for granted that we can apply strict methods to it. 1+1 = 2 right? If that is true, then how many chewing gums do you get by adding one to another? How many empty sets do you have if you add 5 empty sets together? Can you show me half a piece of chalk? This math is basic enough that you would never make this mistake with these examples. The point is that there is an assumption made even with something as basic as counting.
  • Some math is used so commonly that we forget the changes implicitly made when moving from fractions to decimals and back. Take for example averaging.
    • Alice ate 1/2 an apple. Varun ate 1/4 of an apple. What is the average number of apples eaten?
      • (.5 + .25) / 2 = 3/8 Simple.
    • A baseball player had a hitting average of .5 in year one and .95 in year two.
      • Simple method: (.5 + .95) / 2 = .725
      • Actually, it turns out he hit 15 balls in year one and 95 balls in year two. So 15/30 + 95/100= 110/130, well over 80%. We forgot that the decimals no longer had the weighting information.

-----Examples for the general populace------------------

Risk free investments are risk free- You are promised a risk-free, 10% return after a year (there is no chance of default). You reason that you should be about 5% richer after half a year (or a little less if there is a high frequency of compounding). Unexpectedly you need the money so you decide that you want to take your profits in the middle of the year by selling your risk-free investment to someone else. The only problem is that the market is now offering 20% "risk-free" and you are only able to sell at a major loss. The assumption that you wouldn't have to pay for opportunity cost is unreasonable (thanks to Stephanie for pointing out the correct way to say this). Your investment is not as risk-free as you thought.

---------Examples for Finance majors (chosen because these are so accepted)-------

Diversification leads to higher returns - Why should diversification lead to higher returns? Why doesn't diversification just water down the skill you put into choosing your investments, as Buffet proposes? The answer is to most is simple: either you have no skill or your skill isn't better than the value of diversification. Who knew that the nice guys telling you to diversify were actually implying that you suck. In mathematics, one says geometric returns lag arithmetic returns. The more the lag (which happens with high volatility), the more to be had from diversifying.

Least Squares Regression for Hedge Ratio- Many people, sadly including myself, use "math" blindly. Think of the last time you ran a regression to determine a hedge ratio. What happened? Which security did you choose to be the independent variable? Based on what algorithm did the computer fit the best line?

What would happen if you chose the other security to be the independent variable? Ans: Using financial data, you would get a different hedge ratio. That should raise a major red flag. This anomaly happens because your standard linear regression assumes that you have no error in determining the value of the independent variable. You should be using an "orthogonal least squares." Check the assumptions here. [More in a later post]

What's the point?!
The point is that not only do we use math blindly, but also we use blind math often. Somewhat rationally, you might argue to yourself that you should specialize in finance. That means, of course, you cannot waste time learning theoretical math because you can just use tools developed by others.

Due to our preference for "specializing," you, me, and the next finance major are the people using math incredibly blindly and not even knowing how blind we are. It is a mistake to feel that the immense precision of math means that one is accurate to some nice decimal places (accuracy vs precision). Not only is there a difference between accuracy and precision (ok, I tricked you into that last one), but often the precision is way overstated as well.

You won't find the term 'mathematical blindness' in Wikipedia and you may be asking, what exactly is mathematical blindness? Blind math is the usage of math without the understanding of the assumptions undertaken to make this math work. To some degree, this blind math is the applied math you've always done! It's not your fault! You followed examples to do what your teachers taught you to do.

Does it then follow that the person who knows the most math is the least blind?
Perhaps not. Quant funds, run by people with incredible mathematical understanding, have a reputation for getting killed in the marketplace. However, many quant funds also have a reputation for making a killing in the marketplace. Math makes them confident (and tells them to lever up). What is more dangerous than a person willing to stake his life on something? But then again, who is more bound for success than the confident?

Sometimes blindness will be mathematical and other times will be caused by assumptions in another field (eg. financial assumptions). The blindness is in misunderstanding anything! It is the magnitude of assumptions made from all sources.

Blind financial math
(sometimes called model risk) comes about from (but not limited to):
  • applying mathematical tools to the wrong types of problems
    • Running the wrong regression
    • Mistaking covariance for correlation or vice-versa
  • applying unrealistic (but sometimes necessary) financial assumptions to the data
    • The future will look like the past
    • There is a distribution to this random element
  • using the wrong data
    • Should you keep the outliers?
    • Should you take out certain days?
    • Are the more recent days more important?
    • Does the time of the year matter?
  • not keeping track of assumptions / not challenging assumptions often enough
    • You diversify like you are told [The assumption is that your skill in selection isn't better than the value of further diversification]
    • You take over a trading spot and inherit plenty of assumptions you didn't even know were made
A smart mathematician (name your highest math professor) is not a financial genius and a financial guru (take Buffet for example) is not a mathematical genius. First of all, note that Buffet is not a trader, but an investor. Also examine the assumptions because the future does not have to act like the past! These two, once separate fields, are converging into one understanding -- called financial mathematics. Trading uses financial mathematics. Assumptions in what was okay to consider two different fields can kill you in this one.

Monday, November 12, 2007

Focus

The rules of the blog have changed:

1) I am now more deeply involved in more company specific topics that require sensitivity and filtering. To maintain clarity, I will filter my topics instead of presenting only half-thoughts. Thank you to all that have read my material pertaining to Optiver; there will be no more.

2) My traffic, though nice, has few dedicated members (sorry to those I am offending!). Q: Why post something online? Ans: For others to see it. The point of this blog was to be as realistic as possible. In keeping with my dislike of being delusional, I am refocusing on only the core readership. My other thoughts can go into a word file as easily as they can go online.

Lastly, thank you to those that send me an email every so often asking for specific material. You make my work that much easier.

Sunday, October 14, 2007

Three Weeks of Trading Finished (Volatility 2/3)



Quick comment: Since I haven’t posted for two weeks, I'll post twice as much this week. Thank you to everyone who complained and made me finally write something.



Call Vol = Put Vol for Strike K

Put call parity (for European options!) is an equation. Equations are amazing because they can have all sorts of mathematical operations done to both sides to deduce properties. Keep in mind that only the theoretical, strict definitions of arbitrage have equations. That makes put-call parity a great starting point for talking about implied volatility (Hull).


The following (slightly different) is found in Hull 5E, Chapter 15:

Buying a call and selling a put is the same as owning the stock and subtracting the carrying cost. Put-call parity holds in both the Black-Scholes world and the real world since it is based on a no arbitrage argument. Please take a look to the top of the post.


What is happening up there?! The first line is a formulation of put call parity for Black-Scholes option prices. The second line is the formulation for the market prices. The third line is a manipulation of the top two lines, specifically the first line less the second line. The forth line is just the third line rearranged. The outcome shows that the dollar pricing error in Black-Scholes is the same for calls and puts!


What's with the word implied?

The volatility that, given a particular pricing model, yields a theoretical value for the option equal to the current market price is implied because it must be inferred from the model. More simply, to imply the volatility means you have to guess and check to find it. There are a couple of ways to guess and check more efficiently than random.


Bisection Method: Guess in the middle and see if you are too low / too high. Then guess in the middle of the half that is better.


Newton-Raphson: Guess in the middle, guess again and see how much closer you are. If you increased the volatility by 1 point and got 2 dollars closer and you were 6 dollars off, you should try increasing the volatility by another 2 points.


Brent's Method: (If you would like to explain this clearly, please email me and I'll post it.)


Different Vols for Different Strikes
The first picture at the top of the post is an empirical result showing the volatility smile in DAX options at a certain time. Why does this smile exist? The following is a list of interrelated reasons:
  1. Distribution adjustment - Since the underlying does not have to act lognormally (please see below posts for more on this), some parts of the distribution become more probable than others. This type of correction is very prominent in currency options because of the discrete nature interest rate moves.
  2. Leverage adjustment - "As a company's equity declines in value, its leverage increases. This makes even lower stock prices more likely. As the company's equity increases in value, its volatility decreases in value, making higher stock prices less likely."
  3. Reflexivity - Bad news triggers more bad news. The financial markets are reflexive. An example of positive reflexivity is giving a company a good credit rating. That good credit rating lowers their cost of borrowing. Since their cost of borrowing is less, the company's value increases. Since the company's value increases, it's credit rating increases. Understandably, the effect gets smaller and smaller with each iteration, but the positive feedback is clear. This is a possible explanation for fat tails commonly noticed in financial data.
  4. Volatility clustering - "large changes tend to be followed by large changes, of either sign, and small changes tend to be followed by small changes" - Mandelbrot. This is different from above two in that the direction does not matter.
  5. Supply and Demand - Before the crash of 1987, the smile was not prominent in option prices. It is possible that investors are crashophobic and willing to pay a certain premium to have a back up. Since it is unclear how to arbitrage the smile (more on this in the next post), premium just builds up in a certain strike. Supply and demand also constantly updates the market's perception of the probability of the options ending up in different strikes.

Monday, October 8, 2007

Back by popular demand (Volatility 1/3)


Over the next three posts, I will try to address these questions:

  1. What are the basic properties of volatility and implied volatility?
  2. How do quants measure volatility? Why should there be different implied volatilities for options of different strikes? Why should the put volatility be the same as the call volatility on the same strike?
  3. What is dynamic replication? Can I arbitrage volatility?


“Implied volatilities are the focus of interest both in volatility trading and in risk management. As common practice traders directly trade the so called "vega", i.e. the sensitivity of their portfolios with respect to volatility changes. In order to establish vega trades market professionals use delta-gamma neutral hedging strategies which are insensitive to changes in the underlying and to time decay, Taleb (1997). To accomplish this, traders depend on reliable estimates of implied volatilities and, most importantly, their dynamics.” -- Applied Quantitative Finance



Volatility and implied volatility are different

Volatility is the standard measure for how 'active' a stock is. Volatility:

  • is linear
  • measures the stock's spread of distribution
  • is numerically debatable because the past isn’t supposed to fully reflect the future
  • has an associated time frame. Vol = V per year. Assuming the volatility of the stock stays constant over more years, Vol per t years : V * √(t)
  • has market components. Even though the company itself has not announced any news, the volatility can grow or shrink due to the market becoming more or less volatile. This is why Principal Components Analysis sounds like a good idea (covered in next post)


Since it seems unsettling to draw conclusions from the past to expect market behavior, the focus shifted to implied volatilities, Dumas, Fleming and Whaley (1998). Implied volatility is inferred from option prices given some sort of formula for option prices like Black-Scholes. Implied Volatility shares the above properties but has a couple of its own properties:

  • is different for different strikes
  • is the same for puts and calls of the same strike
  • sometimes doesn’t make sense for exotic options
  • incorporates a distribution adjustment due to stocks not being totally lognormal. This is because Black-Scholes formula assumes lognormality
  • incorporates volatility premiums due to supply and demand. This means that the stock isn’t expected to have this volatility but the price has been bid up and the implied volatility is higher to match the price. This is somewhat controversial and mostly original with me, so don’t think that it is right. This is due to the unavailability of pure arbitrage and further difficulty of balancing in the short term. (What I’m saying is the dynamic recreation doesn’t work completely. The problem with the last idea of course is knowing when the 4th reason is driving premiums and when the 5th reason is driving up premiums.)