time-series

Keras Recurrent Neural Networks For Multivariate Time Series

蹲街弑〆低调 提交于 2021-02-16 09:15:25
问题 I have been reading about Keras RNN models (LSTMs and GRUs), and authors seem to largely focus on language data or univariate time series that use training instances composed of previous time steps. The data I have is a bit different. I have 20 variables measured every year for 10 years for 100,000 persons as input data, and the 20 variables measured for year 11 as output data. What I would like to do is predict the value of one of the variables (not the other 19) for the 11th year. I have my

how to highlight weekends in matplotlib plots?

人走茶凉 提交于 2021-02-15 07:02:06
问题 For a simple time series: import pandas as pd df = pd.DataFrame({'dt':['2020-01-01', '2020-01-02', '2020-01-04', '2020-01-05', '2020-01-06'], 'foo':[1,2, 4,5,6]}) df['dt'] = pd.to_datetime(df.dt) df['dt_label']= df['dt'].dt.strftime('%Y-%m-%d %a') df = df.set_index('dt') #display(df) df['foo'].plot() x =plt.xticks(ticks=df.reset_index().dt.values, labels=df.dt_label, rotation=90, horizontalalignment='right') How can I highlight the x-axis labels for weekends? edit Pandas Plots: Separate color

combine time series plot by using R

 ̄綄美尐妖づ 提交于 2021-02-11 17:55:38
问题 I wanna combine three graphics on one graph. The data from inside of R which is " nottem ". Can someone help me to write code to put a seasonal mean and harmonic (cosine model) and its time series plots together by using different colors? I already wrote model code just don't know how to combine them together to compare. Code :library(TSA) nottem month.=season(nottem) model=lm(nottem~month.-1) summary(nottem) har.=harmonic(nottem,1) model1=lm(nottem~har.) summary(model1) plot(nottem,type="l"

R: formatting axis and titles on plotly plots (time series)

青春壹個敷衍的年華 提交于 2021-02-11 14:37:55
问题 I am using the R programming language. Using the following tutorial : https://plotly.com/r/time-series/ and this stackoverflow question : How to plot multiple series/lines in a time series using plotly in R? I was able to make an interactive time series plot: library(xts) library(ggplot2) library(dplyr) library(plotly) library(lubridate) #time series 1 date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") property_damages_in_dollars <- rnorm(731,100,10) final_data <-

Interpolate data for irregular time series

此生再无相见时 提交于 2021-02-11 04:53:13
问题 I try to interpolate this meterValue, full csv here: https://drive.google.com/open?id=18cwtw-chAB-FqqCesXZJ-6NB6eHFJlgQ localminute,dataid,meter_value 2015-10-03 09:51:53,6578,157806 2015-10-13 13:41:49,6578,158086 : : 2016-01-17 16:00:33,6578,164544 #end of meter_value data for ID=6578 Based on what @G. Grothendieck, suggested, and I got error at z.interpolate (merging data) D6578z <- read.csv.zoo("test_6578.csv")[,2] D6578zd <- to.daily(D6578z)[,4] #Warning messages: #1: In zoo(xx, order.by

How to convert a multi variate time series object to a data frame?

烈酒焚心 提交于 2021-02-10 22:41:33
问题 I would like to do the reverse operation explained in this question: convert data frame with date column to time series. For example the decomposition of the co2 data is a multi variate time series: m <- decompose(co2) > str(m) List of 6 $ x : Time-Series [1:468] from 1959 to 1998: 315 316 316 318 318 ... $ seasonal: Time-Series [1:468] from 1959 to 1998: -0.0536 0.6106 1.3756 2.5168 3.0003 ... $ trend : Time-Series [1:468] from 1959 to 1998: NA NA NA NA NA ... $ random : Time-Series [1:468]

Expanding R Matrix on Date

扶醉桌前 提交于 2021-02-10 20:01:45
问题 I have the following R matrix: Date MyVal 2016 1 2017 2 2018 3 .... 2026 10 What I want to do is "blow it up" so that it goes like this (where monthly values are linearly interpolated): Date MyVal 01/01/2016 1 02/01/2016 .. .... 01/01/2017 2 .... 01/01/2026 10 I realize I can easily generate the sequence using: DateVec <- seq(as.Date(paste(minYear,"/01/01", sep = "")), as.Date(paste(maxYear, "/01/01", sep = "")), by = "month") And I can use that to make a large matrix and then fill things in

Getting error message while calculating rmse in a time series analysis

时间秒杀一切 提交于 2021-02-10 19:35:20
问题 I am trying to replicate this example of time series analysis in R using Keras (see Here) and unfortunately I am receiving error message while computing first average rmes coln <- colnames(compare_train)[4:ncol(compare_train)] cols <- map(coln, quo(sym(.))) rsme_train <- map_dbl(cols, function(col) rmse( compare_train, truth = value, estimate = !!col, na.rm = TRUE )) %>% mean() rsme_train Error message: Error in is_symbol(x) : object '.' not found There are some helpful comments at the bottom

Getting error message while calculating rmse in a time series analysis

五迷三道 提交于 2021-02-10 19:32:36
问题 I am trying to replicate this example of time series analysis in R using Keras (see Here) and unfortunately I am receiving error message while computing first average rmes coln <- colnames(compare_train)[4:ncol(compare_train)] cols <- map(coln, quo(sym(.))) rsme_train <- map_dbl(cols, function(col) rmse( compare_train, truth = value, estimate = !!col, na.rm = TRUE )) %>% mean() rsme_train Error message: Error in is_symbol(x) : object '.' not found There are some helpful comments at the bottom

how to convert a very large dataset to xts? - as.xts fails on 1.5M rows

梦想的初衷 提交于 2021-02-10 18:43:23
问题 I have the data: dput(head(data)) > dput(head(data)) structure(list(Gmt.time = c("01.06.2015 00:00", "01.06.2015 00:01", "01.06.2015 00:02", "01.06.2015 00:03", "01.06.2015 00:04", "01.06.2015 00:05" ), Open = c(0.88312, 0.88337, 0.88377, 0.88412, 0.88393, 0.8838 ), High = c(0.88337, 0.88378, 0.88418, 0.88418, 0.88393, 0.88393 ), Low = c(0.883, 0.88337, 0.88374, 0.88394, 0.88368, 0.88362 ), Close = c(0.88337, 0.88375, 0.88412, 0.88394, 0.8838, 0.88393 ), Volume = c(83.27, 100.14, 117.18, 52