Title: | Brazilian Economic Time Series |
---|---|
Description: | It provides access to and information about the most important Brazilian economic time series - from the Getulio Vargas Foundation <http://portal.fgv.br/en>, the Central Bank of Brazil <http://www.bcb.gov.br> and the Brazilian Institute of Geography and Statistics <http://www.ibge.gov.br>. It also presents tools for managing, analysing (e.g. generating dynamic reports with a complete analysis of a series) and exporting these time series. |
Authors: | Pedro Costa Ferreira [aut], Talitha Speranza [aut, cre], Jonatha Costa [aut], Fernando Teixeira [ctb], Daiane Marcolino [ctb] |
Maintainer: | Talitha Speranza <[email protected]> |
License: | GPL-3 |
Version: | 0.5.0 |
Built: | 2025-02-10 05:31:04 UTC |
Source: | https://github.com/nmecsys/bets |
Performs an ARCH test and show the results. Formerly, this function was part of FinTS, now an obsoleted package.
arch_test(x, lags = 12, demean = FALSE, alpha = 0.5)
arch_test(x, lags = 12, demean = FALSE, alpha = 0.5)
x |
A |
lags |
An |
demean |
A |
alpha |
A |
A list
with the results of the ARCH test
Spencer Graves [email protected], Talitha Speranza [email protected]
Market Expectations with annual reference.
bcbExpectA(indicator = "IPCA", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
bcbExpectA(indicator = "IPCA", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: Balanca comercial, Balanco de pagamentos, Fiscal, IGP-DI, IGP-M, INPC, IPA-DI, IPA-M, IPCA, IPCA-15, IPC-FIPE, Precos administrados por contrato e monitorado, Producao industrial, PIB Industrial, PIB Servicos, PIB Total, Meta para taxa over-selic e Taxa de cambio.
In collaboration with Angelo Salton <https://github.com/angelosalton>.
# bcbExpectA()
# bcbExpectA()
Annual Market Expectations Top5.
bcbExpectATop5(indicator = "IGP-DI", limit = 100, variables = c("tipoCalculo", "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo"), start, end)
bcbExpectATop5(indicator = "IGP-DI", limit = 100, variables = c("tipoCalculo", "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: IGP-DI, IGP-M, IPCA, Meta para taxa over-selic, Taxa de cambio.
# bcbExpectATop5()
# bcbExpectATop5()
Market expectations for inflation in the next 12 months
bcbExpectInf12(indicator = "IPC-FIPE", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
bcbExpectInf12(indicator = "IPC-FIPE", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: IGP-DI, IGP-M, INPC, IPA-DI, IPA-M, IPCA, IPCA-15, IPC-FIPE.
# bcbExpectInf12()
# bcbExpectInf12()
Market Expectations with mensal reference.
bcbExpectM(indicator = "IPCA-15", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
bcbExpectM(indicator = "IPCA-15", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes", "baseCalculo"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: IGP-DI, IGP-M, INPC, IPA-DI, IPA-M, IPCA, IPCA-15, IPC-FIPE, Producao industrial, Meta para taxa over-selic, Taxa de cambio .
# bcbExpectM()
# bcbExpectM()
Monthly Market Expectations Top5.
bcbExpectMTop5(indicator = "IGP-DI", limit = 100, variables = c("tipoCalculo", "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo"), start, end)
bcbExpectMTop5(indicator = "IGP-DI", limit = 100, variables = c("tipoCalculo", "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: IGP-DI, IGP-M, IPCA, Meta para taxa over-selic, Taxa de cambio.
# bcbExpectMTop5()
# bcbExpectMTop5()
Quarterly Market Expectations.
bcbExpectT(indicator = "PIB Total", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes"), start, end)
bcbExpectT(indicator = "PIB Total", limit = 100, variables = c("Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo", "numeroRespondentes"), start, end)
indicator |
A string. Available indicator. |
limit |
A integer. A limint of data in request, top is 10000. |
variables |
Possible options: "Media", "Mediana", "DesvioPadrao", "CoeficienteVariacao", "Minimo", "Maximo". |
start |
Initial date at which the data was projected, in ISO format. |
end |
Final date at which the data was projected, in ISO format. |
A data.frame.
The available indicators are: PIB Agropecuario, PIB Industrial, PIB Serviços e PIB Total.
# bcbExpectT()
# bcbExpectT()
The Brazilian Economic Time Series (BETS) package provides access and information about the most important Brazilian economic time series.
These series are created by three influential centers: the Central Bank of Brazil (BCB), the Brazilian Institute of Geography and Statistics (IBGE) and the Brazilian Institute of Economics, from the Getulio Vargas Foundation (FVG-IBRE). Currently, there are more than 18.640 available time series, most of them free of charge. Besides providing access to this vast database, the package allows the user to interact with data in an easy and friendly way.
For instance, the user can search for a time series using keywords. More importantly, it installs several consecrated packages for time series analysis, giving the user the option to perform a complete analysis without having to worry about installing and loading other packages. In a near future, the authors will publish a series of R exercises to be solved with BETS and its statiscal/econometrical tools, therefore helping the user to understand the behavior of brazilian time series.
The authors would like to thank the support by the Getulio Vargas Foundation (FGV) and make it clear that all data in the package is in public domain. The rights of all centers from which the series are taken are maintained. We reaffirm that BETS is mainly intended for academic usage.
Pedro Costa Ferreira [email protected], Jonatha Costa [email protected], Talitha Speranza [email protected], Fernando Teixeira [email protected]
An interface for searching time series with possibility to extract the data in different extensions.
BETS.addin_en()
BETS.addin_en()
An interface for searching time series with possibility to extract the data in different extensions.
BETS.addin_pt()
BETS.addin_pt()
Extracts a complete time series from either the Central Bank of Brazil (BCB), the Brazilian Institute of Geography and Statistics (IBGE) or the Brazilian Institute of Economics (FGV/IBRE).
BETSget(code, from = "", to = "", data.frame = FALSE, frequency = NULL)
BETSget(code, from = "", to = "", data.frame = FALSE, frequency = NULL)
code |
A |
from |
A |
to |
A |
data.frame |
A |
frequency |
An |
A ts
(time series) object containing the desired series.
Due to the significant size of the databases, it could take a while to retrieve the values. However, it shouldn't take more than 90 seconds.
ts
, BETSsearch
and seas
# Anual series: GDP at constant prices, in R$ (brazilian reais) #BETSget(1208) # International reserves - Cash concept #int.reserves <- get("3543") #plot(int.reserves) # Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) # Multiple requests # BETSget(code = c(10777,4447),from = "2001-01-01", to = "2016-10-31") # BETSget(code = c(10777,4447),from = c("2001-10-31",""),to = c("2016-10-31","")) # f <- c("2001-10-31","1998-09-01") # t <- c("2014-10-31","2015-01-01") # BETSget(code = c(10777,4447), from = f, to = t) # BETSget(code = c(10777,4447),from = "2001-10-31", to = c("2014-10-31","2015-01-01")) # BETSget(code = c(10777,4447),from = c("2002-10-31","1997-01-01"), to = "2015-01-01")
# Anual series: GDP at constant prices, in R$ (brazilian reais) #BETSget(1208) # International reserves - Cash concept #int.reserves <- get("3543") #plot(int.reserves) # Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) # Multiple requests # BETSget(code = c(10777,4447),from = "2001-01-01", to = "2016-10-31") # BETSget(code = c(10777,4447),from = c("2001-10-31",""),to = c("2016-10-31","")) # f <- c("2001-10-31","1998-09-01") # t <- c("2014-10-31","2015-01-01") # BETSget(code = c(10777,4447), from = f, to = t) # BETSget(code = c(10777,4447),from = "2001-10-31", to = c("2014-10-31","2015-01-01")) # BETSget(code = c(10777,4447),from = c("2002-10-31","1997-01-01"), to = "2015-01-01")
Searches the BETS databases for a time series by its description, source, periodicity, code, data, unit of measurement and database name.
BETSsearch(description = "*", src, periodicity, unit, code, start, view = FALSE, lang = "en")
BETSsearch(description = "*", src, periodicity, unit, code, start, view = FALSE, lang = "en")
description |
A |
src |
A |
periodicity |
A |
unit |
A |
code |
An |
start |
A |
view |
A |
lang |
A |
Syntax rules for the parameter description
, the search string to look for matching series descriptions:
To search for alternative words, separate them by white spaces.
Example: description = "ipca core"
means that the series description must contain 'ipca' AND'core'
To search for whole expressions, surround them with ' '
.
Example: description = "'core ipca' index"
means that the series description must contain 'core ipca' AND 'index'
To exclude words from the search, insert a ~
before each of them.
Example: description = "ipca ~ core"
means that the series description must contain 'ipca' AND must NOT contain 'core'
To exclude whole expressions from the search, surround them with code' ' and insert a ~
before each of them.
Example: description = "~ 'ipca core' index"
means that the series description must contain 'index' AND must NOT contain 'core ipca'
It is possible to search for multiple words or expressions and to negate multiple words or expressions, as long as the preceeding rules are observed.
The white space after the negation sign (~
) is not required. But the white spaces AFTER expressions or words ARE required.
Possible values for the parameter src
:
IBGE | Brazilian Institute of Geography and Statistics |
BCB | Central Bank of Brazil |
FGV | Getulio Vargas Foundation |
FGv-IBRE | Getulio Vargas Foundation - Brazilian Institute of Economics |
BCB e FGV | Central Bank of Brazil and Getulio Vargas Foundation |
BCB-Deban | Cetral Bank of Brazil - Department of Banking and Payments |
BCB-Depin | Central Bank of Brazil - Department of International Reserves |
BCB-Derin | Central Bank of Brazil - Department of International Affairs |
BCB-Desig | Central Bank of Brazil - Department of Financial Monitoring |
BCB-Secre | Central Bank of Brazil - Executive Secretariat |
BCB-Demab | Central Bank of Brazil - Department of Open Market Operations |
BCB-Denor | Central Bank of Brazil - Department of Financial System Regulation |
BCB-Depec | Central Bank of Brazil - Department of Economics |
Sisbacen | Central Bank of Brazil Information System |
Abecip | Brazilian Association of Real Estate Loans and Savings Companies |
Possible values for the parameter periodicity
:
A | anual data |
M | monthly data |
Q | quaterly data |
W | weekly data |
D | daily data |
Possible values for the parameter unit
:
R$ | brazilian reais |
$ | US dolars |
% | percentage |
A list
that can be interpreted as a data.frame
. The fields are described below.
code | The code/index of the series within the database |
description | The description of the series |
periodicity | The periodicity of the series |
start | Starting date of the series |
source | The source of the series |
unit | The unit of measurement of the data |
Central Bank of Brazil
#not run #BETSsearch(description="sales",view = FALSE) #BETSsearch(src="Denor", view = FALSE) #BETSsearch(periodicity="A", view = FALSE)
#not run #BETSsearch(description="sales",view = FALSE) #BETSsearch(src="Denor", view = FALSE) #BETSsearch(periodicity="A", view = FALSE)
Display a list of sources available at BETS package in console. The numbers of sources will increase wiht new versions of the package.
BETSsources()
BETSsources()
Create a professional looking chart, using a pre-defined BETS series or a custom series.
chart(ts, style = "normal", file = NULL, open = TRUE, lang = "en", params = NULL)
chart(ts, style = "normal", file = NULL, open = TRUE, lang = "en", params = NULL)
ts |
A |
style |
A |
file |
A |
open |
A |
lang |
A |
params |
A |
Names of pre-defined charts:
1. Business Cycle Dashboard ('plotly' style)
VALUE | DESCRIPTION | CODE |
'iie_br' | Uncertainty Index | ST_100.0 |
'sent_ind' | Economic Sentiment Index (average between several confidence indexes) | (*) |
'gdp_mon' | GDP Monthly and Interanual Variation (last values) - GDP Monitor (FGV/IBRE) | (*) |
'ei_vars' | Economic Indicators (Leading and Coincident) monthly variation | (*) |
'ei_comps' | Economic Indicators (Leading and Coincident) components variation | (*) |
'lei' | Leading Economic Indicator (LEI - FGV/IBRE with The Conference Board) | (*) |
'cei' | Coincident Economic Indicator (CEI - FGV/IBRE with the Conference Board) | (*) |
'gdp_vars' | GDP components variation (whole series) - GDP Monitor (FGV/IBRE) | (*) |
'misery_index | Misery Index | 13522 plus 24369 |
'gdp_comps' | GDP components variation (last values) - GDP Monitor (FGV/IBRE) | (*) |
'gdp_unemp' | GDP monthly levels versus Unemployement Rate | 22109 and 24369 |
'conf_lvl' | Enterprises Confidence Index versus Consumers Confidence Index | (*) |
'inst_cap' | Installed Capacity Index | (*) |
'lab_lead' | Labor Leading Indicator | (*) |
'lab_coin' | Labor Coincident Indicator | (*) |
'transf_ind' | Transformation Industry Confidence Index (Expectations versus Present Situation) | (*) |
'servc' | Services Confidence Index (Expectations versus Present Situation) | (*) |
'constr' | Construction Confidence Index (Expectations versus Present Situation) | (*) |
'retail' | Retail Sellers Confidence Index (Expectations versus Present Situation) | (*) |
'consm' | Consumer Confidence Index (Expectations versus Present Situation) | (*) |
2. Macro Situation Dashboard ('normal' style)
VALUE | DESCRIPTION | CODE |
'ipca_with_core' | National consumer price index (IPCA) - in 12 months and Broad national consumer price index - Core IPCA trimmed means smoothed | 13522 and 4466 |
'ulc' | Unit labor cost - ULC-US$ - June/1994=100 | 11777 |
'eap' | Economically active population | 10810 |
'cdb' | Time deposits (CDB/RDB-preset) - Daily return (percentage) | 14 |
'indprod' | Prodcution Indicators (2012=100) - General | 21859 |
'selic' | Interest rate - Selic accumulated in the month in annual terms (basis 252) | 4189 |
'unemp' | Unemployment rate - by metropolitan region (PNAD-C) | 10777 |
'vargdp' | GDP - real percentage change in the year | 7326 |
(*) Not available on BETS databases yet. But you can find it in .csv files saved under your BETS installation directory.
3. Custom Charts
None of these parameters is required. Please note that some parameters only work for a certain type of chart.
PARAMETER | DESCRIPTION | WORKS FOR |
type |
A character . Either 'bar' or 'lines'. Whether to plot bars or lines. Works for main series, only. |
Both |
trend
|
A boolean . Default is FALSE . Set it to TRUE if the trend of the main series (parameter ts ) is to be drawn. |
Both |
title
|
A character . Plot's title. |
Both |
subtitle
|
A character . Plot's subtitle. |
Both |
xlim
|
A numeric vector. X axis limits |
Both |
ylim
|
A numeric vector. Y axis limits |
Both |
arr.ort
|
A character . Orientation of the arrow pointing to the last value of the main series. Valid values are 'h' (horizontal) and 'v' (vertical). |
'normal' |
arr.len
|
A numeric value. Length of the arrow pointing to the last value of the main series. |
'normal' |
extra
|
A ts object. A second series to be plotted. |
Both |
extra.y2
|
A boolean . Default is FALSE . Does the extra series require a second y axis? |
'plotly' |
extra.arr.ort
|
A character . Orientation of the arrow pointing to the last value of the extra series. Valid values are 'h' (horizontal) and 'v' (vertical). |
'normal' |
extra.arr.len
|
A numeric value. Length of the arrow pointing to the last value of the extra series. |
'normal' |
colors
|
A character or integer vector. A vector of colors, one for each series. Trends will always be drawn in gray, its color can't be set. |
Both |
legend
|
A character vector. Names of the series. Default is NULL (no legends). |
Both |
legend.pos
|
A character . Legend position. If type is set to 'normal', possibile values are 'top' and 'bottom'; if type is set to 'plotly', either 'h' (horizontal) and 'v' (vertical). |
Both |
codace
|
A boolean . Default is FALSE . Include shaded areas for recessions, as dated by CODACE(**)? |
'plotly' |
(**) Business Cycle Dating Committee (FGV/IBRE)
If parameter file
is not set by the user, the chart will be shown at the standard R ploting area. Otherwise, it is going to be saved on your computer.
Talitha Speranza [email protected]
# chart(ts = "sent_ind", file = "animal_spirits", open = T) # chart(ts = "gdp_mon", file = "gdp_mon.png", open = F) # chart(ts = "misery_index") # chart(ts = "transf_ind", file = "transf_ind.png", open = F)
# chart(ts = "sent_ind", file = "animal_spirits", open = T) # chart(ts = "gdp_mon", file = "gdp_mon.png", open = F) # chart(ts = "misery_index") # chart(ts = "transf_ind", file = "transf_ind.png", open = F)
Creates a plot of series 11777
chart.add_basic(ts, xlim = NULL, ylim = NULL, type = "lines", title = "", subtitle = "", col = "firebrick4", arr.size = NULL, arr.pos = "v", leg.pos = "top", trend = FALSE)
chart.add_basic(ts, xlim = NULL, ylim = NULL, type = "lines", title = "", subtitle = "", col = "firebrick4", arr.size = NULL, arr.pos = "v", leg.pos = "top", trend = FALSE)
ts |
A |
xlim |
A |
ylim |
A |
type |
A |
title |
A |
subtitle |
A |
col |
A |
arr.size |
A |
arr.pos |
A |
leg.pos |
A |
trend |
A |
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 11777
chart.add_extra(ts, ylim = NULL, xlim = NULL, col = "firebrick3", arr.size = NULL, arr.pos = "v", leg.pos = "top", leg.text = "", main.type = "lines")
chart.add_extra(ts, ylim = NULL, xlim = NULL, col = "firebrick3", arr.size = NULL, arr.pos = "v", leg.pos = "top", leg.text = "", main.type = "lines")
ts |
A |
ylim |
A |
xlim |
A |
col |
A |
arr.size |
A . |
arr.pos |
A . |
leg.pos |
A . |
leg.text |
A . |
main.type |
A . |
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Add notes
chart.add_notes(series.list, xlim, ylim, names = NULL, dec = 2)
chart.add_notes(series.list, xlim, ylim, names = NULL, dec = 2)
series.list |
A |
xlim |
A |
ylim |
A |
names |
A |
dec |
An |
Talitha Speranza [email protected]
Check series in BETS dataset
check.series(ts, message = NULL)
check.series(ts, message = NULL)
ts |
A |
message |
A |
Talitha Speranza [email protected]
Make the connection with the server
connection()
connection()
Plot correlograms using plot.ly and several other options that differ theses plots from forecasts ACF and PACF.
corrgram(ts, lag.max = 12, type = "correlation", mode = "simple", ci = 0.95, style = "plotly", knit = F)
corrgram(ts, lag.max = 12, type = "correlation", mode = "simple", ci = 0.95, style = "plotly", knit = F)
ts |
An object of type |
lag.max |
A |
type |
A |
mode |
A |
ci |
A |
style |
A |
knit |
A |
A plot and a vector
containing the correlations.
Talitha Speranza [email protected]
Generate thematic dashboards using a selection of BETS time series and charts. For now, themes and charts are pre-defined.
dashboard(type = "business_cycle", charts = "all", saveas = NA, parameters = NULL)
dashboard(type = "business_cycle", charts = "all", saveas = NA, parameters = NULL)
type |
A |
charts |
A |
saveas |
A |
parameters |
A |
Macro Situation and Custom Dashboard Parameters
text
|
The text to be printed in the dashboard. Separate paragraphs with two backslashes 'n' and pages with '##'. There are no other syntax rules. |
author
|
The author's name. |
email
|
The author's email. |
url
|
The author's webpage. |
logo
|
The author's business logo. |
Additional Custom Dashboard Parameters
style |
A character . The style of the charts. As in chart , can be either 'plotly' or 'normal' . |
charts.opts |
A list of parameters lists, one for each chart. Parameters are specified in chart |
A .pdf file (the dashboard)
Talitha Speranza [email protected]
# dashboard() # dashboard(saveas = "survey.pdf") # dashboard(type = "macro_situation")
# dashboard() # dashboard(saveas = "survey.pdf") # dashboard(type = "macro_situation")
Deflate a time series using a deflator series. The deflator can be an index, a percentage or a point percentage series.
deflate(ts, deflator, type = "index")
deflate(ts, deflator, type = "index")
ts |
A |
deflator |
A |
type |
A |
The deflated series.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.cap_utl()
draw.cap_utl()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 14
draw.cdb()
draw.cdb()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.cei()
draw.cei()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.conf_lvl()
draw.conf_lvl()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 10810
draw.eap()
draw.eap()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.ei_comps()
draw.ei_comps()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Creates a plot of series 4189
draw.ei_vars()
draw.ei_vars()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.gdp_comps()
draw.gdp_comps()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.gdp_mon()
draw.gdp_mon()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.gdp_unemp()
draw.gdp_unemp()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.gdp_vars()
draw.gdp_vars()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.generic(ts, style, params)
draw.generic(ts, style, params)
ts |
aaaa |
style |
aaa |
params |
aaa |
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.iie_br()
draw.iie_br()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 21859
draw.indprod()
draw.indprod()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 13522 (NCPI), along with series 4466 (NCPI core)
draw.ipca()
draw.ipca()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.lab_coin()
draw.lab_coin()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.lab_lead()
draw.lab_lead()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.lei()
draw.lei()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.misery_index()
draw.misery_index()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.selic()
draw.selic()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.sent_ind()
draw.sent_ind()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 4189
draw.survey(survey)
draw.survey(survey)
survey |
xxx |
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Talitha Speranza [email protected]
Creates a plot of series 11777
draw.ulc()
draw.ulc()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Creates a plot of series 10777
draw.unemp()
draw.unemp()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Creates a plot of series 7326
draw.vargdp()
draw.vargdp()
An image file is saved in the 'graphs' folder, under the BETS installation directory.
Returns a monthly or quarterly dummy (a time series with only 0s and 1s).
dummy(start = NULL, end = NULL, frequency = 12, year = NULL, month = NULL, quarter = NULL, date = NULL, from = NULL, to = NULL)
dummy(start = NULL, end = NULL, frequency = 12, year = NULL, month = NULL, quarter = NULL, date = NULL, from = NULL, to = NULL)
start |
An |
end |
An |
frequency |
An |
year |
An |
month |
An |
quarter |
An |
date |
a |
from |
An |
to |
The ending period of a sequence of perids for which the dummy must be set to one. Periods must be represented as integer vectors, as described for |
A monthly or a quarterly ts
object.
#1 from a specific date to another specific date dummy(start = c(2000,1),end = c(2012,5),frequency = 12,from = c(2005,1),to = c(2006,12)) #Other options that may be helpful: #over a month equal to 1 dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = c(5,12)) #Months equal to 1 only for some year dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5, year = 2010) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 8, year = 2002) #Months equal to 1 only for some years dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5, year = 2005:2007) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 3, year = c(2005,2007)) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5:6, year = c(2005,2007)) #specific dates dummy(start = c(2000,1), end = c(2012,5), frequency = 12, date = list(c(2010,1))) dummy(start = c(2000,1), end = c(2012,5), freq = 12, date = list(c(2010,9), c(2011,1), c(2000,1)) )
#1 from a specific date to another specific date dummy(start = c(2000,1),end = c(2012,5),frequency = 12,from = c(2005,1),to = c(2006,12)) #Other options that may be helpful: #over a month equal to 1 dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = c(5,12)) #Months equal to 1 only for some year dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5, year = 2010) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 8, year = 2002) #Months equal to 1 only for some years dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5, year = 2005:2007) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 3, year = c(2005,2007)) dummy(start = c(2000,1), end = c(2012,5), frequency = 12, month = 5:6, year = c(2005,2007)) #specific dates dummy(start = c(2000,1), end = c(2012,5), frequency = 12, date = list(c(2010,1))) dummy(start = c(2000,1), end = c(2012,5), freq = 12, date = list(c(2010,9), c(2011,1), c(2000,1)) )
Extracts a complete time series from either the Central Bank of Brazil (BCB), the Brazilian Institute of Geography and Statistics (IBGE) or the Brazilian Institute of Economics (FGV/IBRE).
get.series(code, from = "", to = "", data.frame = FALSE, frequency = NULL)
get.series(code, from = "", to = "", data.frame = FALSE, frequency = NULL)
code |
A |
from |
A |
to |
A |
data.frame |
A |
frequency |
An |
A function to extract BACEN series using their API
get.series.bacen(x, from = "", to = "", save = "")
get.series.bacen(x, from = "", to = "", save = "")
x |
Bacen series numbers. Either an integer or a numeric vector. |
from |
A string specifying where the series shall start. |
to |
A string specifying where the series shall end. |
save |
A string specifying if data should be saved in csv or xlsx format. Defaults to not saving. |
Fernando Teixeira [email protected] and Jonatha Azevedo [email protected]
Given new values of the independent variables, tests a list of trained GRNNs and picks the best net, based on an accuracy measure between the forecasted and the actual values.
grnn.test(results, test.set)
grnn.test(results, test.set)
results |
The object returned by grnn.train. |
test.set |
A |
A list
object representing the best network (according to forecasting MAPE). Its fields are:
mape
: The forecasting MAPE
model
: The network object
sigma
: The sigma parameter
id
: The id number of the network, as given by grnn.train
mean
: The predicted values
x
: The original series
fitted
: The fitted values
actual
: The actual values (to be compared with the predicted values)
residuals
: Difference between the fitted values and the series original values
regressors
: The regressors used to train the network
Talitha Speranza [email protected]
Creates a set of probabilistic neural networks as proposed by Specht [1991]. The user provides a set of regressors and the function chooses which subset is the best, based on an accuracy measure (by default, the MAPE) between fited and actual values. These networks have only one parameter, the sigma
, which is the standard deviation of each activation function (gaussian) of the pattern layer. Sigma can also be automatically chosen. This function builds on grnn-package.
grnn.train(train.set, sigma, step = 0.1, select = TRUE, names = NA)
grnn.train(train.set, sigma, step = 0.1, select = TRUE, names = NA)
train.set |
A |
sigma |
A |
step |
A |
select |
A |
names |
A |
A list
of result objects, each representing a network. These objects are ordered by MAPE (the 20 best MAPEs) and its fields are:
accuracy
: A numeric
value. Accuracy measure between the fitted and the actual series values. By default, the MAPE. In future versions, it will be possible to change it.
fitted
: The fitted values, that is, one step ahead predicitions calculated by the trained net.
net
: An object returned by the grnn function. Represents a trained net.
sigma
: A numeric
. The sigma that was chosen, either by the user or by the function itself (in case select
was set to TRUE
)
regressors
: A character vector
. Regressors that were chosen, either by the user or by the fuction itself (in case select
was set to TRUE
)
sigma.accuracy
: A data.frame
. Sigma versus accuracy value of the corresponding trained network. Those networks were trained using the best set of regressors.
residuals
: A numeric vector
. Fitted values subtracted from the actual values.
grnn.train also returns a diagnostic of training rounds and a sigma
versus accuracy
plot.
Talitha Speranza [email protected]
Customizes a message and shows it in the console.
msg(..., skip_before = TRUE, skip_after = FALSE, warn = FALSE)
msg(..., skip_before = TRUE, skip_after = FALSE, warn = FALSE)
... |
Arguments to be passed to |
skip_before |
A |
skip_after |
A |
warn |
A |
None
Talitha Speranza [email protected], Jonatha Azevedo [email protected]
Normalizes a time series, either by stardization or by mapping to values between 0 and 1.
normalize(series, mode = "scale")
normalize(series, mode = "scale")
series |
A |
mode |
A |
A ts
object or a ts list
. The normalized series.
Talitha Speranza [email protected]
This function is built upon forecast. Besides the model predictions, it returns an accuracy measure table (calculated by the accuracy function) and a graph showing the original series, the predicted values and the actual values.
predict(..., actual = NULL, main = "", ylab = "", xlim = NULL, style = "dygraphs", unnorm = NULL, legend.pos = "topright", knit = F)
predict(..., actual = NULL, main = "", ylab = "", xlim = NULL, style = "dygraphs", unnorm = NULL, legend.pos = "topright", knit = F)
... |
arguments passed on to forecast. If the model is a neural network, these arguments will be passed on to grnn.test. |
actual |
A |
main |
A |
ylab |
A |
xlim |
A |
style |
A |
unnorm |
A |
legend.pos |
A |
knit |
A |
Besides the prediction plot, this function returns an object whose fields are:
accuracy
: An object returned by accuracy. It is a table containing several accuracy measures
predictions
: A numeric vector
containing the predicted values.
Talitha Speranza [email protected]
Generate automatic reports with a complete analysis of a set of time series. For now, SARIMA (Box & Jenkins approach), Holt-Winters and GRNN analysis are possible. Soon, Multilayer Perceptron, Fuzzy Logic and Box-Cox analysis will become available.
report(mode = "SARIMA", ts = 21864, parameters = NULL, report.file = NA, series.saveas = "none")
report(mode = "SARIMA", ts = 21864, parameters = NULL, report.file = NA, series.saveas = "none")
mode |
A |
ts |
A |
parameters |
A |
report.file |
A |
series.saveas |
A |
SARIMA Report Parameters
cf.lags
: An integer
. Maximum number of lags to show on the ACFs e PACFs
n.ahead
: An integer
. Prevision horizon (number of steps ahead)
inf.crit
: A character
. Information criterion to be used in model selection.
dummy
: A ts
object. A dummy regressor. Must also cover the forecasting period.
ur.test
: A list
. Parameters of ur_test
arch.test
: A list
. Parameters of arch_test
box.test
: A list
. Parameters of Box.test
GRNN Report Parameters
auto.reg
: A boolean
. Is the dependant variable auto-regressive?
present.regs
: A boolean
Include non-lagged series among regressors?
lag.max
: A integer
Regressors' maximum lag
regs
: A list
. Regressors codes or time series
start.train
: Training set starting period
end.train
: Training set ending period
start.test
: Testing set starting period
end.test
: Testing set ending period
sigma.interval
: A numeric
vector. Sigma inteval
sigma.step
: A numeric
value. Sigma step
var.names
: A character
vector. Variable names
HOLT-WINTERS Report Parameters
alpha
: Smooth factor of the level component. If numeric, it must be within the half-open unit interval (0, 1]. A small value means that older values in x are weighted more heavily. Values near 1.0 mean that the latest value has more weight. NULL means that the HoltWinters function should find the optimal value of alpha. It must not be FALSE or 0.
beta
: Smooth factor of the trend component. If numeric, it must be within the unit interval [0, 1]. A small value means that older values in x are weighted more heavily. Values near 1.0 mean that the latest value has more weight. NULL means that the HoltWinters function should find the optimal value of beta. The trend component is omitted if beta is FALSE or 0.
gamma
: Smooth factors of the seasonal component. If numeric, it must be within the unit interval [0, 1]. A small value means that older values in x are weighted more heavily. Values near 1.0 mean that the latest value has more weight. NULL means that the HoltWinters function should find the optimal value of gamma. The seasonal component will be omitted if gamma is FALSE or 0. This must be specified as FALSE if frequency(x) is not an integer greater than 1.
additive
: A single character string specifying how the seasonal component interacts with the other components. "additive", the default, means that x is modeled as level + trend + seasonal and "multiplicative" means the model is (level + trend) * seasonal. Abbreviations of "additive" and "multiplicative" are accepted.
l.start
: The starting value of the level component.
b.start
: The starting value of the trend component
s.start
: The starting values of seasonal component, a vector of length frequency(x)
n.ahead
: Prevision horizon (number of steps ahead)
For more information about these parameters, see also HoltWinters
. Most parameters are the same and we just reproduced their documentation here.
One or more .html files (the reports) and, optionally, data files (series plus predictions).
Talitha Speranza [email protected]
##-- SARIMA # parameters = list(lag.max = 48, n.ahead = 12 ) # report(ts = 21864, parameters = parameters) # report(ts = 4447, series.saveas = "csv") # series = list(BETSget(4447), BETSget(21864)) # parameters = list(lag.max = 20, n.ahead = 15 ) # report(ts = series, parameters = parameters) # series = list(4447, 21864) # report(ts = series, parameters = parameters) # parameters = list( # cf.lags = 25, # n.ahead = 15, # dummy = dum, # arch.test = list(lags = 12, alpha = 0.01), # box.test = list(type = "Box-Pierce") # ) # report(ts = window(BETSget(21864), start= c(2002,1) , end = c(2015,10)), #parameters = parameters) # dum <- dummy(start= c(2002,1) , end = c(2017,1) , #from = c(2008,9) , to = c(2008,11)) # parameters = list( # cf.lags = 25, # n.ahead = 15, # dummy = dum # ) # report(ts = window(BETSget(21864), start= c(2002,1) , end = c(2015,10)), #parameters = parameters) ##-- GRNN # params = list(regs = 4382) # report(mode = "GRNN", ts = 13522, parameters = params) ##-- HOLT-WINTERS # params = list(alpha = 0.5, gamma = TRUE) # report(mode = "HOLT-WINTERS", ts = 21864, series.saveas = "csv", parameters = params) # params = list(gamma = T, beta = TRUE) # report(mode = "HOLT-WINTERS", ts = 21864, series.saveas = "csv", parameters = params)
##-- SARIMA # parameters = list(lag.max = 48, n.ahead = 12 ) # report(ts = 21864, parameters = parameters) # report(ts = 4447, series.saveas = "csv") # series = list(BETSget(4447), BETSget(21864)) # parameters = list(lag.max = 20, n.ahead = 15 ) # report(ts = series, parameters = parameters) # series = list(4447, 21864) # report(ts = series, parameters = parameters) # parameters = list( # cf.lags = 25, # n.ahead = 15, # dummy = dum, # arch.test = list(lags = 12, alpha = 0.01), # box.test = list(type = "Box-Pierce") # ) # report(ts = window(BETSget(21864), start= c(2002,1) , end = c(2015,10)), #parameters = parameters) # dum <- dummy(start= c(2002,1) , end = c(2017,1) , #from = c(2008,9) , to = c(2008,11)) # parameters = list( # cf.lags = 25, # n.ahead = 15, # dummy = dum # ) # report(ts = window(BETSget(21864), start= c(2002,1) , end = c(2015,10)), #parameters = parameters) ##-- GRNN # params = list(regs = 4382) # report(mode = "GRNN", ts = 13522, parameters = params) ##-- HOLT-WINTERS # params = list(alpha = 0.5, gamma = TRUE) # report(mode = "HOLT-WINTERS", ts = 21864, series.saveas = "csv", parameters = params) # params = list(gamma = T, beta = TRUE) # report(mode = "HOLT-WINTERS", ts = 21864, series.saveas = "csv", parameters = params)
To be used with saveSpss, saveSas and others.
save(code = NULL, data = NULL, file.name = "series", type = "")
save(code = NULL, data = NULL, file.name = "series", type = "")
code |
An |
data |
A |
file.name |
A |
type |
A |
A list with the data frame to be saved and the file name
Writes a time series to a .sas (SAS) file.
saveSas(code = NULL, data = NULL, file.name = "series")
saveSas(code = NULL, data = NULL, file.name = "series")
code |
An |
data |
A |
file.name |
A |
None
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #require(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveSas(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveSas(code=3691,file.name="us.brl")
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #require(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveSas(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveSas(code=3691,file.name="us.brl")
Writes a time series to a .spss (SPSS) file.
saveSpss(code = NULL, data = NULL, file.name = "series")
saveSpss(code = NULL, data = NULL, file.name = "series")
code |
An |
data |
A |
file.name |
A |
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #requires(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveSpss(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveSpss(code=3691,file.name="us.brl")
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #requires(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveSpss(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveSpss(code=3691,file.name="us.brl")
Writes a time series to a .dta (STATA) file.
saveStata(code = NULL, data = NULL, file.name = "series")
saveStata(code = NULL, data = NULL, file.name = "series")
code |
An |
data |
A |
file.name |
A |
None
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #requires(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveStata(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveStata(code=3691,file.name="us.brl")
#Exchange rate - Free - United States dollar (purchase) #us.brl <- get(3691) #requires(seasonal) #us.brl.seasonally_adjusted <- seas(us.brl) #saveStata(data = us.brl.seasonally_adjusted,file.name="us.brl.seasonally_adjusted") # Or #saveStata(code=3691,file.name="us.brl")
Searches the Sidra databases for a series by its description or a given table descriptions.
sidra.aux(x, len, nova_req, from, to, inputs, territory, variable, header, sections)
sidra.aux(x, len, nova_req, from, to, inputs, territory, variable, header, sections)
x |
Either a character or a numeric. If character, function searches the Sidra metadata. If a numeric argument is provided the descriptions of the given table are seached . |
len |
A . |
nova_req |
A . |
from |
A . |
to |
A . |
inputs |
A . |
territory |
A . |
variable |
A . |
header |
A . |
sections |
A . |
The different parameters define the table and its dimensions (periods, variables, territorial units and classification) to be consulted. The parameters that define the sections may vary from table to table. Henceforth, the Sidra function ranges between 5 mandatory arguments to 7. You can only choose one variable per series per request, but multiple sections within the variable.
sidraGet(x, from, to, territory = c(n1 = "brazil", n2 = "region", n3 = "state", n6 = "city", n8 = "mesoregion", n9 = "microregion", n129 = "citizenship", n132 = "semiarid", n133 = "semiaridUF"), variable, cl = NULL, sections = NULL)
sidraGet(x, from, to, territory = c(n1 = "brazil", n2 = "region", n3 = "state", n6 = "city", n8 = "mesoregion", n9 = "microregion", n129 = "citizenship", n132 = "semiarid", n133 = "semiaridUF"), variable, cl = NULL, sections = NULL)
x |
Sidra series number. |
from |
A string or character vector specifying where the series shall start |
to |
A string or character vector specifying where the series shall end |
territory |
Specifies the desired territorial levels. |
variable |
An integer describing what variable characteristics are to be returned. Defaults to all available. |
cl |
A vector containing the classification codes in a vector. |
sections |
A vector or a list of vectors if there are two or more classification codes containing the desired tables from the classification. |
## Not run: sidra = sidraGet(x = c(1612), from = 1990, to = 2015, territory = "brazil", variable =109) sidra = sidraGet(x = c(3653), from = c("200201"), to = c("201703"), territory = "brazil", variable = 3135, sections = c(129316,129330), cl = 544) sidra = sidraGet(x = c(3653), from = c("200201"), to = c("201512"), territory = "brazil", variable = 3135, sections = "all", cl = 544) sidra = sidraGet(x = c(1618), from = c("201703"), to = c("201703"), territory = "brazil", variable = 109, sections=list(c(39427), c(39437,39441)), cl = c(49, 48)) trim - x = 1620; from = 199001; to = 201701; territory = "brazil"; sections = list(c(90687)); cl =c(11255); variable = 583 sidra = sidraGet(x = 1620, from = 199001, to = 201701, territory = "brazil", sections=list(c(90687)), cl =c(11255), variable = 583) ## End(Not run)
## Not run: sidra = sidraGet(x = c(1612), from = 1990, to = 2015, territory = "brazil", variable =109) sidra = sidraGet(x = c(3653), from = c("200201"), to = c("201703"), territory = "brazil", variable = 3135, sections = c(129316,129330), cl = 544) sidra = sidraGet(x = c(3653), from = c("200201"), to = c("201512"), territory = "brazil", variable = 3135, sections = "all", cl = 544) sidra = sidraGet(x = c(1618), from = c("201703"), to = c("201703"), territory = "brazil", variable = 109, sections=list(c(39427), c(39437,39441)), cl = c(49, 48)) trim - x = 1620; from = 199001; to = 201701; territory = "brazil"; sections = list(c(90687)); cl =c(11255); variable = 583 sidra = sidraGet(x = 1620, from = 199001, to = 201701, territory = "brazil", sections=list(c(90687)), cl =c(11255), variable = 583) ## End(Not run)
Searches the Sidra databases for a series by its description or a given table descriptions.
sidraSearch(description = NULL, code, view = TRUE, browse = FALSE)
sidraSearch(description = NULL, code, view = TRUE, browse = FALSE)
description |
A |
code |
A numeric argument must be provided. The descriptions of the given table are returned. |
view |
A |
browse |
A |
## Not run: sidraSearch(description = "pib") sidraSearch(code = 1248) ## End(Not run)
## Not run: sidraSearch(description = "pib") sidraSearch(code = 1248) ## End(Not run)
Uses a model object to create a plot of standardized residuals. This model can be an Arima or an arima. In a near future, this function will also accept objects returned by grnn.train.
std_resid(model, alpha = 0.05)
std_resid(model, alpha = 0.05)
model |
|
alpha |
A |
Besides showing the plot, this function returns a numeric vector
containing the standardized residuals.
Talitha Speranza [email protected]
Performs the t test on every parameter of an ARIMA model. This model can be an Arima or an arima.
t_test(model, nx = 0, alpha = 0.05)
t_test(model, nx = 0, alpha = 0.05)
model |
An Arima or an arima object. The model for which the parameters must be tested. |
nx |
An |
alpha |
A |
A data.frame
containing the standard erros, the t-statistic, the critical values and whether the null hypothesis should be rejected or not, for each model parameter.
Talitha Speranza [email protected], Daiane Marcolino [email protected]
require(forecast) data("AirPassengers") fit.air<- Arima(AirPassengers,order = c(1,1,1), seasonal = c(1,1,1), method ="ML",lambda=0) summary(fit.air) # Significance test for the model SARIMA(1,1,1)(1,1,1)[12] t_test(model = fit.air)
require(forecast) data("AirPassengers") fit.air<- Arima(AirPassengers,order = c(1,1,1), seasonal = c(1,1,1), method ="ML",lambda=0) summary(fit.air) # Significance test for the model SARIMA(1,1,1)(1,1,1)[12] t_test(model = fit.air)
This function uses the package 'urca' to perform unit root tests on a pre-defined time series. Unlike urca functions, it returns a meaningful table summarizing the results.
ur_test(..., mode = "ADF", level = "5pct")
ur_test(..., mode = "ADF", level = "5pct")
... |
Arguments passed on to urca functions |
mode |
A |
level |
A |
A list
object. The first element is a data.frame
with the test statistics, the critical values and the test results. The second, the model residuals.
Talitha Speranza [email protected]