Integrating Along a 2D Line Segment

  • Context: Graduate 
  • Thread starter Thread starter Teg Veece
  • Start date Start date
  • Tags Tags
    2d Integrating Line
Click For Summary
SUMMARY

The discussion focuses on evaluating a squared exponential covariance function, cov(x,x'), specifically in the context of integrating along a 2D line segment. The covariance function is defined as cov(x,x') = e^{-(\frac{r^2}{2l^2})}, where r is the Euclidean distance and l is the lengthscale constant. The user successfully evaluates the covariance for both 1-D and 2-D cases but seeks assistance in integrating the covariance function from a point to a line segment, represented by the integral cov(([xstart,ystart],[xend,yend]),[xpoint,ypoint])=\int e^{-\frac{1}{2}(\frac{(x-xpoint)^2}{lengthscalex^2}+\frac{((mx+c)-ypoint)^2}{lengthscaley^2})}dx. The user has found a workaround by rotating the line segment but is looking for a direct solution to the integral.

PREREQUISITES
  • Understanding of squared exponential covariance functions
  • Familiarity with Euclidean distance calculations
  • Knowledge of integral calculus, particularly in multiple dimensions
  • Experience with Gaussian distributions and their properties
NEXT STEPS
  • Research methods for integrating Gaussian functions over line segments
  • Explore techniques for transforming coordinates to simplify integrals
  • Study the properties of covariance functions in multivariate statistics
  • Learn about numerical integration methods for complex functions
USEFUL FOR

Mathematicians, data scientists, and statisticians working with Gaussian processes, particularly those interested in covariance functions and integration techniques in multiple dimensions.

Teg Veece
Messages
8
Reaction score
0
I've been trying to evaluate an integral for the last few days now and it really has me stumped.
I was hoping that maybe someone here would be able to help me out.

So the function, cov(x,x'), is fairly basic. It's called a squared exponential covariance function and it evaluates the covariance between two points.

<br /> cov(x,x&#039;) = e^{-(\frac{r^2}{2l^2})}<br />

r is just the Euclidean distance between the points x and x'. l is the lengthscale constant for that dimension.

So for example the 1-D case, with an lengthscale of say 2, the covarance between a x = 5 and x' = 9 is:
<br /> cov(5,9) = e^{-\frac{1}{2}(\frac{(5-9)^2}{(3)^2})}= 0.4111<br />

In the 2-D case with an x lengthscale of 2 and a y lengthscale of 1 the covariance between x = (5,3) and x'=(9,6) is:

<br /> cov([5,3],[9,6]) = e^{-\frac{1}{2}(\frac{(5-9)^2}{3^2}+\frac{(3-6)^2}{1^2})}= 0.0046<br />So that's the function evaluated from a point to another point. However, I want to evaluate it from a point to a line segment.
I've solved this for the 1-D case but the 2-D case seems to be a bit trickier.

I've rewritten the covariance function so that it incorporates the equation of the line:

<br /> cov(([xstart,ystart],[xend,yend]),[xpoint,ypoint])=\int e^{-\frac{1}{2}(\frac{(x-xpoint)^2}{lengthscalex^2}+\frac{((mx+c)-ypoint)^2}{lengthscaley^2})}dx<br />

[xstart,ystart] are the starting coordinates of the line segment and [xend,yend] and the ending coordinates. [xpoint,ypoint] are the coordinates of the point. Everything in the equation is now a constant except for x. (m is the slope of the line segment and c is the y intercept of it)
So the limits of the integral would be xstart and xend.

I'm not sure how to integrate this however.

I have been able to get a solution by rotating the line segment and the point about the origin so that the line segment's slope is zero. Then it's very similar to the 1-D case. However is it possible to solve that integral without resorting to this.

Any help at all would be greatly appreciated. If you need me to clarify anything, just let me know.

I've summarised my problem in the pic below.
f9nms7.jpg
 
Last edited:
Physics news on Phys.org
Or I guess in other words, what I'm asking is it is possible to determine the mean value of the Gaussian distribution along a line segment like in the diagram below?
2w7n33m.jpg
 

Similar threads

  • · Replies 27 ·
Replies
27
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K