1
$\begingroup$

Why are the "observed" numbers returned by tbats.components so different from the actual numbers? I'd think they should be the same. Data and R code follow:

> library(forecast)
> x
 [1] 0.0190 0.0139 0.0223 0.0134 0.0087 0.0090 0.0090
 [8] 0.0180 0.0131 0.0179 0.0161 0.0175 0.0147 0.0260
[15] 0.0442 0.0248 0.0178 0.0263 0.0224 0.0188 0.0161
[22] 0.0191 0.0179 0.0191 0.0193
> summary(x)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.00870 0.01470 0.01790 0.01858 0.01930 0.04420 
> summary(tbats.components(tbats(msts(x,seasonal.periods=c(8,4)))))
    observed          level       
 Min.   :-4.744   Min.   :-4.659  
 1st Qu.:-4.220   1st Qu.:-4.164  
 Median :-4.023   Median :-4.012  
 Mean   :-4.048   Mean   :-4.055  
 3rd Qu.:-3.948   3rd Qu.:-3.887  
 Max.   :-3.119   Max.   :-3.476  

I have no idea whether what's wrong with the above is in stats or in R: I seem to be lacking some knowledge in one or the other, but am not sure which. (Well, I'm lacking some knowledge in both, and thus don't know which lack is relevant here. :-))

$\endgroup$
10
  • $\begingroup$ @whuber, I have no idea whether what's wrong with the above is in stats or in R: I seem to be lacking some knowledge in one or the other, but am not sure which. (Well, I'm lacking some knowledge in both, and thus don't know which lack is relevant here. :-)) So I don't see why this was closed as off-topic; would changing its wording help? If so, how? And if not, then can you migrate it to SO, please? $\endgroup$
    – msh210
    Commented Jun 19, 2017 at 22:29
  • $\begingroup$ It would immediately be closed on Stack Overflow on the suspicion this isn't anywhere close to a minimal reproducible example. Like that site, we hope you would exhibit some effort to produce a small, simple example of the problem rather than requiring people to process and examine almost a thousand data values. If this really is the smallest dataset that produces the problem, then please explain how you figured that out: it would give a helpful start for anyone who might be inclined to pursue it. $\endgroup$
    – whuber
    Commented Jun 19, 2017 at 22:51
  • $\begingroup$ What you actually want, I suspect, is tbats(msts(x,seasonal.periods=c(8,4))$fitted.values. The "observed" values you are seeing are components of the model, not fitted values, despite being labeled "observed". $\endgroup$
    – jbowman
    Commented Jun 30, 2017 at 19:42
  • 1
    $\begingroup$ @GordonSmyth - the documentation does not, so far as I could tell with some considerable effort, describe what is actually returned in the "observed" values. I spent some time looking on the web, too, and was unable to find anything helpful there... Also, the OP isn't asking for the original data, he/she already has that; the "so different" I took to mean "these can't be fitted values!" I think you should give the OP a pass on this one. $\endgroup$
    – jbowman
    Commented Jul 1, 2017 at 21:10
  • 1
    $\begingroup$ Well, I think you could be a bit more careful with language. The first sentence of your question is good. But the title of your question says that the tbats results are "incorrect". You go on to say that the output "should be" different to what it is. Then you repeat that the results are "wrong". Perhaps it's just semantics, but if I was the author I wouldn't like that. Anyway, I hope that Rob's answer gave you the information you need. $\endgroup$ Commented Jul 5, 2017 at 4:30

1 Answer 1

4
+50
$\begingroup$

They are the Box-Cox transformed values of the original data. I'll improve the docs in the next update.

$\endgroup$
1
  • 1
    $\begingroup$ I suspected that might be the case, but I couldn't find the Box-Cox index (omega) in the fitted model output in order to confirm. $\endgroup$ Commented Jul 2, 2017 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.