Distance between two lines.

distLines(x1, x2)

Arguments

x1

A numeric vector with positive norm.

x2

A numeric vector with positive norm and with the same length as x1.

Value

The distance.

Details

This function is used to build diagnostics during the construction of profile-likelihood confidence intervals. So the function is not intended to be used by itself.

The vectors x1 and x2 are scaled to have an unit Euclidean norm and to have the same direction. The distance between the lines is simply the distance between the unit vectors on the unit sphere.

Note

When a constrained optimisation is used for the determination of the lower or upper bound of the interval, we have to check that the gradient of the objective and that of the constraint are colinear, which is performed with this function.