I am trying to use the lregSlope function to evaluate the slope over a short interval from a 1 minute bar, using source.close.
I am trying to work out what are the units in the various mathex routines, specifically lregSlope. This is not specified in the routine definition.
Copying (for example) the time in days at the end of the bar, and the price in whatever units into R I get completely different answers, but rather closer if I work in pips. It could be the time that I am using, which is actually from the corresponding tick trace at the end of the bar, but a consistent error in time would not actually change the slope as that slope is deltaY/deltaX. Equally the routine only returns the slope so the intercept does not matter.
I don't know what the lreg function does at all. What is a "linear regression value" when it's out? A simple y=Ax+B should return the intercept and slope - it would be useful to return an adjusted R-squared as well. Is there a reference for mathex? I can't find one on the web although there are other mathex libraries.