time-series

Production of a BSTS Mean Absolute Percentage Error (MAPE) Plot from a Bayesian Time Series Analysis with MCMC using ggplot() and bsts() packages

岁酱吖の 提交于 2021-01-07 03:11:54
问题 Problem: I have a data frame called FID (see below) that contains two columns for Year & Month, and Sighting_Frequency (counts of birds). The data frame contains 3 years of observations between 2015-2017 , indicating I have 36 months of data. I have run a Bayesian time series analysis with MCMC using the bsts() function in the bsts package (see the R-code below) by following the tutorial below. I want to produce a holdout Mean Absolute Percentage Error (MAPE) Plot as seen in the diagram below

R Language: Code Taking a Long Time to Run

跟風遠走 提交于 2021-01-07 02:52:51
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. stats555 is looking for a canonical answer : I am using the R programming language. I am trying to use the "plotly" library to make interactive time series plots as shown in this tutorial over here : plotly.com/r/custom-buttons and plotly.com/r/cumulative-animations . I generated some artificial time series data that matches the structure of the data shown in the tutorial - now I am trying to

Converting zoo object into a weekly time series

牧云@^-^@ 提交于 2021-01-07 02:48:26
问题 I am working on building a time series in R programming language. I m having a zoo object which is follows: I 'd like to convert this into a weekly time series data for analysis and typed in the following code tt2<-as.ts(zz,freq=365.25/7,start=decimal_date(ymd("2018-01-01"))) tt2[is.na(tt2)]<-0 However, I get the following output: Time Series: Start = 17538 End = 18532 Frequency = 0.142857142857143 While I'd like to see the output in line with something like this: Time Series: Start = c(2018

Converting zoo object into a weekly time series

冷暖自知 提交于 2021-01-07 02:46:03
问题 I am working on building a time series in R programming language. I m having a zoo object which is follows: I 'd like to convert this into a weekly time series data for analysis and typed in the following code tt2<-as.ts(zz,freq=365.25/7,start=decimal_date(ymd("2018-01-01"))) tt2[is.na(tt2)]<-0 However, I get the following output: Time Series: Start = 17538 End = 18532 Frequency = 0.142857142857143 While I'd like to see the output in line with something like this: Time Series: Start = c(2018

R: how to plot a “time series” with ggplot2

只谈情不闲聊 提交于 2021-01-07 02:39:04
问题 I simulated some time series data in R, aggregated by every 8 days, and then tried to plot the results. However, the plots are not working. I have posted my code below: #load library library(xts) library(ggplot2) set.seed(123) #simulate data property_damages_in_dollars <- rnorm(731,100,10) date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") final_data <- data.frame(date_decision_made, property

R: plotly time series graphs

你离开我真会死。 提交于 2021-01-07 02:38:29
问题 I am using the R programming language. I found some examples on the plotly r website that I am trying to replicate: https://plotly.com/r/cumulative-animations/ and https://plotly.com/r/custom-buttons/ I created some artificial time series data: library(xts) library(ggplot2) library(dplyr) library(plotly) #create data #time series 1 date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages

R: plotly time series graphs

穿精又带淫゛_ 提交于 2021-01-07 02:37:31
问题 I am using the R programming language. I found some examples on the plotly r website that I am trying to replicate: https://plotly.com/r/cumulative-animations/ and https://plotly.com/r/custom-buttons/ I created some artificial time series data: library(xts) library(ggplot2) library(dplyr) library(plotly) #create data #time series 1 date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages

Create lag / lead time series with by groups in Julia?

半城伤御伤魂 提交于 2021-01-02 18:17:56
问题 I am wondering if there is an easy way to create a lag (or lead) of a time series variable in Julia according to a by group or condition? For example: I have a dataset of the following form julia> df1 = DataFrame(var1=["a","a","a","a","b","b","b","b"], var2=[0,1,2,3,0,1,2,3]) 8×2 DataFrame │ Row │ var1 │ var2 │ │ │ String │ Int64 │ ├─────┼────────┼───────┤ │ 1 │ a │ 0 │ │ 2 │ a │ 1 │ │ 3 │ a │ 2 │ │ 4 │ a │ 3 │ │ 5 │ b │ 0 │ │ 6 │ b │ 1 │ │ 7 │ b │ 2 │ │ 8 │ b │ 3 │ And I want to create a

Create lag / lead time series with by groups in Julia?

不想你离开。 提交于 2021-01-02 18:14:02
问题 I am wondering if there is an easy way to create a lag (or lead) of a time series variable in Julia according to a by group or condition? For example: I have a dataset of the following form julia> df1 = DataFrame(var1=["a","a","a","a","b","b","b","b"], var2=[0,1,2,3,0,1,2,3]) 8×2 DataFrame │ Row │ var1 │ var2 │ │ │ String │ Int64 │ ├─────┼────────┼───────┤ │ 1 │ a │ 0 │ │ 2 │ a │ 1 │ │ 3 │ a │ 2 │ │ 4 │ a │ 3 │ │ 5 │ b │ 0 │ │ 6 │ b │ 1 │ │ 7 │ b │ 2 │ │ 8 │ b │ 3 │ And I want to create a

Create lag / lead time series with by groups in Julia?

血红的双手。 提交于 2021-01-02 18:12:25
问题 I am wondering if there is an easy way to create a lag (or lead) of a time series variable in Julia according to a by group or condition? For example: I have a dataset of the following form julia> df1 = DataFrame(var1=["a","a","a","a","b","b","b","b"], var2=[0,1,2,3,0,1,2,3]) 8×2 DataFrame │ Row │ var1 │ var2 │ │ │ String │ Int64 │ ├─────┼────────┼───────┤ │ 1 │ a │ 0 │ │ 2 │ a │ 1 │ │ 3 │ a │ 2 │ │ 4 │ a │ 3 │ │ 5 │ b │ 0 │ │ 6 │ b │ 1 │ │ 7 │ b │ 2 │ │ 8 │ b │ 3 │ And I want to create a