Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data access layer #48

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e1e1746
Added DAL
Mar 15, 2023
a235544
bear dals
ebenetce Jun 12, 2023
0662065
added Abstract BEARDAL
ebenetce Jun 12, 2023
a1197ca
data is now timetable whenever possible
ebenetce Jun 13, 2023
43344f7
Merge branch 'develop' of https://github.com/european-central-bank/BE…
ebenetce Jun 13, 2023
1d0f3f1
added exported classes
ebenetce Jun 13, 2023
0db3382
+ Moved settings from Excel to DAL
Jun 19, 2023
7582641
removed xlswrite/xlsread from basic BVAR
ebenetce Jun 19, 2023
d4aab25
Migrated to FileExported object for Excel Writing
Jun 19, 2023
f7079d1
refactored loadsignres for xlsread/write
Jun 19, 2023
7d87573
Further removing xlsread
Jun 20, 2023
00601fa
Fixed app in 22a
Jun 20, 2023
e7b548a
Fixed random datetime values
Jun 20, 2023
1f14845
further xlsread removal
ebenetce Jun 20, 2023
43f03ed
fixed bug in cfshocks
ebenetce Jun 20, 2023
850ec4b
minor changes
ebenetce Jun 26, 2023
c57becb
New changes readded
Jun 27, 2023
6063502
Read excel edge cases
Jun 27, 2023
b32d07d
Cleaning up messages
Jun 28, 2023
3fb08d5
fixed loadcorrel loading
ebenetce Jun 28, 2023
4a2699b
refactored the dal to avoid NumEndo
ebenetce Jun 29, 2023
3fb38af
fixed blocks and shocks
ebenetce Jul 4, 2023
3a22051
various changes
ebenetce Jul 7, 2023
13c7370
favar fixes to avoid xlsread
ebenetce Jul 10, 2023
239fcff
removing unused files
ebenetce Jul 10, 2023
d079b5c
full xlsread removal from OLS +removed unreachable file
ebenetce Jul 10, 2023
4179d85
Various .mlx changes
Oct 10, 2023
36bf64d
Merged master
Oct 10, 2023
442aded
slow removal of xlsread in panel
ebenetce Oct 10, 2023
a3ca553
added md file with doc
ebenetce Oct 30, 2023
95669b7
added lambda_posterior draws in panel 4
ebenetce Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ edit('bear_settings_BVAR')

## Documentation

For a full BEAR documentation please visit our [doc page](https://github.com/european-central-bank/BEAR-toolbox/tree/master/tbx/doc).
To get started running the code, please visit:
[Full doc](/doc/Getting_started_2.md)

For the actual technical documentation, please look at the [technical guides](https://github.com/european-central-bank/BEAR-toolbox/tree/master/tbx/doc)

## Distribute BEAR

Expand Down
178 changes: 178 additions & 0 deletions doc/GettingStarted_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@

<a name="T_3795D8B6"></a>
# <span style="color:rgb(213,80,0)">BEAR</span>
<a name="beginToc"></a>
## Table of Contents
[Quick Guide](#H_5194ADD6)

[OLS VAR](#H_C9D87C44)

&emsp;[Bayesian VAR](#H_8F830DE7)

&emsp;[PANEL VAR](#H_79E2BAEE)

&emsp;[Stochastic Volatility](#H_0C663C91)

&emsp;[Time Varying Panel](#H_F7A1563A)

&emsp;[Mixed Frequency](#H_413C373A)

[Applications](#H_3B88EB60)

&emsp;[Impulse Response Functions](#H_231A6857)

&emsp;[Unconditional Forecasts](#H_8DFCADBE)

&emsp;[Forecast Error Variance](#H_811CB45A)

&emsp;[Historical Decompositions](#H_4C47CFC6)

&emsp;[Conditional Forecasts](#H_EE37E1B9)

[Replications](#H_B3AD755D)

<a name="endToc"></a>
<a name="H_5194ADD6"></a>
# Quick Guide

First of all, you should probably understand basic [OLS VAR models](#H_C9D87C44)


BEAR has two sets of inputs.

- A number of timeseries and tables that you normally enter in an Excel file
- A nubmer of inputs that you pass in as a struct.

You can create such a group of settings and run BEAR as follows

```matlab
s = BEARsettings('BVAR', data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_8BB0D5E4"></a>
# **Common Settings**

Here we discuss how to run a generic BEAR model and the basic "generic" settings. The equivalent to the Blue Box in the BEAR app. For example:

```matlab
s = BEARsettings("BVAR", data = "default_bear_data.xlsx")
```

Optional inputs:

- frequency % data frequency (1=yearly, 2= quarterly, 3=monthly, 4=weekly, 5=daily, 6=undated)
- startdate % sample start date; must be a string consistent with the date formats of the toolbox
- enddate % sample end date; must be a string consistent with the date formats of the toolbox
- varendo % endogenous variables; must be a single string, with variable names separated by a space
- varexo % exogenous variables, if any; must be a single string, with variable names separated by a space
- lags % number of lags
- const % inclusion of a constant (1=yes, 0=no)
- data
- results % save the results in the excel file (true/false)
- results_path % path where there results file is stored
- results_sub % name of the results file
- plot % plot the results (true/false)
- Debug % save error
- workspace % save the workspace as a .mat file (true/false)
<a name="H_47BE6EC6"></a>
# **VAR Type**

This is the most important setting for BEAR. It decides which type of model you are running.


This settings cannot be changed, becuase a lot of properties are dependent on it, so once you create a specific settings object, you either stick with it or recreate.

<a name="H_C9D87C44"></a>
# OLS VAR

Brief explanation

```matlab
s = BEARsettings("OLS", data = "default_bear_data.xlsx")
BEARmain(s)
```

[Detailed Explanation](./OLS.mlx)

<a name="H_8F830DE7"></a>
## Bayesian VAR

Brief explanation

```matlab
s = BEARsettings("BVAR", data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_79E2BAEE"></a>
## PANEL VAR

Brief explanation

```matlab
s = BEARsettings("PANEL", data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_0C663C91"></a>
## Stochastic Volatility

Brief explanation

```matlab
s = BEARsettings("SV", data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_F7A1563A"></a>
## Time Varying Panel

Brief explanation

```matlab
s = BEARsettings("TVP", data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_413C373A"></a>
## Mixed Frequency

Brief explanation

```matlab
s = BEARsettings("MFVAR", data = "default_bear_data.xlsx")
BEARmain(s)
```
<a name="H_3B88EB60"></a>
# Applications

This is where the applications tab is explained

<a name="H_231A6857"></a>
## Impulse Response Functions

Basic description and quick example

```matlab
s = BEARsettings('BVAR', IRF = 1, IRFt = 'Cholesky', IRFperiods = 20)
BEARmain(s)
```

[More here](./IRF.mlx)

<a name="H_8DFCADBE"></a>
## Unconditional Forecasts
<a name="H_811CB45A"></a>
## Forecast Error Variance

Basic description and quick example

```matlab
s = BEARsettings('BVAR', F = 1, Fstartdate = '2014q1', Fenddate = '2016q4', Fendsmpl = true)
BEARmain(s)
```

[More here](./Forecasts.mlx)

<a name="H_4C47CFC6"></a>
## Historical Decompositions
<a name="H_EE37E1B9"></a>
## Conditional Forecasts
<a name="H_B3AD755D"></a>
# Replications
2 changes: 2 additions & 0 deletions resources/project/Root.type.Files/doc.type.File.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info/>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design" />
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design" />
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="artifact"/>
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="test"/>
</Category>
</Info>
8 changes: 7 additions & 1 deletion tbx.prj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<param.summary>The Bayesian Estimation, Analysis and Regression toolbox (BEAR)</param.summary>
<param.description>The Bayesian Estimation, Analysis and Regression toolbox (BEAR) is a comprehensive (Bayesian Panel) VAR toolbox for forecasting and policy analysis. Use of BEAR implies acceptance of the End User Licence Agreement (EULA) for the Use of the Software “the Bayesian Estimation, Analysis and Regression (BEAR) toolbox”.</param.description>
<param.screenshot>${PROJECT_ROOT}\tbx\bear\BEAR.PNG</param.screenshot>
<param.version>5.1.5</param.version>
<param.version>5.2.0</param.version>
<param.output>${PROJECT_ROOT}\BEAR toolbox.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -97,6 +97,7 @@
<toolboxes>
<toolbox name="matlabcoder" />
<toolbox name="embeddedcoder" />
<toolbox name="neuralnetwork" />
</toolboxes>
<toolbox>
<matlabcoder>
Expand All @@ -108,6 +109,11 @@
<enabled>true</enabled>
</embeddedcoder>
</toolbox>
<toolbox>
<neuralnetwork>
<enabled>true</enabled>
</neuralnetwork>
</toolbox>
</matlab>
<platform>
<unix>false</unix>
Expand Down
2 changes: 1 addition & 1 deletion tbx/app/+bear/+app/optionsProxyForApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

warning off
for p = baseProps
if ~ismember(p, {'VARtype','FEVDinternal','HDinternal'})
if ~ismember(p, {'VARtype','Exporter', 'DAL', 'FEVDinternal','HDinternal'})
obj.setCommonProp(p{1}, value.(p{1}));
end
end
Expand Down
Binary file modified tbx/app/BEARapp22a.mlapp
Binary file not shown.
Loading
Loading