Exploring Gram Schmidt Algorithms for QTQ-I in MATLAB

  • Thread starter Jamin2112
  • Start date
In summary, the Homework Statement is about comparing a variety of Graham Schmidt algorithms by looking at ||QTQ-I||1. The Attempt at a Solution confused about the qi which appears in the Classical one. Where did it come from? What does it mean? Same with the stuff in the Modified one.
  • #1
Jamin2112
986
12

Homework Statement



So my assignment is to compare a variety of Graham Schmidt algorithms by looking at ||QTQ-I||1

Homework Equations



So my teacher has the algorithms for the Gram Schmidt and "Modified Gram Schmidt" written as

screen-capture-3-21.png

The Attempt at a Solution



So I'm confused about the qi which appears in the Classical one. Where did it come from? What does it mean?

Also, what is the rij? Just a constant to use in the next line?

Same with the stuff in the Modified one.

I just went ahead and typed into MATLAB even though it ain't makin' sense.
screen-capture-2-16.png
 
Physics news on Phys.org
  • #2
Hi Jamin2112! :smile:

Jamin2112 said:
So I'm confused about the qi which appears in the Classical one. Where did it come from? What does it mean?

qi is introduced in this algorithm.
The point of the algorithm is to find a set of qi that form an orthonormal basis.
That is, qi is the "output" of the algorithm.

Jamin2112 said:
Also, what is the rij? Just a constant to use in the next line?

Yes, it is just a constant to use in the next line.

Note that it holds the result for the inner product of qi and aj, which is ultimately needed to calculate qj.
 
  • #3
I like Serena said:
Hi Jamin2112! :smile:



qi is introduced in this algorithm.
The point of the algorithm is to find a set of qi that form an orthonormal basis.
That is, qi is the "output" of the algorithm.


But if you look in the Classical Gram Schmidt algorithm, q is used on the right side of an equality before it has been defined.
 
  • #4
Jamin2112 said:
But if you look in the Classical Gram Schmidt algorithm, q is used on the right side of an equality before it has been defined.

I see why you might think that, but no it isn't.
Check the range of the inner loop.

Any qj is only used after it has been calculated.

In the first iteration of the outer loop (j=1), the inner loop is not executed (since i runs from 1 to j-1).
In every next iteration of the outer loop, only the qj that have already been calculated are used.
 
  • #5
I like Serena said:
I see why you might think that, but no it isn't.
Check the range of the inner loop.

Any qj is only used after it has been calculated.

In the first iteration of the outer loop (j=1), the inner loop is not executed (since i runs from 1 to j-1).
In every next iteration of the outer loop, only the qj that have already been calculated are used.

hmmmmm ...

Well, the program seems to running without any errors, so I'll take your word for it!
 
  • #6
Jamin2112 said:
hmmmmm ...

Well, the program seems to running without any errors, so I'll take your word for it!

All right. I'll leave it at that then. :smile:

Let me know if you have more questions.
 
  • #7
I like Serena said:
All right. I'll leave it at that then. :smile:

Let me know if you have more questions.

Turned it in and got 10/10 [PLAIN]http://www.fastfatburning.org/wp-content/plugins/RSSPoster_PRO/cache/c2584_success_baby.jpg

But I do have another question. Refer yourself to my QR Decomposition thread.
 
Last edited by a moderator:

1. What is Gram Schmidt algorithm?

Gram Schmidt algorithm is a mathematical method used to find an orthonormal basis for a vector space. It is commonly used in linear algebra and signal processing to transform a set of vectors into an orthogonal set.

2. How does Gram Schmidt algorithm work?

The Gram Schmidt algorithm works by taking a set of linearly independent vectors and transforming them into a set of orthogonal vectors. This is achieved by first normalizing the first vector, then subtracting its projection from the second vector, and so on for each subsequent vector in the set.

3. Why is Gram Schmidt algorithm important?

Gram Schmidt algorithm is important because it allows for the simplification of complex vector calculations and helps in solving systems of linear equations. It is also used in various fields such as computer graphics, data compression, and machine learning.

4. How is Gram Schmidt algorithm implemented in MATLAB?

In MATLAB, Gram Schmidt algorithm can be implemented using the qr() function. This function takes in a matrix as an input and returns a QR decomposition, which can then be used to obtain the orthonormal basis using the orth() function.

5. What are the applications of Gram Schmidt algorithm?

Gram Schmidt algorithm has various applications in mathematics, engineering, and computer science. Some common applications include solving linear systems of equations, signal processing, data compression, and image processing. It is also used in algorithms for machine learning and artificial intelligence.

Similar threads

  • Calculus and Beyond Homework Help
Replies
16
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
5K
Replies
13
Views
3K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
10
Views
3K
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
Back
Top