my-markdown-library 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/F24LS_md/ Lecture 4 - Public.md +347 -0
  3. data/F24LS_md/Lecture 1 - Introduction and Overview.md +327 -0
  4. data/F24LS_md/Lecture 10 - Development_.md +631 -0
  5. data/F24LS_md/Lecture 11 - Econometrics.md +345 -0
  6. data/F24LS_md/Lecture 12 - Finance.md +692 -0
  7. data/F24LS_md/Lecture 13 - Environmental Economics.md +299 -0
  8. data/F24LS_md/Lecture 15 - Conclusion.md +272 -0
  9. data/F24LS_md/Lecture 2 - Demand.md +349 -0
  10. data/F24LS_md/Lecture 3 - Supply.md +329 -0
  11. data/F24LS_md/Lecture 5 - Production C-D.md +291 -0
  12. data/F24LS_md/Lecture 6 - Utility and Latex.md +440 -0
  13. data/F24LS_md/Lecture 7 - Inequality.md +607 -0
  14. data/F24LS_md/Lecture 8 - Macroeconomics.md +704 -0
  15. data/F24LS_md/Lecture 8 - Macro.md +700 -0
  16. data/F24LS_md/Lecture 9 - Game Theory_.md +436 -0
  17. data/F24LS_md/summary.yaml +105 -0
  18. data/F24Lec_MD/LecNB_summary.yaml +206 -0
  19. data/F24Lec_MD/lec01/lec01.md +267 -0
  20. data/F24Lec_MD/lec02/Avocados_demand.md +425 -0
  21. data/F24Lec_MD/lec02/Demand_Steps_24.md +126 -0
  22. data/F24Lec_MD/lec02/PriceElasticity.md +83 -0
  23. data/F24Lec_MD/lec02/ScannerData_Beer.md +171 -0
  24. data/F24Lec_MD/lec02/demand-curve-Fa24.md +213 -0
  25. data/F24Lec_MD/lec03/3.0-CubicCostCurve.md +239 -0
  26. data/F24Lec_MD/lec03/3.1-Supply.md +274 -0
  27. data/F24Lec_MD/lec03/3.2-sympy.md +332 -0
  28. data/F24Lec_MD/lec03/3.3a-california-energy.md +120 -0
  29. data/F24Lec_MD/lec03/3.3b-a-really-hot-tuesday.md +121 -0
  30. data/F24Lec_MD/lec04/lec04-CSfromSurvey-closed.md +335 -0
  31. data/F24Lec_MD/lec04/lec04-CSfromSurvey.md +331 -0
  32. data/F24Lec_MD/lec04/lec04-Supply-Demand-closed.md +519 -0
  33. data/F24Lec_MD/lec04/lec04-Supply-Demand.md +514 -0
  34. data/F24Lec_MD/lec04/lec04-four-plot-24.md +34 -0
  35. data/F24Lec_MD/lec04/lec04-four-plot.md +34 -0
  36. data/F24Lec_MD/lec05/Lec5-Cobb-Douglas.md +131 -0
  37. data/F24Lec_MD/lec05/Lec5-CobbD-AER1928.md +283 -0
  38. data/F24Lec_MD/lec06/6.1-Sympy-Differentiation.md +253 -0
  39. data/F24Lec_MD/lec06/6.2-3D-utility.md +287 -0
  40. data/F24Lec_MD/lec06/6.3-QuantEcon-Optimization.md +399 -0
  41. data/F24Lec_MD/lec06/6.4-latex.md +138 -0
  42. data/F24Lec_MD/lec06/6.5-Edgeworth.md +269 -0
  43. data/F24Lec_MD/lec07/7.1-inequality.md +283 -0
  44. data/F24Lec_MD/lec07/7.2-historical-inequality.md +237 -0
  45. data/F24Lec_MD/lec08/macro-fred-api.md +313 -0
  46. data/F24Lec_MD/lec09/lecNB-prisoners-dilemma.md +88 -0
  47. data/F24Lec_MD/lec10/Lec10.2-waterguard.md +401 -0
  48. data/F24Lec_MD/lec10/lec10.1-mapping.md +199 -0
  49. data/F24Lec_MD/lec11/11.1-slr.md +305 -0
  50. data/F24Lec_MD/lec11/11.2-mlr.md +171 -0
  51. data/F24Lec_MD/lec12/Lec12-4-PersonalFinance.md +590 -0
  52. data/F24Lec_MD/lec12/lec12-1_Interest_Payments.md +267 -0
  53. data/F24Lec_MD/lec12/lec12-2-stocks-options.md +235 -0
  54. data/F24Lec_MD/lec13/Co2_ClimateChange.md +139 -0
  55. data/F24Lec_MD/lec13/ConstructingMAC.md +213 -0
  56. data/F24Lec_MD/lec13/EmissionsTracker.md +170 -0
  57. data/F24Lec_MD/lec13/KuznetsHypothesis.md +219 -0
  58. data/F24Lec_MD/lec13/RoslingPlots.md +217 -0
  59. data/F24Lec_MD/lec15/vibecession.md +485 -0
  60. data/F24Textbook_MD/00-intro/index.md +292 -0
  61. data/F24Textbook_MD/01-demand/01-demand.md +152 -0
  62. data/F24Textbook_MD/01-demand/02-example.md +131 -0
  63. data/F24Textbook_MD/01-demand/03-log-log.md +284 -0
  64. data/F24Textbook_MD/01-demand/04-elasticity.md +248 -0
  65. data/F24Textbook_MD/01-demand/index.md +15 -0
  66. data/F24Textbook_MD/02-supply/01-supply.md +203 -0
  67. data/F24Textbook_MD/02-supply/02-eep147-example.md +86 -0
  68. data/F24Textbook_MD/02-supply/03-sympy.md +138 -0
  69. data/F24Textbook_MD/02-supply/04-market-equilibria.md +204 -0
  70. data/F24Textbook_MD/02-supply/index.md +16 -0
  71. data/F24Textbook_MD/03-public/govt-intervention.md +73 -0
  72. data/F24Textbook_MD/03-public/index.md +10 -0
  73. data/F24Textbook_MD/03-public/surplus.md +351 -0
  74. data/F24Textbook_MD/03-public/taxes-subsidies.md +282 -0
  75. data/F24Textbook_MD/04-production/index.md +15 -0
  76. data/F24Textbook_MD/04-production/production.md +178 -0
  77. data/F24Textbook_MD/04-production/shifts.md +296 -0
  78. data/F24Textbook_MD/05-utility/budget-constraints.md +166 -0
  79. data/F24Textbook_MD/05-utility/index.md +15 -0
  80. data/F24Textbook_MD/05-utility/utility.md +136 -0
  81. data/F24Textbook_MD/06-inequality/historical-inequality.md +253 -0
  82. data/F24Textbook_MD/06-inequality/index.md +15 -0
  83. data/F24Textbook_MD/06-inequality/inequality.md +226 -0
  84. data/F24Textbook_MD/07-game-theory/bertrand.md +257 -0
  85. data/F24Textbook_MD/07-game-theory/cournot.md +333 -0
  86. data/F24Textbook_MD/07-game-theory/equilibria-oligopolies.md +96 -0
  87. data/F24Textbook_MD/07-game-theory/expected-utility.md +61 -0
  88. data/F24Textbook_MD/07-game-theory/index.md +19 -0
  89. data/F24Textbook_MD/07-game-theory/python-classes.md +340 -0
  90. data/F24Textbook_MD/08-development/index.md +35 -0
  91. data/F24Textbook_MD/09-macro/CentralBanks.md +101 -0
  92. data/F24Textbook_MD/09-macro/Indicators.md +77 -0
  93. data/F24Textbook_MD/09-macro/fiscal_policy.md +36 -0
  94. data/F24Textbook_MD/09-macro/index.md +14 -0
  95. data/F24Textbook_MD/09-macro/is_curve.md +76 -0
  96. data/F24Textbook_MD/09-macro/phillips_curve.md +70 -0
  97. data/F24Textbook_MD/10-finance/index.md +10 -0
  98. data/F24Textbook_MD/10-finance/options.md +178 -0
  99. data/F24Textbook_MD/10-finance/value-interest.md +60 -0
  100. data/F24Textbook_MD/11-econometrics/index.md +16 -0
  101. data/F24Textbook_MD/11-econometrics/multivariable.md +218 -0
  102. data/F24Textbook_MD/11-econometrics/reading-econ-papers.md +25 -0
  103. data/F24Textbook_MD/11-econometrics/single-variable.md +483 -0
  104. data/F24Textbook_MD/11-econometrics/statsmodels.md +58 -0
  105. data/F24Textbook_MD/12-environmental/KuznetsHypothesis-Copy1.md +187 -0
  106. data/F24Textbook_MD/12-environmental/KuznetsHypothesis.md +187 -0
  107. data/F24Textbook_MD/12-environmental/MAC.md +254 -0
  108. data/F24Textbook_MD/12-environmental/index.md +36 -0
  109. data/F24Textbook_MD/LICENSE.md +11 -0
  110. data/F24Textbook_MD/intro.md +26 -0
  111. data/F24Textbook_MD/references.md +25 -0
  112. data/F24Textbook_MD/summary.yaml +414 -0
  113. metadata +155 -0
@@ -0,0 +1,101 @@
1
+ ---
2
+ title: CentralBanks
3
+ type: textbook
4
+ source_path: content/09-macro/CentralBanks.ipynb
5
+ chapter: 9
6
+ ---
7
+
8
+ # Central Banks
9
+
10
+ Understanding the levels and relationships between the four main macro indicators mentioned in the previous section is of particular interest to a country’s central bank.
11
+
12
+ One way to think about a central bank is that it acts as the “bankers’ bank”. Wells Fargo, Barclays, and many of the other commercial banks that we’re familiar with are regulated and overseen by a given country’s central bank. That’s just a simple way to consider it, but in practice central banks play a much larger role beyond this.
13
+
14
+ Diving deeper, a central bank is a politically-independent financial institution that is responsible for overseeing the monetary system of a country. This mainly involves doing so by setting interest rates and regulating how much money circulates throughout the economy. Central banks closely monitor and forecast the aforementioned indicators in order to carry out these responsibilities and conduct monetary policy as needed. An important feature of central banks is that they exist independently from the government, meaning the actions they take are not influenced by political pressure nor do they have to go through a congressional body to carry out their policies.
15
+
16
+ While central banks across countries differ slightly in their mandates, for the most part they share a common vision in their functions and responsibilities. For example, these include
17
+ - Keeping unemployment low
18
+ - Maintaining price stability while managing a healthy level of inflation
19
+ - Stimulating the economy in times of recession
20
+ - Overseeing the commercial banking system and serving as a lender of last resort
21
+ - Carrying out economic research and statistical analysis (yay data science!)
22
+ - and [tHere is more in this article called the "Fed Explained"](https://www.federalreserve.gov/aboutthefed/the-fed-explained.htm)
23
+
24
+ When you hear the terms monetary policy or macroeconomic policy, you can think of it as encompassing what’s listed above. In short, **monetary policy** is the set of actions that a central bank takes to achieve sustainable economic growth, and much of it revolves around adjusting interest rates and the money supply.
25
+
26
+ In this chapter we’ll take a closer look at the central bank that serves the United States, known as the **Federal Reserve System.**
27
+
28
+ The Fed was established in 1913 to promote stability and flexibility within the United States’ monetary and financial system.Led by the Chair and the Board of Governors, the Fed is comprised of a network of 12 regional banks that serve as the operating arms of the system. Together they guide monetary policy action as well as analyze domestic and international economic conditions.
29
+
30
+ [Figure: Map of Federal Reserve Regions]
31
+
32
+ ![regionalbanks.png](regionalbanks.png)
33
+
34
+ *Here’s a graphic showing the locations of the 12 different regional banks. If you’re ever interested you can go take a tour of the Federal Reserve Branch in SF right on Market St!*
35
+
36
+ The current Federal Chairman is Jerome Powell, who you’ve probably heard about in the news lately. He’s got quite a bit on his plate with inflation running the highest it’s been in over four decades. Before him came Berkeley’s own Janet Yellen who served from 2014-2018 and was the first woman to hold the position, Ben Bernanke (2006-2014) who helped the US recover from the Great Recession, Alan Greenspan (1987-2006), the “rock star of economics, and Paul Volcker (1979-1987) who is famously known for setting incredibly high interest rates to combat high inflation in the 80s. There have been many [other Chairs](https://www.federalreservehistory.org/people/federal-reserve-chair) as well since the Fed was first established in the early twentieth century.
37
+
38
+ [Figure - cartoon of different Fed chairs, comparing their heights to interest rates in their tenure]
39
+
40
+ ![chairs.png](chairs.png)
41
+
42
+ *The Federal Funds Rate is a nominal interest rate like we discussed earlier in the chapter. Interest rates, which can be thought of as the cost of borrowing, are set low to stimulate the economy, and hiked up in times of inflation in order to “cool off” the economy. Inflation was incredibly high in the 80s after oil supply shocks in the 70s.*
43
+
44
+ While these Chairs have served as the face of monetary policy throughout history, there is a lot more that goes on behind the curtains. Namely, the **Federal Open Market Committee** is the team of 12 economists that serves as the Fed’s monetary policy-making body, and the Chair stands as the leader of this team. The other voting members of the FOMC include the 6 other governors from the Board of Governors, the president of the New York branch, and 4 of the presidents from the 11 other regional banks.
45
+
46
+ The FOMC has 8 scheduled meetings throughout the year, at which they discuss the short and long run outlooks for the US economy as well as monetary policy options. Sometimes they have to hold emergency meetings when the situation appears to be particularly dire, for example when the coronavirus pandemic first hit, prompting a lowering of interest rates to near 0 percent.
47
+
48
+ What is particularly important about these FOMC meetings is that the committee designs a course of action for staying committed to the Federal Reserve’s **dual mandate** and releases a statement outlining how they plan to do so. An example of this can be seen in an excerpt from the press release below,
49
+
50
+
51
+ [Figure - Graphic of a Federal Reserve press release from January 2021]
52
+
53
+ ![FOMC.png](FOMC.png)
54
+
55
+ Note how the FOMC begins by describing the current state of the economy’s health in terms of the indicators that we learned about earlier in the chapter. They then outline and forecast what they plan to do in response to the situation at hand. This is important because it anchors peoples’ expectations.
56
+
57
+ Employment and inflation are particularly relevant because these are the drivers that govern how the Fed designs monetary policy actions according to their dual mandate, which is to **achieve maximum employment** and **maintain price stability**. Adjusting interest rates is directly related to reaching a delicate balance between these two goals. For example, at this snapshot of time in January 2021, the Fed wanted to keep the federal funds rate low in order to provide a boost to an economy that was experiencing “weaker demand”.
58
+
59
+ At first glance it is probably pretty confusing how all of these moving parts work hand in hand. But the intuition behind how employment, inflation and interest rates are all related to the dual mandate can best be captured by the **The Taylor Rule**.
60
+
61
+ The Taylor Rule was first proposed in 1993 by the American economist John B. Taylor. It’s called a “rule” because it serves as a guide to monetary policy for how to set interest rates based on the inflation gap and output gap at a given time. The equation is as follows
62
+
63
+ $$i = 2\% + \pi + 0.5(\pi - 2\%) + 0.5(\frac{Y - Y^P}{Y^P})$$
64
+
65
+ And these are the variables
66
+ - i is the nominal interest rate (like we learned about earlier in the chapter)
67
+ - The first 2% is the equilibrium interest rate. You can think of this as the ideal interest rate when production has reached its potential and inflation is stable in the long run.
68
+ - $\pi$ is the current inflation rate
69
+ - The second 2% is the target inflation rate. Note how this was mentioned in the FOMC press release above! The Fed wants to have some stable inflation in the long run because that is indicative of a growing economy
70
+ $\frac{Y - Y^P}{Y^P}$ is the output gap. $Y^P$ is the potential output if we are at full employment, so this gap tells us how far off we are from that.
71
+ - The 0.5 coefficients reflect the relative balance between how much the Fed cares about inflation versus output. In the newspaper, you will often hear the terms “hawkish” or “dove-ish”. Those who support high rates to combat inflation are hawks, for example Chairman Volcker, whereas doves tend to favor lower interest rates.
72
+
73
+ In English, you can think of the Taylor Rule as a means of prescribing how nominal interest rates should adjust in response to the observed gaps. For example, the annual inflation rate as of April 2022 is currently 8.5%. Thus the Taylor Rule says that nominal interest rates should go up by
74
+
75
+ $$8.5\% + 0.5(8.5\% - 2\%)$$
76
+ $$= 8.5\% + 0.5(6.5\%)$$
77
+ $$= 11.75\%$$
78
+
79
+
80
+ Now recall the Fisher equation that we learned about earlier the chapter, $r_t = i_t - \pi_t$. Plugging 11.75% and 8.5% in, we see that the Taylor Rule suggests real interest rates should increase to 3.25%. Indeed, this is similar to Jay Powell’s vision as the Federal Reserve is tentatively planning to hike up rates by 0.25% - 0.5% at 6 different occasions over the course of the next year.
81
+
82
+ Another way that we can directly see how the Taylor Rule is related to the Fed’s dual mandate is to make a simplification using what is called **Okun’s Law**. It was proposed in 1962 by Yale professor Arthur Okun who studied the relationship between unemployment and production.
83
+
84
+ $$\frac{Y - Y^P}{Y^P}= -C_{okun} (U - U^N)$$
85
+
86
+ where
87
+ - $\frac{Y - Y^P}{Y^P}$ is the output gap as seen before
88
+ - $(U - U^N)$ is the unemployment gap with $U$ being the current level of unemployment and $U^N$ being the natural rate of employment
89
+ - and $C_{okun}$ is a coefficient that represents the sensitivity of the unemployment gap to changes in the output gap
90
+
91
+ The intuition behind Okun’s Law is that the less unemployment there is, the more output that will be produced. This is because there will be more workers contributing to the country’s GDP. Thus the coefficient is negative, and empirically $C_{okun}$ is approximately 2. By plugging Okun’s Law into our equation for the Taylor Rule we get,
92
+
93
+ $$i = 2\% + \pi + 0.5(\pi - 2\%) - 0.5C_{okun}(U - U^N)$$
94
+
95
+ Recall that the Federal Reserve’s dual mandate is to achieve maximum employment and a stable level of inflation close to their target. Therefore we can clearly see how this is captured by the Taylor Rule with Okun’s Law substituted into it. Moreover, this also illustrates how the nominal interest rate is the conventional tool that can allow the Fed to reach a balance between their two goals.
96
+
97
+ In the next section we’ll talk about some of the graphs the Federal Reserve looks at to guide their understanding of the economy and its outlook in both the short and long run.
98
+
99
+ ```python
100
+
101
+ ```
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: Indicators
3
+ type: textbook
4
+ source_path: content/09-macro/Indicators.ipynb
5
+ chapter: 9
6
+ ---
7
+
8
+ # Macroeconomic Indicators
9
+
10
+ The process of conducting macroeconomic policy often starts with studying and projecting the behavior of a variety of indicators that measure the economy’s current or expected future performance. While there are many different variables one could look to depending on the interests and goals of the individuals or institutions involved, in this chapter we will focus specifically on four main indicators that capture the overall health of the economy and thus tend to play a critical role in policy decisions. These are GDP, the unemployment rate, the inflation rate and the real interest rate.
11
+
12
+ ## Gross Domestic Product (𝑌)
13
+
14
+ Earlier in the semester, when studying Production, we introduced the concept of GDP briefly. To recap, we looked at how GDP serves as a means of capturing a given country’s overall production over a given period of time. In theory it can then be used as a way to measure a country’s economic performance in a given quarter or year; the higher its GDP, the more that it’s produced, the better it’s doing economically, and vice versa. In this chapter, we’ll go into more detail on its significance and how it’s measured. By definition, GDP, often denoted as 𝑌, is measured as the:
15
+
16
+ **market value** of
17
+ **final goods and services**
18
+ **newly produced**
19
+ in the **domestic economy**
20
+ over a **specified period of time**
21
+
22
+ Let’s dive into each of these individually:
23
+
24
+ First, the *market value* refers to the market price of goods and services, which sets a standard for how we value goods and services. This is especially useful when we are trying to add together products that may be quite different from one another.
25
+
26
+ Second, *final goods and services* refer to those which are not used up in the production process. We only consider these in our calculation of GDP, because we don’t want to end up overrepresenting the overall level of production. Intermediate goods, which are used up in the production process, inherently add some value to the final product, and therefore if we were to consider these in our calculation, we would end up double counting and overstating the level of production.
27
+
28
+ Third, *newly produced* refers that we are only interested in goods and services that were made during the time period we are looking at. Since we are using GDP as a way to measure the level of production in the economy, it wouldn’t make a whole lot of sense to include products that were produced outside the time period that we are looking at in our calculation.
29
+
30
+ Fourth, in the *domestic economy* refers to the fact that in our calculation of GDP, we only include goods and services that were produced within the geographical area of the area that we are looking at. Given that we are trying to measure the level of production of a certain country, we wouldn’t want to consider products or services that are produced outside of the country in our calculation.
31
+
32
+ Lastly, over a *specified period of time* simply points out that GDP is measured within an interval of time. This is important to consider when comparing countries based on their GDP, as we would want to make sure to consider the same time period for all of them. This is also related to the newly produced aspect that we touched on earlier.
33
+
34
+ The above definition and approach to calculating GDP considers the production of goods and services in the economy. However, it’s important to note that GDP can also be calculated by looking at the total spending on those goods and services or the total income earned from producing those goods and services. You may recall that in our discussion on Production, we often referred to output and income synonymously. This is because in theory, each of these approaches to calculating GDP (production, expenditure, and income) should all yield the same result, and indeed we find that for the most part they do.
35
+
36
+ ## **Unemployment Rate (𝑈)**
37
+
38
+ The unemployment rate is also an important measure of a country’s economic performance, as it gives us some insight on the supply and demand of labor in the economy. By definition, the unemployment rate measures the percentage of the labor force – the sum of all employed and unemployed people – that are not currently employed, but are willing to, able to, and looking for work. Mathematically, this can be expressed by the following equation:
39
+
40
+ $$ Unemployment Rate = \frac{Unemployed}{Labor Force}$$
41
+
42
+ As stated before, the labor force is just the sum of all employed and unemployed persons in the population, so we can simplify the equation above to be
43
+
44
+ $$ Unemployment Rate = \frac{Unemployed}{Employed + Unemployed}$$
45
+
46
+
47
+ An important thing to remember is that in order to be considered unemployed, a person must be able to, willing to, and currently looking for work. This means that anyone who is unable to work or has stopped looking for a job is no longer considered part of the labor force and is therefore not included in the unemployment rate. Intuitively this makes sense for the most part, as it probably wouldn’t be very helpful to include retirees or stay-at-home parents or even students for that matter when calculating the unemployment rate. It’s worth considering, however, that this also means that people who have been unable to find any work and therefore stopped looking – often referred to as discouraged workers – would not be represented in the unemployment rate either.
48
+
49
+ ## **Inflation Rate (𝜋)**
50
+
51
+ Generally speaking, the inflation rate in an economy measures the percent change in prices over a specified period of time, and it is usually calculated using a price index. While there are many different price indices that can be used to calculate inflation, one of the more common ones is the Consumer Price Index (CPI). The CPI measures the average price for a consistent basket of goods and services relative to some defined base year. It is calculated by taking the value of said basket in any given year, dividing it by its value in the base year, and multiplying that by 100. Mathematically, this can be expressed as
52
+
53
+
54
+ $$CPI_t = \frac{Price of basket_t}{Price of basket_0} * 100 $$
55
+ where t = 0 refers to the base year.
56
+
57
+ We can then calculate the inflation rate for a given year as
58
+
59
+ $$𝜋_t = \frac{CPI_t - CPI_{t-1}}{CPI_{t-1}} * 100 $$
60
+
61
+ The inflation rate is yet another key indicator that macroeconomists look at, as it can reflect where or not the economy is growing. Generally, a small, positive inflation rate is considered a good thing, as it’s usually indicative of a growing economy. However, inflation rates that are negative or too high can create a lot of problems, and as such the inflation rate tends to play an important role in guiding monetary policy decisions – something we will discuss more later in this chapter.
62
+
63
+ ## **Real Interest Rate (𝑟)**
64
+
65
+ If you have a bank account or own a credit card or have ever taken a loan, chances are that you’ve come across an interest rate at some point. In general, interest rates represent the cost of borrowing. On the flip side, it also represents the return on saving or lending. In other words, you can think of interest rates as the opportunity cost of holding money.
66
+
67
+ There are many different interest rates that can be found in the economy from interest rates for savings accounts to interest rates charged for mortgages to interest rates set by the Central Bank. All of the interest rates that we observe in the economy are known as nominal interest rates – meaning rates that are not adjusted for inflation.
68
+
69
+ As discussed earlier, inflation measures the change in prices over a given time and can be used in some sense to measure the relative value of a dollar (or other unit of currency) over time. It makes sense then, that we might want to take inflation into account, when deciding what interest rate would make sense to lend/borrow at. To do so, we use real interest rates, which are calculated by taking nominal interest rates and subtracting inflation. This relationship between inflation, nominal interest rates, and real interest rates is captured by what is known as the Fisher Equation
70
+
71
+ $$r_t = i_t - 𝜋_t$$
72
+
73
+
74
+
75
+ where $r_t$ refers to the real interest rate, $i_t$ refers to the nominal interest rate, and $𝜋_𝑡$ refers to the inflation rate, all in a given time period.
76
+
77
+ As a final note, we find that generally speaking all of the nominal interest rates present in the economy tend to be pretty strongly correlated with one another. Therefore, for purposes of simplification, macroeconomists will often refer to these rates in singular form in their models as simply the nominal interest rate or the real interest rate. As seen in the Fisher equation above, we use 𝑖 to denote the nominal interest rate, and 𝑟 to denote the real interest rate.
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: fiscal_policy
3
+ type: textbook
4
+ source_path: content/09-macro/fiscal_policy.ipynb
5
+ chapter: 9
6
+ ---
7
+
8
+ # Fiscal Policy
9
+
10
+ In this section, we will give a broad overview of fiscal policy.
11
+
12
+ Fiscal policy is the use of government spending and taxation to influence the economy. Governments typically use fiscal policy to promote strong and sustainable growth and reduce poverty.
13
+
14
+ $$ Y = C + I + G + NX $$
15
+
16
+ **There are many fiscal policy tools at the hands of the government to stabilize the economy. These primarily include changes to levels of taxation and government spending. To stimulate growth, taxes are lowered and government spending is increased, often involving borrowing through issuing government debt. To cool down an overheated economy, the government can use the opposite tools.**
17
+
18
+ ## Classical vs Keynesian View
19
+
20
+ Why is fiscal policy an effective tool to stabilize the economy? We must first look at two views of macroeconomics and what each of them implies for fiscal policy.
21
+
22
+ **Classical economics** claims economic fluctuations arise from “supply
23
+ shocks'' such as fluctuations in productivity, and the aggregate supply is the determinant of economic output. So, the Classical view places little emphasis on the use of fiscal policy to manage aggregate demand. Classical theory is the basis for Monetarism, which only concentrates on managing the money supply, through monetary policy.
24
+
25
+ **Keynesian economics** suggests recessions often arise from “aggregate demand” shocks, and governments need to use fiscal policy, especially in a recession.
26
+
27
+ In the AD–AS diagram below, we can see a visual comparison between the economy under the Classical view and the Keynesian view. In the Classical view, the AS curve is vertical. So any increase or decrease in aggregate demand (such as government spending) will not affect the output. On the other hand, in the Keynesian view, increase or decrease in aggregate demand will result in a corresponding change in the output.
28
+
29
+ ![classical_vs_keynesian.png](classical_vs_keynesian.png)
30
+ <center> Classical view vs. Keynesian view </center>
31
+
32
+ Empirically speaking, our economy lies between the Classical view and the Keynesian view. So fiscal policy has the ability to adjust the economy to some extent.
33
+
34
+ ```python
35
+
36
+ ```
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: index
3
+ type: textbook
4
+ source_path: content/09-macro/index.md
5
+ chapter: 9
6
+ ---
7
+
8
+ # Macroeconomic Policy
9
+
10
+ ## Student Learning Outcomes:
11
+ - Learn about the 4 main macro indicators and how they relate to one another
12
+ - Learn how to graphically represent these relationships and understand historical trends
13
+ - Learn about central banks and the tools they use for monetary and fiscal policy
14
+ - Improve macro literacy
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: is_curve
3
+ type: textbook
4
+ source_path: content/09-macro/is_curve.ipynb
5
+ chapter: 9
6
+ ---
7
+
8
+ # IS-Curve
9
+
10
+ In this section we will introduce the IS curve (“investment–saving” curve), an important macroeconomics model that characterizes the relationship between real interest rates and output. **The IS curve is downward sloping. When the real interest rate falls, output will increase.** We will see why this inverse relationship is true and what this relationship implies for the economy.
11
+
12
+ [Figure - a downward slopign curve with Real Interest Rate on Y-Axis and Output on X-Axis]
13
+
14
+ ![is_curve.png](is_curve.png)
15
+ <center> IS Curve </center>
16
+
17
+ ## Keynesian Cross
18
+
19
+ First, we will discuss a model of aggregate demand and aggregate output. The Keynesian cross diagram, determines the equilibrium level of real GDP by the point where the total or aggregate demand in the economy is equal to the amount of output produced.
20
+
21
+ [Figure - Keynesian cross diagram with two upward sloping lines, Aggregate Demand on Y-xis and Output on X-axis]
22
+
23
+
24
+
25
+ ```python
26
+
27
+ ```
28
+
29
+ ![keynesian_cross.png](keynesian_cross.png)
30
+ <center> Keynesian Cross Diagram </center>
31
+
32
+ The axes of the Keynesian cross diagram show output / national income (or real GDP) on the horizontal axis and output / aggregate demand on the vertical axis. The orange line represents the aggregate demand, and the blue 45° line represents the aggregate output.
33
+
34
+ - **Why is the slope of the aggregate output line equal to 1?**
35
+ Both the horizontal axis and the vertical axis are the output of the economy, so they should be the same.
36
+
37
+
38
+ - **Why is the slope of the aggregate demand line less than 1, and the intercept greater than 0?**
39
+ We will first consider how demand increases when national income rises. People can do two things with their income: consume it or save it (let’s ignore taxes for now). Each person who receives an additional dollar faces this choice.
40
+ The marginal propensity to consume (MPC), is the share of the additional dollar of income a person decides to devote to consumption expenditures. Since the marginal propensity to consume is usually less than 1 (which means not all income is consumed), for every unit increase in national income, we will expect the aggregate demand to increase by less than 1 unit. So, the slope is less than 1.
41
+ However, even when the economy is not producing any output, people still need to consume. They may do so by using their savings or borrowing. So we have a positive intercept.
42
+
43
+ ## Dynamics of Keynesian Cross and Derivation of IS Curve
44
+
45
+ Now, we are ready to derive the IS curve.
46
+
47
+ What will happen if the real interest rate decreases? First, people have less incentive to save money, since the gains from interest income are lower. Second, people have more incentive to spend (especially borrow money to spend) because the opportunity costs of spending are lower.
48
+
49
+ **So, when the real interest rate decreases, people will tend to save less and consume more, shifting the aggregate demand curve in the Keynesian Cross upward. The equilibrium output level will therefore increase. The opposite direction will also hold true.**
50
+
51
+ This precisely describes the inverse relationship between real interest rate and output.
52
+
53
+ [Figure - Kenesian cross diagram with interest rates at 10% or 5%]
54
+
55
+ ![is_derivation.png](is_derivation.png)
56
+ <center> Keynesian Cross and IS Curve </center>
57
+
58
+ ## Implication of IS Curve
59
+
60
+
61
+
62
+ The IS curve explains the inverse relationship between real interest rate and output.
63
+
64
+ A more comprehensive model of how the money markets interact with the goods market can be illustrated by the IS–LM model. The IS–LM model, or Hicks–Hansen model, is a two-dimensional macroeconomic tool that shows the relationship between interest rates and the asset market (also known as real output in goods and services market plus money market). The intersection of the "investment–saving" (IS) and "liquidity preference–money supply" (LM) curves models a "general equilibrium" where equilibria simultaneously occur in both the goods and the asset markets. Hence, this tool is sometimes used not only to analyze economic fluctuations but also to suggest potential levels for appropriate stabilization policies.
65
+
66
+ The chart below illustates how each monetary and fiscal policy will affect the economy.
67
+
68
+ [Figure - four panel chart with different cases - IS downward sloping , LM upward sloping, interest reate on Y-axis, Income on X-axis, cases are A: Fiscal Expansion, B: Fiscal contration, C:Monetary Expansion, D: Monetary Contraction]
69
+
70
+ ![islm_fiscalmonetarypolicy.png](islm_fiscalmonetarypolicy.png)
71
+
72
+
73
+ <center> </center>
74
+
75
+ Source: Lev Lafayette, [Chapter 2: The IS–LM model](http://levlafayette.com/node/629)
76
+
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: phillips_curve
3
+ type: textbook
4
+ source_path: content/09-macro/phillips_curve.ipynb
5
+ chapter: 9
6
+ ---
7
+
8
+ # Phillips Curve
9
+
10
+ The Phillips Curve describes an inverse relationship between inflation and unemployment: when the inflation is low, the level of unemployment tends to be high; when the level of unemployment is low, price level tends to increase more rapidly.
11
+
12
+ In essence, the Phillips Curve characterizes a tradeoff between economic growth and inflation–we cannot have the best of both worlds. The theory claims that with economic growth comes inflation, which in turn should lead to more jobs and less unemployment.
13
+
14
+ However, empirical evidence calls Phillips Curve into question, including the stagflation period that happened during the 1970s when the economy was suffering from both a high inflation and a high unemployment rate. A neoclassical model was then introduced to address this issue.
15
+
16
+ ## Classical Phillips Curve
17
+
18
+ **The classical Phillips Curve describes the relationship between inflation and unemployment: Inflation is higher when unemployment is low and lower when unemployment is high.**
19
+
20
+ $$ \pi = - h \cdot ( u - u^{*} ) $$
21
+
22
+ where $\pi$ is the inflation rate, $u - u^{*}$ is the unemployment gap.
23
+
24
+ Often also simplified as
25
+
26
+ $$ \pi = - h \cdot u $$
27
+
28
+ where $\pi$ is the inflation rate, $u$ is the unemployment rate.
29
+
30
+ The relationship was originally described by New Zealand economist A.W. Phillips in his paper titled The Relation between Unemployment and the Rate of Change of Money Wage Rates in 1958, who examined data on unemployment and wages for the United Kingdom from 1861 to 1957.
31
+
32
+ [Figure - Historic Phillip's Curve downward sloping, Rate of change of money on Y-axis, Unemployment on X-axis]
33
+
34
+ ![original_pc.png](original_pc.png)
35
+ <center> The original curve drawn for pre-WW1 data </center>
36
+
37
+ The underlying logic of this inverse relationship can be explained as follows: **when the demand for labor increases, the pool of unemployed workers subsequently decreases and companies increase wages to compete and attract a smaller talent pool. The cost of wages increases and companies pass along those costs to consumers in the form of price increases. Thus, a lower unemployment rate ultimately translates to a higher inflation.**
38
+
39
+ Theoretically, the Phillips curve presents a menu of options for policymakers–if higher inflation actually causes lower levels of unemployment, then the government could control unemployment via monetary policy as long as it was willing to accept changes in the level of inflation.
40
+
41
+ ## Expectation-Augmented Phillips Curve
42
+
43
+ Unfortunately, economists soon learned that the relationship between inflation and unemployment was not as stable as they had previously thought.
44
+
45
+ [ 3 Figures with different decades - 1960-1970, 1980-1990, 2010-2020 with Inflation on Y-axis and Unemployment on X-axis]
46
+
47
+ ![pc_1960s.png](pc_1960s.png)
48
+ ![pc_1980s.png](pc_1980s.png)
49
+ ![pc_2010s.png](pc_2010s.png)
50
+ <center> Relationship between inflation and unemployment during three periods of time </center>
51
+
52
+ **What economists initially failed to realize in constructing the Phillips curve was that people and firms take the expected level of inflation into account when deciding how much to produce and how much to consume.** When workers expect prices to rise, they demand higher wages. When firms expect costs to rise, they set higher prices.
53
+
54
+ **Therefore, economists introduced inflation expectation into the original Phillips Curve.**
55
+
56
+ $$ \pi = \pi^{e} - h \cdot ( u - u^{*} ) $$
57
+
58
+ where $\pi$ is the inflation rate, $\pi^{e}$ is the expected inflation rate, $u - u^{*}$ is the unemployment gap.
59
+
60
+ Therefore, a given level of inflation will eventually be incorporated into the decision-making process and not affect the level of unemployment in the long run. The long-run Phillips curve is vertical, since moving from one constant rate of inflation to another doesn't affect unemployment in the long run.
61
+
62
+ What this implies is that if the Central Bank would like to pin down inflation, they cannot do it by simply raising the interest rate (even though this is still an effective way in the short run). What is more important is to anchor people’s inflation expectations at a relatively low level. If they succeed, they can control inflation. This idea also appears to have been remarkably successful so far. Whenever it has shot above target, it has, soon enough, fallen back.
63
+
64
+ While the idea of inflation expectation looks concrete, interestingly enough, a recent paper (Rudd 2021) sets off a round of debate about the role of expectations in shaping prices in the economy, where the author argued the theory of inflation expectation “rests on extremely shaky foundations”. But still the majority of economists are optimistic about this new Keynesian model. This is an ongoing research field.
65
+
66
+ > ***Thought experiment***: Spring 2022 marks a season with high inflation. The US inflation rate was sitting at 7.87% in February 2022, compared to 1.68% last year. What would happen if people thought this high level of inflation would persist?
67
+
68
+ ```python
69
+
70
+ ```
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: index
3
+ type: textbook
4
+ source_path: content/10-finance/index.md
5
+ chapter: 10
6
+ ---
7
+
8
+ # Finance
9
+
10
+ This week, we will be covering some of the greatest hits of Financial Economics - most of which you can learn by taking Econ 136. We will begin our discussion with an important introduction to interest rates and the time value of money. After, we will pivot to stock options. These are ways investors can bet on stock value movements through purchasing or selling contracts that only have value at certain stock prices.
@@ -0,0 +1,178 @@
1
+ ---
2
+ title: options
3
+ type: textbook
4
+ source_path: content/10-finance/options.ipynb
5
+ chapter: 10
6
+ ---
7
+
8
+ # Options
9
+
10
+ Before we discuss options, it's important to understand some basics regarding stocks. A stock is a share in a company. By owning stock you are owning a small part of a company. Stocks trade on a stock exchange, where people come together to buy and sell shares to one another. People who want to buy a stock place a *bid*, or a price at which they want to buy. Others who want to sell place an *ask*, or a price that they want to sell. The market price of a stock is where these bids and asks come together.
11
+
12
+ If I purchase and hold onto a stock, I am said to have a *long* position on the stock. If the stock goes up in value, I profit. If it goes down in value, I lose. It is also possible to have inverse exposure to the price of a stock, meaning that if the price of the stock goes down I profit, and if it goes up I lose. This is called shorting the stock, or having a *short* position on the stock. This is accomplished by borrowing stock from a stock broker and selling it today, and then buying it back sometime in the future to pay off your "loan" of borrowed stock from the broker.
13
+
14
+ You can see how you can profit from this if you sell stock at \$100. Then, if the value of the stock goes down to \$70 in the future, you can buy back the stock using the \$100 you made earlier, thus finishing your loan from the broker. However, you have \$30 left over. You made \$100 selling the stock, yet it only cost \$70 to buy it back. Thus, you have made a profit from the stock going down in value.
15
+
16
+ Recall that in a short position, you never actually owned the stock to begin with. You borrowed the stock from a stock broker, and you paid back that stock in the future. In reality, the stock broker wants to be paid for the service it provides you, and someone shorting stock will have to effectively pay interest on that "loan", just like a normal loan.
17
+
18
+ ## Puts
19
+
20
+ Suppose you own some stock in an investment account. You want your stock to be able to increase in value over time, but you also don't want its value to decrease too much. One way to think about this is that you want to own some asset that has asymmetrical payoff; you want all the potential upside of owning the asset with as little of the downside as possible.
21
+
22
+ One way to achieve this is to buy "insurance" on your stock. You might want an insurance contract that will cover losses if the value of your stock goes below a certain number. This type of contract exists, and they are called *puts*.
23
+
24
+ The simplest way to think about a put is that it is a contract that pays you a dollar for each dollar that your stock does below some specified number. So for instance, if you own a stock that trades at \$110, and you don't want to lose more than \$10 in value from owning the stock, you might buy a put with a *strike* of \$100. The strike of the put is this pre-specified number below which you don't want to lose money. Now, let's say your stock starts going down in value. Going down from \$110 to \$100, there's nothing that your put can do. But starting at \$100, each dollar that your stock goes down in value, your put pays you one dollar. Therefore, when you own this put *in combination* with the stock, the overall value of this combination cannot go below \$100.
25
+
26
+ Let's call this combination of stock and put a *portfolio*. Your portfolio's value depends on the value of the stock, and the portfolio's value looks like this:
27
+
28
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is flat then upward sloping ]
29
+
30
+
31
+ ![title](figure1.png)
32
+
33
+ Now that we have the basic intuition down, let's get more specific. While a put behaves like insurance, the way a put is technically defined is a bit different. A put contract says the following:
34
+
35
+ > "The holder of this contract has the right, *but not the obligation*, to sell 100 shares of an underlying stock at a specified strike price, from now until some expiration date."
36
+
37
+ You can see how this behaves essentially as insurance. If the strike price is \$100 as above, and your stock goes below \$100 in value, you might want to exercise your right to sell your shares at \$100. Regardless of how far below \$100 your stock is, the put allows you to sell at \$100. Additionally, if your stock is valued above \$100, there's no reason to exercise your right to sell at \$100; you could just sell at whatever price your stock is trading.
38
+
39
+ ## Calls
40
+
41
+ The opposite of a put, in a sense, is a *call*. A call contract specifies the following:
42
+
43
+ > "The holder of this contract has the right, *but not the obligation*, to buy 100 shares of an underlying stock at a specified strike price, from now until some expiration date."
44
+
45
+ You could technically interpret calls as insurance for people who are *short* some stock, but this isn't the most helpful way to think about them. A better way to think about calls is the following: Suppose you want to buy and hold a stock, but you aren't sure if the value of the stock will go up in a desired time frame. Instead of buying the stock and risking that its value will decrease, you could buy a call that gives you the *opportunity* to purchase the stock at some price that you want, say \$100. That way, if the value of the stock goes above \$100, instead of missing out on that increase in value, your call gives you the right to purchase the stock at \$100, even though it is actually worth more than \$100. If the stock is worth less than \$100 after some time, you don't have to do anything and you didn't lose the value you would have lost if you had purchased the stock.
46
+
47
+ ## Payoff Diagrams
48
+
49
+ Instead of thinking about the value of a portfolio with a stock and a put, let's just think about the value of a put given the price of the underlying stock. In other words, you don't actually own the stock, you just own the put. Let's use the example of a put with a strike of \$100 as above. If the stock is trading somewhere below \$100, say \$90, then the put has a payoff of \$10. The reason for this is because you could purchase the stock for \$90, and then use your put, which gives you the right to sell a stock for \$100. That's a profit of \$10, and therefore the put has a payoff of \$10.
50
+
51
+ Similarly, if the stock is trading above \$100, the put has no payoff. If you were to buy the stock at its price and use your put to sell at \$100, you would lose money. This is because it cost you more than \$100 to buy the stock, but you only sold for \$100. Since you are never actually obligated to use a put, you would not use it in this case, and it has 0 payoff.
52
+
53
+ **Notice that all of this occured without you ever owning the stock to begin with.**
54
+
55
+ Now let's plot the payoff of this put with a strike of \$100, given the price of the underlying stock.
56
+
57
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is downward sloping then flat at zero ]
58
+
59
+ ![title](figure2.png)
60
+
61
+ The payoff of a call works similarly. Remember that a call gives you the right to buy a stock at a certain price. So if you own a call with a strike of \$100, and the underlying stock is trading at \$110, the call has a payoff of \$10. This is because you could use your call to buy the stock for \$100, and then sell it for \$110, since this is the market price of the stock. And again, if the stock is trading below \$100 the call has no payoff. This is because if you were to use your call to purchase the stock at \$100, you could only sell it for less than \$100, thus losing money. A rational investor would never use the call for this, and therefore it has no payoff. Below is the payoff diagram for a call with a strike of \$100.
62
+
63
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is flat at zero then upward sloping ]
64
+
65
+ ![title](figure3.png)
66
+
67
+ And quickly, here are the payoff diagrams for being long and short a stock, which should appear trivial by now. These diagrams ignore the price of the stock when you bought/shorted it. In other words, if you purchased the stock at \$100, and sold at \$100, the diagram implies a payoff of \$100. This is to be consistent with the above diagrams, in which we implicitly assumed that there is no cost in buying an option, a claim which we will examine below.
68
+
69
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is upward sloping ]
70
+
71
+ ![title](figure4.png)
72
+
73
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is downward sloping ]
74
+
75
+
76
+ ![title](figure5.png)
77
+
78
+ Now, we see how we can generate the payoff diagram for the portfolio of a stock and a put from above. The diagram for that portfolio is copied below.
79
+
80
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, line is flat and then upward sloping ]
81
+
82
+ ![title](figure1.png)
83
+
84
+ Notice how we can generate this by adding the payoff diagrams of a stock and a put. We have shown that the payoff diagram of a portfolio can be represented as the sum of payoff diagrams of its components.
85
+
86
+ [Figure Payoff Diagram - Value on Y-axis, price of underlying stock on X-axis, there are lines for Put, Stock and Portfolio overlaid ]
87
+
88
+ ![title](figure6.png)
89
+
90
+ ## Pricing Options
91
+
92
+ We have only been studying one side of an option contract: the holder of the option. Of course, in order to own a contract that gives you the right to buy or sell a stock at a certain price, someone has to be willing to guarantee you that right. Offering you that right comes with some risk, because whoever sells you the contract might be obligated to buy or sell a stock from you at a price that is not favorable. Because of this, they will ask for payment in return. Therefore, just like any other form of insurance, options are not free.
93
+
94
+ Let's think about what could contribute to an option's price. We know that someone is taking on risk by selling you an option, so whatever puts that person at an increased risk of losing money should make the option more expensive. For this lesson let's only think about the price of a call.
95
+
96
+ * **Strike price**. Suppose a stock is trading at \$100, and I am interested in a call with a strike of \$110. The person who sells me that call bears some risk, because the price of the stock might go above \$110 sometime in the future, in which case I would profit and the person who sold me the option would lose money. Now suppose I look at a call with a strike of \$120. The person selling me the \$120 call bears some risk, but not as much as the first person, because it is less likely that the stock's price exceeds \$120 sometime in the future compared to the chance that it exceeds \$110. So which of these two options should cost more, holding all else equal? Naturally, the call with the strike of \$110 should cost more, because it is more likely that I make money with this call as opposed to the \$120 call, and therefore more likely that the person selling it to me loses money. **This shows that for calls, the lower the strike price, the more expensive the call becomes**.
97
+ * **Time until expiration**. We briefly mentioned earlier in the definitions for calls and puts that options are only active for a certain time period. So if a call is only active for 1 week, while an otherwise identical call is active for 1 year, which should cost more? Using similar logic as above, the call lasting 1 year puts the option seller at a higher risk of losing money, since there is more time for the underlying stock price to move in such a way that is disadvantageous. The call lasting 1 week doesn't have much time at all to move in such a way that the option seller loses money. **This shows that for calls, the farther away the expiration, the more expensive the call becomes**.
98
+ * **Volatility**. Imagine a stock is trading at \$100, and historically this stock's price does not move very much at all. Now, imagine another stock that is also trading at \$100, but has a history of wild price swings. In this example, if there exist two calls with otherwise identical attributes on these two stocks, which one should cost more? We say that the stock with a history of price swings is more volatile than the more tame stock. The more volatile stock has a higher chance of jumping up in price to a point where you can make a profit compared to the more tame stock. **This shows that for calls, the higher the volatility of the underlying stock, the more expensive the call becomes**.
99
+ * **Underlying stock price**. This should be the most obvious factor that affects the prices of options. If someone is offering to sell a call with a strike of \$100 on some stock, and the stock's price is \$90, then the call option will have some price. But if the stock jumps in value to \$95, then clearly the call option will be worth more. After the stock's price increases to \$95, it becomes more likely that the stock' price can exceed \$100 sometime in the future. This exposes the person selling you the call to a higher risk of losing money, and therefore the person will charge more for the call. **This shows that for calls, the higher the price of the underlying stock, the more expensive the call becomes**.
100
+ * **The risk-free interest rate**. This one is a bit less intuitive and we will not be discussing this in depth, but the prevailing interest rate of risk-free deposits also affects the prices of options.
101
+
102
+ ### Black-Scholes
103
+
104
+ So how would we calculate the fair price of an option? Intuitively, the fair price of an option should be the payoff of the option for every possible price of the stock, weighted by the probability of that stock being at that particular price, discounted into the present (since you receive some payment in the future). It turns out that this is a pretty complicated problem to solve, and we will not ask you derive the following formulae. Below is an expression for the price of a call and a put.
105
+
106
+ $$\begin{aligned}
107
+ C &= S \cdot N(d_1) - K \cdot e^{-r_{rf}T} \cdot N(d_2) \\
108
+ P &= K \cdot e^{-r_{rf}T} \cdot N(-d_2) - S \cdot N(-d_1)
109
+ \end{aligned}$$
110
+
111
+ where $S$ is the price of the stock, $K$ is the strike of the call, $r_{rf}$ is the risk-free interest rate, $T$ is time till expiration, $N()$ is the normal CDF, $d_1 = \frac{ln(S/K) - (r_{rf} + \sigma^2/2)T}{\sigma\sqrt{T}}$, and $d_2 = d_1 - \sigma\sqrt{T}$. This assumes that stock returns are normally distributed.
112
+
113
+ ```{admonition} Disclaimer
114
+ :class: attention
115
+
116
+ These expressions are actually the prices **European options**. A European option is an option that only allows you to exercise (use the option) exactly on the expiration date, and not before. The definitions for options that we gave earlier correspond to **American options**, which allow you to exercise the option at any time, even before expiration. The reason we have the prices for European options and not American options is because the prices for American options are actually even more difficult to find. For example, American puts are priced quite differently from European puts. However, for a stock that does not pay dividends, the prices for American calls and European calls tend to be similar.
117
+ ```
118
+
119
+ ## Trading Options
120
+
121
+ Options can be traded on an exchange just like stocks. You can buy an option today, and if something happens that makes you not want to hold the option anymore, you can sell it tomorrow. Options therefore have some prevailing market price that is determined by buyers and sellers, but in a rational market the prices of options must follow the rules/trends defined above.
122
+
123
+ Importantly, you aren't restricted to just buying options. You can also assume the role of the person taking on risk by selling an option to someone else. Let's think about how this would work.
124
+
125
+ Suppose you want to buy a call option from me on some underlying stock currently trading at \$90. You want the option to have a strike of \$100, and you want it to expire in 1 month. You would have to pay me whatever the fair market price for this option is, but there's one more step that I would then have to take.
126
+
127
+ By owning a call, you have the right to buy the underlying stock from me at \$100, even if the price of the stock goes above \$100. From my perspective, that means that I might have the *obligation* to *sell* you stock at a price of \$100. In order to cover this obligation, I will have to put up some collateral to guarantee that I will be able to pay my obligation, should the time come. The specific rules for collateral vary with different brokers and other conditions.
128
+
129
+ Suppose I only needed to put up enough collateral to cover a \$20 increase in stock price. That means that I need to be able to afford buying stock at \$110, and selling it to you at \$100. That's a difference of \$10. But recall that option contracts actually deal with increments of 100 shares. So I will actually have to post \$10 x 100 = \$1000 in collateral. If the stock price does in fact jump to \$110, my broker may then ask me to put even more money down for collateral, in the event that it continues to go up.
130
+
131
+ If for some reason the rules specify that I need to completely cover all the risk of selling this call, no amount of money will be sufficient to cover the cost of buying shares at some unknown price in the future and selling at \$100. This is because there is no theoretical limit to how high the price of a stock can reach. In this situation, I would actually have to post 100 shares of the stock as collateral at the same time that I sell you the call. This way, I am guaranteed to have 100 shares of stock to sell to you in the event that you use your call.
132
+
133
+ Selling calls works similarly, but instead I need to have enough money down as collateral to afford to *buy* shares from you at the strike price.
134
+
135
+ ## Returns
136
+
137
+ This portion of the lecture is fairly simple. A return on security is essentially the money made or lost by investing in the security over a period of time.
138
+
139
+ The return on security has two components:
140
+ 1. The change in price of the security
141
+ 2. Any cash flows associated with the security (dividends for stock, coupons for bonds)
142
+
143
+ If we write the change in price over a time interval τ as
144
+ $∆x_t = x_{t+τ} − x_t = x(t + τ) − x(t)$,
145
+ then we can write the rate of return r as
146
+ $r(t) = \frac{x(t + τ) −x(t) + income − costs}{x(t)}$
147
+
148
+ ### Calculating Returns Using an API
149
+
150
+ ```python
151
+ #importing packages needed to access the API
152
+ !pip install yfinance
153
+ import yfinance as yf
154
+ import numpy as np
155
+ ```
156
+
157
+ ```python
158
+ data = yf.download("^GSPC", start="1993-01-01", end="2021-01-01")
159
+ # In code above, we input the ticker symbol for S&P500 and specify the start and end time intervals
160
+ ```
161
+
162
+ ```python
163
+ data
164
+ ```
165
+
166
+ Let's plot the graph for the closing price of S&P500.'
167
+
168
+ [Figure returns for S&P 500 stock index - Value on Y-axis, Time on X-axis ]
169
+
170
+ ```python
171
+ data['Close'].plot(color="purple",figsize=(10,8), title = 'S&P500 Returns');
172
+ ```
173
+
174
+ The graph below shows the returns from S&P500 as a function of time over the previous time interval.
175
+
176
+ [Figure Returns - Value of Returns on Y-axis, time on X-axis]
177
+
178
+ ![title](figure9.png)