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 ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Set boundary for least-square calculation
PostPosted: Wed, 4 Apr 2012 09:20:20 UTC 
Offline
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
 Profile  
 
 Post subject: Re: Set boundary for least-square calculation
PostPosted: Wed, 4 Apr 2012 13:38:03 UTC 
Offline
Moderator
User avatar

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
 Profile  
 
 Post subject: Re: Set boundary for least-square calculation
PostPosted: Wed, 4 Apr 2012 23:01:41 UTC 
Offline
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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
Contact Us | S.O.S. Mathematics Homepage
Privacy Statement | Search the "old" CyberBoard

users online during the last hour
Powered by phpBB © 2001, 2005-2011 phpBB Group.
Copyright © 1999-2013 MathMedics, LLC. All rights reserved.
Math Medics, LLC. - P.O. Box 12395 - El Paso TX 79913 - USA