From 2a458c445a5c6a43cc7602ea42b1b22105d328c5 Mon Sep 17 00:00:00 2001 From: fipelle <6272230+fipelle@users.noreply.github.com> Date: Sat, 27 Nov 2021 04:35:27 +0000 Subject: [PATCH 1/4] Deprecated methods folder --- src/TSAnalysis.jl | 1 - src/{ => deprecated}/uc_models.jl | 0 2 files changed, 1 deletion(-) rename src/{ => deprecated}/uc_models.jl (100%) diff --git a/src/TSAnalysis.jl b/src/TSAnalysis.jl index 209784e..805a75f 100644 --- a/src/TSAnalysis.jl +++ b/src/TSAnalysis.jl @@ -12,7 +12,6 @@ module TSAnalysis include("$local_path/methods.jl"); include("$local_path/kalman.jl"); include("$local_path/subsampling.jl"); - #include("$local_path/uc_models.jl"); # Export types export IntVector, IntMatrix, IntArray, FloatVector, FloatMatrix, FloatArray, JVector, JMatrix, JArray, DiagMatrix, SymMatrix, diff --git a/src/uc_models.jl b/src/deprecated/uc_models.jl similarity index 100% rename from src/uc_models.jl rename to src/deprecated/uc_models.jl From 0e865bddf783ac4acc01933a3cbf26127463d42d Mon Sep 17 00:00:00 2001 From: fipelle <6272230+fipelle@users.noreply.github.com> Date: Sat, 27 Nov 2021 04:55:06 +0000 Subject: [PATCH 2/4] TSAnalysis => MessyTimeSeries --- Project.toml | 2 +- README.md | 22 +++++++++++----------- src/TSAnalysis.jl | 2 +- test/tools.jl | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Project.toml b/Project.toml index 32b3220..596cc32 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "TSAnalysis" +name = "MessyTimeSeries" uuid = "04d71284-fb40-11e9-15e5-dbbde6a47ab4" version = "0.1.5" diff --git a/README.md b/README.md index bf4aaa2..85c90e7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# TSAnalysis.jl -```TSAnalysis``` includes basic tools for time series analysis, compatible with incomplete data. +# MessyTimeSeries.jl +```MessyTimeSeries``` includes basic tools for time series analysis, compatible with incomplete data. ```julia import Pkg; -Pkg.add("TSAnalysis") +Pkg.add("MessyTimeSeries") ``` ## Preface @@ -25,7 +25,7 @@ Make sure that your FRED API is accessible to ```FredData``` (as in https://gith To run the examples below, execute first the following block of code: ```julia using Dates, DataFrames, LinearAlgebra, FredData, Optim, Plots, Measures; -using TSAnalysis; +using MessyTimeSeries; # Plots backend plotlyjs(); @@ -88,7 +88,7 @@ Y = permutedims(Y); #### Estimation -Suppose that we want to estimate an ARIMA(1,1,1) model for the Industrial Production Index. ```TSAnalysis``` provides a simple interface for that: +Suppose that we want to estimate an ARIMA(1,1,1) model for the Industrial Production Index. ```MessyTimeSeries``` provides a simple interface for that: ```julia # Estimation settings for an ARIMA(1,1,1) d = 1; @@ -242,7 +242,7 @@ figure[3] ### Kalman filter and smoother #### Data -The following examples show how to perform a standard univariate state-space decomposition (local linear trend + seasonal + noise decomposition) using the implementations of the Kalman filter and smoother in ```TSAnalysis```. These examples use non-seasonally adjusted (NSA) data that can be downloaded via: +The following examples show how to perform a standard univariate state-space decomposition (local linear trend + seasonal + noise decomposition) using the implementations of the Kalman filter and smoother in ```MessyTimeSeries```. These examples use non-seasonally adjusted (NSA) data that can be downloaded via: ```julia # Download data of interest Y_df = download_fred_vintage(["IPGMFN"], ["log"]); @@ -284,7 +284,7 @@ trend_llts = hcat(kstatus.history_X_post...)[1,:]; ``` #### Kalman filter (out-of-sample forecast) -```TSAnalysis``` allows to compute *h*-step ahead forecasts for the latent states without resetting the Kalman filter. This is particularly efficient for applications wherein the number of observed time periods is particularly large, or for heavy out-of-sample exercises. +```MessyTimeSeries``` allows to compute *h*-step ahead forecasts for the latent states without resetting the Kalman filter. This is particularly efficient for applications wherein the number of observed time periods is particularly large, or for heavy out-of-sample exercises. An easy way to compute the 12-step ahead prediction is to edit the block ```julia @@ -318,7 +318,7 @@ history_Xs, history_Ps, X0s, P0s = ksmoother(ksettings, kstatus); ``` ### Estimation of state-space models -State-space models without a high-level interface can be estimated using ```TSAnalysis``` and ```Optim``` jointly. +State-space models without a high-level interface can be estimated using ```MessyTimeSeries``` and ```Optim``` jointly. The state-space model described in the previous section can be estimated following the steps below. @@ -360,7 +360,7 @@ function fmin(θ_unbound, Y; s::Int64=12) # Apply bounds θ_bound = copy(θ_unbound); for i=1:length(θ_bound) - θ_bound[i] = TSAnalysis.get_bounded_log(θ_bound[i], 1e-8); + θ_bound[i] = MessyTimeSeries.get_bounded_log(θ_bound[i], 1e-8); end # Compute loglikelihood @@ -380,7 +380,7 @@ res = Optim.optimize(θ_unbound->fmin(θ_unbound, Y, s=12), θ_starting, NelderM # Apply bounds θ_bound = copy(res.minimizer); for i=1:length(θ_bound) - θ_bound[i] = TSAnalysis.get_bounded_log(θ_bound[i], 1e-8); + θ_bound[i] = MessyTimeSeries.get_bounded_log(θ_bound[i], 1e-8); end ``` @@ -415,7 +415,7 @@ p_slope = plot(Y_df[!,:date], hcat(history_Xs...)[2,:], label="Slope", color=RGB ### Bootstrap and jackknife subsampling -```TSAnalysis``` provides support for the bootstrap and jackknife subsampling methods introduced in Kunsch (1989), Liu and Singh (1992), Pellegrino (2020), Politis and Romano (1994): +```MessyTimeSeries``` provides support for the bootstrap and jackknife subsampling methods introduced in Kunsch (1989), Liu and Singh (1992), Pellegrino (2020), Politis and Romano (1994): * Artificial delete-*d* jackknife * Block bootstrap diff --git a/src/TSAnalysis.jl b/src/TSAnalysis.jl index 805a75f..077314f 100644 --- a/src/TSAnalysis.jl +++ b/src/TSAnalysis.jl @@ -1,6 +1,6 @@ __precompile__() -module TSAnalysis +module MessyTimeSeries # Libraries using Dates, Distributed, Logging; diff --git a/test/tools.jl b/test/tools.jl index 15afb7c..73cb4cf 100644 --- a/test/tools.jl +++ b/test/tools.jl @@ -1,4 +1,4 @@ -using LinearAlgebra, Test, TSAnalysis; +using LinearAlgebra, Test, MessyTimeSeries; """ read_test_input(filepath::String) From 56de78b0d5e7ea910ba42ed062bb5dfb9f387c0f Mon Sep 17 00:00:00 2001 From: fipelle <6272230+fipelle@users.noreply.github.com> Date: Sat, 27 Nov 2021 04:55:53 +0000 Subject: [PATCH 3/4] TSAnalysis.jl => MessyTimeSeries.jl --- src/{TSAnalysis.jl => MessyTimeSeries.jl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{TSAnalysis.jl => MessyTimeSeries.jl} (100%) diff --git a/src/TSAnalysis.jl b/src/MessyTimeSeries.jl similarity index 100% rename from src/TSAnalysis.jl rename to src/MessyTimeSeries.jl From fe27fc3dcc2370b69346a93eec59c19c6ed0edbe Mon Sep 17 00:00:00 2001 From: fipelle <6272230+fipelle@users.noreply.github.com> Date: Sat, 27 Nov 2021 05:01:44 +0000 Subject: [PATCH 4/4] toml update --- Project.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 596cc32..0c8da77 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "MessyTimeSeries" -uuid = "04d71284-fb40-11e9-15e5-dbbde6a47ab4" -version = "0.1.5" +uuid = "2a88db5c-15f1-4b3e-a070-d1159e8d76cc" +version = "0.2.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -18,5 +18,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" test = ["Test"] [compat] -Distributions = "^0" +Distributions = "0.25" +StableRNGs = "1.0" julia = "1.6"