Skip to content

time series in R

2 messages · Brian Ripley, Martyn Plummer

#
Rather, in the C core of R (the base package has no C code).  I was not
intended to separate that. My aim was merely to allow some code to be
re-written without losing backwards compatibility, yet. For example,
print.ts does not do well with multiple series (and it breaks the 
cardinal rule of a print method returning its first argument unchanged).
Good. What do you want na.omit.ts to do?
I'll take a look.
I have that. However, I am having a number of problems with it,
for example that pacf does not work, and acf does not work correctly
for multiple series.
Error: Object "xb" not found

OK, fix that:
Error: NA/NaN/Inf in foreign function call (arg 1)

[The NA handling needs to be sorted out.]

A little later:

            var0 <- diag(acf[1, , ], nrow = nser)

is wrong: it gives a matrix and multivariate acfs fail. I used

            var0 <- if(nser > 1) diag(acf[1, , ]) else acf[1,1,1]

I think I will special-case the univariate code here.
Yes, I intend to look at that. For now, though, your code is not
giving the same results as S-PLUS, and I need to fix up at least the
confidence interval calculations.  (I think I know exactly how it
is done in S-PLUS: it uses Bloomfield's code.)  I believe that padding
needs to be optional.
I agree, but maybe it should be done.
Yes, please (even though I think it is in principle a bad idea).
Looking at where I am, that looks feasible

Brian
#
On 20-Jul-99 Prof Brian Ripley wrote:
It would either
1) remove missing values only from the beginning or end of a time
   series, or
2) return the longest contiguous subseries with no missing values,
   e.g. presidents[32:110], or the first such subseries if there
   were multiple matches.
A lot of S-plus time series functions use option 1). Option 2) seems
more useful to me. There is no "na.omit.ts" in Splus 3.3 but  it
seems like a good way to implement this functionality.
See above.
This works for me!
The main reason my confidence intervals are different is that I don't
have the correct expression for the degrees of freedom in the presence
of tapering (or padding, but that is trivial). Apart from that,
I deliberately chose different limits because I allow the user to
specify the coverage of the confidence interval in plot.spec, and if
one is allowed to do that, one needs to make sure that the confidence
interval contains the estimate, which would not always be the case with
the Splus behaviour.
There seems to be two sorts of padding going on in Splus. One under
the control of the user, via the "pad" argument and the other
which is automatic, to aid the Fast Fourier Transform. I have
tried to reproduce this, but can't exactly match the Splus behaviour.

Martyn
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._