msz13 / Goal-Based-Investing

1 stars 0 forks source link

esg var model #11

Open msz13 opened 11 months ago

msz13 commented 11 months ago

var model:

factors:

usa:

euro area

pln

Assets

msz13 commented 11 months ago

model var.docx

msz13 commented 9 months ago

ezegonous variables

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

msz13 commented 9 months ago

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

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 commented 6 months ago

Internationl bvar model

msz13 commented 5 months ago

Single country var:

Multicountry

msz13 commented 5 months ago

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

msz13 commented 4 months ago

Out of sample

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

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 | ..

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

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 commented 4 months ago

Macro TODO EDA:

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

NGDPRSAXDCPLQ

okresy:

Wskaźniki:

msz13 commented 4 months ago

bond data: https://datarepository.eur.nl/articles/dataset/Data_Treasury_Bond_Return_Data_Starting_in_1962/8152748

msz13 commented 4 months ago

sposoby bonds returns:

msz13 commented 4 months ago

Cel:

msz13 commented 4 months ago
msz13 commented 4 months ago

excess usa short rate acwi, acwi based on sr

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

msz13 commented 3 months ago

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

Summary posterior:

Zrobić var simulate

refactor gibs

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

msz13 commented 3 months ago

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 commented 3 months ago

Do czytania:

msz13 commented 3 months ago

Modele:

Hoevenaars

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

msz13 commented 3 months ago

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
  3. Estimate normal wishart bvar params
  4. Simulate
    • Evaluate forecat error
    • percentiles
    • plots
      1. Generate k-means scenario lattice on ols var
      2. Generate kmeans with moments lattice on ols var
      3. Generate kmeans with moments lattice on ols var different est. period
      4. Optimise goal based model
      5. Estimate ols params with inflation
      6. Generate scenarios with inflation
      7. Optimiase goal based model with inflation
      8. Generate k-means scenario lattice on bvar
      9. Generate kmeans with moments lattice on bvar
msz13 commented 3 months ago

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

msz13 commented 3 months ago

Następny model:

msz13 commented 2 months ago

International


msz13 commented 2 months ago

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 commented 2 months ago

Polska

msz13 commented 2 months ago

trend cycle bvar

msz13 commented 2 months ago

https://arxiv.org/abs/2302.03172

msz13 commented 2 months ago

Trend cyckle decomposiotion models

Jaki steady state

Todo trend cycle decomposition python

msz13 commented 2 months ago

equties, reprezentacja:

msz13 commented 1 month ago

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 commented 1 month ago

czytanie

msz13 commented 1 month ago

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 commented 1 month ago

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

msz13 commented 1 month ago
"""
μ: 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 commented 1 month ago

gvar algo:

msz13 commented 1 month ago

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

msz13 commented 4 weeks ago

posterior: for ieach draw

msz13 commented 3 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago

ttvp global var uzycie bibliotek z r

co jest celem"

msz13 commented 2 days ago

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