Skip to content

Commit 7bb02f8

Browse files
rename the package (#65)
1 parent 0008ada commit 7bb02f8

21 files changed

+109
-109
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "GAS"
1+
name = "ScoreDrivenModels"
22
uuid = "4a87933e-d659-11e9-0e65-7f40dedd4a3a"
33
authors = ["guilhermebodin <[email protected]>, raphaelsaavedra <[email protected]>"]
44
version = "0.1.0"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# GAS.jl
1+
# ScoreDrivenModels.jl
22

33
| **Build Status** | **Coverage** | **Documentation** |
44
|:-----------------:|:-----------------:|:-----------------:|
5-
| [![Build Status][build-img]][build-url] | [![Codecov branch][codecov-img]][codecov-url] |[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://lampspuc.github.io/GAS.jl/latest/)
5+
| [![Build Status][build-img]][build-url] | [![Codecov branch][codecov-img]][codecov-url] |[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://lampspuc.github.io/ScoreDrivenModels.jl/latest/)
66

7-
[build-img]: https://travis-ci.org/LAMPSPUC/GAS.jl.svg?branch=master
8-
[build-url]: https://travis-ci.org/LAMPSPUC/GAS.jl
7+
[build-img]: https://travis-ci.org/LAMPSPUC/ScoreDrivenModels.jl.svg?branch=master
8+
[build-url]: https://travis-ci.org/LAMPSPUC/ScoreDrivenModels.jl
99

10-
[codecov-img]: https://codecov.io/gh/LAMPSPUC/GAS.jl/coverage.svg?branch=master
11-
[codecov-url]: https://codecov.io/gh/LAMPSPUC/GAS.jl?branch=master
10+
[codecov-img]: https://codecov.io/gh/LAMPSPUC/ScoreDrivenModels.jl/coverage.svg?branch=master
11+
[codecov-url]: https://codecov.io/gh/LAMPSPUC/ScoreDrivenModels.jl?branch=master
1212

13-
GAS.jl is a Julia package for modeling, forecasting, and simulating time series with generalized autoregressive score models (GAS), also known as score-driven models. Implementations are based on the paper [Generalized Autoregressive Models with Applications](http://dx.doi.org/10.1002/jae.1279) by D. Creal, S. J. Koopman, and A. Lucas.
13+
ScoreDrivenModels.jl is a Julia package for modeling, forecasting, and simulating time series with generalized autoregressive score models (ScoreDrivenModels), also known as score-driven models. Implementations are based on the paper [Generalized Autoregressive Models with Applications](http://dx.doi.org/10.1002/jae.1279) by D. Creal, S. J. Koopman, and A. Lucas.

bench/benchmark_estimate.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using GAS, Distributions, BenchmarkTools, Random, Test
1+
using ScoreDrivenModels, Distributions, BenchmarkTools, Random, Test
22

33
include("test/utils.jl")
44

@@ -7,7 +7,7 @@ scaling = 0.0
77
A = [0.2 0; 0 0.2]
88
B = [0.2 0; 0 0.2]
99
simulation = simulate_GAS_1_1(Beta, scaling, ω, A, B, 1)
10-
gas = GAS.Model(1, 1, Beta, scaling)
10+
gas = ScoreDrivenModels.Model(1, 1, Beta, scaling)
1111
gas.ω = ω
1212
gas.A[1] = A
1313
gas.B[1] = B
@@ -34,8 +34,8 @@ p = 1
3434
q = 1
3535
num_seeds = 3
3636
@benchmark begin
37-
gas = GAS.Model($p, $q, $Beta, $scaling)
38-
opt_method = GAS.LBFGS(gas, $num_seeds)
37+
gas = ScoreDrivenModels.Model($p, $q, $Beta, $scaling)
38+
opt_method = ScoreDrivenModels.LBFGS(gas, $num_seeds)
3939
fit!(gas, $simulation; verbose = $verbose, opt_method = opt_method)
4040
end
4141
# BenchmarkTools.Trial:
@@ -60,8 +60,8 @@ p = 1
6060
q = 1
6161
num_seeds = 3
6262
@benchmark begin
63-
gas = GAS.Model($p, $q, $LogNormal, $scaling)
64-
opt_method = GAS.LBFGS(gas, $num_seeds)
63+
gas = ScoreDrivenModels.Model($p, $q, $LogNormal, $scaling)
64+
opt_method = ScoreDrivenModels.LBFGS(gas, $num_seeds)
6565
fit!(gas, $simulation; verbose = $verbose, opt_method = opt_method)
6666
end
6767
# BenchmarkTools.Trial:
@@ -79,8 +79,8 @@ end
7979

8080
scaling = 0.5
8181
@benchmark begin
82-
gas = GAS.Model($p, $q, $LogNormal, $scaling)
83-
opt_method = GAS.LBFGS(gas, $num_seeds)
82+
gas = ScoreDrivenModels.Model($p, $q, $LogNormal, $scaling)
83+
opt_method = ScoreDrivenModels.LBFGS(gas, $num_seeds)
8484
fit!(gas, $simulation; verbose = $verbose, opt_method = opt_method)
8585
end
8686
# BenchmarkTools.Trial:
@@ -97,8 +97,8 @@ end
9797

9898
scaling = 1.0
9999
@benchmark begin
100-
gas = GAS.Model($p, $q, $LogNormal, $scaling)
101-
opt_method = GAS.LBFGS(gas, $num_seeds)
100+
gas = ScoreDrivenModels.Model($p, $q, $LogNormal, $scaling)
101+
opt_method = ScoreDrivenModels.LBFGS(gas, $num_seeds)
102102
fit!(gas, $simulation; verbose = $verbose, opt_method = opt_method)
103103
end
104104
# BenchmarkTools.Trial:

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using Documenter, GAS
1+
using Documenter, ScoreDrivenModels
22

33
makedocs(
4-
modules = [GAS],
4+
modules = [ScoreDrivenModels],
55
doctest = false,
66
clean = true,
77
format = Documenter.HTML(mathengine = Documenter.MathJax()),
8-
sitename = "GAS.jl",
8+
sitename = "ScoreDrivenModels.jl",
99
authors = "Guilherme Bodin and Raphael Saavedra",
1010
pages = [
1111
"Home" => "index.md",
@@ -15,5 +15,5 @@ makedocs(
1515
)
1616

1717
deploydocs(
18-
repo = "github.com/LAMPSPUC/GAS.jl.git",
18+
repo = "github.com/LAMPSPUC/ScoreDrivenModels.jl.git",
1919
)

docs/src/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Water inflow
44

5-
Let's model some monthly water inflow data from the Northeast of Brazil using a Lognormal GAS model. Since inflow is a highly seasonal phenomenon, we will utilize lags 1 and 12. The former aims to characterize the short-term evolution of the series, while the latter characterizes the seasonality. The full code is in the examples folder.
5+
Let's model some monthly water inflow data from the Northeast of Brazil using a Lognormal ScoreDrivenModels model. Since inflow is a highly seasonal phenomenon, we will utilize lags 1 and 12. The former aims to characterize the short-term evolution of the series, while the latter characterizes the seasonality. The full code is in the examples folder.
66

77
```julia
88
# Convert data to vector
99
y = Vector{Float64}(vec(inflow'))
1010

11-
# Specify GAS model: here we use lag 1 for trend characterization and
11+
# Specify ScoreDrivenModels model: here we use lag 1 for trend characterization and
1212
# lag 12 for seasonality characterization
13-
gas = GAS.Model([1, 12], [1, 12], LogNormal, 0.0)
13+
gas = ScoreDrivenModels.Model([1, 12], [1, 12], LogNormal, 0.0)
1414

1515
# Estimate the model via MLE
1616
fit!(gas, y)

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# GAS.jl Documentation
1+
# ScoreDrivenModels.jl Documentation
22

3-
GAS.jl is a Julia package for modeling, forecasting and simulating time series with or generalized autoregressive score models (GAS) models, also known as dynamic conditional score models (DCS). Implementations are based on the paper [Generalized Autoregressive Models with Applications](http://dx.doi.org/10.1002/jae.1279) by D. Creal, S. J. Koopman and A. Lucas.
3+
ScoreDrivenModels.jl is a Julia package for modeling, forecasting and simulating time series with or generalized autoregressive score models (ScoreDrivenModels) models, also known as dynamic conditional score models (DCS). Implementations are based on the paper [Generalized Autoregressive Models with Applications](http://dx.doi.org/10.1002/jae.1279) by D. Creal, S. J. Koopman and A. Lucas.
44

55
## Installation
66

77
This package is not yet registered so you can `Pkg.add` it as follows:
88
```julia
9-
pkg> add https://github.com/LAMPSPUC/GAS.jl.git
9+
pkg> add https://github.com/LAMPSPUC/ScoreDrivenModels.jl.git
1010
```
1111

1212
## Contributing
1313

14-
Contributions to this package are more than welcome, if you find a bug or have any suggestions for the documentation please post it on the [github issue tracker](https://github.com/LAMPSPUC/GAS.jl/issues).
14+
Contributions to this package are more than welcome, if you find a bug or have any suggestions for the documentation please post it on the [github issue tracker](https://github.com/LAMPSPUC/ScoreDrivenModels.jl/issues).
1515

1616
When contributing please note that the package follows the [JuMP style guide](https://www.juliaopt.org/JuMP.jl/stable/style/).

docs/src/manual.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Links
88

9-
Links are reparametrizations utilized to ensure certain parameter is within its original domain, i.e. in a distribution one would like to ensure that the time varying parameter ``f \in \mathbb{R}^+``. The way to do this is to model ``\tilde{f} = \ln{f}``. More generally one can stablish that ``\tilde{f} = h(f)``. We refer to this procedure as **linking**. When the parameter is linked the GAS recursion happens in the domain of ``\tilde{f}`` and then one can recover the orginal parameter by ``f = \left(h\right)^-1(\tilde f)``. We refer to this procedure as **unlinking**. The new GAS recursion becomes.
9+
Links are reparametrizations utilized to ensure certain parameter is within its original domain, i.e. in a distribution one would like to ensure that the time varying parameter ``f \in \mathbb{R}^+``. The way to do this is to model ``\tilde{f} = \ln{f}``. More generally one can stablish that ``\tilde{f} = h(f)``. We refer to this procedure as **linking**. When the parameter is linked the ScoreDrivenModels recursion happens in the domain of ``\tilde{f}`` and then one can recover the orginal parameter by ``f = \left(h\right)^-1(\tilde f)``. We refer to this procedure as **unlinking**. The new ScoreDrivenModels recursion becomes.
1010

1111
```math
1212
\begin{equation*}\left\{\begin{array}{ccl}
@@ -17,24 +17,24 @@ Links are reparametrizations utilized to ensure certain parameter is within its
1717
\end{equation*}
1818
```
1919

20-
Notice that the change in parametrization changes the dynamics of the model. The GAS(1,1) for a Normal distribution with inverse scaling ``d = 1`` is equivalent to the GARCH(1, 1) model, but only on the original parameter, if you work with a different parametrization the model is no longer equivalent.
20+
Notice that the change in parametrization changes the dynamics of the model. The ScoreDrivenModels(1,1) for a Normal distribution with inverse scaling ``d = 1`` is equivalent to the GARCH(1, 1) model, but only on the original parameter, if you work with a different parametrization the model is no longer equivalent.
2121

2222

2323
### Types of links
2424

2525
The abstract type `Link` subsumes any type of link that can be expressed.
2626

2727
```@docs
28-
GAS.IdentityLink
29-
GAS.LogLink
30-
GAS.LogitLink
28+
ScoreDrivenModels.IdentityLink
29+
ScoreDrivenModels.LogLink
30+
ScoreDrivenModels.LogitLink
3131
```
3232

3333
### Link functions
3434

3535
```@docs
36-
GAS.link
37-
GAS.unlink
38-
GAS.jacobian_link
36+
ScoreDrivenModels.link
37+
ScoreDrivenModels.unlink
38+
ScoreDrivenModels.jacobian_link
3939
```
4040

examples/garch.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
using GAS, Statistics, DelimitedFiles
1+
using ScoreDrivenModels, Statistics, DelimitedFiles
22

3-
# The GARCH(1, 1) is equivaent to a GAS.Model(1, 1) Normal model with inverse scaling. The models are only equivalent under
3+
# The GARCH(1, 1) is equivaent to a ScoreDrivenModels.Model(1, 1) Normal model with inverse scaling. The models are only equivalent under
44
# no reparametrizations, here this means that the you should fit the model overwriting the default link!, unlink! and
55
# jacobian_link! methods for the Normal distribution to use only the IdentityLink.
66

77
# Overwrite link interface to work with Identity links.
8-
function GAS.link!(param_tilde::Matrix{T}, ::Type{Normal}, param::Matrix{T}, t::Int) where T
8+
function ScoreDrivenModels.link!(param_tilde::Matrix{T}, ::Type{Normal}, param::Matrix{T}, t::Int) where T
99
param_tilde[t, 1] = link(IdentityLink, param[t, 1])
1010
param_tilde[t, 2] = link(IdentityLink, param[t, 2])
1111
return
1212
end
13-
function GAS.unlink!(param::Matrix{T}, ::Type{Normal}, param_tilde::Matrix{T}, t::Int) where T
13+
function ScoreDrivenModels.unlink!(param::Matrix{T}, ::Type{Normal}, param_tilde::Matrix{T}, t::Int) where T
1414
param[t, 1] = unlink(IdentityLink, param_tilde[t, 1])
1515
param[t, 2] = unlink(IdentityLink, param_tilde[t, 2])
1616
return
1717
end
18-
function GAS.jacobian_link!(aux::AuxiliaryLinAlg{T}, ::Type{Normal}, param::Matrix{T}, t::Int) where T
18+
function ScoreDrivenModels.jacobian_link!(aux::AuxiliaryLinAlg{T}, ::Type{Normal}, param::Matrix{T}, t::Int) where T
1919
aux.jac[1] = jacobian_link(IdentityLink, param[t, 1])
2020
aux.jac[2] = jacobian_link(IdentityLink, param[t, 2])
2121
return
@@ -30,7 +30,7 @@ initial_params = [mean(y) var(y)]
3030
# There are 2 possibilities to estimate the model.
3131
# The first one is to understand that in the GARCH estimation process usually one
3232
# defines that the parameters ω, α_0, α_1 and β_1 are constrained. The problem is
33-
# that the equivalent GAS model relies that
33+
# that the equivalent ScoreDrivenModels model relies that
3434
# ω_1 = ω
3535
# ω_2 = α_0
3636
# A_1 = α_1
@@ -42,8 +42,8 @@ initial_params = [mean(y) var(y)]
4242
ub = [1.0; 1.0; 0.5; 1.0]
4343
lb = [-1.0; 0.0; 0.0; 0.5]
4444

45-
# Define a GAS model where only \sigma^2 is varying over time
46-
gas = GAS.Model(1, 1, Normal, 1.0, time_varying_params = [2])
45+
# Define a ScoreDrivenModels model where only \sigma^2 is varying over time
46+
gas = ScoreDrivenModels.Model(1, 1, Normal, 1.0, time_varying_params = [2])
4747

4848
# Give an initial_point in the interior of the bounds.
4949
initial_point = [0.0; 0.5; 0.25; 0.75]

examples/inflow_lognormal.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using GAS, Plots
1+
using ScoreDrivenModels, Plots
22

33
# Some data on monthly inflow from Northeastern Brazil
44
inflow = [
@@ -49,8 +49,8 @@ y = Vector{Float64}(vec(inflow'))
4949
y_train = y[1:400]
5050
y_test = y[401:end]
5151

52-
# Specify GAS model: here we use lag 1 for trend characterization and lag 12 for seasonality characterization
53-
gas = GAS.Model([1, 2, 11, 12], [1, 2, 11, 12], LogNormal, 0.0; time_varying_params = [1])
52+
# Specify ScoreDrivenModels model: here we use lag 1 for trend characterization and lag 12 for seasonality characterization
53+
gas = ScoreDrivenModels.Model([1, 2, 11, 12], [1, 2, 11, 12], LogNormal, 0.0; time_varying_params = [1])
5454

5555
# Define initial_params with
5656
initial_params = dynamic_initial_params(y_train, gas)
@@ -66,7 +66,7 @@ plot(y_train, label = "In-sample inflow")
6666
plot!(y_fitted, label = "in-sample estimates")
6767

6868
# Forecasts with 95% confidence interval
69-
forec = GAS.forecast(y_train, gas, 80; initial_params = initial_params, ci = [0.95])
69+
forec = ScoreDrivenModels.forecast(y_train, gas, 80; initial_params = initial_params, ci = [0.95])
7070

7171
plot(y_test, label = "Out-of-sample inflow")
7272
plot!(forec, label = "Forecast", color = "Steel Blue")

src/GAS.jl renamed to src/ScoreDrivenModels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module GAS
1+
module ScoreDrivenModels
22

33
using Distributions, Optim, SpecialFunctions
44
using LinearAlgebra, Printf

0 commit comments

Comments
 (0)