# S.O.S. Mathematics CyberBoard

Your Resource for mathematics help on the web!
 It is currently Mon, 20 May 2013 04:21:09 UTC

 All times are UTC [ DST ]

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Set boundary for least-square calculationPosted: Wed, 4 Apr 2012 09:20:20 UTC
 S.O.S. Newbie

Joined: Wed, 4 Apr 2012 08:38:59 UTC
Posts: 2
Hello,

When calculating least-squares we use the form Xw=y
(where X is a matrix and y is a vector of appropriate dimensions).

This gives us an approximation, and it can happen that the resulting w will be such that Xw<y.

Is there a way how to make every entry in w big enough so that every Xw≥y?

And is it possible, at the same time, to make sure every entry in Xw is less that some other number?

Thank you
Best regards
hugo

Top

 Post subject: Re: Set boundary for least-square calculationPosted: Wed, 4 Apr 2012 13:38:03 UTC
 Moderator

Joined: Wed, 30 Mar 2005 04:25:14 UTC
Posts: 12097
Location: Austin, TX
hugolove wrote:
Hello,

When calculating least-squares we use the form Xw=y
(where X is a matrix and y is a vector of appropriate dimensions).

This gives us an approximation, and it can happen that the resulting w will be such that Xw<y.

Is there a way how to make every entry in w big enough so that every Xw≥y?

And is it possible, at the same time, to make sure every entry in Xw is less that some other number?

Thank you
Best regards
hugo

Check out Fourier Motzkin elimination.

_________________
(\ /)
(O.o)
(> <)
This is Bunny. Copy Bunny into your signature to help him on his way to world domination

Top

 Post subject: Re: Set boundary for least-square calculationPosted: Wed, 4 Apr 2012 23:01:41 UTC
 S.O.S. Newbie

Joined: Wed, 4 Apr 2012 08:38:59 UTC
Posts: 2
Hello Shadow, thank you very much for your help. I tried what you suggest.

When calculating least-squares we use the form Xw=y.

I have created this (10x5)Matrix X:
2 4 1 3 3
3 5 2 2 3
6 6 1 1 4
0 7 3 7 5
2 8 4 10 2
1 0 5 3 3
1 6 0 0 7
2 7 7 5 0
3 8 8 4 7
4 9 0 3 8

and this (10x1) vector y1.....y10:
105
45
36
78
20
60
30
20
79
94

nvar = 5;
then, when I Fourier Motzkin elimination (fourmotz) in Matlab: fourmotz(X,y,nvar)

.....I get this Matrix M:
0 7 3 7 5
1 0 5 3 3
6 6 1 1 4
3 5 2 2 3
2 4 1 3 3
4 9 0 3 8
3 8 8 4 7
2 7 7 5 0
2 8 4 10 2
1 6 0 0 7

What shall I do then?

I tried to calculate least square from this M Matrix, giving me w1....w5:
5.5543
-5.8469
0.6521
6.3349
11.9513

and then create a table by multiplication of these w numbers with transposed M, like:
w1*Mn1,m1..........w1*Mn1,m10
.............................
.............................
.............................
w5*Mn5,m1..........w5*Mn5,m10

and do sum of its columns, thinking I would get values same or bigger than y1.....y10:
105 45 36 78 20 60 30 20 79 94 (transposed vector of y)

But I did not get it. I got these numbers:
65.12 63.67 53.03 37.25 43.23 84.21 84.10 6.41 54.19 54.13

So my algorithm is obviously wrong.
Do you know what have I done wrong please
Best regards
hugo

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC [ DST ]

#### Who is online

Users browsing this forum: No registered users

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forum

Search for:
 Jump to:  Select a forum ------------------ High School and College Mathematics    Algebra    Geometry and Trigonometry    Calculus    Matrix Algebra    Differential Equations    Probability and Statistics    Proposed Problems Applications    Physics, Chemistry, Engineering, etc.    Computer Science    Math for Business and Economics Advanced Mathematics    Foundations    Algebra and Number Theory    Analysis and Topology    Applied Mathematics    Other Topics in Advanced Mathematics Other Topics    Administrator Announcements    Comments and Suggestions for S.O.S. Math    Posting Math Formulas with LaTeX    Miscellaneous