search for: xfreq

Displaying 13 results from an estimated 13 matches for "xfreq".

Did you mean: ifreq
1999 Jul 02
0
Bug in "[.ts" for multivariate ts {Problem with plot.ts, "[" (PR#217)
...[.ts" <- function (x, i, j, drop = TRUE) { y <- NextMethod("[") if (missing(i)) ts(y, start = start(x), freq = frequency(x)) else y } "window.ts" <- function (x, start, end, frequency, deltat) { x <- as.ts(x) xtsp <- tsp(x) xfreq <- xtsp[3] xtime <- time(x) ts.eps <- .Options$ts.eps if (missing(frequency) && missing(deltat)) yfreq <- xfreq else if (missing(deltat)) yfreq <- frequency else if (missing(frequency)) yfreq <- 1/deltat if (xfreq%%yfreq &...
1999 Jul 02
1
Bug in "[.ts" for multivariate ts {Problem with plot.ts, "["} (PR#216)
>>>>> On Fri, 02 Jul 1999, Adrian Trapletti <Adrian.Trapletti@wu-wien.ac.at> said: Adrian> There seems to be a problem with plot.ts (R Version 0.64.2) > x<-cbind(1:10,2:11) > x<-as.ts(x) > plot(x) Adrian> Error: subscript (20) out of bounds, should be at most 10 This is definitely a bug --> CC: R-bugs ALL NOTE : This is *not* new
2007 Nov 21
1
Different freq returned by spec.ar() and spec.pgram()
...e ldeaths data: > spectrum(ldeaths, col = "blue") > spec.ar(ldeaths, add = TRUE) the resulting plots do not compare over the same frequency range. This results because spec.ar defines frequency as > freq <- seq.int(0, 0.5, length.out = n.freq) whereas spec.pgram uses > xfreq <- frequency(x) > N <- nrow(x) > Nspec <- floor(N/2) > freq <- seq.int(from = xfreq/N, by = xfreq/N, length.out = Nspec) And so the reason the spectral estimates of lh are similar is that frequency(lh) = 1, whereas frequency(ldeaths) = 12. The documentation seems more extensi...
2019 Feb 14
0
Proposed speedup of spec.pgram from spectrum.R
...nel = NULL, taper = 0.1, pad = 0, fast = TRUE, demean = FALSE, detrend = TRUE, plot = TRUE, na.action = na.fail, ...) { ## Estimate spectral density from (smoothed) periodogram. series <- deparse(substitute(x)) x <- na.action(as.ts(x)) xfreq <- frequency(x) x <- as.matrix(x) N <- N0 <- nrow(x) nser <- ncol(x) if(!is.null(spans)) # allow user to mistake order of args kernel <- { if(is.tskernel(spans)) spans else kernel("modified.daniell", spans %/% 2) }...
2005 Feb 26
1
reshape without timevar argument?
...n this convulated way there is a step that I can't solve. I used a "fake" timevar using the table function. df <- data.frame(id=c(rep('IDa',3), rep('IDb', 5), rep('IDc', 2), rep('IDd',5)), let=letters[1:5]) #add Freq to each id xFreqdf <- merge(df, table(df['id']), by.x='id', by.y='Var1') xFreq <- xFreqdf[,'Freq'] #general way of transforming xFreq into: xFreq2 <- c(3:1, 5:1, 2:1, 5:1) #substitute Freq by xFreq2 xFreqdf['Freq'] <- xFreq2 #get final df xReshape <- reshape(...
2019 Sep 16
2
Maybe bug? Using non-integer frequencies in stats::ts
...06.5, frequency = 0.2) bar = ts(x, start = 2.5, end = 107.5, frequency = 0.2) window(foo, start = 20, end = 30, extend=TRUE) # Time Series:# Start = 20 # End = 25 # Frequency = 0.2 # [1] 5 6 window(bar, start = 20, end = 30, extend=TRUE) # Error in attr(y, "tsp") <- c(ystart, yend, xfreq) : # invalid time series parameters specified The reason is in the rounding procedures for ystart and yend at the end of the stats::window function. For the 'foo' series the ystart and yend values are calculated as: c(20, 25), whereas for the 'bar' series, they become c(20, 30) a...
2023 Jun 01
1
bug in na.contiguous? Doesn't give the first tied stretch if it is at the start
...to patch this could be by the two commented assignments added by me to the code below to prepend a 0 to tt and then drop the first element of 'keep' to allow correct indexing later. Georgi Boshnakov > stats:::na.contiguous.default function (object, ...) { tm <- time(object) xfreq <- frequency(object) if (is.matrix(object)) good <- apply(!is.na(object), 1L, all) else good <- !is.na(object) if (!sum(good)) stop("all times contain an NA") tt <- cumsum(!good) ## tt <- c(0, tt) ln <- sapply(0:max(tt), function(i) su...
2019 Dec 05
2
Maybe bug? Using non-integer frequencies in stats::ts
...o, start = 20, end = 30, extend=TRUE) >> >> # Time Series: >> # Start = 20 >> # End = 25 >> # Frequency = 0.2 >> # [1] 5 6 >> >> window(bar, start = 20, end = 30, extend=TRUE) >> >> # Error in attr(y, "tsp") <- c(ystart, yend, xfreq) : >> # invalid time series parameters specified >> >> The reason is in the rounding procedures for ystart and yend at the end > of the stats::window function. For the 'foo' series the ystart and yend > values are calculated as: c(20, 25), whereas for the 'bar&...
2019 Dec 05
0
Maybe bug? Using non-integer frequencies in stats::ts
....5, frequency = 0.2) > > window(foo, start = 20, end = 30, extend=TRUE) > > # Time Series: > # Start = 20 > # End = 25 > # Frequency = 0.2 > # [1] 5 6 > > window(bar, start = 20, end = 30, extend=TRUE) > > # Error in attr(y, "tsp") <- c(ystart, yend, xfreq) : > # invalid time series parameters specified > > The reason is in the rounding procedures for ystart and yend at the end of the stats::window function. For the 'foo' series the ystart and yend values are calculated as: c(20, 25), whereas for the 'bar' series, they beco...
2019 Dec 06
1
Maybe bug? Using non-integer frequencies in stats::ts
...eries: >>>> # Start = 20 >>>> # End = 25 >>>> # Frequency = 0.2 >>>> # [1] 5 6 >>>> >>>> window(bar, start = 20, end = 30, extend=TRUE) >>>> >>>> # Error in attr(y, "tsp") <- c(ystart, yend, xfreq) : >>>> # invalid time series parameters specified >>>> >>>> The reason is in the rounding procedures for ystart and yend at the end >>> of the stats::window function. For the 'foo' series the ystart and yend >>> values are calculated...
2019 Dec 06
0
Maybe bug? Using non-integer frequencies in stats::ts
...; > >> # Time Series: > >> # Start = 20 > >> # End = 25 > >> # Frequency = 0.2 > >> # [1] 5 6 > >> > >> window(bar, start = 20, end = 30, extend=TRUE) > >> > >> # Error in attr(y, "tsp") <- c(ystart, yend, xfreq) : > >> # invalid time series parameters specified > >> > >> The reason is in the rounding procedures for ystart and yend at the end > > of the stats::window function. For the 'foo' series the ystart and yend > > values are calculated as: c(20, 25),...
2008 Jun 09
2
using spec.pgram
Hi everyone, first of all, I would like to say that I am a newbie in R, so I apologize in advance if my questions seem to be too easy for you. Well, I'm looking for periodicity in histograms. I have histograms of certain phenomenons and I'm asking whether a periodicity exists in these data. So, I make a periodogram with the function spec.pgram. For instance, if I have a histogram h, I
2007 Nov 23
0
R users in Cyprus
...e ldeaths data: > spectrum(ldeaths, col = "blue") > spec.ar(ldeaths, add = TRUE) the resulting plots do not compare over the same frequency range. This results because spec.ar defines frequency as > freq <- seq.int(0, 0.5, length.out = n.freq) whereas spec.pgram uses > xfreq <- frequency(x) > N <- nrow(x) > Nspec <- floor(N/2) > freq <- seq.int(from = xfreq/N, by = xfreq/N, length.out = Nspec) And so the reason the spectral estimates of lh are similar is that frequency(lh) = 1, whereas frequency(ldeaths) = 12. The documentation seems more extensi...