Am 11.03.2024 um 11:52 schrieb Dionysio Lalounta:
Hi all,
I have a few questions about BVAR package .
At first how can I save the forecasted values of the depedent variables , in order to  calculate RMSE etc?

This should probably be mentioned or explained in the manual, admittedly. Right now the idea is that you use the built-in plotting functions.

Anyway, please grab the result bundle from BVAR_posterior (in your example below, "res1"), and then check out the sub-bundle "fcast". In there you find a matrix for each endogenous variable. The column labels should hopefully be self-explanatory. Please bear in mind that the Bayesian approach produces densities, it's not clear a priori what _the_ (point or path) forecast is.

The second question is about the inclusion of exogenous vars in the model .

I wrote the following script 

 clear --dataset
# read data available up to 2023:4
open dbnomics
data Eurostat/namq_10_gdp/Q.CLV05_MEUR.SCA.B1GQ.EA --name="YER" 
data Eurostat/namq_10_gdp/Q.PD05_EUR.SCA.B1GQ.EA --name="YED" 
data ECB/FM/Q.U2.EUR.RT.MM.EURIBOR1MD_.HSTA --name="STN" 
data ECB/FM/Q.U2.EUR.4F.CY.OILBRNI.HSTA --name="POILU" 
# BVAR with exogenous vars
list POILU1 =POILU # create a list for the exogenous variable
series yer=100*ldiff(YER)
series yed =100*ldiff(YED)
list dep = yer yed STN         # create list for endogenous vars
lag =4
type ="fixed"          # minnesota
exog =  POILU1
bundle mod1 = BVAR_setup(dep, lag, type,_(exog=POILU1)) #  bundle with exogenous variable
matrix m= zeros(1,4)
m={80,85,80,86} #future values for exogenous var 
smpl 2000:1 2022:4
bundle res1 = BVAR_posterior(mod1,"all",_(iter = 10000, fcast_h = 4,fcast_exog=m)) # with exogenous var

When run the above script I get the following error
#ERROR MESSAGE
#error! Provide fcast_h obs of exog (as matrix, rows) for fcast!

It looks as if your m matrix is a row vector, but you need a column vector as suggested in the error message (obs in rows).

thanks for using and testing the BVAR package

Sven