similar to: Generating a time series.

Displaying 20 results from an estimated 20000 matches similar to: "Generating a time series."

2009 Jul 23
3
how to predict dynamic model in R
I have a dynamic time series model like this: dyn$lm( y ~ lag(y,-1) + x + lag(x,-1)+lag(x,-2) ) I need to do an out of sample forecast with this model. Is there any way I can do this with R? It would be greatly appreciated if some one can give me an example. Thanks. Harry [[alternative HTML version deleted]]
2011 Nov 26
3
Time series merge?
I have two time series a <- ts(1:10, start=c(1,6), end=c(2,5), frequency=10) b <- ts(1:5, start=c(2,1), end=c(2,5), frequency=10) Obviously 'b' is a subset of 'a'. I want a single index value indicating where that start of 'b' lines up with the start of 'a'. So in this simple example I would expect an index of 5. I was playing with 'merge'.
2007 Jul 31
1
A complicated 'aggregate'
Hi, I have a financial (zoo) time series with prices and volumes (although I can get the coredata as a matrix). Due to the data-source some indices have multiple observations. I want to aggregate these according to a weighted average. 11:00:01 34 1000 11:00:01 35 500 11:00:01 35 1000 11:00:02 34 500 11:00:02 35 500 should become 11:00:01 34.6 2500 11:00:02 34.5 1000 I currently do this
2006 Nov 23
1
Problem with as.ts(zoo-object)
Dear all, I have an error message, when I try to convert a zoo object (called test) to ts (on R 2.4.0, Package zoo version 1.2-1, Windows XP) > test 1994-05-10 1994-06-09 1994-07-09 0.0024943889 0.0024881824 0.0006955831 > str(test) atomic [1:3] 0.002494 0.002488 0.000696 - attr(*, "index")=Class 'Date' num [1:3] 8895 8925 8955 > is.regular(test) [1] TRUE
2009 Nov 19
2
Problem with zoo and BootPR packages
Hi, I'm trying to plot the forecasts I generated using the Plot.Fore function of the BootPR package. But I got an error from zoo: My data: Time Series: Start = 1 End = 18 Frequency = 1 [1] 38731 38628 39117 92809 71984 31226 58613 72360 107956 92066 [11] 95208 99098 95848 120383 110717 105680 98469 101916 Script: y1<-ts(y1);
2005 Aug 27
1
ARIMA (seasonal) backcasting & interpolation
Thanks for everyone's help with zoo -- I think I've got my data set ready. (The data consists of surface weather temperatures, from 2002 to 2005, one observation per hour. Some values are missing... i.e. NA) I have three goals: GOAL #1:Get the data in proper time series form, preserving frequency information: > w4.ts <- as.ts( w3.zoo, frequency=(1/3600) ) I hope that 1/3600
2006 Nov 03
1
as.zoo behavior (
hi all : the code pasted below runs but then, a dput on rollmeandifflogbidask gives me what is below the code. the structure of rollmeandifflogbidask is a zoo object but with a "frequency" so it's not the same structure as the original actual diff and this really causes things to blow up in later code. i'm sure gabor and achim know what to do but in the case that they are not
2008 Mar 06
1
can't merge zoo ojects and convert to ts (been trying for 2 days)
I'm stuck, but am sure it can be done I just don't understand how. I have data in an irregular timeseries. I want to be able to use stl to visualise the data (see seasonal parts etc), so I need to change to regular series of class ts (I think). I am using 2 zoo objects one is regular and the other is my irregular data. I am then merging to create the object I want but when I try to change
2008 Aug 02
2
Gaps in time series.
I like the fact that in subtracting two time series objects that there is some effort to align the series. So if I have a time series of that begins at 1 and one that begins at 2 a subtraction operation makes sure that the proper values are subtracted. But I am unclear as to the best way to build a time series with "holes". say that I have data for "day" 1,2,6,7 in one time
2011 Nov 08
3
window?
Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d <- rep(1:53,2) (s <- ts(d, frequency=53, start=c(2000,10))) n <- length(s) k <- n%/%3 for(i in (n-k):n) { st <- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] + i) %% frequency(s)) ed <- c(start(s)[1] +
2009 Jul 18
7
Question on qplot
Hi, suppose I have following codes : library(zoo); library(ggplot2) dat <- matrix(rnorm(500*2), 500); dat <- zooreg(dat, start = as.Date("01/01/01", "%m/%d/%y"), frequency=1); plot(dat) head(dat); month.no <- format(index(dat), "%m"); dat1 <- cbind(coredata(dat), as.numeric(month.no)) x <- dat1[,1]; y <- dat1[,2]; z <- dat1[,3] Now I draw a
2008 Sep 04
1
Building a time series.
I have a need to build a time series and there are a couple of aspects about the time series object that are confusing me. First it seems that ts.union is not doing what I would expect. For example: x0 <- rep(0,10) x1 <- rep(1,10) xt0 <- ts(x0, frequency=10) xt1 <- ts(x1, frequency=10) st2 <- ts.union(xt0, xt1) > xt2 Time Series: Start = c(1, 1) End = c(1, 10) Frequency = 10
2011 Jan 18
1
Semi-Regular Time Series with Missing Values
Hi, I'm trying to make a ts object that has both NA values and a frequency other than 1 (so I can use stl). I've tried all permutations I can think of, but cannot get the desired (expected?) results. The values live in x and the corresponding semi-regular time stamps are in t: > library('zoo') > z = zoo(x, order.by=t, frequency=24) > zzr = as.zooreg(z, start=0) > zr
2008 Jul 26
4
Data length mismatch.
I have two vectos (list) that represent a years of data. Each "row" is represented by the day of year and the quantity that was sold for that day. I would like to form a new vector that is the difference between the two years of data. A sample of A (and similarly B) looks like: > A[1:5,] DayOfYear x 1 1 1429 2 2 3952 3 3 3049 4 4 2844 5 5
2011 Feb 16
2
leap years in temporal series command ts
Hi R community! I'd like to create a temporal series with ts command for the interval 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
2010 Jan 30
2
question about time series objects
Hi All, I have a very simple question about a time series object: how to access values for a particular year and quarter (say)? Suppose, following http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm I have read in data as a time series; here is how it looks. * Qtr1 Qtr2 Qtr3 Qtr4 1960 0.71 0.63 0.85 0.44 1961 0.61 0.69 0.92 0.55 . . . . .
2017 Jul 30
4
Kalman filter for a time series
I found an example at http://www.bearcave.com/finance/random_r_hacks/kalman_smooth.html shown below. But it seems the structSSM function has been removed from KFAS library so it won't run. Does anyone know how to fix the code so that it runs? library(KFAS) library(tseries) library(timeSeries) library(zoo) library(quantmod) getDailyPrices = function( tickerSym, startDate, endDate ) {
2017 Oct 06
2
Time series: xts/zoo object at annual (yearly) frequency
Hi, I'd like to make a time series at an annual frequency. > a<-xts(x=c(2,4,5), order.by=c("1991","1992","1993")) Error in xts(x = c(2, 4, 5), order.by = c("1991", "1992", "1993")) : order.by requires an appropriate time-based object > a<-xts(x=c(2,4,5), order.by=1991:1993) Error in xts(x = c(2, 4, 5), order.by =
2010 Oct 27
1
Regular time series with irregular start and end dates
Dear R users, I have a quick question regarding creating an index for a zoo object. I am using R 2.12 on winxp. I have read through the R archives searching for information on dates and time series analysis and nothing seems to cover my question. I am extracting data from a time series of remote sensing data. The frequency of the data is 16 days which means I cant use ts (ts likes months single
2011 Mar 24
2
Help with creating a ts (time series) object with daily sampling values
Hi All, I have a data set of daily measurements of river flow. I would like to create a "ts" object from this data. Here's a sample data set: date <- as.Date(c(1:300), format="%Y") year=as.numeric(format(date, format = "%Y")) month=as.numeric(format(date, format = "%m")) julianday=as.numeric(format(date, format = "%j"))