-2
$\begingroup$

I'm following a course that asks me the following question: Calculate the logits a and b for the following formula..

I don't understand how to do this, I would like to understand how to practically calculate this.

UPDATE:
I understand now:
a = -0.5*0.2 + 0.2*0.5 + 0.1*0.6 + 0.1
b = 0.7*0.2 + -0.8*0.5 + 0.2*0.6 + 0.2

enter image description here

  • 0
    First multiply the matrix and the vector (viewing the vector as a $3 \times 1$ matrix), then add the second vector. Whatever you get is equal to $\begin{pmatrix} a \\ b \end{pmatrix}$.2017-01-07
  • 0
    Thanks, I'm not sure I understand. My problem is -I guess- that I don't understand how to multiply the matrix and the vector.2017-01-07
  • 0
    Do you know how to multiply an $m \times n$ matrix and an $n \times k$ matrix?2017-01-07
  • 0
    I think I do, I'm using this ref to learn it: https://www.mathsisfun.com/algebra/matrix-multiplying.html2017-01-07
  • 0
    O, thanks @kccu I understand now. Your point about 'multiply the matrix and the vector' got me on the right track.2017-01-07
  • 0
    For whoever downvoted, thanks for that! Just trying to learn something new :-)2017-01-07
  • 1
    Okay, I posted an answer to clarify how multiplying a matrix and a vector is a special case of multiplying two matrices.2017-01-07

1 Answers 1

2

Say we want to multiply an $m \times n$ matrix $A$ and an $n \times k$ matrix $B$: $$\begin{pmatrix}a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1}& \cdots & a_{mn}\end{pmatrix} \begin{pmatrix}b_{11} & \cdots & b_{1n} \\ \vdots & \ddots & \vdots \\ b_{n1}& \cdots & b_{nk} \end{pmatrix}.$$ The answer will be an $m \times k$ matrix $C$. The entry in the $i$th row and $j$th column of $C$ will be the dot product of the $i$th row of $A$ with the $j$th column of $B$, as in the reference you linked.

if $B$ is a column vector, i.e., $k=1$, then we have $$\begin{pmatrix}a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1}& \cdots & a_{mn}\end{pmatrix} \begin{pmatrix}b_{1} \\ \vdots \\ b_{n} \end{pmatrix}.$$ The answer will be an $m \times 1$ matrix, i.e., another column vector. Its entry in the $i$th row and $1$st column (the only column) is the dot product of the $i$th row of $A$ with the $1$st column of $B$ (i.e., the vector $B$ itself): $$\begin{pmatrix}a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1}& \cdots & a_{mn}\end{pmatrix} \begin{pmatrix}b_{1} \\ \vdots \\ b_{n} \end{pmatrix}=\begin{pmatrix}a_{11}b_1+a_{12}b_2+\cdots + a_{2n}b_n\\a_{21}b_1+a_{22}b_2+\cdots + a_{2n}b_n\\ \vdots \\ a_{m1}b_1+a_{m2}b_2+\cdots + a_{mn}b_n \end{pmatrix}.$$