How to calculate the projection of a function in a vector space

In summary: But what if f(x) is not a polynomial? How do I find the projection then?In summary, in order to find the linear polynomial g nearest to the function f in a real linear space with inner product (f, g) = integral(-1 to 1)[f(x)g(x)]dx, one must calculate the projection of f onto the set of basis functions. This can be done by using the formula: ∑(⟨ei, v⟩/⟨ei, ei⟩)ei, where ei represents the basis functions and v represents the function f. If the function f is not a polynomial, this process can still be applied by using a set of basis functions that are appropriate for the function.
  • #1
Cassi
18
0

Homework Statement


In the real linear space C(-1, 1) with inner product (f, g) = integral(-1 to 1)[f(x)g(x)]dx, let f(x) = ex and find the linear polynomial g nearest to f.

Homework Equations

The Attempt at a Solution


I understand that the best approximation for g is equal to the projection of f. Therefore, in order to find the linear polynomial g nearest to f, I must calculate this projection. However, I do not know how to solve for the projection.

(The solution in my book is g(x) = 1/2(e-e-1) + (3/e)x)
 
Physics news on Phys.org
  • #2
Cassi said:

Homework Statement


In the real linear space C(-1, 1) with inner product (f, g) = integral(-1 to 1)[f(x)g(x)]dx, let f(x) = ex and find the linear polynomial g nearest to f.

Homework Equations

The Attempt at a Solution


I understand that the best approximation for g is equal to the projection of f. Therefore, in order to find the linear polynomial g nearest to f, I must calculate this projection. However, I do not know how to solve for the projection.

(The solution in my book is g(x) = 1/2(e-e-1) + (3/e)x)

This problem is almost, word-for-word, the same as one you have already described in this forum (the one about C(1,3) and the function 1/x), and you have already been given the solution. What is it you are not seeing?
 
  • #3
If you have a set of bases, ##\{e_i\}## and a function ##v##, the projection is ##\displaystyle \sum_i \frac{ \langle e_i, v \rangle}{\langle e_i, e_i \rangle} e_i##.
 
  • #4
Ray Vickson said:
This problem is almost, word-for-word, the same as one you have already described in this forum (the one about C(1,3) and the function 1/x), and you have already been given the solution. What is it you are not seeing?
I do not see the relationship between the definition of a projection and finding the specific projection of a function. I do not understand how to apply the concept.
 
  • #5
@Cassi: When you abandon threads where you have been given help, why should we continue to waste our time with you?
 
  • #6
I did not abandon a thread. I asked a new question for clarification. How do you calculate the projection of a particular function?
Thank you for your insightful help.
 
  • #7
The space that you are projecting onto has a set of basis functions.
In this case, let's say they are the powers of x from 0 to N, since we are looking for linear polynomials N=1. Note that these are not orthonormal bases given your definition of the inner product.
The projection of ##f(x)=e^x## onto the span of your first basis ##x^0## is ##\displaystyle \frac{\int_{-1}^1 f(x)b_0 dx}{\int_{-1}^1 b_0b_0 dx} b_0= \frac{ \int_{-1}^1 e^x (1) dx }{\int_{-1}^1 dx}(1)##, repeat this process for higher powers of x up to N.
 
  • #8
Cassi said:
I did not abandon a thread. I asked a new question for clarification. How do you calculate the projection of a particular function?
If the new question pertains to a thread you have already started, ask it it the existing thread, not a new one. If the question is unrelated to the existing thread, then a new thread is appropriate.
 
  • #9
Cassi said:
I did not abandon a thread. I asked a new question for clarification. How do you calculate the projection of a particular function?
Thank you for your insightful help.

Several people have told you exactly how to do it, complete with explicit formulas. You need to do the actual work of applying those formulas.
 
  • #10
  • Like
Likes Mark44
  • #11
The only relevant difference between this problem and this problem (as continued here) is that in this problem you will end up having to minimize a function of two variables (the coefficients of [itex]1[/itex] and [itex]x[/itex]) instead of a function of one variable.

But the principle is the same: the "nearest" linear polynomial is the linear polynomial [itex]g[/itex] which minimizes the distance between [itex]f[/itex] and [itex]g[/itex]. This is also, for the reasons given in the first thread linked above, the linear polynomial which minimizes the square of that distance. This is easier to work with and given by the formula in both the cited threads (with an appropriate adjustment to the domain of integration).
 
  • #12
RUber said:
The space that you are projecting onto has a set of basis functions.
In this case, let's say they are the powers of x from 0 to N, since we are looking for linear polynomials N=1. Note that these are not orthonormal bases given your definition of the inner product.
The projection of ##f(x)=e^x## onto the span of your first basis ##x^0## is ##\displaystyle \frac{\int_{-1}^1 f(x)b_0 dx}{\int_{-1}^1 b_0b_0 dx} b_0= \frac{ \int_{-1}^1 e^x (1) dx }{\int_{-1}^1 dx}(1)##, repeat this process for higher powers of x up to N.
Thank you, this was very helpeful. So I see that when it is a polynomial, I know repeat this with b1 = x, etc.
 

Related to How to calculate the projection of a function in a vector space

1. What is a projection in a vector space?

A projection in a vector space is a mapping that takes a vector and returns a new vector that is the closest approximation of the original vector onto a subspace of the vector space.

2. How do you calculate the projection of a vector onto a subspace?

To calculate the projection of a vector onto a subspace, you need to use the formula: projU(v) = (v ⋅ u1)u1 + (v ⋅ u2)u2 + ... + (v ⋅ un)un, where v is the original vector, u1, u2, ..., un are the basis vectors of the subspace, and projU(v) is the projection of v onto the subspace U.

3. Can a vector have multiple projections onto different subspaces?

Yes, a vector can have multiple projections onto different subspaces. This is because there can be different subspaces that are equally close to the vector, resulting in different projections.

4. How do you determine the closest subspace to a vector?

To determine the closest subspace to a vector, you can use the formula: ||v − projU(v)||, where v is the original vector and projU(v) is the projection of v onto the subspace U. The subspace with the smallest value of ||v − projU(v)|| is the closest subspace to the vector.

5. How is projection used in real-world applications?

Projection is used in various real-world applications, such as image processing, computer graphics, and data analysis. It is especially useful in reducing the dimensionality of data while preserving important information. For example, in image compression, projection is used to reduce the size of an image while retaining its visual quality. In data analysis, projection can be used to find the most important features of a dataset by projecting it onto a lower-dimensional subspace.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
319
  • Calculus and Beyond Homework Help
Replies
2
Views
410
  • Calculus and Beyond Homework Help
Replies
1
Views
787
  • Calculus and Beyond Homework Help
Replies
1
Views
344
  • Calculus and Beyond Homework Help
Replies
2
Views
233
  • Calculus and Beyond Homework Help
Replies
17
Views
2K
  • Calculus and Beyond Homework Help
2
Replies
58
Views
3K
  • Calculus and Beyond Homework Help
Replies
5
Views
846
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
518
Back
Top