1 registered members (rki),
405
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: polyfit order 1 - coeff[1] sign is reversed?
[Re: jcl]
#430282
09/26/13 12:33
09/26/13 12:33
|
Joined: Jun 2013
Posts: 1,609
DdlV
OP
Serious User
|
OP
Serious User
Joined: Jun 2013
Posts: 1,609
|
Thanks for the explanation, jcl, but this simpleton still doesn't get it. I don't understand the inconsistency. LinearReg is the same as polyfit order 1, and Linear Reg does generate coefficients. Just because one calls them "Slope" and "Intercept" doesn't change that. I can plug those coefficients into an array and pass them to polynom, and should get the same result as if they were generated by polyfit. polynom doesn't know and shouldn't care that the coefficients came from polyfit, LinearReg, random number generators, or anywhere else. Someone - the Zorro gods, the trading community, whoever - has decided that LinearReg should work in forward time and polynom/polyfit in reverse time. Please don't tell me that this difference in behavior is simple math, because it isn't. If you wish to maintain this difference, please highlight it in the manual. Although it would seem to me a better solution to have all functions work in the same time direction.
Thanks.
|
|
|
Re: polyfit order 1 - coeff[1] sign is reversed?
[Re: jcl]
#430293
09/26/13 13:33
09/26/13 13:33
|
Joined: Jun 2013
Posts: 1,609
DdlV
OP
Serious User
|
OP
Serious User
Joined: Jun 2013
Posts: 1,609
|
Thanks jcl. Actually, the problem is forest vs. trees. At your trees level, what you say makes some sense. Although I don't understand your distinction between "calculating the slope of a line" and "calculates ... coefficients" - the slope is a coefficient. In any case, at the forest level, it breaks down. An order 1 polynomial is a straight line (if you don't believe me, your 2nd link above says so ). 2 functions doing the same thing at the same polynomial order should return the same results. Imagine further that Zorro had a "LinearRegnom" function designed to take the Slope and Intercept and compute the value for any bar - like, say, polynom does. The results should be identical, and the input coefficients should be interchangeable. But hey - it's your system - look at it whatever way you wish! Just realize that you caused this user some confusion. If you're going to leave the functions the way they are, please at least point out in the manual the difference in time perspective, x=0 point, whatever you want to call it. Thanks.
|
|
|
|