[Rd] PR 640 (diff.default computes an incorrect starting time) (PR#658)

lkavalieris@maths.otago.ac.nz lkavalieris@maths.otago.ac.nz
Wed, 13 Sep 2000 03:40:46 +0200 (MET DST)


diff.default computes an incorrect starting time for time series.

An error occurs in the arima0 procedure:

library(ts)
y <- ts(rnorm(24),freq=12)
x <- ts(rnorm(24),freq=12)
arima0(y,xreg=x,seasonal=list(order=c(0,1,0)))
Error in tsp<-(*tmp*, value = c(xtsp[1] + lag * differences * xtsp[3],
:
 invalid time series parameters specified

This can be traced to the following lines in arima0

class(x) <- NULL
diff(x,12,1)

The computation of the starting value of the differenced series in
diff.default is incorrect - replacing
             xtsp[1] + lag * differences * xtsp[3]
by

xtsp[1] + lag * differences / xtsp[3]

gives the correct starting time and the problem vanished in arima0.

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status =
 major = 1
 minor = 1.0
 year = 2000
 month = June
 day = 15
 language = R

_____________________________________

Laimonis Kavalieris
Maths and Stats
University of Otago
Dunedin
New Zealand





-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._