search for: deltat

Displaying 20 results from an estimated 69 matches for "deltat".

Did you mean: delta
2011 Sep 23
1
Cross Spectrum : Conversion of 2-D spectrum into a single complex array
Hi, I'm wondering why the spectrum() phase of quadrature couple isn't purely +/-pi. But mostly, I'm looking for a recommended way to take a 2-D spectrum and convert it into a single complex array. Kindly consider: # 10 Hz sine wave 10 seconds long sampled at 50 Hz deltaT = 1/50 t = seq(0, 10, deltaT) w = 2 * pi * 10 x = ts( sin( w * t ), deltat = deltaT ) y = ts( sin( w * t ), deltat = deltaT ) # Want the cross spectrum between x and y Sxy = spectrum( cbind( x, y ), plot = F ) # The phase is perfectly zero plot( Sxy $ freq, Sxy $ phase[ ,1], type = ...
2008 Jul 04
2
create a zero matrix & fill
Dear R user, I have written a function which returns max,min and variation of a power (see below) Power is a given matrix(1,n) I call the function >Variation<-VAR(p,(n-deltat)) Now the problem is when I want plot(Results[1],Results[2]). Not possible! I become the following error (in english it means: Error in as.double.default(x) :Object cannot be transformed in double) > plot(Variation[1],Variation[2]) Fehler in as.double.default(x) : (list) Objekt kann nicht nac...
2012 Jan 07
1
using deltat parameter in time series in HoltWinters prediction
...ernet network traffic bitrate. The data are in file http://www.forumaltavilla.it/joomla/datitesi/dati.datand the sampling time is every 0.05 seconds. Now, i want to use HoltWinters forecasting. This is my script. dt=1.58443823e-9 #0.05 seconds in years dati.ts=ts(scan("dati.dat"),start=0,deltat=dt) model=HoltWinters(dati.ts) dati.forecast=forecast(model,h=100) plot(dati.forecast) When I type the command model=HoltWinters(dati.ts) R gives me the error "Error in NextMethod("[") : cannot allocate vector of length 1262277040" even if I take a shorter dati.dat (50 sampl...
2010 Apr 20
1
bug in aggregate.ts
Hi, I am getting unexpected behaviour from aggregate.ts(). The 'ndeltat' argument is effectively being reduced by 1 in some cases, even when it is an integer, with the result that the blocks to be aggregated are not of the expected size, and also that the end() of the aggregated series is much later than the end() of the original series. rawts <- ts(rep(1:10, e...
2008 Jul 04
0
RES: initialize a matrix
You have to put the tml in the function and deltat too. like VAR<-function(power,length,deltat,tml){ -----Mensagem original----- De: r-help-bounces em r-project.org [mailto:r-help-bounces em r-project.org]Em nome de mysimbaa Enviada em: sexta-feira, 4 de julho de 2008 11:22 Para: r-help em r-project.org Assunto: [R] initialize a matrix De...
2006 Jul 13
1
ts and stl functions - still a problem
Hi I am still having problems with using the stl function, when I read the csv file into R into a file called tkr and use dim(tkr) the result is 132 1 which is fine. When coerce it into a trime series using ts either: tstkr <- ts(t(tkr), deltat=1/12) or tstkr <- ts(c(tkr), deltat=1/12) and use the stl function I get the following error: Error in stl(tstkr) : only univariate series are allowed id just use the tkr file I get the same error..does anyibe have an idea what to do next, here is my data...it's not...
2008 Jul 04
1
initialize a matrix
Dear R users, I'm trying to write a function which returns minimum,maximum,mean of a vector(power) I've done the following : VAR<-function(power,length){ for(i in tml:length)){ tvar[i]<-i pmean[i]<-mean(power[i:i+deltat]) pmin[i]<-min(power[i:i+deltat]) pmax[i]<-max(power[i:i+deltat]) varmax[i]<-100*(pmax[i]-pmean[i])/pmean[i] varmin[i]<-100*(pmean[i]-pmin[i])/pmean[i] Resulats<-list(tvar,pmin,pmax,pmean,varmin,varmax) }} p.s. tml is a variable which is grater than 0 , deltat is a constant defined...
2009 Jun 17
2
GAM function with interaction
...season. Thus, when data from all dates are combined to create a model from the entire dataset, I think I need to include some type of metric/variable/interaction term to account for this date relationship. I have written the following code using a "by" term: Distribution.s.temp.logwm2.deltaT<-gam(yoyras~s(temp,by=datecode)+s(logwm2,by=datecode)+s(DeltaT,by=datecode),data=AllData) However, I am not convinced this is the correct way to account for this relationship. What do you think? Is there another way to include this in my model? Maybe I should simply include date ("date...
2010 Apr 13
0
ccf problem (cross-correlation)
Hi all, I have a problem concerning my understanding of the cross-correlation (ccf) function in R. assume a time serie as: > t<-seq(0,6.28,by=0.01); > my_serie<-ts(sin(t),start=0,end=6.28,deltat=0.01) then I generate an other one shifted by 12 time points: > my_shifted_serie<-ts(sin(t),start=0+0.12,end=6.28+0.12,deltat=0.01) if I do the cross-correlation I get that the two series are shifted by 12 time units: > c<-ccf(my_serie,my_shifted_serie); c[[4]][which(c[[1]]==max(c[[...
2006 Jul 12
1
ts and stl functions
Hi, I have imported a csv file into R which contains one column (the rate er 100,000 population of a disease, by month over 11 years) I coerced into a time series using the following function, tstkr<-ts(tkr,deltat=1/12) This seems to work fine, and when I check for the class of the object using class(tstkr) I get "ts" as the response. When I try to use the stl function in stats I get the error message: Error in stl(tstkr)only univariate series are allowed I then tried this: tstkr <- ts...
1999 Jul 02
0
Bug in "[.ts" for multivariate ts {Problem with plot.ts, "[" (PR#217)
...ain; charset=us-ascii; name=tsfix; SizeOnDisk=1838 "[.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(frequen...
2008 Jul 08
2
time series by calendar week
hello, i cant find a solution on this (might be) easy problem: i have a time serie by carlandar weeks, so for every carlendar week i have a value. now i would like to use the functions for time series, so i change structur to a time serie with cam <- ts(number,start=c(2001,1),deltat=7/365) or cam <- ts(number,start=c(2001,1),frequency=52) the problem on it is, that 2004 had 53 calendar weeks, which is not recognized there. it follows with using a saisonal structure the weeks are shifting. f.e. first week in 2005 is conected with the second week in 2004. with the first fun...
2005 Aug 27
2
zoo, zooreg, & ISOdatetime
I create a zooreg object that runs from Jan-1-2002 0:00 to Jun-1-2005 0:00... regts.start = ISOdatetime(2002, 1, 1, hour=0, min=0, sec=0, tz="") regts.end = ISOdatetime(2005, 6, 1, hour=0, min=0, sec=0, tz="") regts.zoo <- zooreg( NA, regts.start, regts.end, deltat=3600 ) Upon inspection: > regts.zoo[1:3] 2002-01-01 00:00:00 2002-01-01 01:00:00 2002-01-01 02:00:00 NA NA NA > regts.zoo[29926:29928] 2005-05-31 22:00:00 2005-05-31 23:00:00 2005-06-01 00:00:00 NA NA...
2008 Jun 26
1
Date Time Sequence
I would like a sequence of dates with a time step of 15 minutes starting: 1/1/2006 00:00:00 - 12/31/2006 23:45:00 function(x) { chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x)) } this is the piece of code I use to read in zoo objects for any help I would be grateful I have tried sequence and I can not seem to get it to work -- Let's not
2011 Feb 16
2
leap years in temporal series command ts
...nterval 1st January 2002 - 31 December 2008. I have daily values, so this is a 2557 days temporal series. I'm using this command : ts(observations, start=2002, end=2009, freq=365) However, I don't get the correct temporal series since both frequency (365 OR 366 for leap years) and deltat (1/365 OR 1/366) are varying with the year considered. So, is there a specific way to deal with leap years in the ts command or have I to use another package? Thanks in advance, Peter
2003 Oct 28
3
ts vs. POSIX
OK. What if I have a time series which is collected every Monday, please? What is the proper way to use the start option within the ts command in order to indicate that this is Monday data, please? Thanks again! Sincerely, Erin
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
2009 Jun 23
1
Model fitting with GAM and "by" term
...season. Thus, when data from all dates are combined to create a model from the entire dataset, I think I need to include some type of metric/variable/interaction term to account for this date relationship. I have written the following code using a "by" term: Distribution.s.temp.logwm2.deltaT<-gam(yoyras~s(temp,by=datecode)+s(logwm2,by=datecode)+s(DeltaT,by=datecode),data=AllData) However, I am not convinced this is the correct way to account for this relationship. What do you think? Is there another way to include this in my model? Maybe I should simply include date ("dat...
2008 Aug 21
1
max and min with the indexes in a zoo object (or anything else that could solve the problem)
library(zoo) library(chron) t1 <- chron("1/1/2006", "00:00:00") t2 <- chron("1/31/2006", "23:45:00") deltat <- times("00:15:00") tt <- seq(t1, t2, by = times("00:15:00")) d <- sample(33:700, 2976, replace=TRUE) sin.zoo <- zoo(d,tt) #there are ninety six reading in a day d.max <- rollapply(sin.zoo, width=96, FUN=max) d.min <- rollapply(sin.zoo, width=96, FUN=max) th...
2007 Aug 02
1
Using 'diff' on zoo vs zooreg classes (possible bug?)
Hello, Can anyone explain the following behaviour? To me it seems a bug, but maybe it is intentional. It seems that a diff on a zooreg class that is not _strictly_ regular only considers those entries that are 'deltat' apart. In the following, diff on the zooreg class only returns values where the index was one second apart. The example replicates by dev code, but I've also tested using plain old integer indices, and the behaviour is the same. Cheers, Josh. --- Example --- input <- "...