HP Forums
x’ forecast only on HP-32E - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: x’ forecast only on HP-32E (/thread-20109.html)

Pages: 1 2


x’ forecast only on HP-32E - Matt Agajanian - 06-20-2023 03:04 AM

Hi all.

I’m wondering why the x’ statistical forecast function was omitted on most models except the 32E for example.


RE: x’ forecast only on HP-32E - Joe Horn - 06-20-2023 05:11 AM

Not quite true. The "x hat" (AKA "x forecast" and "estimate x") function is also found in the HP 10B, 10BII, 10C, 12C, 14B, 17B, 17BII, 17BII+, 18C, 19B, 19BII, 19BII+, 20S, 21S, 22S, 27S, 28C, 28S, 30S, 32S, 32SII, 33E, 33C, 33S, 38E, 38C, 38G, 39G, 39G+, 39GS, 40G, 40G+, 40GS, 42S, 48S, 48SX, 48G, 48G+, 48GX, 49G, 49G+, 50G... and maybe others I'm forgetting. Smile


RE: x’ forecast only on HP-32E - Matt Agajanian - 06-20-2023 05:22 AM

(06-20-2023 05:11 AM)Joe Horn Wrote:  Not quite true. The "x hat" (AKA "x forecast" and "estimate x") function is also found in the HP 10B, 10BII, 10C, 12C, 14B, 17B, 17BII, 17BII+, 18C, 19B, 19BII, 19BII+, 20S, 21S, 22S, 27S, 28C, 28S, 30S, 32S, 32SII, 33E, 33C, 33S, 38E, 38C, 38G, 39G, 39G+, 39GS, 40G, 40G+, 40GS, 42S, 48S, 48SX, 48G, 48G+, 48GX, 49G, 49G+, 50G... and maybe others I'm forgetting. Smile

My amnesia must be kicking in. Thanks!


RE: x’ forecast only on HP-32E - Dave Britten - 06-20-2023 12:56 PM

(06-20-2023 05:11 AM)Joe Horn Wrote:  Not quite true. The "x hat" (AKA "x forecast" and "estimate x") function is also found in the HP 10B, 10BII, 10C, 12C, 14B, 17B, 17BII, 17BII+, 18C, 19B, 19BII, 19BII+, 20S, 21S, 22S, 27S, 28C, 28S, 30S, 32S, 32SII, 33E, 33C, 33S, 38E, 38C, 38G, 39G, 39G+, 39GS, 40G, 40G+, 40GS, 42S, 48S, 48SX, 48G, 48G+, 48GX, 49G, 49G+, 50G... and maybe others I'm forgetting. Smile

I always thought it was kind of odd they included it on the 12C but not the 11C or 15C.


RE: x’ forecast only on HP-32E - brouhaha - 06-20-2023 09:12 PM

(06-20-2023 12:56 PM)Dave Britten Wrote:  I always thought it was kind of odd they included it on the 12C but not the 11C or 15C.

"Life is short and ROM is full."
- Bill Wickes

But also there aren't extra key assignments available on the 11C and 15C. That's why the 15C had to move all but two of the number comparisions into "g TEST <n>" sequences.

It's easy enough to write a subroutine to do it on the 11C and 15C. Swap two pairs of statistics registers (R3 with R5, R4 with R6), compute the y linear estimate, swap back. On the 15C this can be fairly conveniently done in the subroutine without disturbing the stack with a sequence of "x <>" instructions.


RE: x’ forecast only on HP-32E - Matt Agajanian - 06-21-2023 01:15 AM

(06-20-2023 09:12 PM)brouhaha Wrote:  
(06-20-2023 12:56 PM)Dave Britten Wrote:  I always thought it was kind of odd they included it on the 12C but not the 11C or 15C.

"Life is short and ROM is full."
- Bill Wickes

But also there aren't extra key assignments available on the 11C and 15C. That's why the 15C had to move all but two of the number comparisions into "g TEST <n>" sequences.

It's easy enough to write a subroutine to do it on the 11C and 15C. Swap two pairs of statistics registers (R3 with R5, R4 with R6), compute the y linear estimate, swap back. On the 15C this can be fairly conveniently done in the subroutine without disturbing the stack with a sequence of "x <>" instructions.

Just to clarify, I would be swapping Σx & Σy. Right?


RE: x’ forecast only on HP-32E - Joe Horn - 06-21-2023 03:19 AM

(06-21-2023 01:15 AM)Matt Agajanian Wrote:  
(06-20-2023 09:12 PM)brouhaha Wrote:  It's easy enough to write a subroutine to do it on the 11C and 15C. Swap two pairs of statistics registers (R3 with R5, R4 with R6), compute the y linear estimate, swap back. On the 15C this can be fairly conveniently done in the subroutine without disturbing the stack with a sequence of "x <>" instructions.

Just to clarify, I would be swapping Σx & Σy. Right?

Yes, but also swapping Σx² & Σy².


RE: x’ forecast only on HP-32E - Matt Agajanian - 06-21-2023 04:07 AM

(06-21-2023 03:19 AM)Joe Horn Wrote:  
(06-21-2023 01:15 AM)Matt Agajanian Wrote:  Just to clarify, I would be swapping Σx & Σy. Right?

Yes, but also swapping Σx² & Σy².

Excellent. Thank you.


RE: x’ forecast only on HP-32E - Namir - 06-21-2023 07:09 AM

If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

My 2 cents worth!

Namir


RE: x’ forecast only on HP-32E - Dave Britten - 06-21-2023 11:36 AM

(06-21-2023 07:09 AM)Namir Wrote:  If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

My 2 cents worth!

Namir

So as long as I'm sloppy and inaccurate with my x measurements, then I'm okay? Big Grin


RE: x’ forecast only on HP-32E - rawi - 06-21-2023 01:59 PM

Namir wrote:
Quote:If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

Strictly speaking, it is not a forecast of x, but it answers the question: What x will result in a forecast of a given y?


RE: x’ forecast only on HP-32E - Matt Agajanian - 06-21-2023 10:36 PM

(06-21-2023 01:59 PM)rawi Wrote:  Namir wrote:
Quote:If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

Strictly speaking, it is not a forecast of x, but it answers the question: What x will result in a forecast of a given y?

I got what you mean. Just so I can understand the mathematics behind that, in what way is this method not a forecast?

Thanks


RE: x’ forecast only on HP-32E - Namir - 06-22-2023 10:53 AM

(06-21-2023 11:36 AM)Dave Britten Wrote:  
(06-21-2023 07:09 AM)Namir Wrote:  If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

My 2 cents worth!

Namir

So as long as I'm sloppy and inaccurate with my x measurements, then I'm okay? Big Grin

Dave,

If there are errors in measuring x and y then one needs a different set of equations to calculate the slope and intercept--the Demming regression! :-)

Namir


RE: x’ forecast only on HP-32E - Namir - 06-22-2023 10:57 AM

(06-21-2023 01:59 PM)rawi Wrote:  Namir wrote:
Quote:If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

Strictly speaking, it is not a forecast of x, but it answers the question: What x will result in a forecast of a given y?

I hear you ... perhaps slightly more accurately put .... What x will result in a forecast of a given projected value of y.

BTW .. I am not a statistitcian (by education) ... although I spend a lot of time tinkering with curve fitting ... and probably committing an untold number of statistical herressies that would justify my burning at the stake!

Namir


RE: x’ forecast only on HP-32E - rawi - 06-22-2023 12:05 PM

Namir wrote:
Quote:I got what you mean. Just so I can understand the mathematics behind that, in what way is this method not a forecast?

The point is that x influences y. Normally x can be set (e.g. advertising spendings, price) or you can wait for a certain x (if x is time) and then you get for this x a forecast of y with a mean (normally used as the forecast), an error distribution (normally assumed to be normally distributed with a standard deviation for which formulas exist). This error distribution is essential for a forecast. For example, from this you can get a 95% confidence interval for your forecast.

If you use a given value of y to estimate for which x you will get the mean forecast of this specific y you just get a single value for x, no distribution information, no standard deviation. Therefore it is not possible to compute a confidence interval. You cannot set y and then get x, it's vice versa.


RE: x’ forecast only on HP-32E - Dave Britten - 06-22-2023 12:22 PM

(06-22-2023 12:05 PM)rawi Wrote:  Namir wrote:
Quote:I got what you mean. Just so I can understand the mathematics behind that, in what way is this method not a forecast?

The point is that x influences y. Normally x can be set (e.g. advertising spendings, price) or you can wait for a certain x (if x is time) and then you get for this x a forecast of y with a mean (normally used as the forecast), an error distribution (normally assumed to be normally distributed with a standard deviation for which formulas exist). This error distribution is essential for a forecast. For example, from this you can get a 95% confidence interval for your forecast.

If you use a given value of y to estimate for which x you will get the mean forecast of this specific y you just get a single value for x, no distribution information, no standard deviation. Therefore it is not possible to compute a confidence interval. You cannot set y and then get x, it's vice versa.

Couldn't you just find the minimum and maximum values of x for which the given value of y falls within a 95% confidence interval? (Disclaimer: I am not a statistician.)


RE: x’ forecast only on HP-32E - Namir - 06-24-2023 12:37 AM

(06-22-2023 12:05 PM)rawi Wrote:  Namir wrote:
Quote:I got what you mean. Just so I can understand the mathematics behind that, in what way is this method not a forecast?

The point is that x influences y. Normally x can be set (e.g. advertising spendings, price) or you can wait for a certain x (if x is time) and then you get for this x a forecast of y with a mean (normally used as the forecast), an error distribution (normally assumed to be normally distributed with a standard deviation for which formulas exist). This error distribution is essential for a forecast. For example, from this you can get a 95% confidence interval for your forecast.

If you use a given value of y to estimate for which x you will get the mean forecast of this specific y you just get a single value for x, no distribution information, no standard deviation. Therefore it is not possible to compute a confidence interval. You cannot set y and then get x, it's vice versa.

Excelllent! Well stated!!


RE: x’ forecast only on HP-32E - rawi - 06-24-2023 02:32 PM

Dave Britten wrote:
Quote:Couldn't you just find the minimum and maximum values of x for which the given value of y falls within a 95% confidence interval?
This would be possible if the x-variable had an distribution like the y-variable. But it has not. For instance x can be a time variable like a year. If there is an increasing trend a lower y would lead to a lower x, in this case to the beginning of the year. It easily can be that due to saisonality in the beginning of the year there is a higher y than in the middle of the year. So this does not make sense.


RE: x’ forecast only on HP-32E - Eddie W. Shore - 06-24-2023 02:48 PM

(06-21-2023 07:09 AM)Namir Wrote:  If I rmember my summer stat course in 1979, classical linear regression is supposed to be used to predict y ONLY because the values of y can have errors while the values of x are error free. So predicting x for given y is a statistical heressy!! I mean you can still calculate x', but don't write home about it!

My 2 cents worth!

Namir

Sounds like decided that the x values are perfect was 100% confident about their x-data.


RE: x’ forecast only on HP-32E - lrdheat - 06-24-2023 04:43 PM

Based upon other calculators, I believe that if one forecasts y, and then uses the forecasted y value to now forecast x, one will get the original x value returned.