Displaying 20 results from an estimated 2000 matches similar to: "kernapply.ts"
2010 Nov 30
2
stats::kernel
Hi,
There is a small bug in the kernel() function. Everything is fine when
we use the format:
kernel("name",m,r)
but if we want the first argument to be a vector, which is useful is we
are interested in using a method not implemented in kernel(), the
default value of m is wrong. For example, if we do:
s <- rep(1/11,6)
k <- kernel(s)
we get the error message
Error in
2005 Jun 03
1
ts.intersect a multivariate and univariate ts
This seems like a FAQ, but I can't figure it out.
I have a mv ts object:
R > tsp(pg)
[1] 1982 2003 1
R > dim(pg)
[1] 22 12
and a univariate ts:
R > tsp(rw)
[1] 1690 1996 1
Yet, when I try to intersect them:
R > tsp(ts.intersect(rw, pg))
[1] 1982 2176 1
the process goes awry.
How to I get rw and pg to be one ts that runs from 1982 to 1996 and has 13
univariate time
2010 Jul 03
2
Change the frequency of a ts?
I'm trying to convert a column of a table into a ts object. The data is
monthly, so I want the ts frequency to be 12.
I did this ...
> filings.ts = as.ts(Filings.100K, frequency=12)
> filings.ts
Time Series:
Start = 1
End = 311
Frequency = 1
[1] 246.9336 305.6789 ... ...
> tsp(filings.ts)
[1] 1 311 1
> tsp(filings.ts) <- c(1,311,12)
Error in attr(x, "tsp")
2005 Jan 31
2
changing the time base in a ts
I'm probably apporaching this all wrong to start but....
Suppose I have a monthly time series and I want to compute the mean of
months 6,7, and 8. I want to plot the original time series and the
seasonal time series, one above the other. When I do that as below the
time series don't line up for reasons that are obvious. How can I
change the base of the seasonal time series so I can make
2018 Mar 16
3
Discrepancy: R sum() VS C or Fortran sum
Hi all,
I found a discrepancy between the sum() in R and either a sum done in C
or Fortran for vector of just 5 elements. The difference is very small,
but this is a very small part of a much larger numerical problem in
which first and second derivatives are computed numerically. This is
part of a numerical method course I am teaching in which I want to
compare speeds of R versus Fortran (We
2012 Aug 21
1
GPU Computing
Hi all,
I am looking for a function similar to mclapply() that would work with
GPU cores. I have looked at all possible packages related to GPU
computing but they are mainly providing functionality for big dataset or
big matrices. I use mainly mclapply to speed up simulations by running
several simulations in parallel, which works nicely.
Is it possible to do the same with a multicore GPU? I
2007 Nov 24
1
patch proposal for plot.ts
Hi all.
Currently, if you try:
> lag.plot(1:10)
you get superposed labels '1' and '10'. Things go worse in more extreme cases:
x <- ts(1:10)
x1 <- lag(x, 4)
plot(x1, x)
This is due to a mistake in plot.ts. My suggestion is the following
really minimal patch to plot.ts:
@@ -530,7 +530,7 @@ plot.ts <-
text(xy, labels =
1999 Jul 27
3
Preliminary version of ts package
There is now a preliminary version of a time series package in the R-devel
snapshots, and we would welcome feedback on it. It is based in part on the
packages bats (Martyn Plummer) and tseries (Adrian Trapletti) and in part
on code I had or have written. (Thanks for the contributions, Martyn and
Adrian!) Some of the existing ts code has been changed, for example to plot
multiple time series, so
2017 Sep 02
1
Precision error in time index of ts objects
Thanks for the very detailed explanation.
I did not create the series using structure(), that was the result of
dump() on an intermediate object created within tsdisagg::ta(), which is
where I found the error in the first place. ta() indeed manipulates .Tsp
directly, rather than using ts. I guess this is a bug in tsdisagg then.
Thanks!
--
Andrea Altomani
On Sat, Sep 2, 2017 at 12:31 AM
2013 Oct 23
2
Multivariate time series in R 3 vs R 2
Hello!
Recently I got report that my package mar1s doesn't pass checks any more on
R 3.0.2. I started to investigate and found the following difference in
multivariate time series handling in R 3.0.2 compared to R 2 (I've checked
on 2.14.0).
Suppose I wish to calculate seasonal component for time series. In case of
multivariate time series, I wish to process each column independently.
2007 Nov 25
1
spec.pgram() - circularity of kernel
Hi,
I am far from experienced in both R and time series hence the question.
The code for spec.pgram() seems to involve a circularity of the kernel (see
below) yielding new power estimates to all frequencies computed by FFT.
"
if (!is.null(kernel)) {
for (i in 1:ncol(x)) for (j in 1:ncol(x)) pgram[, i,
j] <- kernapply(pgram[, i, j], kernel, circular = TRUE)
2009 Jun 14
1
time function behavior for ts class objects
Hi all-
I am trying to use the time function for ts class objects and do not
understand the return value. I want to use it to set up a time trend in
arima fits. It does not seem to return a correct linear sequence that
matches the underlying time series. I am running:
R version 2.8.1 (2008-12-22).
For example:
R> ## create a time series
R> x <- rnorm(24)
R> (xts <-
2017 Sep 01
0
Precision error in time index of ts objects
On Fri, 1 Sep 2017, Andrea Altomani wrote:
> I should have formulated my question in a more specific way.
>
> 1. I suspect this is a floating point precision issue. I am not very
> knowledgeable about R internals, can someone else confirm it?
Yes. If you represent a series with increment 1/12 it depends on how you
do it. As a simple example consider the following two descriptions
2017 Sep 01
2
Precision error in time index of ts objects
I have a time series x, and two other series obtained from it:
x <- structure(2017, .Tsp = c(2017.41666666667, 2017.41666666667, 12),
class = "ts")
y <- floor(x)
z <- x-y
I would expect the three series to have exactly the same index.
However I get the following
> time(x)-time(y)
Jun
2017 0
as expected, but
> time(x)-time(z)
integer(0)
Warning message:
In
2000 Aug 21
2
diff.default / diff.ts in wrong package bug (PR#640)
{all recent versions of R}
Problem / design bug :
diff.default() doesn't deal with "ts" objects properly,
diff.ts() does, but that is only available from package "ts"
where as the constructor function ts() is in base.
It's not sufficient to just move diff.ts() to package base,
since it relies itself on lag & lag.default which are also only in package
ts.
1999 Jul 15
1
[R] R: ts - objects (PR#228)
Marcus Eger <marcus.eger@physik.uni-marburg.de> writes:
> > time(sqrt(arrts))
> Time Series:
> Start = c(1, 1)
> End = c(5, 1)
> Frequency = 1
> [1] 1 2 3 4 5
Looks like a bug...
> ----------------------------------------------------------------------------
> 2. (At least) boolean indexing with matrices does not seem to work
> properly:
>
2009 Nov 20
2
How to setup the tsp attribute of a dataset
Hello,
I am wondering how I should set up the tsp attribute (available through
attr(x, "tsp")) of a dataset x? Let's assume that x has 100 points, and
I want to set the frequency to 4.
I tried:
> attr(x,"tsp")<-c(1,100,4)
Error in attr(x, "tsp") <- c(1, 100, 4) :
invalid time series parameters specified
Is there any other way to set the frequency of
2011 Aug 19
3
ATSP to TSP reformulation
Greetings,
I am having trouble getting the function reformulate_ATSP_as_TSP to work for
me. I have provided a simple example of some of the code I've been using.
In particular, I'm not sure why I'm getting the error
"Error in dimnames(tsp) <- list(lab, lab) :
length of 'dimnames' [1] not equal to array extent"
since I created the object ATSP with a valid
1998 Sep 28
1
"tsp<-"
If value is NULL I think tsp assignment should not return a class ts object.
Below is a fixed version.
Paul Gilbert
____
"tsp<-" <-function(x, value)
{if (is.null(value))
{attr(x, "tsp") <- value
if(inherits(x,"ts")) class(x) <- NULL
return(x)
}
attr(x, "tsp") <- value
class(x) <- "ts"
x
}
2017 Sep 01
2
Precision error in time index of ts objects
I should have formulated my question in a more specific way.
1. I suspect this is a floating point precision issue. I am not very
knowledgeable about R internals, can someone else confirm it?
2. Should this be considered a bug or not, because it is "just a precision
issue"? Should I report it?
3. How can it happen? From a quick review of ts.R, it looks like the values
of the time