time-series

How to plot a two-columned grid of time series with custom titles using R?

我的梦境 提交于 2021-01-28 19:03:50
问题 I have the following code (although without data, sadly): detrend_plot <- cbind(l_p_lng,l_vol_lng,l_p_oil,l_rgdpe, ldiff_p_lng,ldiff_vol_lng,ldiff_p_oil,ldiff_rgdpe) plot.ts(detrend_plot, main="",) which gives the following plot: What I want to do is to add custom titles, individual y-axis labels, and x-axis labels. I know that this is possible using GGPLOT , although my knowledge of it is sparse. Has anyone encountered a similar problem? I don't think this is possible using the regular plot

Get first and last elements with pd.Grouper()

ε祈祈猫儿з 提交于 2021-01-28 07:29:34
问题 I have a time series that I am resampling to 5s windows like such: INDEX size price 2018-05-07 21:53:13.731 0.365127 9391.800000 2018-05-07 21:53:16.201 0.666127 9391.800000 2018-05-07 21:53:18.038 0.143104 9391.800000 2018-05-07 21:53:18.243 0.025643 9391.800000 2018-05-07 21:53:18.265 0.640484 9391.800000 2018-05-07 21:53:18.906 -0.100000 9391.793421 2018-05-07 21:53:19.829 0.559516 9391.800000 2018-05-07 21:53:19.846 0.100000 9391.800000 2018-05-07 21:53:19.870 0.006560 9391.800000 2018-05

plot dataframe: overlay line and bar plot doesn't work for time series index?

大兔子大兔子 提交于 2021-01-28 05:14:16
问题 import numpy as np import pandas as pd import matplotlib.pyplot as plt # create dataframes df0 and df1: index0 = pd.date_range(start='2014-06-01 00:00:00', end='2014-06-01 00:15:00', freq='1S') data0 = np.random.rand(len(index0)) df0 = pd.DataFrame(data=data0, index=index0, columns=['DF0']) index1 = pd.date_range(start='2014-06-01 00:00:00', end='2014-06-01 00:15:00', freq='15S') data1 = np.random.rand(len(index1)) df1 = pd.DataFrame(data=data1, index=index1, columns=['DF1']) # plot df0 and

extrapolate in R for a time-series data [closed]

风流意气都作罢 提交于 2021-01-28 03:59:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Improve this question I have a time-series data for the last 20 years. The variable has been measured every year so I have 20 values. I have a tab-delimited file with first column representing year and second column the value. Here is what it looks like : 1991 438 1992 408 1993 381 1994 361 1995 338 1996 315

HOW to SELECT data basing on both a period of date and a period of time in clickhouse

女生的网名这么多〃 提交于 2021-01-28 03:29:28
问题 I want to filter some data by both yyyymmdd (date) and hhmmss (time), but clickhouse don't support time type. So I choose datetime to combine them. But how to do such things: This is code of dolphindb (which supports second type to represent hhmmss . select avg(ofr + bid) / 2.0 as avg_price from taq where date between 2007.08.05 : 2007.08.07, time between 09:30:00 : 16:00:00 group by symbol, date This is code of clickhouse , but a logical problematic code. SELECT avg(ofr + bid) / 2.0 AS avg

HOW to SELECT data basing on both a period of date and a period of time in clickhouse

☆樱花仙子☆ 提交于 2021-01-28 02:21:55
问题 I want to filter some data by both yyyymmdd (date) and hhmmss (time), but clickhouse don't support time type. So I choose datetime to combine them. But how to do such things: This is code of dolphindb (which supports second type to represent hhmmss . select avg(ofr + bid) / 2.0 as avg_price from taq where date between 2007.08.05 : 2007.08.07, time between 09:30:00 : 16:00:00 group by symbol, date This is code of clickhouse , but a logical problematic code. SELECT avg(ofr + bid) / 2.0 AS avg

How to forecast time series using AutoReg

一个人想着一个人 提交于 2021-01-27 18:54:47
问题 I'm trying to build old school model using only auto regression algorithm. I found out that there's an implementation of it in statsmodel package. I've read the documentation, and as I understand it should work as ARIMA. So, here's my code: import statsmodels.api as sm model = sm.tsa.AutoReg(df_train.beer, 12).fit() And when I want to predict new values, I'm trying to follow the documentation: y_pred = model.predict(start=df_test.index.min(), end=df_test.index.max()) # or y_pred = model

How to efficiently extrapolate missing data for multiple variables

最后都变了- 提交于 2021-01-27 15:13:00
问题 I have panel data and numerous variables are missing observations before certain years. The years vary across variables. What is an efficient way to extrapolate for missing data points across multiple columns? I'm thinking of something as simple as extrapolation from a linear trend, but I'm hoping to find an efficient way to apply the prediction to multiple columns. Below is a sample data set with missingness similar to what I'm dealing with. In this example, I'm hoping to fill in the NA

Reduce daily data to monthly using Google Earth Engine

喜夏-厌秋 提交于 2021-01-27 10:14:43
问题 I am looking at precipitation data (both GPM and CHIRPS) for different provinces in Indonesia using Google Earth Engine. GPM is sub-daily (every 30 minutes) and CHIRPS is daily. I am only interested in getting the monthly values. Unlike here and here I am not interested in getting the multi-annual monthly values, but simply the average of each month and make a time series. Here I found a way to create a list of values containing the mean of each month. Edit: Thanks to Nicholas Clinton's

Reduce daily data to monthly using Google Earth Engine

不打扰是莪最后的温柔 提交于 2021-01-27 10:13:43
问题 I am looking at precipitation data (both GPM and CHIRPS) for different provinces in Indonesia using Google Earth Engine. GPM is sub-daily (every 30 minutes) and CHIRPS is daily. I am only interested in getting the monthly values. Unlike here and here I am not interested in getting the multi-annual monthly values, but simply the average of each month and make a time series. Here I found a way to create a list of values containing the mean of each month. Edit: Thanks to Nicholas Clinton's