Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fitted values of stlm with Box-Cox transform #482

Closed
dashaub opened this issue Jan 18, 2017 · 2 comments
Closed

fitted values of stlm with Box-Cox transform #482

dashaub opened this issue Jan 18, 2017 · 2 comments

Comments

@dashaub
Copy link
Contributor

dashaub commented Jan 18, 2017

stlm()$fitted does not hold backtransformed fitted values when a Box-Cox transformation is used.
Compare the following:

AirPassengers
fitted(stlm(AirPassengers, lambda = 0))
fitted(stlm(AirPassengers, lambda = 0.5))

I'd guess the values saved in $fitted need to be backtransformed and saved correctly (if that doesn't break anything else) or that a generic fitted.stlm() might need to be defined to use $lambda to process and return the correct fitted values when fitted() is called on the stlm object.

@robjhyndman
Copy link
Owner

Works fine for me. Are you using the current github version?

@dashaub
Copy link
Contributor Author

dashaub commented Jan 21, 2017

This was CRAN 7.3. Here is what I was getting:

> fitted(stlm(AirPassengers, lambda = 0))
          Jan      Feb      Mar      Apr      May      Jun      Jul      Aug
1949 4.715368 4.767621 4.896160 4.840177 4.827500 4.924210 5.012171 5.013449
1950 4.784878 4.809209 4.952913 4.902013 4.882955 4.965430 5.084855 5.125331
1951 4.930423 4.998641 5.136897 5.113109 5.086230 5.233633 5.299545 5.308910
1952 5.131329 5.159410 5.321523 5.235713 5.218166 5.315293 5.445093 5.459486
1953 5.288316 5.273287 5.434237 5.415615 5.448973 5.551107 5.614632 5.600925
1954 5.339533 5.296063 5.428278 5.428779 5.431700 5.567770 5.684088 5.688312
1955 5.461978 5.433775 5.609056 5.582928 5.600950 5.738444 5.864910 5.859334
1956 5.645033 5.603406 5.766719 5.746782 5.763969 5.923122 6.039430 6.013308
1957 5.752095 5.708111 5.855589 5.846322 5.878014 6.040820 6.158433 6.151205
1958 5.859879 5.792900 5.915723 5.897317 5.905544 6.053762 6.191893 6.198717
1959 5.869347 5.827681 5.967464 5.993203 6.022049 6.183898 6.298174 6.307074
1960 6.034930 5.981558 6.108248 6.074277 6.145003 6.301312 6.422344 6.433115
          Sep      Oct      Nov      Dec
1949 4.907158 4.776838 4.647850 4.788912
1950 5.031441 4.917863 4.772251 4.892547
1951 5.195026 5.077215 4.953450 5.109478
1952 5.358410 5.230504 5.117418 5.262435
1953 5.475905 5.357078 5.225189 5.328354
1954 5.557076 5.433891 5.297819 5.433811
1955 5.728386 5.602000 5.475151 5.598919
1956 5.871028 5.732652 5.596114 5.721158
1957 5.987864 5.859278 5.723289 5.830876
1958 6.042238 5.890839 5.752782 5.849948
1959 6.142991 6.015926 5.875695 5.990080
1960 6.240603 6.112567 5.987460 6.079867
> 
> fitted(stlm(AirPassengers, lambda = 0.5))
          Jan      Feb      Mar      Apr      May      Jun      Jul      Aug
1949 19.42818 19.90254 21.43304 20.62392 20.44226 21.70074 22.81876 22.76562
1950 20.06849 20.33317 22.04239 21.30393 21.07748 22.20706 23.64322 24.05610
1951 21.65126 22.36141 24.15561 23.79385 23.52798 25.35536 26.37275 26.52375
1952 24.03686 24.37087 26.57234 25.51655 25.29623 26.63256 28.41705 28.68021
1953 26.11482 25.92080 28.24731 27.99459 28.43271 30.04161 31.20350 30.97495
1954 26.96117 26.30810 28.37670 28.25681 28.27465 30.42099 32.39162 32.33412
1955 28.68432 28.21932 30.96403 30.59505 30.87293 33.28766 35.54441 35.37635
1956 31.54797 30.88858 33.61597 33.31790 33.64411 36.59490 38.86921 38.43171
1957 33.41854 32.65255 35.29926 35.10033 35.70961 38.88103 41.34126 41.27863
1958 35.41119 34.21718 36.50380 36.19054 36.39618 39.31641 42.21127 42.32190
1959 35.69125 34.82677 37.39184 37.89895 38.51639 41.78179 44.45281 44.67883
1960 38.78391 37.79709 40.14663 39.69029 40.98725 44.22966 47.14449 47.55459
          Sep      Oct      Nov      Dec
1949 21.24142 19.62557 18.19322 20.01424
1950 22.69192 21.25849 19.62345 21.20867
1951 24.89283 23.34731 21.81850 23.70694
1952 27.12595 25.38995 23.86457 25.72375
1953 28.95643 27.16508 25.29113 26.78761
1954 30.14697 28.18509 26.18505 28.23729
1955 33.03051 30.85456 28.84650 30.83338
1956 35.63943 33.12101 30.81517 32.87468
1957 37.88833 35.41855 32.99203 34.84506
1958 38.88877 35.99602 33.41564 35.23194
1959 41.10715 38.55339 35.83374 37.85962
1960 43.45576 40.77077 38.19447 39.78021

It appears fine on the Github version.

@dashaub dashaub closed this as completed Jan 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants