Forums > Basics > Bayes' theorem

 Page 1 of 1
Display using:
 NeroTulip Total Posts: 1081 Joined: May 2004
 Posted: 2019-10-06 20:57 I am trying to find a good practical example of Bayes' theorem use in finance. I have a great example in medicine with cancer screening, but I struggle to find something cool in finance. Should be simple enough for undergraduate students, does anyone have any ideas? "Earth: some bacteria and basic life forms, no sign of intelligent life" (Message from a type III civilization probe sent to the solar system circa 2016)
 nikol Total Posts: 1483 Joined: Jun 2005
 Posted: 2019-10-06 22:21 Risk management problem:P(account of client-A is in limit breach)*P(history of limit breaches|clients defaulted)=>P(client-A is in default)Trading problem:P(see uptick)*P(history of upticks | uptrends)=>P(beginning of uptrend) PS: My mistake. Above should be modified from 'beginning updtrend' to 'uptrend'.Correct is this: P(see uptick)*P(history of upticks | start of uptrends)=>P(we are at beginning of uptrend) ... What is a man If his chief good and market of his time Be but to sleep and feed? (c)
 goldorak Total Posts: 1091 Joined: Nov 2004
 Posted: 2019-10-07 11:02 We are in 2019 and finance folks are still relying on frequentist statistics. That tells a lot about this industry.Once you actually reverse the way we have been (wrongly) trained to look at things in finance, and consider the probability of the hypothesis you make given the data you observe rather than the probability of the data given the hypothesis you make, the use of Baye's theorem is pretty straightforward. If you are not living on the edge you are taking up too much space.
 bullero Total Posts: 75 Joined: Feb 2018
 Posted: 2019-10-07 11:13 Parameter estimation?Edit: For example in stat arb you could sample the posterior joint distribution for a set of interesting parameters that describe the stochastic behavior of a spread you are trading. Then, given the joint density you compute the expected pnl.
 AB12358 Total Posts: 70 Joined: Apr 2014
 Posted: 2019-10-08 00:26 Monty Hall? :D
 NeroTulip Total Posts: 1081 Joined: May 2004
 Posted: 2019-10-10 08:32 @goldorak, we have:P(H|D)=P(D|H)*P(H)/P(D)So in order to get the probability of the hypothesis (H) given the data (D), we need unconditional probabilities of the data and hypothesis... How do we go about those?I know you are super clever, please explain like I am 12 years old. "Earth: some bacteria and basic life forms, no sign of intelligent life" (Message from a type III civilization probe sent to the solar system circa 2016)
 Maggette Total Posts: 1350 Joined: Jun 2007
 Posted: 2019-10-10 11:38 Sorry, I guess I am missing something here. I don't get the question. You are aware of the classical Bayesian inference stuff (start with a prior for the parameters ...posterion = prior * likelihood..etc)?In general you don't do that in a closed form pen and paper way....Edit: I get know that I misunderstood the question. I guess you are looking for a more direct application of the theorem, other than general bayesian statistics Ich kam hierher und sah dich und deine Leute lächeln, und sagte mir: Maggette, scheiss auf den small talk, lass lieber deine Fäuste sprechen...
 nikol Total Posts: 1483 Joined: Jun 2005
 Posted: 2019-10-10 15:10 @NeroTulip>> P(H|D)=P(D|H)*P(H)/P(D)Usually P(D) = 1.>> I know you are super clever, please explain like I am 12 years old.Hm... Assume that you already explained the concept of probability.Imagine walking in the museum and seeing Kandinsky's Composition no.XIhttps://www.wassily-kandinsky.org/Yellow-Red-Blue.jspData is paintingH is everything what tells imagination about the picture. P(H) is a probability that particular H (let say face) will appear among anything else. P(D|H) is a number (EDIT: better fraction=P(D|H)/P(D)) of paintings with faces on it. Portraits included.Then P(H|D) is a probability that what I see is face indeed. ... What is a man If his chief good and market of his time Be but to sleep and feed? (c)
 vertigo Total Posts: 9 Joined: Dec 2015
 Posted: 2019-10-21 21:19 Regarding Goldorak's post... I think this kind of thinking is worse than useless - it is dangerous. Young people will look at your post and take inspiration, and then get a harsh reality shock when they attempt to use Bayesian methods in practice and found out that these methods are more complicated, more difficult to calibrate and far more subjective than frequentist methods. In my opinion, they are nearly useless in finance. It is not that finance folks "believe" on frequentist statistics, no, that is how an academic would see it (and academic's opinions count as the same as garbage cleaners) - more likely it is that they are aware of the dangers of using more complicated statistical methods (i.e., Bayesian methods) and therefore use more simple methods that have damage limitations.You cannot use Bayesian methods for pricing - when you work with the martingale measure, the volatility function is already specified, and the drift is whatever rate you can finance with (LIBOR, OIS, etc...). You could use Bayesian methods for risk - but usually "risk models" need to get regulatory approval and you tend to use simple models (i.e., not subjective) for such cases. Therefore, Bayesian methods are useless.An example of where you could use them - calibration for yield curves. ... maybe one day ...
 NeroTulip Total Posts: 1081 Joined: May 2004
 Posted: 2019-10-22 08:35 To Bayes or not to Bayes, that is the question. (ok, kill me now)@Maggette: Indeed, I am looking for an example of simple direct application of Bayes' theorem in finance, something I could explain to some undergrads.For example, in medicine, you want to know the probability that you have cancer given that your screening test is positive P(C|T). You know the test sensitivity P(T|C), the false positive rate P(T|not(C)), and the prevalence in the general population P(C). Direct application of the theorem gives you the result you are looking for, which can be counter-intuitive e.g. your test is positive, but you only have a 15% chance of actually having cancer.Wondering if there are simple examples like that in finance. "Earth: some bacteria and basic life forms, no sign of intelligent life" (Message from a type III civilization probe sent to the solar system circa 2016)
 deeds Total Posts: 521 Joined: Dec 2008
 Posted: 2019-10-22 14:07 @v - i try not to be a 'wow-ist' but am overcome. Wow.Garbage cleaners. Useless.I'll take wisdom from any source and test it. In finance, it would seem some of the best wisdom is that which everyone else thinks is garbage.In general, i'll try to keep my opinion of sources as clean as possible so i don't miss them in this loose jumble of my i sometimes call mind.
 Maggette Total Posts: 1350 Joined: Jun 2007
 Posted: 2019-10-22 16:18 @vertigoI think your perspective about users on this phorum is a bit limited. You probably worked in bigger institutions...but there are a LOT of smaller and sophisticated players out there who don't do risk-management in order to comply to regulatory nonsense...but to actually manage the risks on their books!I never thought about bayesian methods in in derivatives pricing....But there is still a lot left in the finance industry, that is neither pricing derivatives nor corporate risk management for complicane reporting. By goldoracks quite knowledgeable posts about the pitfalls of backtesting strategies I assume he is from that part of the industry. I learned stuff from him... I think to a practioner it is rather obvious where frequentist and bayesian methods complement each other well and where one of the two is more instructive. My experience in energy trading, the bayesian stuff was rather helpful...and in some cases the only way to do at least something.... You can do things with a bayesian approach that you can't do with a frequentist. Frequentist stuff is still the way to go in many use cases, but often it does not do the trick....Use both when appropriate. Everything else is rather academic bickering. Ich kam hierher und sah dich und deine Leute lächeln, und sagte mir: Maggette, scheiss auf den small talk, lass lieber deine Fäuste sprechen...
 nikol Total Posts: 1483 Joined: Jun 2005
 Posted: 2019-10-23 16:40 Intuitively Distance to Default is closest to cancer. Must be something about good stress test for the Lehman B. which defaulted few months later. ... What is a man If his chief good and market of his time Be but to sleep and feed? (c)
 ahd Total Posts: 32 Joined: May 2017
 Posted: 2019-12-24 19:27 how about scenario of cratering stock that has been successfully traded in the past based on some mean-reversion strategy? is the stock getting super cheap, i.e. is the current realization of the mean-reverting state variable far out in the tail of the pdf? or is model wrong in the current environment? or, better, consider a simple multistrat where trading strat = P(mean reverting dynamics) mr strat + P(trending dynamics) * trend following strat. Now the two probabilities are history dependent in a Bayesian sense...
 goldorak Total Posts: 1091 Joined: Nov 2004
 Posted: 2019-12-25 05:40 Interesting. ahd recent post gave me an update in my rss feed, but I had not got any since I posted in this thread. Anyone relying on rss feed having the same kind of issue? If you are not living on the edge you are taking up too much space.
 goldorak Total Posts: 1091 Joined: Nov 2004
 Posted: 2019-12-25 06:59 @Nero. (I hope you are taking advantage of fresh snow in the Phrench Alps at the moment...) I understand this will not be what you are looking for (a simple example of Baye's theorem), and my post was more trolling than anything else (do not forget that I spend most of my time in the mountains which makes me a natural troll). Still, I think it is worth a word or two.First, why would you want to know all different parts: P(D|H), P(H) and P(D) ? The only thing you need is to estimate P(H|D) so you can use it to actually build a portfolio of... let's call them "opportunities".Second, your example on cancer is quite telling. All the probabilities you are using have been ex-ante determined thanks to a frequentist process and in medicine there are good reasons to assume that, at least in the medium term, they will not change (unless sapiens metabolism is changing faster than I think it should...). In finance you do not have that luxury, even in the shorter term nowadays (it used to be in the past though). This is an important reason why trying to determine each part separately is a waste of your time. Determining P(H|D) through other empirical means is already painful enough.Finally, regarding your example of Bayes theorem of finance, why not consider the probability of "you are good" conditional on the fact that "you make money". With people having a real habit to overestimate the probability of "you make money" given that "you are good" ? It will not help you making any money though...@vertigo. Not talking of applying Kruschke's book here. Just to rely on:First, fix a simple and acceptable for all prior.Second, update that prior given new evidence.Third, iterate once more evidence available.That is way more powerful than observing, choosing and calibrating a model and hoping for the best in the future. If you are not living on the edge you are taking up too much space.
 ahd Total Posts: 32 Joined: May 2017
 Posted: 2019-12-26 03:47 I like @goldorak's suggestion of P(good | make money) = P(make money | good) * P(good) / P(make money) . Imagine we consider a concrete toy example in which i) an investor gets a coin drawn from an urn containing some distribution of fair and biased coinsii) the investor flips his coin N times and bets on each flipiii) the investor puts his coin back in the urn and a new investor goes through i) and ii)iv) repeat 1000 times The bias (if any) in each guy's coin is a measure of edge or "being good". Each guy is rational and will simply bet whatever side has come up most often for him so far... I'll imagine "good" means "abs(P(heads)-.5) >threshold1" and "make money" means "avg pnl > threshold2"@NeroTulip you can have your kids write a script to investigate this, or just show them in class certain features like both conditional probs go up with N as signal becomes more certain to dominate noise, etc.
 NeroTulip Total Posts: 1081 Joined: May 2004
 Posted: 2019-12-27 06:58 @goldorak:I like the P(good|make money) idea... I think I can probably create a toy example such as:There are 10,000 hedge funds with 5 year track records. Your favorite one has a 2 Sharpe. What is the probability that the manager is good rather than lucky: P(good|2SR)?To answer this question, let's assume that out of the 10,000 funds, 100 have a large edge with a SR of 2, and 9900 are exotic betas with a true SR of 0.5 - but some of them will get lucky.P(good|2SR)=P(2SR|good)*P(good)/P(2SR)=50%*1%/P(2SR)We have P(2SR)=P(2SR|good)*P(good)+P(2SR|not good)*P(not good)Is there an analytic solution for P(2SR|not good), or do I need to simulate it?To be clear, P(2SR|not good) means probability of getting a Sharpe of 2 over 5 years, knowing that your strategy has a true Sharpe of 0.5 "Earth: some bacteria and basic life forms, no sign of intelligent life" (Message from a type III civilization probe sent to the solar system circa 2016)
 goldorak Total Posts: 1091 Joined: Nov 2004
 Posted: 2019-12-27 10:19 I would simulate it, would it be just to include different volatilities for the managers. If you are not living on the edge you are taking up too much space.
 ahd Total Posts: 32 Joined: May 2017
 Posted: 2019-12-27 12:12 Well, if the investment returns are iid gaussian then the sampling distribution of the SR is a non-central t-distribution with a known pdf - so you can always compute in closed form stuff like P(realized SR >=2 | true SR = 0.5).
 nikol Total Posts: 1483 Joined: Jun 2005
 Posted: 2022-10-14 17:10 Finance example:Observe data (prices, rates, news, distribution of defaults, etc) = D(ata)Given the history of observations classify the states into bottom, growth, prosperity, stagnation, recession, depression = M(odel)Now we can estimate the probabilities of all states, Mi, the economy is in given the current set of data:P(Mi|D) = P(D|Mi)*P(Mi)/P(D), where P(D) = P(D|Mi)*P(Mi)+P(D|not-Mi)*P(not-Mi) P(D|Ms) are likelihoods. Can be empirical.Classification tech is key here.This is static picture. Some prediction can be done too assuming transitions between states and assuming Markov is static. ... What is a man If his chief good and market of his time Be but to sleep and feed? (c)
 Page 1 of 1