# Math Help

Status
Not open for further replies.

#### shermaine

##### New Member
Given:

X = [ 1 1
1 1.5
1 3
1 3.5
1 4]

d = [ 3.5
2.5
2
1
1]

how do i get w = [X^T (X)]^-1 (X^T) d

The ans is [ 4.04
- 0.78]

I tried, but i cant the answer.
Thanks.

#### MrAl

##### Well-Known Member
Hi,

You must know a few things in order to solve this:

1. How to multiply matrixes and vectors.
2. How to compute the transpose of a matrix.
3. How to find the inverse of a matrix.

If you do not know how to do any of the above let us know.

If you do, then you proceed as follows:

1. Calculate the transpose of X, call this T.
2. Calculate T*X in that order using vector/matrix multiplication, call the result Y.
3. Find the inverse of Y (which is Y^-1), call that I.
4. Multiply I*T, call that S.
5. Finally, multiply S*d and that result is the answer which is approximately:
[4.037313433,
-0.783582090]

Remember that when you do matrix multiplication you have to observe the correct order as you
can not reverse the order like you can do with regular single number arithmetic multiplication like
2*3=6.

Last edited:
Status
Not open for further replies.

Replies
7
Views
2K
Replies
10
Views
2K
Replies
2
Views
1K
Replies
3
Views
976
Replies
6
Views
1K 