Hi, I found a surprising result when multiplying a positive interval row vector by a positive interval vector.
All entries of both vectors are strictly positive intervals, so the resulting dot product should also have a positive lower bound. However, b * a returns an interval with a negative lower bound.
Minimal working example:
using Pkg
using IntervalArithmetic
Pkg.status("IntervalArithmetic")
a = Interval{Float64}[
interval(77.0713, 645.097),
interval(59.9388, 282.904),
interval(3.8025, 6.30973)
]
b = Interval{Float64}[
interval(2.35903e14, 3.16785e15) interval(2.36564e14, 1.38742e15) interval(3.89381e12, 1.68618e13)
]
println(a)
println(b)
println(size(a), " ", size(b))
println(b * a)
bb = vec(b)
s = zero(eltype(a))
for i in eachindex(a)
s += bb[i] * a[i]
end
println("manual dot = ", s)
On my side, the package version is:
IntervalArithmetic v1.0.9
The output of b * a is:
Interval{Float64}[[-9.28652e+17, 2.43619e+18]_com]
This is surprising because all entries are positive. The expected lower bound should be positive. A direct endpoint estimate gives approximately:
The upper bound agrees with the matrix multiplication result, but the lower bound is much too wide and becomes negative.
I understand that interval matrix multiplication may return an enclosure rather than the tightest possible interval. However, since this is a dot product of positive intervals, I wonder whether this behavior is expected, or whether the matrix multiplication path is using a method that loses sign information too aggressively.
Is this intended behavior in v1.0.9, or could it be a bug / missed optimization in interval matrix-vector multiplication?
Thanks!
Hi, I found a surprising result when multiplying a positive interval row vector by a positive interval vector.
All entries of both vectors are strictly positive intervals, so the resulting dot product should also have a positive lower bound. However,
b * areturns an interval with a negative lower bound.Minimal working example:
On my side, the package version is:
The output of
b * ais:This is surprising because all entries are positive. The expected lower bound should be positive. A direct endpoint estimate gives approximately:
The upper bound agrees with the matrix multiplication result, but the lower bound is much too wide and becomes negative.
I understand that interval matrix multiplication may return an enclosure rather than the tightest possible interval. However, since this is a dot product of positive intervals, I wonder whether this behavior is expected, or whether the matrix multiplication path is using a method that loses sign information too aggressively.
Is this intended behavior in v1.0.9, or could it be a bug / missed optimization in interval matrix-vector multiplication?
Thanks!