-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from TanguyBarthelemy/develop
add LICENSE file and update README and description file
- Loading branch information
Showing
17 changed files
with
298 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
^rjd3nowcasting\.Rproj$ | ||
^\.Rproj\.user$ | ||
^\.github$ | ||
^LICENSE$ | ||
^README\.Rmd$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
--- | ||
output: github_document | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.path = "man/figures/README-", | ||
out.width = "100%", | ||
fig.align = "center", | ||
fig.dim = c(7,4) * 1.4 | ||
) | ||
``` | ||
|
||
# rjd3nowcasting | ||
|
||
<!-- badges: start --> | ||
<!-- badges: end --> | ||
|
||
## Overview | ||
|
||
Nowcasting is often defined as the prediction of the present, the very near future and the very recent past. | ||
|
||
rjd3nowcasting provides helps to operationalize the process of nowcasting. This first version can be used to specify and estimate dynamic factor models. | ||
A later version is expected to include the concept of "news" similar to the [Nowcasting plugin](https://github.com/nbbrd/jdemetra-nowcasting/tree/master) | ||
of the Graphical User Interface of JDemetra+ v2. | ||
|
||
## Installation | ||
|
||
To get the current stable version (from the latest release): | ||
|
||
```{r, echo = TRUE, eval = FALSE} | ||
# install.packages("remotes") | ||
remotes::install_github("rjdemetra/rjd3toolkit@*release") | ||
remotes::install_github("rjdemetra/rjd3nowcasting@*release") | ||
``` | ||
|
||
To get the current development version from GitHub: | ||
|
||
```{r, echo = TRUE, eval = FALSE} | ||
# install.packages("remotes") | ||
remotes::install_github("rjdemetra/rjd3nowcasting") | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
```{r, echo = TRUE, eval = TRUE} | ||
library("rjd3nowcasting") | ||
``` | ||
|
||
|
||
### Input | ||
|
||
```{r, echo = TRUE, eval = TRUE} | ||
set.seed(100) | ||
data <- ts( | ||
data = matrix(rnorm(500), 100, 5), | ||
frequency = 12, | ||
start = c(2010, 1) | ||
) | ||
data[100, 1] <- data[99:100, 2] <- data[(1:100)[-seq(3, 100, 3)], 5] <- NA | ||
``` | ||
|
||
|
||
### Model | ||
|
||
```{r, echo = TRUE, eval = TRUE} | ||
dfm_model <- model( | ||
nfactors = 2, | ||
nlags = 2, | ||
factors_type = c("M", "M", "YoY", "M", "Q"), | ||
factors_loading = matrix(data = TRUE, 5, 2), | ||
var_init = "Unconditional" | ||
) | ||
``` | ||
|
||
|
||
### Estimation | ||
|
||
```{r, echo = TRUE, eval = TRUE} | ||
rslt_ml <- estimate_ml(dfm_model, data) | ||
# or rslt_em<-estimate_em(dfm_model, data) | ||
# or rslt_pca<-estimate_pca(dfm_model, data) | ||
``` | ||
|
||
|
||
### Results | ||
|
||
```{r, echo = TRUE, eval = TRUE} | ||
fcst <- get_forecasts(rslt_ml, nf = 2, forecasts_only = TRUE) | ||
params <- get_parameters(rslt_ml) | ||
factors <- get_factors(rslt_ml) | ||
# ... | ||
print(rslt_ml) | ||
summary(rslt_ml) | ||
plot(rslt_ml) | ||
``` | ||
|
||
|
||
## Contributing | ||
|
||
Any contribution is welcome and should be done through pull requests and/or issues. | ||
|
||
|
||
## Licensing | ||
|
||
The code of this project is licensed under the [European Union Public Licence (EUPL)](https://joinup.ec.europa.eu/page/eupl-text-11-12). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.