time-series

How to create a loop in Python (ADF test with p-value check)

旧巷老猫 提交于 2020-03-05 02:42:06
问题 I need a little help with creating a loop in Python. Here's the code that I'm using: import pandas as pd import numpy as np import math import matplotlib.pyplot as plt from statsmodels.graphics.tsaplots import plot_acf from statsmodels.graphics.tsaplots import plot_pacf %matplotlib inline df= pd.read_csv('original_data.csv', index_col='1') from statsmodels.tsa.stattools import adfuller def adf_test(timeseries): #Perform Dickey-Fuller test: test_types = ['nc','c','ct'] for tests in test_types:

How to Decompose and Visualise Slope Component in Tensorflow Probability

不问归期 提交于 2020-03-05 00:32:39
问题 I'm running tensorflow 2.1 and tensorflow_probability 0.9. I have fit a Structural Time Series Model with a seasonal component. I am using code from the Tensorflow Probability Structural Time Series Probability example: Tensorflow Github. In the example there is a great plot where the decomposition is visualised: # Get the distributions over component outputs from the posterior marginals on # training data, and from the forecast model. component_dists = sts.decompose_by_component( demand

Timeseries resample error - none of Dateindex in column pandas

被刻印的时光 ゝ 提交于 2020-03-05 00:28:02
问题 Please excuse obvious errors - still in the learning process. I am trying to do a simple timeseries plot on my data with a frequency of 15 minutes. The idea is to plot monthly means, starting with resampling data every hour - including only those hourly means that have atleast 1 observation in the interval. There are subsequent conditions for daily and monthly means. This is relatively simpler only if this error does not crop up- "None of [DatetimeIndex(['2016-01-01 05:00:00', '2016-01-01 05

Speed up auto_arima on time series with seasonality of 2 years

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-04 19:37:48
问题 I have a time series at weekly level with seasonlity of 2 years. I am using auto_arima to forecast for next 2 years. Plot of the time series - The challenge is - its taking more than 90 mins to train the model with following parameters. stepwise_model = auto_arima(onion_data_train_weekly['Modal_Price'], start_p=1, start_q=1, max_p=1, max_q=1, m=104, start_P=0, seasonal=True, d=1, D=1, trace=True, error_action='ignore', suppress_warnings=True, stepwise=True) print(stepwise_model.aic()) Note:

Speed up auto_arima on time series with seasonality of 2 years

╄→гoц情女王★ 提交于 2020-03-04 19:37:30
问题 I have a time series at weekly level with seasonlity of 2 years. I am using auto_arima to forecast for next 2 years. Plot of the time series - The challenge is - its taking more than 90 mins to train the model with following parameters. stepwise_model = auto_arima(onion_data_train_weekly['Modal_Price'], start_p=1, start_q=1, max_p=1, max_q=1, m=104, start_P=0, seasonal=True, d=1, D=1, trace=True, error_action='ignore', suppress_warnings=True, stepwise=True) print(stepwise_model.aic()) Note:

R code to get max count of time series data by group

左心房为你撑大大i 提交于 2020-03-04 17:56:07
问题 I'd like to get a summary of time series data where group is "Flare" and the max value of the FlareLength is the data of interest for that group. If I have a dataframe, like this: Date Flare FlareLength 1 2015-12-01 0 1 2 2015-12-02 0 2 3 2015-12-03 0 3 4 2015-12-04 0 4 5 2015-12-05 0 5 6 2015-12-06 0 6 7 2015-12-07 1 1 8 2015-12-08 1 2 9 2015-12-09 1 3 10 2015-12-10 1 4 11 2015-12-11 0 1 12 2015-12-12 0 2 13 2015-12-13 0 3 14 2015-12-14 0 4 15 2015-12-15 0 5 16 2015-12-16 0 6 17 2015-12-17 0

R code to get max count of time series data by group

一世执手 提交于 2020-03-04 17:54:13
问题 I'd like to get a summary of time series data where group is "Flare" and the max value of the FlareLength is the data of interest for that group. If I have a dataframe, like this: Date Flare FlareLength 1 2015-12-01 0 1 2 2015-12-02 0 2 3 2015-12-03 0 3 4 2015-12-04 0 4 5 2015-12-05 0 5 6 2015-12-06 0 6 7 2015-12-07 1 1 8 2015-12-08 1 2 9 2015-12-09 1 3 10 2015-12-10 1 4 11 2015-12-11 0 1 12 2015-12-12 0 2 13 2015-12-13 0 3 14 2015-12-14 0 4 15 2015-12-15 0 5 16 2015-12-16 0 6 17 2015-12-17 0

R code to get max count of time series data by group

旧城冷巷雨未停 提交于 2020-03-04 17:53:27
问题 I'd like to get a summary of time series data where group is "Flare" and the max value of the FlareLength is the data of interest for that group. If I have a dataframe, like this: Date Flare FlareLength 1 2015-12-01 0 1 2 2015-12-02 0 2 3 2015-12-03 0 3 4 2015-12-04 0 4 5 2015-12-05 0 5 6 2015-12-06 0 6 7 2015-12-07 1 1 8 2015-12-08 1 2 9 2015-12-09 1 3 10 2015-12-10 1 4 11 2015-12-11 0 1 12 2015-12-12 0 2 13 2015-12-13 0 3 14 2015-12-14 0 4 15 2015-12-15 0 5 16 2015-12-16 0 6 17 2015-12-17 0

Plotting categorical data over time in Python

牧云@^-^@ 提交于 2020-03-03 11:41:06
问题 I have a data set as follows: [Time of notification], [Station], [Category] 2019-02-04 19.36:22, Location A, Alert 2019-02-04 20.06:35, Location B, Request 2019-02-05 07.04:53, Location A, Incident Time of notification is in datetime64[ns] format. The time span is one year. I am trying to get the following line graphs: One per station Time on x axis. Preferably: Accumulated for days of the week and hours (e.g. all Mondays, Tuesdays etc together, so that a daily/weekly trend over the whole

Highcharts time X axis

筅森魡賤 提交于 2020-02-25 13:22:45
问题 I would like to ask if somebody knows how to set X axis in Highcharts to time. My aplication is taking data from database and the frequency of the samples is 250ms. I want the X axis not to show counted values but something like time. I render 2500 values at once so that means 10 secs. The best would be to have on X axis and a mark there every 0.5 sec that means every 125 samples a mark. Like (0 samples = 0 sec);(125 samples = 0,5 sec);(500 samples = 1 sec);(725 samples = 1.5 sec) Thank you