msz13 / Goal-Based-Investing

1 stars 0 forks source link

generowanie scenariuszy #9

Open msz13 opened 8 months ago

msz13 commented 8 months ago

Zakres:

Aktywa i modele I Etap - prosty portfel

msz13 commented 8 months ago
msz13 commented 8 months ago

output

asset1 prices id | rok1 | rok2|

miesięczne, roczne, kwartalne ?

| asset | scenarioid | rok1 | rok2 | | ... | ... | ... | ... |

do symulacji potrzebuje zwrotów

msz13 commented 8 months ago

symulacja

preprocessing

połącz zbiory

format

| scenario_id | date1 | date2 | date3 |

| date | scenario-1 | scenario-2 |

series time scenario_id value
1 1 35

wygenerować zwroty edo

inflacja:

docelowe parametry:

msz13 commented 8 months ago

TODO

msz13 commented 8 months ago

MCMC parameter estimation

najpier dla geometric brownian motion zrozumieć, co to jest:

jak jest probaiblity density function dla GBM

msz13 commented 8 months ago

Gibs sampling Geometric brownian motion u - mean of returns mean ~ N(u, sigma2/T)

msz13 commented 8 months ago

join multiple scenarios matrix into one: np.stack((arr1,arr2),axis=2) shape (T,n_scenarios,number_of_assets)

msz13 commented 7 months ago

var model I

var model II

Asset model based on real

Drugi model dla polski

msz13 commented 7 months ago

problem z GBM

co dalej:

dwa warianty acwi price i dodac dividen acwi price returns i dodac dywidends oparte na regresji osobno zrobic model returns i dywidends

msz13 commented 7 months ago

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

aktywa i |   |   |   |   -- | -- | -- | -- | --   |   |   |   |   wersja | Equity | fixed income | Alternative | currency I |   |   |   |     | pl equity | edo | gold | eurpln   | developmed market equity | tbsp |   | usdpln   | emerging market equity | global aggregate |   |   II |   |   |   |     | Acwi | edo | commodity | jpnpln   | pln equity | tbsp |   | chnpln   |   | usa long term |   | funt pln   |   | germany long term |   |     |   | swiss long term |   |   III |   |   |   |     | pl equity | tbsp |   |     | usa | edo |   |     | europe | euro tresaury |   |     | japan | usa treasury |   |     | pacyfic | global corporate |   |     | emerging market equity | rest development treasury  |   |   III |   |   |   |     | pl equity | edo |  gold | usdpln |     | usa | euro tresaury |   |  eurpln |   | europe | usa treasury |   |     | rest development| |   |     | emerging market equity |   |   |  

msz13 commented 7 months ago

TODO 26.11.23

msz13 commented 7 months ago

TODO 26.11.23

Poprawi do ewaluacji

msz13 commented 7 months ago

TODO

Uporządkować projekt

Scenariusze:

Optymalizacja goal based investing

Efficient frontier

msz13 commented 7 months ago

regime switching model ma rożne parametry w róznych okresach , male roznice w parametrqch powoduje niewielkie roznice w skumulowanych zyskach, natomaist duze duze (jak duze) przyszlosc, niedzwieciedla przeszlosci trzeba dobrac odpoweidnie parametry (moze korekcja danych historycznych, np. odjecie od historycznych stow zwrotów jakies sumy)

jak wygladaja parametry i jaka jest stabilnosc przy mcmc

jaka jest relacja miedzy konserwatywnymi zalozeniami modelu, co sie dzieje gdy przyjme zbyt konserwatynwe zalozenia dla ryzyka i celu

jakie sa moje oczekiwania na 10 i 20 lat

maksymalny horysont to 25 lat, przy dluzszym blad w estymacji parametrow sie kumuluje

co robic kontynuowac z regime switching model, - baye, wybrac dobry okres, wybrac 4 regimy (kryzys, revovery, slow growth, high growth) porzuccic i pobawiac sie z var modelem i pokrewnymi, lub ortec methodology, views, itd poszukac z mean reverting long run

jak sa moje oczekiwania do rozkaldow srednich stop zwrotu (10,25,50) dropd down 50% raz na 50 lat

msz13 commented 7 months ago

Co dalej

Do czytania:

msz13 commented 7 months ago
msz13 commented 7 months ago

conning

us rf => usa -> eafe -> em -> wig us yeld -> us bond index -> int bond index

pln cpi -> edo pln -> tbsp

usdpln heston model (us rf - pln risk free)

korelacja miedzy tbsp a wig korelacja miedzy tbsp a us bond i int bond korelacja edo -> int

przy acwi i edo mozna tak zrobic, bo nie trzeba zakładac korelacji, gdy chcemy polska stope procentowa, to musimy zrobic korelacje miedzy stopami pln i usa, i waluta moze tez byc wig excess return regression on foreign index

lub wersja odwrotna

pln inflation -> stopy -> akcje -> regresja foreign na polskim modelu

msz13 commented 7 months ago

todo

msz13 commented 7 months ago

Cele i kryteria akceptacji:

cechy scenariuszy

  1. Realistyczne percentyle stopy zwrotu po x latach
  2. Realistyczne prawdopodobieństwo drop down - zabezpieczenie przed ryzykiem ostatnich latch
  3. Korelacje między klasami - do oszacowanie efficient frontier
  4. Aktualna sytuacja rynkowa
cecha/cel long term ef glide path
dystrybucja długookresowych wyników
dystrybucja wyników w jednym okresie
przebieg scenariusza
msz13 commented 7 months ago

var model:

zlaeznosci :

msz13 commented 7 months ago

Target setting: It is our belief that certain principles should be adhered to:

  1. The methodology should enable the setting of long-term or steady-state targets of key variables.
  2. The methodology should lead to targets which remain stable through time and do not require regular updating.
  3. The methodology should be consistent across economies and, by extension, be applicable irrespective of geographic, economic, or other differences.
  4. The methodology should not be overly impeded by the lack of availability of data.
  5. The methodology should be justifiable based on the available data and the latest thinking in the academic literature.
  6. The methodology should lead to targets which are appropriate and meet the expectations of the many markets the ESG product serves.
  7. The methodology should be as prescriptive as possible, allowing targets to be set by following a well- defined procedure
msz13 commented 7 months ago

zrobic analize acwi pln dla 03 2000 – 12 2021 – od szczytu do szczytu 09.2002 – 09.2022 09.2002 – 02.2020

msz13 commented 7 months ago

zrobic regresje spp wobec wig i odwrotna

msz13 commented 6 months ago

problem:

jakby sie chcialo wykorzystac model cas, to trzeba zrobic model waluty, a do tego potrzbne sa roznice w stopach procentowych

msz13 commented 6 months ago

Cele i kryteria akceptacji:

  1. Realistyczne percentyle stopy zwrotu po x latach
  2. Realistyczne prawdopodobieństwo drop down - zabezpieczenie przed ryzykiem ostatnich latch
  3. Korelacje między klasami - do oszacowanie efficient frontier
  4. Czy mają uwzględniać obecną sytuację rynkową?

msz13 commented 6 months ago

usd pln

modele do rozwazenia

msz13 commented 6 months ago

rozszerzenie prostego modelu

msz13 commented 6 months ago

model single variable.docx

msz13 commented 6 months ago

Aktualny stan:

msz13 commented 6 months ago

bootstrap vs overlapping im mniejszy okres w gropu bootrap, tym niejsze 25 percentyl, im wiekszy tym wkeszy 25% percentyl

msz13 commented 6 months ago

''' data = np.arange(1,48, dtype=int)

bootstrap

def block_bootstrap(data, block_length, num_blocks, n_samples):

index_range = np.arange(len(data)-block_length)

resampled = np.zeros((n_samples,block_length*num_blocks))

for s in range(n_samples):
    for block in range(num_blocks):    
        index = np.random.choice(index_range)
        sample = data[index:index+block_length]
        resampled[s,block*block_length:(block+1)*block_length] = sample

return resampled

block_bootstrap(data,6,2,2) '''

msz13 commented 6 months ago

porownanie modeli dlasp500

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

  | llf | aic | bic |   -- | -- | -- | -- | -- AR | 6 | 6 | 6 | 18 regime2 | 5 | 5 | 1 | 11 regime3 | 4 | 4 | 3 | 11 regime4 | 2 | 3 | 4 | 9 ARregime3 | 3 | 1 | 2 | 6 ARregime4 | 1 | 2 | 5 | 8

msz13 commented 5 months ago

inflacja

dane roczne 2003-2023, 2003-2023

msz13 commented 4 months ago

pln cpi calibration target: mean: 2,5% percentule 97,5% - 16% 2% - 1%

msz13 commented 4 months ago

problemy z polska inflacja:

krótki okres nie byłby problemem, gdyby nie ta duza inflacja

możliwe rozwiązania:

msz13 commented 4 months ago

zaleznosc:

msz13 commented 4 months ago

prosty model:

msz13 commented 2 months ago

Geometric Bropwnian Motion Parameters https://medium.com/@polanitzer/estimating-the-parameters-for-a-geometric-brownian-motion-stochastic-process-using-two-different-6c7cbdf20c8f

msz13 commented 1 month ago

Global scenarios https://www.actuaries.org/AFIR/Colloquia/Nuernberg/Mulvey_Thorlacius.pdf

msz13 commented 1 month ago

edo

edo = [1:10]

edo_ret[stage % 10] = yield[stage] edo_ret[1:stage % 10 - 1] = inflation_previous.in +premium inflation_previous.out = inflation[stage]

edo.out = edo.in .* edo_ret + edo_buy(tylko dla etgo stage) + edo_sell (dla wszystkich)

msz13 commented 1 month ago

Albo:

Problem z HMM Dane w pln tylko z 20 lat. Nie wiem, jak zamienić model miesięczny na roczny

Czy iść w scenario lattice, czy w regime switching

msz13 commented 1 month ago

Ewaluacja scenariuszy: