0

I have a function X_t which I have defined anonymously to take as variables t which is a scalar time and z which is a vector of potentially arbitrary dimension.

That is,

X_t = @(t,z) fun(t,z).

I want to find the integral L2 norm of this object over the space of z's. That is, I want to find

X_t_norm = @(t) integral(@(z) abs(X_t(t,z))^2, -infinity,infinity).

Now clearly two things are a problem here.

Firstly, taking the limits as infinite isn't going to work, but I think I should be fine to take the limits as just large numbers (100 would certainly be enough for my purposes).

However, the real problem comes with taking this integral. My variable z is a vector of somewhat arbitrary (even) dimension and as a result I've gotten stuck figuring out how to pass z into the integral in such a way that I can compute this n-dimensional integral. (Basically I want to vary the length of z for different cases and compute the L2 norm for each of these cases).

In particular, I'm not sure how to tell the integral function to compute the integral over every component of z between the limits discussed above.

Any help would be greatly appreciated!

Ishara Madhawa
  • 3,549
  • 5
  • 24
  • 42
Carrier
  • 31
  • 5
  • Those aren't integral norms. I need the capital L2 norm not the lowercase l2 norm. – Carrier Jun 13 '18 at 14:01
  • When you say "dimension", I assume here you mean "size", i.e. it could have 10 elements or 100 elements, but `z` will always be a 1D or 2D array? – Wolfie Jun 13 '18 at 14:06
  • Yes it will always be a column vector. – Carrier Jun 13 '18 at 14:06
  • Not sur to understand but are you looking for `integral(@(t) abs(X_t(t,5)).^2, -inf,inf)` ? where you fix `z` to be whatever you want (in this example z = 5) – obchardon Jun 13 '18 at 15:03
  • No thats not it at all, z is a **vector** of some dimension and i want integrate with respect to z not with respect to t. – Carrier Jun 13 '18 at 15:05
  • Your question is not clear, you should edit your question and give us a working example and the expected result. It looks like you want to mix a numerical solution (the function `integral`) with an analytical solution (the function `int`)... You said that `z` should be a vector, but in your code Z∈ℝ,... – obchardon Jun 13 '18 at 15:30
  • Frankly I think you just didn't read it or didn't understand it. I made it clear right at the start that z was a vector, and it is clear that the integral is respect to z given a specific value of t. The fact that I didnt write z out explicitly as a vector is rather the whole point of the question since it is of arbitrary dimension. Nowhere in my code do i specify that z is a real number except maybe in the limits which are really only there to indicate that i want to integrate across all values of z in all components. – Carrier Jun 13 '18 at 15:47
  • I thought the question was clear. **Is there an upper bound on the size of `z`?** You need to keep in mind that if `z` is very high dimensional then a brute force numerical approximation of the integral is going to be very slow. For example, if `z` is 100-dimensional, and say we only use 10 samples along each dimension to estimate the integral, then we require at least 10^100 samples of the function which is infeasible. – jodag Jun 14 '18 at 13:45

0 Answers0