The new heroes of trading are math, statistics, and computer science in regards to trading.
The massive amount of trading data is a major reason why quantitative methods are a bedrock. The NYSE has 2-3 million separate trades on a standard day from 9:30am - 4:00 pm. This means that around 100 trades are occurring per second on NYSE.
Stocks can be modelled with a probability of distributions, with probability density function. For example, this is a density model for Tesla.
And here is the density, since the price tends to be the lower end of the spectrum.
It is often reasonable to model a stock price as a random variable. Under normal conditions, it is reasonable to model a stock price as a random video. We should usually use probability numbers to model stock frequencies. For examples, stock X increases by 1% or multiplied by 1.001, etc.
Here's a good question:
A bank is trying to model risks from 100 home mortgages it has provided. Estimates say there is a 1% chance defaulting on mortgage. What is the probability that no one defaults? I'd say (0.99)^1. We can't say that a default or anything is independent across 100 owners or so. This is because default is often correlated, since people in a town can work in the same industry and have similar risks. As a result, this model might be severely underestimating mass default.
Probability and statistics are the foundation of most quantitative models, and allow us to model future outcomes that humans cannot on their own. Stocks that are in similar sectors usually have the greatest amount of correlation. For example, general motors and ford. Models of stocks often evaluate how erratically a price moves, Tesla has major change in stock price a lot.
Let's say a stock is $12 and and should rise to $20 if a drug test is successful and drop to $8 if the failed. If a current stock price is equal to future expected value, then the probability of success is 1/3 since we calculate expected value from there.
The probability of a successful test is p, and the probability of a failed test is 1 - p. The expected value of a stock price is 20 x p + 8 x (1 - p). We want to solve the following:
20 x p + 8 x (1 - p) = 23, which is the probability of success that makes the expected value of the stock = 12. If we solve for p, we get that p = 1/3.
Sometimes the price of a certain asset follows a Markov model which it will increase/decrease miute to minute. For example, if a price increases one minute, is is 80% likely to increase in the next minute. What portion would the stock increase.
Here is the model:
There are 2 ways in the Markov model. It can be increased in the previous minute then again by 0.8 or decreased by 0.4.
p = 0.8(p) + 0.4(1 - p). Expanding this equation is p = 0.4p + 0.4. This simplifies to p = 2/3.
Let's check another problem.
Certain types of traders attempt to repeatedly buy and sell the same asset for a profit over a short time. You can sell a stock for $8.50 and buy it for $8.49 and make 1 cent each time. If the transaction succeeds with probability of 99% how many times can this transaction be executed before the probability of at least one failure exceeds 50%? Try Log 0.99 0.5 and we get around 70 or we can do 1-0.99^n >= 0.5 and figure out what n is equal to, which is around 68.97.
Some people think that value is measured in terms of money, and people and investors make decisions to maximize the expected value of money. This is misleading because this does not account for risk in value.
Most people would not take a bet that a coin is flipped and they double their life savings if it is heads or lose all their assets if it is tails even though the expected value is positive, since the risk outweighs the rewards. Here's the probability equation:
1/2 (-W) + 1/2 (W + 1) which equals to 1/2 and it is not enough for most people to risk all their money. This illustrates that value is much more complicated than an expected value calculation. People's happiness decreases every dollar they receive. $100 to a millionaire is less than $100 to someone who only has $1,000.
Here's a question regarding utility functions:
A trading firm has the utility function U(w) = (w)^(1/2) where w is the wealth of the firm in dollars. Currently, the firm is worth $100,000,000 so their happiness is 10,000 and we want to maximize their expected happiness. There is a risky bet which will succeed with probability p, which will double the wealth of the firm, but if it fails, the firm will go bankrupt. What is the smallest probability in which they will take that bet?
So the utility is they will gain 10,000 happiness, but then the issue is that they will lose 10,000 happiness.
So p(300,000,000) + (1 - p)(-100,000,000) = 0 which is around 70%?
Unfortunately, this is not the case. The answer is right, but this is not how you solve it. It doubles the money in the firm not the happiness, so the expected utility is the following:
p(200,000,000)^0.5 + (1 - p)(0)^(0.5) = p * 10,000 * (2)^0.5
and we want to find where this is higher than the current utility
p x 10000 x (2)^(0.5) > 10,000, this p = (2)^(-0.5). which is around 0.70710.
So there is an aspect for diminishing returns for wealth, and there is also an effect of time on the amount of money.
The most an individual can pay to receive $1,000 one year from now is around a little less than $1,000 since you would charge your service for lending money.
If money is compounded with an annual interest rate of 1%, it would take around 70 years for this money to double. This is because the probability equation is P x e^(0.01n), where if we set this equal to 2p, n = ln(2)/0.01 which is equivalent to 69. It's very likely people will look at other forms of investment to get a higher rate of interest.
Now the next part is probability in financial markets. Probability is found everywhere, because the financial markets are full of uncertainty, and we must be able to quantify that uncertainty and make predictions.
One question is that red and blue 20-sided dice numbered 1-20 are rolled. What is the probability that the number on the red die is greater than the number on the blue die? So there are 400 different combinations. 1 has 19 combinations that are greater, 2 has 18, etc all the way up to 0 so 19 + 18 + 17 + .... + 1. This is 20 x 9 + 10 which is 190, so I'm thinking it's 19/40. Here's the simple explanation:
The probability of a tie is 1/20 and the other 19/20 the die is larger than the other one, so the probability one die is greater than the other is 1/2 * 19/20 = 19/40.
Let's say Alice rolls a five-sided die and Bob rolls a 10-sided die, what is the probability that Alice wins? Again here's my logic for it:
There are 50 possibilities. 4/20 chance for number 5, 3/20 for number 4, 2/20 for number 3, and 1/20 for number 4. Thus there are only 4 + 3 + 2 + 1 possibilities, bringing the probability of Alice winning to 10/50 or 1/5 (20%). Here's the simple explanation:
If Bob rolls a number 1-5 it reduces to a simpler idea, and they would have a 1/5 chance in tying and an equal chance of rolling a higher number. So Alice would win half of these time, which would be around 2/5. However when Bob rolls 6-10 he automatically wins. Thus, the total probability would be (1/2) x (2/5), or 20%.
So 5 fair coins are flipped. What is the probability of more than half of them being heads? So, there are 32 possibilities. 1 possibility for all heads, 1 for all tails, then 5 for 1 head, 5 for one tail, and 10 for both 2-3 combinations. Which means that probability would be 16/32 or 1/2.
This is because of the law of symmetric, and there are an odd number of coins flipped which means there are no ties, which means the probability of more heads than tails is 1/2. anot
Here's another one:
Amy flips 3 coins, while Brad flips 4 coins. What is the probability that Brad flips more heads than Amy. I can try it this way.
If Amy flips 3 coins Brad flips 3 coins, due to the law of odd numbers the probability Brad flips more heads than Amy is around 50%, and adding one more coin gives 4/3 more probability of this happening. Thus, there is a 2/3 chance brad flips more heads than Amy?
Unfortunately, this is not true.
The probability of Amy getting 0 heads is 1/8 then 1 head is 3/8, 2 heads is 3/8, and 3 heads is 1/8.
As for brad, for 0, 1, 2, 3, 4 heads the probability is 1, 4, 6, 4, and 6, respectively. Let P(A) be the outcome for Amy, and P(B) be the probability that Brad beats that outcome. ∑P(A)⋅P(B) is (1/8 x 15/16) + (3/8 x 11/16) + (3/8 x 5/16) + (1/8 x 1/16), which the total of these sums are 1/2. The expected number of heads for the first n coin flips is the same in both cases. However, in the one additional flip, the probability that it comes up heads is 1/2.
Another use of probability is modelling the likelihood of change. The stock can go up or down with a probability, which forms the basis of more complex levels in quantitative finance.
Here's a good question:
Every day, a stock goes up 1% with probability of 0.5 or down 1% with probability 0.5. After 4 days, what is the probability that stock price is greater than it's started?
Probability it stays the same is 1/16 so 15/16 or 30/32. Which means 15/32. No, It's 5/16! Why is that? Because there are 2^4 or 16 equally likely outcomes. When the stock goes down 1% the price is multiplied by 0.99, and 1.01 if the stock goes up 1%.
Since 0.99^2 * 1.01 ^2 = 0.99980001. So it's only if there's 3 or more up days. There's only 1/16 chance for 4 up days, and 4/16 for 3 up days and 1 down day, so there's only a 5/16 chance for there to be 3 or more "up" days for the stock.
The probability that at least one company is going to announce a takeover in the next hour is 84%. How about the next 30 minutes?
I also got this wrong, because of the probabilistic principle of inclusion and exclusion. The probability that at least ONE company announces a takeover in the next hour is 84%, and in some one hour periods, more than one company might announce a takeover.
If the desire probability is p, the probability no announcement in half an hour is 1 - p, so the probability of no announcement in the next hour is (1 - p) ^ 2 =0.84 and 1 - p = (0.16) ^ (1/2) = 0.4 so the probability that there is an announcement is 60%.
The next topic is conditional probability. This is the science of updating probabilistic beliefs based on new information. The probability of rolling a 6 is 1/6, if your friend say a number is even then 1/3. The conditional probability of "A given B" is denoted as P(A|B).
If A and B are independent events, the result of one event does not affect one another; therefore, P(A|B) = P(A).
If the sum of numbered rolled is even, the probability that all 3 numbers were rolled as even considering that the sum of the dice is even is 1/4 because there is EEE, EOO, OEO, OOE for even sum and out of all of these, 1 of them is all evens, thus making the conditional probability 1/4.
Now Bayes' Theorem is an important theory in terms of conditional probability. Bayes' theorem is the following:
P(A|B) = (P(B|A) * P(A)) / (P(B)).
Now, let's practice a problem pertaining to this.
On any given day, the probability that General Motors (GM) and General Electric (GE) both go up is 40% and the probability that they both go down is 20%. If you Know that at least one went up, what is the probability that both wen up.
P(A goes up | B goes up) = P(B goes up | A goes up) * P(A goes up) / P(B goes up)
So the probability of one stock going up and the other going down is around 40%. This means the probability of A going up is 20% + 40% = 60% and the probability that B goes up is the same. This indicates that 0.4 (0.6) / (0.6) = 0.24/0.6 which equals about 0.4? Unfortunately, this is wrong AGAIN!
We don't need to use Baye's rule for this. If there's a 40% chance that both go up and 40% chance is mixed, the probability that one stock goes up given the other goes up is 50%.
You have a jaw with 4 fair coins and 1 unfair coin. You choose 1 coin at random, flip if 5 times, and get all heads. What is the probability that you choose the unfair coin?
Probability(given the unfair coin if you get 5 heads) = P(5 heads given you get unfair coin) P(unfair coin) / (P(5 heads))
= 100 % * (1/5) / ((4/5 * 1/32) + 1/5 * 1) = 8/9. which is an illustration of Bayes' Theorem.
Now it's time to tackle a Monty Hall problem. Here it is.
There is a game show with 3 doors and you choose door #1. According to the rules, the host will open the door with a goat. Should you stick with your original door, or switch?
You have 1/3 chance of getting the million dollar car. Now the host reveals there's a goat. The probability of picking the car is still 1/3, but in 2/3 of cases you are sitting on the door with a goat, meaning that the door that he didn't eliminate has a 2/3 probability of a golden car. Thus, you want to switch.
Now there's a slight variant of the next problem. Behind one door is a pot of gold and behind the other door contains rocks. Again, choosing 1, but now the host pulls a lever and randomly open up one of the doors you didn't choose, and now to relief, that door has rocks. Should you stick with door 1 or switch to door 2? What should you do now?
The correct answer is that it doesn't matter. Use Bayes' theorem for this. P(G|R) = P(R|G) x P(G) / P(R).
1 x 1/3 / ((1/3 * 1) + (1/3 * 1/2) + (1/3 * 1/2)) = 1/3. This doesn't add information to door 1, so it doesn't really matter. The (1/3 * 1) is if gold is already revealed, then the probability of the rock on the other door will be 1.
Now goes to the practice interview question. This needs a good thought process, and breaks down 2 problems into their logical steps.
A 3x3 cube is painted red, then cut into 27 1x1x1 cubes. What if the probabilitities that a cube lands with a painted side facing up?
There are 6 faces, or 54 mini faces, and each cube which is a 3x3x3 has 6 faces, 27 * 6 = 162. 54/162 = 1/3?
That was a simple problem. Let's go to the next problem.
There are 2 boxes, each with 3 balls. Box A has 2 red balls and 1 blue ball, and Box B has 1 red ball and 2 blue balls. I randomly choose a box and draw a red ball. If I draw another ball from the same box, what is the probability that it is also red?
There is a 1/2 chance of choosing box A and a 2/3 chances of drawing a ball from box a, given that we have a red ball. For box b this probability is 1/6. (1/3) / (1/3 + 1/6) = 2/3.
To answer the question, the probability of choosing box a is 1/2 and box b is 1/2. Now the probability of choosing a red ball from box b is 0 and from box a is 1/2. So (1/2) (1/2) + (1/2) (0) = 1/4.
This is incorrect, though the answer is relatively close. The probability of getting a red ball from box A is 1/3 and drawing another red ball is 1/2. The probability of getting a red ball from box B is 1/3 and drawing another red ball is 0. (2/3) x (1/2) + (1/3) x 0 = 1/3.
Another thing that we need to calculate is expected value. Here it is
A stock is currently trading at $50. Tomorrow it will announce either good news and rise to $55 or bad news and fall to $40s. What do you do if the probability of good news is 80%? Should you buy or sell the stock?
We can do an expected value analysis here. Perform 55 * (0.8) + 40 * (0.2) = $52, which means you should buy the stock for $50, to bank an expected profit of $2. This is the formula for expected values:
∑ x⋅P(X=x) where x∈S and S is the set of values that X takes.
The next question is about stock trading:
A stock is trading at $15. Tomorrow it will announce either good news (rise to $20) or bad news, given that the stock is trading at its post-expected value?
I correctly guessed it's 2/5. Let me go over the math for this.
20p + 10(1 - p) = 14
20p + 10 - 10p = 14
10p = 4
Which in turn gives p = 2/5.
One of the most important properties of expected value is the linearity of expectation, meaning that E(X + Y) = E(X) + E(Y). That is the expected value of the sum of 2 variables is equal to the sum of their expected values, even if these variables are dependent on each other.
Here's a problem:
The price of stock A in one month is normally distributed with a mean of $100 and a standard deviation of $25. The price of stock B in one month is normally distributed with mean of $50 and standard deviation of $5. If you buy 3 shares of stock A and sell 2 shares of stock B, what is the expected value in one month? They have a correlation of 90%.
I'd say -$200, but I have no idea how to do this problem. The answer is 200 because 3E(A) - 2E(B) = 300 - 100 = 200. The volatility might factor the decision whether to buy or sell a stock, but it doesn't affect its expected value.
Now, you are trading a weather contract that pays out $1 each day it rains on a 7-day week. If the probability of rain is 20% what is the fair value of this 7 day contract? It's (7/5) * 1 or $1.40??
A useful construct for exploiting linearity of explanation is the indicator variable. It is 1 when some event occurs, and 0 otherwise.
1n is the indicator variable on the event of rain on day n.
The expected number of rainy days is E(11 + 12 + ... + 17) and by linearity of expectation is E(11) + E(12) + ... + E(17).
You flip 10 coins and are paid $1 for each consecutive pair of heads. For example, if you flipped TTHHHTHHTT you would be paid $3. What is the expected value of this game in dollars?
So let's have Xk be an indicator variable on the even that the kth and (k + 1)st flips are both heads. The expected value for and Xk is (1/4) * 1 + (3/4) * 0 = 1/4. There's 9 of these for numbers 1, 2, 3, 4, 5, 6, 7, 8, 9. The total expected value is 9 * 1/4 or 9/4 which is 2.25.
The only coin that matters on the third flip is the second flip and it doesn't matter what the first flip is. That's the intuition behind this problem.
Here's another problem.
A work event gets very rowdy and no one can remember what coat they bought, so each person takes a random coat as they leave. What is the expected number of people who got the correct coat? For any person, the probability is 1/100 and for 100 people 1 person probably picked their coat correctly.
Now a utility function is a way of measuring one's "happiness" as a function of wealth denoted as U(w). The log(w) function is the most reasonable approximation for a human's utility function in terms of their total wealth in dollars, since multimillionaires don't really save loose change. Another reasonable heuristic would be (w)^(1/2).
Now the next question is that Tony has a utility function of U(w) = (w)^(1/2) and an initial wealth of $100. A coin will be flipped once, and if it is heads he will gain $21 and if it is tales he will lose $20. What is the value of the utility?
It would be 1/2 x (121)^(0.5) + 1/2 x (80)^(0.5) would be Tony's total expected utility when initially it was 100.
The expected utility hypothesis states that a firm will try to maximize their expected utility rather than their expected wealth. It illustrates how a specific utility function can have someone pass up a bet that has the positive expected value. Charging for risk is ensuring that the bet has enough positive expected value to compensate for the risk of loss. People don't take bets unless a return is huge or the bets don't have the potential to bankrupt them. However, things can go awry with a risk-neutral utility function.
Now the next question involves a trader being presented with a game as a one-time offer, and a fair coin is flipped until a head appears and you will be paid ($2^n) if there are n flips. What is the most that someone would pay to play this game?
-x + 2 (1/4) + 4(1/8) + 8(1/16) + ..... = 0.
The probability of the flips is 1/2^n so what is the expected value of the game?
If a person pays $P to play the game, then her expected value in dollars is
100 - P + ∑ (n = 1 to ∞) of (1/(2^n) * 2*n) which will be equivalent to infinity since for every 2 times so she gets $1 for every flip that she does. There are flaws to this, since you wouldn't want to pay $100 for a $2 gain 50% of the time.
Now this time, the manager tells a trader to optimize the utility function, which would be ∑ (n = 1 to ∞) (1/(2^n)) * loge(x + 2^n). To play this game, there should, ideally, be a utility of zero.
If, given this graph, you can clearly see that the expected utility is around $8.
From the graph, the expected utility will exceed utility around x = $92, so this means that the lady would be willing to pay slightly less than $8, which is denoted by equation 100 - ∑ (n = 1 to ∞) (1/(2^n)) * loge(x + 2^n) since $100 is the initial wealth. We just see when the expected utility will exceed doing nothing.
Here's another question:
Our trader still has $100 and is optimizing the utility function.
1/2 log (100 - 10) + 1/2 log(100 + 20) > 1/2 log (100 - X) + 1/2 log (100 + 5X), where x = 40 + 12 (10)^(1/2) = 77.95 or X = $78, she would prefer offer 1 even though it gives her lower expected wealth.
Utility functions define a measure of "risk tolerance" for an individual or firm. U(w) = log(w) played a key in determining when a trader would prefer the lower risk bet over the higher risk bet. Even the utility function that behave like U(w) = log(w) and U(w) = w ^ (0.5) indicate much different levels or risk tolerance, for these 2 utility functions.
The next question is a very friendly casino manager is running a promotion which for $1 he will pay a fir coin and if it is heads you get $1 plus a bonus of (x). Alice has a utility function of log(w) and Bob has utility function of (w)^(1/2) and if they they both have wealth $100, who is more likely to play the game?
Alice plays if bonus satisfies log(100) < 0.5 log(100 + x) + 0.5 log(99) or x > 1.01.
and Bob plays if the bonus satisfies 10 < 0.5 (100 + x) ^1/2 + 0.5 (99) ^(1/2) or x > 1.005. Thus, Bob is more likely to play than Alice since his standards are met more easily.
Now Stellla has a car worth $22,500 and additional assets worth $40,000 and utility function of U(w) = (w)^(0.5). She believes there is a 10% chance of being in an accident which destroys her car, but the insurer will give her the full value of policy if that happens. How much will she pay for this insurance?
(22,500) ^ (0.5) < 0.9 * (22,500)^0.5 + 0.1 * (x)^0.5.
This is not how you do it. The following is the real way:
Stella has a car worth $22,500 and additional assets worth $40,000. There's a 10% chance of the car being destroyed but insurer will offer a policy that gives full value of the car. How much would Stella be willing to pay for insurance?
When she doesn't have insurance her expected utility is (0.9) (62,500)^(1/2) + (0.1)(40000)^0.5 = 245, and she would be willing to pay any amount with that expected utility which will be (62500 - X) ^(1/2) since X is the constant of insurance. X would equal to around $2,475. Now if it is linear, she only pays $2,250 and is satisfied.
A good thought process is better than a correct answer with no reasoning. Let's go over a problem:
An ant is on a vertex of a tetrahedron, and every second, it randomly chooses one of the other 3 vertices and crawls to that vertex. What is the expected number of seconds until it has visited every vertex?
So we have to figure out how many seconds, on average, that the ant will take in order to reach the vertex.
I first want to see what the probability that the ant visits all 4 vertices in 3 seconds is, which is the minimum possible number of vertices. Probability of Ant visiting a different vertex every time, which equals to P(diff second vertex) * P(different third vertex) * P(different final vertex)
Which means that 1 * (2/3) * (1/3) = 2/9.
Now we want to define some variables in order to help to solve the original problem. What would be helpful?
Xi, the expected number of distinct vertices visited after i seconds, or Xi, the expected number of seconds until i distinct vertices have been visited? Expected value isn't reversible, the expected number of vertices after n seconds won't give us the expected number of seconds needed to visit n vertices. B is the expected number of seconds until i distinct vertices have been visited, so that we can subsequently compute X4.
X1 is zero because the ant visits one vertex when the time is at zero, at the initial point. X2 if there is a 2/3 chance of visiting vertex 2, it would be X2 = 1, since the and has a 100% chance of moving to an unvisited vertex, given that the ant moves to a different point every time. The probability of the ant visiting the new vertex at the next step is 2/3. Out of 3 possible steps, there's only 1 "bad" step.
The next question is what is the expected number of steps between visiting the second distinct vertex and the third distinct vertex. Note that there would be 1.5 steps. This is a geometric distribution problem with success probability 2/3.
The number of additional steps would be that the ant would have a 2/3 chance of getting to a distinct vertex if the ant goes back to the none distinct vertex, so the number of additional steps is (2/3)(1) + (2/(3^2)) (2) + (2/(3^3)) * 3 + ... + (2/3^n)(n) which would yield 3/2 or we can do this with recursive expected values as well as 1 + 2/3 (0) + 1/3 (E).
Using the same logic, what is the expected number of seconds between visiting the third vertex and the final vertex? There are 3 vertices to travel, only 1 that works, so 1/3. Remember the success probability is 1/3 and this can be solved through intuition, or by solving the following Geometric distribution:
Σ (n = 1 to ∞) (n x 2^(n - 1) / (3 ^ n)) = (1/3)(1) + 2/(3^2)(2) + ... + 2^(n - 1)/(3^n) (n) = 3. Try to calculate all of the future distributions. Thus the total expected time in seconds is 0 seconds for the first vertex, 1 second for the second vertex, 1.5 seconds for the third vertex and 3 seconds for the final vertex. 0 + 1 + 1.5 + 3 = 5.5.
Looking at the pattern reaching the k - 1th index had an expectation of 3/(4 - k).
Now the next topic that I want to cover is variance, which measures the "spread" of a random variable, where var(X) = E((X - E(X))^2). Through expansion, we can get variance to equal var(X) = E(X^2) - E(X)^2. The standard deviation is the square root of the variance. These are both used widely in quantitative finance to model the fluctuation of assets, and assess and quantify risk.
The standard deviation has the same units as the data it measures. This is not the same thing as variation, which measures in units squared, or σ^2.
If one set has variance 6, I believe the other set {2x1 2x2 ... 2xn} will have variance 24 in comparison. If we add 2, the variance of the data set remains the same for all the elements. This proves that a linear shift does not change the variance of the set.
Now what is the variance of the number of results of a single roll of a fair six-sided dice?
I guessed 35/12 since this is the number that has the closest result to 3.
This is (1/6) (1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2) - (1/6)^2(1 + 2 + 3 + 4 + 5 + 6)^2 = 35/12 or 2.9167.
There are 2 ways of variances, rolling a single die and adding that number to itself, or rolling 2 die and adding the results. Do these 2 have the same variance? I don't think so, but let's see.
Find ordered pair A, B. B will be around 35/6. A will be the variance of (2X) which is 4 * 35/12 which is 35/3.
The next question deals with flipping a fair coin. If it comes up heads, roll a fair six-sided die else roll a fair four-sided dice. What is the variance of the number that I obtain throughout this process?
First let's figure out the variance of flipping a fair coin, which is var(X) = E(X^2) - E(X)^2.
(0.5) (1^2 + 0^2) + (0.5(1 + 0)) ^2 = 0.5 + 0.25 which will equal around 0.75. Now the variance when there are heads is 35/12 and the variance when there is tails is (1/4) (1^2 + 2^2 + 3^2 + 4^2) - ((1/4) (1 + 2 + 3 + 4))^2 = (10/4) ^2 + (30/4) which is around 120/16 - 100/16 which is 20/16 or around 1.25.
Unfortunately, this is not the way to do it; instead, we were supposed to combine all of the expected variances together.
We do (1/2)((1/6) + (1 + 2 + 3 + 4 + 5 + 6)) + (1/2) ((1/4) ( 1 + 2 + 3 + 4)) = 3, meaning that E(X^2) is 9. We know E(X^2) = (1/2) ((1/6) (1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2)) + (1/2) ((1/4)(1^2 + 2^2 + 3^2 + 4^2)) = 34/3 which means the variance is 34/3 - 9 = 7/3.
Now the next topic is covariance, which generalizes the concept of variance to multiple random variables. Covariance generalize this concept of variance to multiple random variables, and instead of measuring the fluctuation of a single random variable, the covariance measures the fluctuation of two variables with each other. This covariance measure is defined as cov(X,Y) = E[(X - E[X]) (Y - E[Y])]. This is important in quantitative finance since many different assets are correlated with each other, so understanding how they fluctuate with respect to each other becomes extremely important for using one asset to help to price another, or use one asset as a hedge for another.
So the first question I want to answer is Cov(X, X) which would be E[(X - E(X)) (X - E(X))] which is E(X^2 - 2E[X] - E[X]^2), which would probably just look like the variance variable since cov(X, X) = E(X^2) - E(X)^2.
So let X be {1, 2, 3, 4, 5} and let Y be 1/x. We want to compute the covariance between (X,Y) here. Let's do the expectation of the value of X which will be 1/5 ( 1 + 2 + 3 + 4 + 5) = 3. Now, let's obtain the expected value of Y which is denoted as 1/5 (1 + 1/2 + 1/3 + 1/4 + 1/5) = 0.45666666666. c
X - E(X) is going to be X - 3 and Y will be Y - (0.45666666666) so then we just basically multiply them and get XY - 0.45666666666Y - 3X + 1.37.
Unfortunately, this is also wrong, and this would be better denoted as E(XY) - E(X)E(Y) which = 1 - 3 x 0.45666666666 which equals to 1 - 1.37 which is equivalent to -0.37.
Now let's have X be the result of a fair six-sided die, and we are to compute the covariance between X^2 and X, or cov(X^2, X). Which would be E(X^3) - E(X)E(X^2). 1/6 (1^3 + 2^3 + 3^3 + 4^3 + 5^3 + 6^3) - 3 * 1/6 (1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2).
E(X) = (1/6) (1 + 2 + 3 + 4 + 5 + 6) = 3.5
E(X^2) = (1/6) (1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2 ) = 91/6.
E(X^3) = (1/6) (1^3 + 2^3 + 3^3 + 4^3 + 5^3 + 6^3 ) =147/2.
cov(X^2, X) = E(X^3) - E(X ^ 2) E(X) = 245/12.
Now, we can come up with the following sum:
var(X + Y) = var(X) + var(Y) + 2 cov(X,Y).
var(X^2) + X = var(X^2) + var(X) + 2 cov(X^2, X).
Which would be E(X^4) - (E(X^2)^2) + E(X^2) - E(X)^2 + 2 cov(X, X^2)
E(X^4) = 1/6 (1^4 + 2^4 + 3^4 + 4^4 + 5^4 + 6^4) = 2275/6.
Now we figure out and derive the equation of 2275/6 - 91^2/36 + 91/6 - 49/4 + 245/6 = 1736/9.
Covariance can also study models of stock prices.
For example, every day the price of a stock increases with a probability of 1/3 and decreases with a probability of 2/3. Let U be the # days it goes up and D be the number of days it goes down. Define cov(X,Y) = E[(X - E[X]) (Y - E[Y])], or E[XY] -E[X]E[Y] where E[Y] would be a negative number, which indicates E[X]E[Y] would be a positive number. E[XY] would be neglibigle, since we don't know how much the stock goes up or down.
Unfortunately, this is wrong. Here's why:
E(U) = 10 x 1/3 which would be 10/3 days it goes up, and the remaining 20/3 days that the stock prices move down.
The covariance is E(UD) - E(U)E(D) and D is 10 - U. So E(UD) = E(U(10 - U)) = E(10U - U^2) = 10 E(U) - E(U^2) which will be var(U) + E(U)^2, so then E(UD) = 10E(U) - var(U) - [E(U)]^2 which would be 10 x 10/3 - 20/9 - (10/3) ^ 2 or 20. So cov(U,D) = E(UD) - E(U)E(D) = 20 - 10/3 x 20/3 which would be -20/9. Thus this would make the variance equal to a negative number.
From the definition of correlation as cov(A, B) /((var A * var B)^(0.5)). the we can solve 0.5 = cov(A, B) / ((4)^(0.5) x (9) ^ (0.5)) so the final covariance is 3.
Then var(A + B) = var(A) + var(B) + 2 cov(A, B) = 4 + 9 + 6 = 19, which is the variance of the sum of the prices of the stock.
The next trend is on individual variables.
Comments
Post a Comment