[R-SIG-Finance] Range intersections

Mark Knecht markknecht at gmail.com
Sat Jul 27 00:22:37 CEST 2013


For the sake of asking here assume I have 5 models that attempt to
predict a pair of future values like tomorrow's high & low. The
predictions are placed in a matrix with the low prediction in column 1
and the high prediction in column 2. _IF_ there is an intersection of
all 5 predictions then I can test for that using the simple equation
in Range1. However if there is a prediction that's a complete outlier
as is Pred2[4,] then the simple equation fails and says the high is
less than the low.

Are there any R packages that automatically handle simple intersection
problems like this? My real goals include things like probability
distributions across the ranges, but for now I'm just looking for
what's out there?

Thanks,
Mark


Pred1 = matrix(data=NA, nrow=5, ncol=2)
Pred1[1,] = c(100,110)
Pred1[2,] = c(88,125)
Pred1[3,] = c(92,120)
Pred1[4,] = c(25,105)
Pred1[5,] = c(91,121)

Range1 = c(max(Pred1[,1]), min(Pred1[,2]))
Range1

Pred2 = matrix(data=NA, nrow=5, ncol=2)
Pred2[1,] = c(100,110)
Pred2[2,] = c(88,125)
Pred2[3,] = c(92,120)
Pred2[4,] = c(25,70) #outlier - the high is too low
Pred2[5,] = c(91,121)

Range2 = c(max(Pred2[,1]), min(Pred2[,2]))
Range2



More information about the R-SIG-Finance mailing list