Tuesday, 27 November 2012

Week 1 Blog 2 - Vectors and Matrices


Before you start reading, I have two quick announcements:
  1. Sorry for taking a few days to upload this post - I had a few teething problems trying to get the mathematical notation on the blog. Although it is not perfect, it is the best that I can achieve, for the moment.
  2. It might help to zoom in slightly, in order to make the equations clearer. To do this on Google Chrome, and Internet Explorer, simply hold Ctrl (Cmd on a Mac) and press +.
    Here we are then: the first week of the MA100 course. In the calculus lecture this week, we study the basics of vectors, and in linear algebra, we begin with matrices. How is this article going to work? I will work first with vectors, and then move onto matrices briefly at the end – our work on vectors spans only one week, whereas we shall spend a considerable time on matrices in linear algebra over the next 19 blog articles. For each of these topics, I shall very quickly give an overview of the lecture, then give one example in theoretical economics, and finish with a real world application of the topic in question.

    Our work on vectors, to begin with, will focus on $\mathbb{R}^{n}$, until we approach vector spaces in linear algebra. For those of you who are unaware, a vector in $\mathbb{R}^{n}$ is like a list of n numbers, put together in one neat notation. We might write $\bigl(\begin{smallmatrix}1.41 &-2  &3.141  &4  &-1 \end{smallmatrix}\bigr)^{T}$ as a vector in $\mathbb{R}^{5}$, as it is a list of 5 real numbers. We will cover $\mathbb{R}^{n}$ later more formally, so please do not start worrying about its details for now, but just imagine $\mathbb{R}^{n}$ as all possible lists of n numbers. The vector $\bigl(\begin{smallmatrix}1 &2  &3  &4  &5 \end{smallmatrix}\bigr)^{T}$ could be thought in economics as a list of 5 inputs for a firm making a cake: it might need 1 unit of butter, eggs, 3 units of milk, 4 bars of chocolate, and 5 units of flour. 

    This is probably the most simple way that we can go about explaining what a vector is. At the moment, we might think that vectors are useful, because they make everything neater: rather than writing out a list of 100 numbers: $\bigl(\begin{smallmatrix}x_{1} &x_{2}  &... &x_{100}\end{smallmatrix}\bigr)^{T}$, it is much easier to just say that $\mathbf{x}= \bigl(\begin{smallmatrix}x_{1} &x_{2}  &... &x_{100}\end{smallmatrix}\bigr)^{T}$ , and then work with $\mathbf{x}$! But their use goes far beyond making things less writing for us. Let’s consider  $\mathbb{R}^{1}$, which is a list containing one real number. Quite obviously, $\mathbb{R}^{1} = \mathbb{R}$, that is, it’s just the real numbers! We can think of this as a line of numbers. Then $\mathbb{R}^{2}$ is the Cartesian product of $\mathbb{R}$ and $\mathbb{R}$, which means that it is all vectors of the form $\left ( x,y \right )$, where $x$ and $y$ are real numbers. This is obviously the Cartesian plane that we are familiar with. Then likewise, $\mathbb{R}^{3}$ is 3 space. These are the coordinates that are the space of the world we live in: you can move your hand forward and backward, left and right, or up and down: 3 dimensions. More on this in linear algebra later.

    The great thing about vectors as well is that we can think of vectors algebraically: we can add and scalar multiply vectors. For example, multiplying a vector by a real number $d$ is as simple as multiplying every number in that vector by $d$. If  $\textbf{x}=\begin{pmatrix}1 &2 \end{pmatrix}$ then $2\mathbf{x}=\begin{pmatrix}2&4 \end{pmatrix}^{T}$. Multiplying two vectors together can be defined in many ways, but normally we use the inner product, which takes two vectors, and multiplies them to output a number.

    Vectors are applied so widely in economics, it is hard to pick any single example that does this justice, but because this is our first blog, I shall stick with a rather simple one. Let’s imagine we are a firm producing cakes. Our manager tells us that we must produce exactly 30 cakes this week and supply that to the market. Imagine that we make cakes from 6 input goods: eggs, butter, flour, milk, chocolate, and icing. (Unrealistic, but work with me here). So the first question we ask is, what possible input combinations will make exactly 30 cakes? We know that we have to pick exactly one of these combinations (or technologies, to use economic parlance), but there are a big set of these possibilities. We call this set the q-isoquant set for the firm. It is: \[ I_{q}=\left \{ vectors\, \left ( eggs,\, butter,\, milk,\,flour,\, chocolate,\, icing   \right ) that\, will\, produce\, 30\, cakes\, \right \}\] Letting eggs = e, butter = b, milk = m, flour = f, chocolate =c, icing = i, we have: \[I_{q}=\left \{ \mathbf{z} = \left ( e,b,m,f,c,i \right )|\phi \left ( \mathbf{z} \right )=30 \right \}\]Where $\phi \left ( \mathbf{z} \right )$ is the production function (the process that turns inputs into outputs). Then this set of vectors that produces such a given quantity, is actually extremely useful in solving the firm’s cost minimisation problem.

    Now we move onto matrices. What is a matrix? Well, the simplest way to think of a matrix is as a table, or a spreadsheet of numbers or symbols. We get all different kinds of matrices: square, diagonal, invertible, to name but a few. One useful piece of notation is that the set of all possible $m\times n$ matrices with all real number entries is written $\mathbb{R}^{m\times n}$. Interestingly enough, real matrices are actually vectors, even though all real vectors can be thought of as column matrices! I will let that one sit in your mind for a while, or you can research it yourself, or email me and I’ll explain. But because real matrices are vectors, all the ideas of addition and scalar multiplication carry over for matrices, we just have to be careful with all matrix operations that our matrices are of the right order (number of rows and columns), before we do anything. Matrix multiplication is a very special operation, and should be handled with a lot of care. For example, if $AB$ exists, this doesn’t mean that $BA$ exists, and even if both exist, they definitely don’t have to be equal, although they might well be. The inverse of a matrix is our best equivalent of the idea of division, but we can only invert some (not all) square matrices. Finally we have this idea of the transpose of a matrix $A=\left ( a_{ij} \right )$ , which is the matrix $A^{T}=A'=\left ( a_{ji} \right )$.If all the notation confuses you, do learn it, but really just think of the transpose as swapping the rows of the matrix with the columns, and vice versa.

    To finish this blog, we show how matrices can be used economics. Matrices are especially useful, as we shall see in the next few lectures, for dealing with systems of linear equations. We will use a running example from macroeconomics for the couple of following blogs: in this blog we shall set up the problem, and then next week we shall solve the problem.

    We consider a very simple model of the macroeconomy, based upon two equations: \[Y=C+I_{0}+G_{0}\] \[C=a+bY\]where we treat income $Y$ and consumption $C$ as our endogenous variables - that is, our model explains these values. All other variables, investment $I_{0}$, government spending $G_{0}$, and parameters $a$ and $b$  are treated as exogenous – that is, given to the model. We rearrange these equations to get:\[Y-C=I_{0}+G_{0}\]\[-bY+C=a\] Now is where we apply a matrix (and some vectors as well!), to write these equations as a matrix equation. This will be properly explained next week, but let us see it now. Let: \[A=\left( {\begin{array}{*{20}{c}}  1&-1 \\  { - b}&1\end{array}} \right)\]\[x=\begin{pmatrix}Y\\C \end{pmatrix}\]\[d=\begin{pmatrix}I_{0}+G_{0}\\a \end{pmatrix}\]  Now, writing:\[Ax=d\] Means: \[\left( {\begin{array}{*{20}{c}}  1&{ - 1} \\  { - b}&1\end{array}} \right)\left( {\begin{array}{*{20}{c}}  Y \\  C\end{array}}\right) = \left( {\begin{array}{*{20}{c}}  {{I_0}+{G_0}} \\  {a}\end{array}} \right)\]Let us just check that this works by multiplying out the left hand side: \[ \left( {\begin{array}{*{20}{c}}  1&- 1 \\   - b&1 \end{array}} \right) \left( {\begin{array}{*{20}{c}}  Y \\  C \end{array}} \right) = \left( {\begin{array}{*{20}{c}}  Y-C \\  -bY + C \end{array}}  \right)\]Then our equations tell us that $Y-C=I_{0}+G_{0}$  and $-bY+C=a$, hence:\[ \left( {\begin{array}{*{20}{c}}  1&- 1 \\   - b&1 \end{array}} \right) \left( {\begin{array}{*{20}{c}}  Y \\  C \end{array}} \right) = \left( {\begin{array}{*{20}{c}}  Y-C \\  -bY + C \end{array}}  \right) = \left( {\begin{array}{*{20}{c}} {{I_0}+{G_0}} \\ {a} \end{array}} \right)\]As required. From $Ax=d$, we hope to solve for $x$, because it is $x$ that contains our endogenous variables. So if we were given the levels of $I_{0},G_{0},a$ and $b$, solving this system will give us $Y$ and $C$. We will do this formally next week.

    Thanks,
    Will

    Monday, 19 November 2012

    Blog 1: An Introduction

    Mathematics and Economics - Introduction

    By William Matcham

    Welcome to the LSESU Economics Society Research Department MA100 Blog. This weekly blog aims to reveal the applications of the mathematics that economists at LSE learn, and the motives behind doing so. Often when studying MA100 (for those of you unfamiliar with LSE, this is the 1st year mathematics course for economists and mathematicians), the applications of MA100 to economics are so explicit, that the study seems both necessary and rational [1]. However, there are little who argue that the application of trigonometry to economics is blindingly obvious.

    This blog aims to explicitly reassure economics students that what they are learning will be useful in the future. An example of this is the concept of convex and concave functions, which play a crucial role in micro and macroeconomics. For me at least, I could not see into the future and realise that diminishing marginal products (that is, concave production functions) would be central to our studies into the growth of the macroeconomy. To summarise, I hope that this blog will make it clear to students that mathematics is useful in economics, and confirm to students that they are not just learning mathematics for the fun of it. I will try to spread my examples evenly over micro and macroeconomics, and econometrics, although it is certainly easier to use examples from microeconomics than the other two.

    The level of mathematics in this blog will certainly not exceed the level of MA100. Along with this, this blog will certainly not turn into a regurgitation of the MA100 lecture slides with a quick example at the end. Yes, I may spend a small amount of time to briefly summarise the content of the week, but I will state again that the purpose of this blog is to reveal to economists how the mathematics that they learn is genuinely useful in economics, not to teach mathematics. That saying, because the ideas are very introductory to begin with, finding explicit examples in economics may prove difficult. I will try to keep the equations and variables to a minimum, and work in words, but I definitely make no promises here.

    So that’s about it for administration. For more information about the LSESU Economics Society in general, please go to www.economicssociety.org or check out our Facebook Page. Will

    [1] - For example, see Lecture 12 and the application of the Lagrangian to Consumer Optimisation