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

esg var model #11

Open
msz13 opened this issue Dec 13, 2023 · 39 comments
Open

esg var model #11

msz13 opened this issue Dec 13, 2023 · 39 comments

Comments

@msz13
Copy link
Owner

msz13 commented Dec 13, 2023

var model:

factors:

usa:

  • real gdp - (GDP/CPI)
  • inflation ln(CPI)
  • exchange rate - ln(esch )
  • short rate ln(1+R/100)
  • long rate ln(1+R/100)
  • stock rate (Index/CPI)?
  • money suplly ??
  • consumtion??
  • investments??
  • credit spread??
  • government borrowing (deficyt/dług?)

euro area

  • real gdp - (GDP/CPI)
  • inflation ln(CPI)
  • exchange rate - ln(esch )
  • short rate ln(1+R/100)
  • long rate ln(1+R/100)
  • stock rate (Index/CPI)?
  • money suplly ??
  • consumtion??
  • investments??
  • credit spread??
  • government borrowing (deficyt/dług?)

pln

  • real gdp - (GDP/CPI)
  • inflation ln(CPI)
  • exchange rate - ln(esch )
  • short rate ln(1+R/100)
  • long rate ln(1+R/100)
  • stock rate (Index/CPI)?
  • money suplly ??
  • unemployment
  • consumtion??
  • investments??
  • credit spread
  • credit spread??
  • government borrowing (deficyt/dług?)

Assets

  • usa equity - price,dividend
  • europe equity - price,dividend
  • rest development equity - price,dividend
  • emerging markets - price, dividend
  • pl equity
  • usa bond index (duration 1-30)
  • ue bond index (duration -30)
  • usa corporate bond
  • ue corporate bond
@msz13
Copy link
Owner Author

msz13 commented Dec 15, 2023

model var.docx

@msz13
Copy link
Owner Author

msz13 commented Feb 15, 2024

ezegonous variables

  • usd, eu
    endegonous variables:
  • pln

usd i eu są modelowane odzielnie
ale wtedy za duzo zmiennych dla okresu 2003 -2023

@msz13
Copy link
Owner Author

msz13 commented Feb 18, 2024

General VAR

bayesian var
https://sciencespo.hal.science/hal-03458277/file/wp2018-18-bayesian-autoregressions-smiranda.pdf
https://www.sciencedirect.com/science/article/pii/S0169207022000024#b39

Missing Disinflation and Missing Inflation: A VAR Perspective
https://www.ijcb.org/journal/ijcb19q1a5.htm

forecasting with bvar karlson
https://www.oru.se/globalassets/oru-sv/institutioner/hh/workingpapers/workingpapers2012/wp-12-2012.pdf

Regime Switching Bayesian Vector Autoagression
http://www.actuaries.org/AFIR/colloquia/Cairns/Harris.pdf

PRIORS FOR THE LONG RUN
https://faculty.wcas.northwestern.edu/gep575/plr5-1.pdf

Conditional Forecasts in Large Bayesian VARs with Multiple Equality and Inequality Constraints
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4358152

Advanced Time Series
https://github.com/Stellenbosch-Econometrics/AdvancedTimeSeries-872?tab=readme-ov-file

A New Identification Strategy for U.S. Monetary Policy Shocks: Estimates Since 1914 (Davis)
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4769252

Megatrends and the U.S. economy, 1890-2040 (Davis)
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4702028

A BAYESIAN APPROACH TO VECTOR AUTOREGRESSIVE MODEL ESTIMATION AND FORECASTING WITH UNBALANCED DATA SETS
https://beri.iliauni.edu.ge/wp-content/uploads/2021/10/A-Bayesian-Approach-to-Vector-Autoregressive-Model-Estimation-and-Forecasting-with-Unbalanced-Data-Sets.pdf

Scenario Generation for IFRS9 Purposes using a Bayesian MS-VAR Model
https://www.econstor.eu/bitstream/10419/247377/1/wp2021-10.pdf

ESTIMATING MULTI-COUNTRY VAR MODELS
https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp603.pdf

LEARNING ABOUT THE LONG RUN
https://www.nber.org/system/files/working_papers/w29495/w29495.pdf

Bayesian workflow
https://arxiv.org/pdf/2011.01808

Time Varying Structural Vector Autoregressions and Monetary Policy
https://faculty.wcas.northwestern.edu/gep575/tvsvar_final_july_04.pdf

Macroeconomic Forecasting in a Multi-country Context
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4025488

Conditional Forecasts in Large Bayesian VARs with Multiple Equality and Inequality Constraints *
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4358152

Large Time-Varying Parameter VARs
https://www.gla.ac.uk/media/Media_224576_smxx.pdf

Steady-State Priors and Bayesian Variable Selection in VAR Forecasting
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4185571

STEADY STATE PRIORS FOR VECTOR AUTOREGRESSIONS
https://villani.wordpress.com/wp-content/uploads/2009/08/steadystatepriorvarfinaljae.pdf

Large Vector Autoregressions with Stochastic Volatility and Flexible Priors
https://www.clevelandfed.org/publications/working-paper/2016/wp-1617-large-vector-autoregressions-with-stochastic-volatility-and-flexible-priors

Macroeconomic Forecasting and Structural Changes in Steady States
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4185941

Steady-state priors and Bayesian variable selection in VAR forecasting
https://www.degruyter.com/document/doi/10.1515/snde-2015-0048/html

Real-Time Density Forecasts from VARs with Stochastic Volatility
https://www.kansascityfed.org/documents/5319/pdf-rwp09-08.pdf

A Flexible Mixed-Frequency Vector Autoregression with a Steady-State Prior (stochastic volality + steady state prior)
https://arxiv.org/pdf/1911.09151

Panel Vector autoregressive models
https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp1507.pdf

Responses to monetary Policy Shocks in the eastern and the Western of Europe
https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp970.pdf

The Use of BVARs in the Analysis of Emerging Economies
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3617544

The Role of Domestic and External Shocks in Poland: Results from an Agnostic Estimation Procedure
https://www.imf.org/en/Publications/WP/Issues/2016/12/31/The-Role-of-Domestic-and-External-Shocks-in-Poland-Results-from-an-Agnostic-Estimation-41018

Steady-state modeling and macroeconomic forecasting quality
https://onlinelibrary.wiley.com/doi/10.1002/jae.2657

ESTIMATING MULTI-COUNTRY VAR MODELS
https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp603.pdf

Forecasting Economic and Financial Variables with Global VARs
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1089456

How to estimate a VAR after March 2020
https://www.ecb.europa.eu/pub/pdf/scpwps/ecb.wp2461~fe732949ee.en.pdf

Should I stay or should I go? A latent threshold approach to large-scale mixture innovation models
https://arxiv.org/abs/1607.04532

What Drives Long-Term Interest Rates? Evidence from the Entire Swiss Franc History 1852-2020
https://www.researchgate.net/publication/359843140_What_Drives_Long-Term_Interest_Rates_Evidence_from_the_Entire_Swiss_Franc_History_1852-2020

Introducing shrinkage in heavy-tailed state space models to predict equity excess returns
https://www.researchgate.net/publication/371135726_Introducing_shrinkage_in_heavy-tailed_state_space_models_to_predict_equity_excess_returns

Efficient Bayesian Inference for Multiple Change-Point and Mixture Innovation Models
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=738894

FORECASTING AND POLICY ANALYSIS WITH TREND-CYCLE BAYESIAN VARS
https://michalandrle.weebly.com/uploads/1/3/9/2/13921270/tc_vars.pdf

Assets returns

An Econometric Model of Nonlinear Dynamics in the Joint Distribution of Stock and Bond Returns
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=582581

Can VAR Models Capture Regime Shifts in Asset Returns? A Long-Horizon Strategic Asset Allocation Perspective
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1533525

A multivariate model of strategic asset allocation - cambel i veira
https://scholar.harvard.edu/files/lviceira/files/a_multivariate_model_of_strategic_asset_allocation.pdf

Moments, shocks and spillovers in Markov-switching VAR models - (sotcks, bonds, tbills, dividend yeld)
https://www.sciencedirect.com/science/article/pii/S0304407623001902

Strategic Asset Allocation for Long-Term Investors: Parameter Uncertainty and Prior Information
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=905003

1/N and Long Run Optimal Portfolios: Results for Mixed Asset Menus
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1533537

Are Stocks Really Less Volatile in the Long Run?
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1136847

Prediction and Allocation of Stocks, Bonds, and REITs in the US Market
https://link.springer.com/article/10.1007/s10614-024-10589-2

Return Predictability and the Implied Intertemporal Hedging Demands for Stocks and Bonds: International Evidence
https://www.researchgate.net/publication/24128666_Return_Predictability_and_the_Implied_Intertemporal_Hedging_Demands_for_Stocks_and_Bonds_International_Evidence

Long-Term Investing Under Uncertain Parameter Instability
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4557798

Investing for the Long Run When Returns are Predictable
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=185376

Long-Term Strategic Asset Allocation: An Out-of-Sample Evaluation
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107840

On the Long Run Volatility of Stocks
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2808191

Model uncertainty for long-term investors
http://efa2011.efa-meetings.org/fisher.osu.edu/blogs/efa2011/files/MET_2_3.pdf

Forecasting Stock Returns
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4403635

Bond Return Predictability: Economic Value and Links to the
Macroeconomy
https://rady.ucsd.edu/_files/faculty-research/timmermann/bond_return_predictability_april_2017_final.pdf

Optimal asset allocation with multivariate Bayesian dynamic linear models
https://projecteuclid.org/journals/annals-of-applied-statistics/volume-14/issue-1/Optimal-asset-allocation-with-multivariate-Bayesian-dynamic-linear-models/10.1214/19-AOAS1303.full

The Impact of Model Instability on Long-Term Investors
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2480046

Forecasting Stock Market Returns by Summing the Frequency-Decomposed Parts
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2878752

Economic Scenarios for an Asset and Liability Management Study of a Pension Fund
https://www.netspar.nl//assets/uploads/038_MA_Cornelis_Slagmolen_2010.pdf

Return predictability and intertemporal asset allocation: Evidence from a bias-adjusted VAR model
https://colab.ws/articles/10.1016%2Fj.jempfin.2012.01.003

Predictability in International Asset Returns: A Reexamination,
https://research.stlouisfed.org/wp/more/1997-010

Real Asset Returns and Components of Inflation: A Structural VAR Analysis
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=614763

An intertemporal CAPM with stochastic volatility
https://www.sciencedirect.com/science/article/abs/pii/S0304405X18300503#preview-section-cited-by

dummy variable models
https://www.egyankosh.ac.in/bitstream/123456789/23446/1/Unit-10.pdf

Predicting international equity returns: Evidence from time-varying parameter vector
autoregressive models
https://repository.up.ac.za/bitstream/handle/2263/73898/Gupta_Predicting_2020.pdf?sequence=1

Tools

https://github.com/justinjjlee/bayesianvar

@msz13
Copy link
Owner Author

msz13 commented May 24, 2024

Internationl bvar model

  • inflation pln

  • inflation usd

  • inflation eur

  • real short rate pln

  • real short rate usd

  • real short rate eu

  • real long rate pln

  • real long rate usd

  • real long rate pln

  • us pln stocks price returns – pln short rate

  • us usd stocks price returns – us short rate

  • us stocks dividend yeld

  • acwi ex-us pln stocks price returns – pln short rate

  • WIG pln stocks price returns – pln short rate

  • wig stocks dividend yeld

  • stocks

  • bond index excess returns

@msz13
Copy link
Owner Author

msz13 commented Jun 20, 2024

Single country var:

  • macro variables + stock index + bonds kalkulowane na podstawie interest rate
  • assets risk premium (real short rate, equity excess return, bonds eqcess return) with eqzegonous variables (nominal short rate, log dividend yeld, term spread)
  • macro variables + shiller, stocks na podstawie shiller,div i growth, bonds na podstawie stóp

Multicountry

  • bvar bex macro factors
  • single countries + residuals correlation
  • multi country large bvar
  • developed multicountry + poland single country z developed macrovator jako egsegonous variable

@msz13
Copy link
Owner Author

msz13 commented Jun 20, 2024

Inny framework

Oszacuj required rate of return na podstawie irr
Okresl optimal portfolio na krótki okres, np. 2 lata

POwtartzaj w okresie rebalancingu

Zrob symulacje

  • testowamnie - error, confidance bands, czy wpisauja sie procesy, model accuracy
  • testowanie – scenario lattice based on models

@msz13
Copy link
Owner Author

msz13 commented Jul 1, 2024

Out of sample

  • 10-5 year forecast - od 2006 (est od 1998 dla pln, albo 2001)
<style> </style>
est start start end est lenght forecast lenght
1998 2006 2023 8 17
1998 2008 2023 10 15
1998 2010 2023 12 13
1998 2012 2023 14 11
1998 2014 2023 16 9
1998 2016 2023 18 7
1998 2018 2023 20 5

wyniki
foreacst erro
| rok est | 1 rok forecast | 2 forecast | ... |
|2006 | ..

lower bound
| rok est | 1 rok forecast | 2 forecast | ... |
|2006 | ..

<style> </style>
est start est end forecast end out of sample length
2001 2014 2023 9
2001 2018 2023 5
2007 2020 2023 3
1976 1993 2023 30
1976 2006 2023 17

@msz13
Copy link
Owner Author

msz13 commented Jul 8, 2024

Macro TODO EDA:

  • Data:

  • real gdp

  • cpi

  • long term yeld

  • short term yeld

  • stocks

  • pln

  • us

  • euro

country gdp cpi lr sr stocks
pln NGDPRSAXDCPLQ POLCPIALLQINMEI IRLTLT01PLM156N IR3TIB01PLQ156N
us NGDPRSAXDCUSQ USACPIALLMINMEI IRLTLT01USQ156N IR3TIB01USQ156N
euro CLVMEURSCAB1GQEA19 EA19CPALTT01IXOBQ IRLTLT01EZM156N IR3TIB01EZQ156N

NGDPRSAXDCPLQ

  • summary stats
  • plots
  • corelations między krajami

okresy:

  • 1972 -2024 Q1
  • 1972 - 2019
  • 1998 - 2024
  • 1983 - 2024
  • 2000 - 2024

Wskaźniki:

  • real short rate
  • term yeld
  • short pln - short us
  • short pln - short eur
  • real short pln - real short us

@msz13
Copy link
Owner Author

msz13 commented Jul 15, 2024

@msz13
Copy link
Owner Author

msz13 commented Jul 15, 2024

sposoby bonds returns:

  • bond index etf
  • na podstawie cashflow wyliczanie ceny i zmian ceny
  • na podstawie duration i ytm
  • wzór z dempster

@msz13
Copy link
Owner Author

msz13 commented Jul 19, 2024

Cel:

  • return predictibility w krótkim i średnim okresie - 1-10 lat
  • konserwatywne percentyle skrajne - wyższe niż są obecnie
  • uwzględnienie extreme events, np. post covid inflation i defrlation w 90% confidenve interval
  • realna współzależność między factorami

@msz13
Copy link
Owner Author

msz13 commented Jul 24, 2024

  • które zmienne wybrać
    • usa - stock, real short, term, opcjonalnie div yeld, gold in usd - od 1976
    • pl - inflation, real short, term, stocks, opcjonalnie div, eur - real short, term, stocks, eurpln, usdpln - od 2001
  • częstotliwość - kwartalna
  • okres estymacji - od 1976 i 2001

@msz13
Copy link
Owner Author

msz13 commented Jul 24, 2024

excess usa short rate acwi, acwi based on sr

pl short rate - based on regression on us rate
a co z inflacja?

@msz13
Copy link
Owner Author

msz13 commented Jul 31, 2024

Porównać quaniles i moments - zwykle gb i gibs

  • funckja percentiles w latach i moments w latach

Summary posterior:

  • tabela describe każdy z parametrów, albo użyć chains

Zrobić var simulate

refactor gibs

zdecydowac, czy robic tvp-var, ms-bvar, czy model z structural changes

@msz13
Copy link
Owner Author

msz13 commented Aug 5, 2024


names = ["cpi","short_us","term"]

[names[j] * "_" * names[i] for j in 1:3 for i in 1:3]

names = ["cpi","short_us","term"]

collect(skipmissing([ i > j ? names[j] * "_" * names[i] : missing for j in 1:3 for i in 1:3]))

@msz13
Copy link
Owner Author

msz13 commented Aug 7, 2024

Do czytania:

  • wstęp alm and strategic asset
  • large bvars
  • multi cauntry vars
  • tvp large bvars
  • ten od alm - inne prior niż uninformative
  • ksiaza amid low
  • dempster

@msz13
Copy link
Owner Author

msz13 commented Aug 12, 2024

Modele:

Hoevenaars

  • USA, Tbill, 10y Tbonds, stocks, nominal t-bill, dividend yeld, term spread,
  • modedel: normal wishart with unconditional mean, prior means as mean of economic esxpansion and contradiction(crisis)
  • data: freq - quarterly, est: 1952I:2008IV
  • forecast horison - od 1 -15 yers

1/N and Long Run Optimal Portfolios: Results for Mixed Asset Menus

  • USA, Tbill, 10y Tbonds, stocks, reits, nominal t-bill, dividend yeld, term spread, defoult spread, inflation
  • normal wishart uninformative prior
  • data: freg monthly,, 1972:01 – 2007:12
  • forecasty horison: 1-60 months, 1994:2007

@msz13
Copy link
Owner Author

msz13 commented Aug 12, 2024

TODO - usa bvar

stocks, bonds, short rate, state variables: dividend yeld, term spread, nominal rate

  1. Estimate ols params
  2. Simulate
  • Evaluate forecat error
  • percentiles
  • plots
  1. Estimate normal wishart bvar params
  2. Simulate
    • Evaluate forecat error
    • percentiles
    • plots
  3. Generate k-means scenario lattice on ols var
  4. Generate kmeans with moments lattice on ols var
  5. Generate kmeans with moments lattice on ols var different est. period
  6. Optimise goal based model
  7. Estimate ols params with inflation
  8. Generate scenarios with inflation
  9. Optimiase goal based model with inflation
  10. Generate k-means scenario lattice on bvar
  11. Generate kmeans with moments lattice on bvar

@msz13
Copy link
Owner Author

msz13 commented Aug 12, 2024

Treasury Bond Return Data Starting in 1962
https://www.mdpi.com/2306-5729/4/3/91#

@msz13
Copy link
Owner Author

msz13 commented Aug 14, 2024

Następny model:

  • bvar with stedy state prior and stochastic volallity

@msz13
Copy link
Owner Author

msz13 commented Sep 11, 2024

International

  • pl sr, term, wig, cpi, dy?, albo cape
  • us sr, term, sp500, dy?
  • word ex usa, em

  • jeden var w pln od 2005 do 2020

  • usa i pl osobno, synchronizacja przez korelację residuals, model waluty(np. irp)

  • usa osobno i regresja pl na dane usa

  • mwig - regresja dla predictors vs var process

  • regresja z usa z tego samego okresu jest wyzsza, niz lagged data

@msz13
Copy link
Owner Author

msz13 commented Sep 11, 2024

Forecasting Stock Returns
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4403635

Predictability in International Asset Returns: A Reexamination - short sample
https://research.stlouisfed.org/wp/more/1997-010

Predictive Regressions (Stamboug, short sample bias)
https://www.nber.org/system/files/working_papers/t0240/t0240.pdf

Return predictability and intertemporal asset allocation: Evidence from a bias-adjusted VAR model
https://colab.ws/articles/10.1016%2Fj.jempfin.2012.01.003

@msz13
Copy link
Owner Author

msz13 commented Sep 20, 2024

Polska

  • Wspolny var od 2004, z restricted coefficient
  • Wspólny Var od 1999 z structural breaks, albo inflation target
  • Usa as external variable, ale nie wiadomo co kolrealcjami
  • pl z restricted var, ale tylko frequency estimation
  • krótkszy wspólny model, ale trzeba dodać informacje z dłuższej historii emerging markets

@msz13
Copy link
Owner Author

msz13 commented Sep 22, 2024

trend cycle bvar

  • możliwość dodania cpi target i innych trendów

  • stochastic volality z hig frequency decomposition - do sprawdzenia

  • aby się nauczyć trzeba:

  • kalman filter

  • svar

  • state space models

  • trend cycle decomposion with kalman filter

@msz13
Copy link
Owner Author

msz13 commented Sep 24, 2024

@msz13
Copy link
Owner Author

msz13 commented Sep 24, 2024

Trend cyckle decomposiotion models

  • villani steady state, ewentualnie z stochastic volatility, steady state i tak trzeba obliczyc,, nie do końca zrozumiały steady state
  • trend cycle decomposition var – prosty – inflation target, I jakiś filtr, jeden kraj ew. em
  • trend cycle decomposition var – bvar – inflation target, I jakiś filtr, jeden kraj ew. em
  • ortec model – tc decomposiotion, dynamic factor model – minusem jest brak możliwości inflation target dla inflacji i tylko short views
  • vanguard long term forecast – tylko jeden kraj, trendy w inflation I dgp sa ujęte jako jedne ze zmiennych modelu var, czyli inflacja i gdp sa rozbite na trend i gap, trend cycle decomposition jest realizowany według osobnego modelu, używa large tvp-var (chan)

Jaki steady state

  • inflacja: inflation target
  • stock returns usa – earnings growth
  • em i polska -?
  • interesert rate – trend from data

Todo trend cycle decomposition python

  • Inflation stocks
  • stock

@msz13
Copy link
Owner Author

msz13 commented Sep 24, 2024

equties, reprezentacja:

  • excess returns
  • real returns
  • index log level
  • decomposition eqrnings growth, yeld, p/e lub cape
  • index - trend, cycle, high frequency decomposition

@msz13
Copy link
Owner Author

msz13 commented Sep 24, 2024

High-Dimensional Conditionally Gaussian State Space Models with Missing Data
https://www.researchgate.net/publication/368333646_High-Dimensional_Conditionally_Gaussian_State_Space_Models_with_Missing_Data

@msz13
Copy link
Owner Author

msz13 commented Sep 30, 2024

czytanie

  • use to emerging
  • multi country
  • short sample return
  • long term prior
  • primacerii

@msz13
Copy link
Owner Author

msz13 commented Oct 7, 2024

GVAR

Constructing Multi-country Rational Expectations Models
https://www.ecb.europa.eu/events/pdf/conferences/multi_country_modelling/20130607_Constructing_Multi_country_Rational_Expectations_Models.pdf?76fe9ecb312d6df2ff096191a93b7f09

LONG RUN MACROECONOMIC RELATIONS IN THE GLOBAL ECONOMY
https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp750.pdf

BGVAR: Bayesian Global Vector Autoregression
https://cran.r-project.org/web/packages/BGVAR/vignettes/examples.html

A Global Vector Autoregressive Model for Banking Stress Testing
https://www.researchgate.net/publication/353347535_A_Global_Vector_Autoregressive_Model_for_Banking_Stress_Testing

Density Forecasting using Bayesian Global Vector Autoregressions with Common Stochastic Volatility
https://research.wu.ac.at/ws/portalfiles/portal/18978393/wp179.pdf

A Global Macro Model for Emerging Europe
https://www.econstor.eu/bitstream/10419/264777/1/oenb-wp-185.pdf

Spillovers from US monetary policy: Evidence from a time-varying parameter GVAR model
https://www.econstor.eu/bitstream/10419/201674/1/WP_18_06.pdf

International effects of a compression of euro area yield curves
https://www.econstor.eu/bitstream/10419/201678/1/WP_19_01.pdf

THEORY AND PRACTICE OF GVAR MODELLING
https://www.dallasfed.org/research/international/-/media/documents/research/international/wpapers/2014/0180.pdf

GVAR ToolBox
https://sites.google.com/site/gvarmodelling/home

Small open economies and external shocks: an application of Bayesian global vector autoregression model
https://link.springer.com/article/10.1007/s11135-022-01423-8

baza z inwestycjami kapitałowymi zagranicznymi
https://data.imf.org/regular.aspx?key=60587804

baza trade
https://wits.worldbank.org/CountryProfile/en/Country/USA/Year/2022/TradeFlow/EXPIMP/Partner/all/Product/Total#

Using Global VAR Models for Scenario-Based Forecasting and Policy Analysis
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2026984

trade data
https://datacatalog.worldbank.org/search/dataset/0064715/Trade-Intensity-Index-Export

IMF Data
https://github.com/stephenbnicar/IMFData.jl

@msz13
Copy link
Owner Author

msz13 commented Oct 16, 2024

filter(row -> row.c in short, df)

@msz13
Copy link
Owner Author

msz13 commented Oct 22, 2024

"""
μ: mean of Volatility
ρ: autoregresive coeff of volatility
"""
function drawStochVolatility(h0, μ, ρ, h)
    i = length(μ)
    result = zeros(i, h+1)
    result[:,1] = h0
    result[:2] = μ + ρ*(result - μ)
    return result
end

drawStochVolatility([0.03, 0.05], [0.01, 0.02], [0.6, 0.3], 8)

@msz13
Copy link
Owner Author

msz13 commented Oct 22, 2024

gvar algo:

  • transform data
    • calculate weaky exegonous variables
  • transform to global model
  • visualise estimated data
  • forecast
  • estimate singel country models

@msz13
Copy link
Owner Author

msz13 commented Oct 23, 2024

forecast:

  1. draw coefficent vector
    a. draw s - state is coefficient time varing, for all t+h
    b. drwa beta - coefficent based on s, for all t+h
  2. draw covmatrix
    a. drwa correlation, for all t+h
    b. draw volatilies, for all t+h
  3. draw forecast from var

posterior:
for ieach draw

  • kalman filter coefficient, based on data and another params from previous sampler

@msz13
Copy link
Owner Author

msz13 commented Oct 26, 2024

posterior:
for ieach draw

  • draw beta zero
  • kalman filter coefficient, based on data and another params from previous sampler

@msz13
Copy link
Owner Author

msz13 commented Oct 29, 2024

kalman inputs

X:: row Vector
B:: Column vector vector
Yt - column vector

X = [1., 2.]'
Y = [10]
B = [2., 3.]
P = diagm([.5, .6])

res = Y .- X * B

S = X * P * X'
K = P * X' * inv(S)

@msz13
Copy link
Owner Author

msz13 commented Nov 7, 2024

threshold posterior

  1. Generate grid, based on prior_threshold and coefficient volatilit
  2. Get grid points probabilities - prob of each grid point is, prob of delta coeficient based od normal dist, given delta coeff as x, and coeff volatility THETA = dv1 + (1-d)v0 ..
  3. Sample from grid with probs, to daje d, zmienc beta jesli change od d jest większe niż d

https://github.com/gregorkastner/threshtvp/tree/master

7.2 The griddy Gibbs sampler
This procedure was described in Ritter and Tanner (1992). Consider a m-dimensional posterior density p(θ1, · · · θm) that is estimated via MCMC and where the conditional distribution p(θi | θj , j 6 = i) is untractable but univari-
ate. If it is difficult to directly sample from p(θi | θj , j 6 = i), the idea is to form a simple approximation to the inverse cdf based on the evaluation of p(θi | θj , j 6 = i) on a grid of points. This leads to the following 3 steps:
Step 1. Evaluate p(θi | θj , j 6 = i) at θi = x1, x2, . . . to obtain w1, w2, ..., wn.
Step 2. Use w1, w2, ..., wn to obtain an approximation to the inverse cdf of p(θi | θj , j 6 = i).
Step 3. Sample a uniform U (0, 1) deviate and transform the observation via the approximate inverse cdf.
Remark 1: The function p(θi | θj , j 6 = i) need be known only up to a proportionality constant, because the normalization can be obtained directly from the w1, w2, ..., wn.
Remark 2: The grid x1, x2, ..., xn need not be uniformly spaced. In fact, good grids put more points in neighborhoods of high mass and fewer points in neighborhoods of low mass. One approach to address this goal is to construct
the grid so that the mass under the current approximation to the conditional distribution between successive grid points is approximately constant.

Model with constant volatility
https://www.arxiv.org/pdf/1607.04532v1

@msz13
Copy link
Owner Author

msz13 commented Nov 14, 2024

ttvp global var
uzycie bibliotek z r

  • napisanie wszystkiego od nowa
  • wykorzystanie bibliotek napisanych w c, do kodu w juli, np., svolatility
  • uzycie biblioteki r call
  • zainstalowanie r i uzycie r

co jest celem"

  • przygotowanie własnych narzedzi w julia
  • pocwiczenie pisania gibs sampleru
  • przygotowanie kompletnego generatora scenariuszy
  • zrobienia proof of concept, czy ten generator dziala
  • przygotowanie jednego modelu do testowania różnych parametrów

@msz13
Copy link
Owner Author

msz13 commented Nov 21, 2024

Short model list

  1. excess WIG in PLN
  2. excess WORLD in PLN
  3. excess EM in PLN
  4. CPI PLN
  5. Short PLN
  6. Long PLN
  7. Gold

Short with usd exchange

  1. WIG
  2. US equties
  3. WORLD in USD
  4. EM in USD
  5. CPI PLN
  6. Short PLN
  7. Long PLN
  8. US CPI
  9. US short
  10. Real Exchange
  11. Gold

Large model list

  1. Eq USA
  2. Eq EZ (Eurozone)
  3. Pacyfic + Japan
  4. Emerging Markets
  5. mWig40
  6. PL short
  7. Pl inflation
  8. Pl long
  9. Pl GDP
  10. Pl DY
  11. US short
  12. US inflation
  13. US long
  14. US GDP
  15. US DY
  16. EU short
  17. EU inflation
  18. EU long
  19. EU GDP
  20. EU DY
  21. USDPLN
  22. EURPLN
  23. GOLD
  24. OIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant