univariate random variables

Upload: radhika-nangia

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Univariate Random Variables

    1/8

    Alright. So, we're going to talk aboutrandom variables and probability review.And so, again, this is a course aboutmodeling financial data. And the primarything that we're going to be looking atare asset returns. And, and when you thinkabout an asset return, You know, we wentover return calculations before, you know?Say, we're investing in Microsoft stock,we buy it today, we hold it for a month,one month from now, we sell it, we cancalculate the percentage change in pricethat's the rate of return. But from thepoint of view of today, the rate of returnon this one-month investment is not known,because we need to know what the pricenext month is in order to be able tocalculate that return. So, we can think ofthe rate of a return as a random variablebecause the future is not known and thereturn depends upon the future price,which is not known. And so you know, theoutcome is uncertain. And so we can

    characterize returns as a random variable,which is a variable that can take on a, apossible set of values called the samplespace. So, the future price could go up,it could go down. And so, there is apotential list of values of the futureprice and then, we attach a probability toeach of those prices and that gives us theprobability distribution over thosepotential values. So, what we are going toreview today is various mathematical waysof describing random variables anddistributions and with several examples

    towards thinking about asset returns andthe properties of probabilitydistributions for asset returns that lookreasonable. So some examples typically, anuppercase letter denotes a randomvariable. So, uppercase X is, in thiscase, the price of Microsoft stock nextmonth. It's a random variable cuz we don'tknow what the future price is going to be.What's the sample space of the futureprices? Well, the sample space, this isthe possible values that we can think,that we think the prices can take on. Now,

    prices can't become negative so we knowthat the sample space is going to be those say positive values. And you know, ifthe stock is trading, if the stock doesn'tgo out of business, then the price shouldbe positive. Now, prices can't go up toinfinity, so there's some realistic upperbound on prices and that upper bound mightbe a $1,000 or something like that. So, wecan think future prices can lie anywhere,

  • 7/28/2019 Univariate Random Variables

    2/8

    any real number, say, between zero andsome big number M like a 1,000. So, thatwould be a, a characterization of a randomvariable, the future price and its samplespace. Another random variable could bethe rate of return on the investment andthe rate of return, which is thepercentage change in price. Now what isthis appropriate example space for a rateof return. Now, what's the smallest valuethat a rate of return can take on? Theworst you can do is lose all your money,right? So, if you, you buy Microsoft todayfor 30, and if Microsoft goes bankrupt,and its price goes to zero in the future,then the percentage change in price isminus a 100%. So, the returns are boundedfrom below by -one, so it can't be anymore than that. And the upper bound,again, is some big positive number. Youknow, say, Microsoft, you know, I don'tknow, in, invent some product thatrevolutionizes the world and its price isgoing to shoot up. And but, you know, it's

    not going to go off to infinity. So,there's some reasonable upper boundassociated with that. Another randomvariable we can think of, and that's useda lot in probability modelling in finance,is a just a, a discrete random variablethat just takes on two values. So, we'regoing to set x to be equal to one if thestock price goes up and we'll say, x isequal to zero if the stock price goesdown. This is sort of like a coin flippingexample. You flip the coin and it landsheads, that's like the stock prices going

    up. You flip the coin, it lands tails,it's like the stock prices going down, andthen we're just coding the random variableto be 1,0 based upon those events. Andhere, the sample space is very simple withjust, just two va lues zero and one. So,those are examples of, of random variablesthat we'll be looking at. So, once we havethese random variables, we need tocharacterize their probabilitydistribution. Now we in, in probabilitymodels, we usually distinguish betweenwhat are call discrete random variables.

    And the discrete random variables is arandom variables that can only take onfinite set of values. So, in the lastexample, the up-down indicator, we took ontwo values, zero and one, that's thediscrete random variables and its samplespace is two discrete points, okay? Theprobability distribution of a discreterandom variable is a function, say, P(x).Such that P(x) is the probability that the

  • 7/28/2019 Univariate Random Variables

    3/8

    random variable is equal to little x. Sotypically, in notation capital letterdenotes the random variable and a lowercase letter denotes a value in the samplespace that the random variable can takeon. Now, this probability function mustsatisfy certain conditions in order to bea valid probability function. So,probabilities are greater and equal tozero for all values in the sample space.Probabilities are equal to zero for valuesoutside of the samples space. You know, weassume that all the values in the samplespace, you know, again are, are discrete,distinct points. The sum of theprobabilities of the values in the samplespace is equal to a 100%. Andprobabilities have to be less than one, aswell. So, as an example of a simplediscrete random variable and a probabilitydistribution, here's a case where we canhave a random variable x here and X isgoing to denote the annual rate of returnon Microsoft stock. Alright. So, we have a

    random variable X that's going torepresent the annual rate of return onMicrosoft stock. And this is an examplethat's kind of like the case where youmight have a stock analyst who's workingfor an investment bank, and they're doingsome fundamental an analysis and they needyou know, make some forecast of what therate of the return might be over the nextyear. And the analysis might have a verysimplified way of viewing the world thatyou know, over the next year the price ofMicrosoft stock is primarily contingent

    upon what's going to happen to the stateof the economy. And so, the analyst says,well, I think there are really one, two,three, four, five potential states of theeconomy, you know, depression, you know,it's a very bad state. And if the economyis in a depression, then Microsoft isgoing to lose 30%. And the analyst puts aprobability of five% on that eventoccurring. And then, the other state ofthe world could be, say, a recession. Andif a recession happens, then Microsoft hasan annual return of zero%, and the analyst

    puts a probability of twenty% on that. Andthen similarly, normal mild boom, majorbooms, these are other states of theworld, and then we see as the economy getsbetter, the rate of return goes up, and,and then we have these probabilities. Sonotice that the, the normal state of theworld is the state that gets the highestprobability associated with it. Now thisis a valid probability distribution, all

  • 7/28/2019 Univariate Random Variables

    4/8

    the probabilities are between zero and oneand the sum of all the probabilities addup to one. Now, in this case, you know,where do these probabilities come from?You now, in, in this case, theprobabilities are the subjective beliefsof the analyst. They may have nothing todo with the real world, you know, inquotations. But there are just, you know,views or opinions associated with, withthe analyst. In, in probability theory,there are generally two types of ways thatwe view probability. One way, thesubjective approach is probabilities areopinions or degrees of belief. And this isassociated with what is often referred toas Basian statistics. The other approachviews probabilities of, actually,actually, real physical objective things .So, the, the, the objective view ofprobability. Think of the coin flippingexample. So, if you have a fair coin thatis, it's weighted such that theprobability that the coin lands heads or

    tails is 50%. So, where doe s thatprobability of 50% come from? Well, it'san objective feature of the coin, and theexperiment of flipping the coin and theidea is that, you know, when you flip afair coin, you know, and you, you do thisin an experimental setting, say, a milliontimes, the probability that the coin landsheads is a fraction of the times in yourexperiment that you actually observe thecoin landing heads. And the probabilitythat lands tails is the fraction of timesyou actually observe the coin landing

    tails. So there, you think of probabilityas being a property of the coin, theexperimental setting, and something thatyou can repeat over and over again and,and reproduce. Whereas, the opinionapproach is, there's no experiment goingon here. You can't repeat, you know, theidea of the views going over and overagain. It's just a degree of belief. Bothviews of probability theory are, are, areequally valid, and but, you know, withinthe statistics literature, you know,there's often very strong opinions about

    what is the right way or the superior wayto view probability. In this class, wewon't take a, make a judgement on that,but we'll, you know, essentially just takeprobability as given and do computations.So one of the things I want to, to showyou is an Excel spreadsheet that I haveand now, Excel is not necessarily a goodtool for doing probability calculations.And so, the point here is just to

  • 7/28/2019 Univariate Random Variables

    5/8

    illustrate how to do certain computationsin Excel and, and, and show some, and showgraphics and, and, and things like that. Ris a much better environment for doing aprobability calculations and, and so on.But in, for my case, you know, I have myexample I just put out an Excelspreadsheet, I have my returns, I have myprobabilities, and then I can do a nicesimple bar chart to represent theprobability distribution. So, in thegraphical representation of thedistribution, I put the values in thesample space on this axis. And then, theheights of the bars just represent theprobabilities. And so, from this graphical representation, we can clearly see themost likely value is around one%. Theshape of the distribution is symmetric andthat this is the middle of thedistribution. The shape to the left of themiddle, and the shape to the right of themiddle is the same and, and so on. We cando the same computation in, in R. So, here

    is my this is new, this is again, justbased on the examples in my lecture notes.So, if I wanted to plot the probabilitydistribution in R I would just create avector of values that represent the valuesin the sample space, create a vector ofprobabilities, and then do a bar plot. Andthat gives me the, the values here. Okay.A more mathematical model for a discreetrandom variable is based on what's calledthe Bernoulli distribution And theBernoulli distribution is a probabilitymodel that essentially describes the

    coin-flipping experiment. So, we have twomutually exclusive events genericallycalled success and failure, right? So, inmodeling stock prices, a success event isthe stock price goes up, a fail event isthe stock price goes down. That's assumingyou have a long position in, in, in, inthe asset. If you have a short position,then stock price going up is the failure,and the stock price going down is thesuccess. What, so, in investments, a longposition means you buy something today.You hold it, you sell it in the future. A

    short position means you sell it today,you, and then you buy it back in thefuture. Okay, and so, when your longsomething, you're hoping the price will goup. When you're short something, you hopethe price is going to go down. Typicallyshorting works, I just, just as an aside,because this is going to come up lat eron. When you short a stock, typically, youopen a brokerage account in, you know,

  • 7/28/2019 Univariate Random Variables

    6/8

    like at Fidelity or E-trade or somethinglike that. Say, you want to shortMicrosoft. Well, you are going to sellsomething you don't own. So, how do you dothat? Well, if you have a brokerageaccount, you can borrow the stock fromsomebody who owns it and you borrow it,and you sell it, you get the proceeds thatyou hold on to it. But because youborrowed it, you have to give it back atsome point. So, when you close out theshort position, you go back in the market,you buy it back, and then you return thestock to who you borrowed it from. So, youwant to think of that transaction istaking place when you do a short sale.Alright. So we're going to calling this inthis, go back to the Bernoulli example.Let's say X = one, if a success occurs andX = zero, if a failure occurs, okay? So,that's, that's coin lands head, success,coin lands tail failure. Now, theprobability that we have a success, that X= one is were, is been equal to pi and pi

    is some number between zero and one. Andthen the probability of a failure that X =zero is then one - pi. Alright, cuz wehave two events. The sum of the pi willalways have to add to one, so pi + one -pi = one. Now, a simple mathematical modelfor this probability distribution areP(x), we can write as pi^x one - pi^1 - xwhere x only takes two values, zero andone. So, this P(x) function gives us ourprobabilities. Notice that when X is zero,P of zero is pi^0 one - pi^1 - zero. So,that's one - pi. So then, we have pi^0 is

    one. One - pi^1 is one - pi. And then,when X = one, my P of one is pi^1 one -pi^1 - one so that's equal to -pi. So,this very simple mathematicalrepresentation gives us our probabilityfunction for the Bernoulli distribution.Now, the other type of random variablesthat we work at, look at, are calledcontinuous random variables. A continuousrandom variable is one, is a randomvariable that can take on any real value,alright? And so now, we talk about theprobab ility density function of a

    continuous random variable. We're going tohave a probability function that we'regoing to denote as f(x) to distinguish itfrom P(x) for the discrete randomvariable. And this f(x) represents what'soften referred to as the probabilitycurve, okay? Now, the probability curvesatisfies such that, if A is any inte rvalon the real line, the probability that thecontinuous random variable is in this

  • 7/28/2019 Univariate Random Variables

    7/8

    interval is equal to the interval of theprobability curve over that interval. So,in other words, the probability that X is,is in this interval, is the area under theprobability curve over this particularinterval. So, we have a continuous randomvariable, we have a probability curve, andprobabilities are associated with areasunder the curve. Now, this probabilitycurve must satisfy, it always, is alwayspositive cuz we want to compute areasunder a curve. And the total area underthe probability curve is equal to a 100%.So, that's the ideas that the, all theprobabilities add to one. So, if we thinkof a probability curve here, let's say, Xis continuous random variable, here, itsthe probability curve, and I've witnessed,suggestively like a, a bell shape curvelike a normal distribution which we willtalk about later. And we want to say, whatis the probability that this randomvariables between -two and one. So, ourintervals between -two and one and the

    probability of this event is equal to thearea under the probability curve over thisinterval. So, we see that one of thereasons why probability theory withCalculus is useful because in order tocalculate probabilities, we have to findarea under a curve. In order to find areaunder the curve, we have to integrate theprobability function. So, when you take amore mathematically-oriented probabilitytheory course, you do a lot of C`alculusto do these types of calculations. In thisclass, we are not going to do the

    Calculus, calculations, right? We need toknow the concept of doing this and thenif, even if you have to integratesomething, we can do it in r numerically.So, we have the function, one in front ofthe area under the curve, we can write afunction in r to represent the probabilitycurve and then, we can use the functioncalled Integrate to numerically calculatethe area under the curve for us. So, we'regoing to be using tools that will doCalculus for us and, but we need to knowthe concept of, of what's going on,

    alright. A very simple example of acontinuous random variable in adistribution is, is the so-called uniformdistribution over the interval ab. So wesay, x is distributed uniform. So, this isa bit of notation in a probability theory.X represents a random variable. Thislittle squiggle character, characterrepresent, is to be read as is distributeda. So, x is distributed as uniform over

  • 7/28/2019 Univariate Random Variables

    8/8

    the interval ab, okay? The probabilitycurve of the uniform distribution is arectangle. So, if we want the think aboutthe uniform distribution, we have someinterval a to b, and we know that the areaunder the probability curve has to equal a100%. And the idea of a uniformdistribution is that, you know,probability over any interval of the samelength is the same, okay? So, it's a, it'sa way of thinking of like, equalprobability for events of the same size,so to say. So, if this total area has tobe 100%, then we know that length timeswidth is equal to one, so the height ofthe probability curve is one / b - a. So,that represents the probability curve fora uniform end variable. And we know thatthis probability curve is greater or equalto zero provided the, the right end pointis bigger than the left end point. And weknow that the total area under this curve,length times width, if we do theintegration it's equal to one.