ラベル

AI Forecast 8306MUFG (344) Social (79) life (75) Financial (70) IT (62) Proposal (57) AI (52) Fund Management (51) idea (51) economics (44) Trading (43) Covid-19 (40) Hedge Fund (37) Risk (36) Culture (31) BOJ (29) Science (29) hobby (27) accounting (17) Apps (16) Travel (14) career (11) job (7) Hiking (5) emotion (5) music (3) Statarb (2) piano (2)
ラベル Statarb の投稿を表示しています。 すべての投稿を表示
ラベル Statarb の投稿を表示しています。 すべての投稿を表示

2019年6月20日木曜日

統計的裁定(StatArb)ポートフォリオの例 StatArb (Statistical Arbitrage) Sample Portfolio

統計的裁定(StatArb)

ポートフォリオの例

English follows


統計的裁定ポートフォリオの簡単な例を見てみよう。

下図のように、東京証券取引所(TSE)上場の1812鹿島(建設)6103オークマ(工作機械)7951ヤマハ( 民生機械)を取り上げてみる。


ここで、この時系列の株価の共分散行列は次のようになる。 


固有値、固有ベクトルは、次のようになる。


固有値が最大の有為なモードの固有ベクトルを見ると、(0.32, 0.46, 0.83)と、同一方向への振れとなっている。これは、株1812が0.32動くと、株7951が0.83動く、即ち2.6倍動く(=0.83/0.32)ことが多いことを示唆している。散布図(下図)を見ても、傾きがおおよそ2.6倍になっていることが確認できる。


ここで注意するべきは、この固有ベクトルに時間軸はないことだ。解析対象は観測した母集団全体の平均値からの偏差のみである。この結果から周期性は分からない。よって時間軸の情報はないので、相場の時間軸上のタイミングも分からない。

一つの単純なペアトレードのスキームとして、株1812の一日の動きの2.6倍だけ株7951が動くことが多いことを利用して、乖離が激しい場合、さやが開いたと判定し、ポジションを立てる(取引を開始する)。2次元以上の場合も同様である。

この例だと、1月18日に株1812が57円下がっているため、株7951は151円下がるはずなのが、実際は10円上がっている。なので、乖離は161円で、仮に設定した閾値100円を超過している。よって、株1812は、株7951から見ると下がりすぎ(本当は上昇してほしい)だ。結果として作るポジションは下がりすぎの株1812を買って、見合いの株7951を売るものになる。1単位買った株1812のCF(キャッシュフロー)はマイナス、空売りした株7951のCFはプラスである(証拠金は省略)。空売りする株7951の単位数は、株7951の相対感度2.6で割ることで作ったポジションを市場中立にする。立てたポジションの反対売買執行条件は、乖離が逆方向に閾値-100円を超えて動いた場合である。

リスク量はシステミックリスクをオフセットする市場中立型であるため、アウトライトよりシステミックリスク部分だけ少ないスプレッドリスクのみである。

なお、ここで考慮していない事項をランダムに列記した。

1)証拠金の金利コスト、もろもろの市場・決済規制
2)流動性チェック(ポジション量は一日当たり平均取引高の1/100程度など)
3)注文タイミング(終値ベースで注文翌日成り行きなど)
4)時間軸(ミリ秒か、1時間か、1日か、観察時間など)
5)複数銘柄、複数資産からテストランを行い、有為な資産の組み合わせを選択する処理
6)システム対応(グローバルリアルタイムモニタリング&自動運用など)
7)閾値および損切レベルのシミュレーションによる最適化
8)ファンダメンタルズ分析(固有ベクトルの論理的理由がもし分かれば)
9)市場価格の正規化(価格が桁違いの商品の組み合わせの場合など)



Stat Arb (Statistical Arbitrage)  Sample Portfolio


Let's look at a simple portfolio of Stat Arb.

As shown below, we take TSE(Tokyo Stock Exchange) listed stock 1812 Kajima (construction), stock 6103 Ohkuma (mother machinery) and stock 7951 Yamaha (retail electronics/machine).


Here, co-variance matrix of stock price is calculated as below.


Corresponding eigen values and eigen vectors are shown below.


If we look at the eigen vector with maximum eigen value with maximum significance, (0.32, 0.46, 0.83) indicates the variation to same direction. This means if stock 1812 moves times 0.32, then stock 7951 moves times 0.83, i.e., tends to move 2.6 times (= 0.83/0.32).  Same can be observed in scatter plot below indicating gradient of around 2.6 times.


Need to be careful here that there is no time axis context to this eigen vector.  Object of analysis is a deviation from average only in the observed population. Thus, there is no time axis information, nor market entry timing information. 

One simple trade scheme on pair trade basis here is to trade by making use of 2.6 times bigger sensitivity of stock 1812 compared to stock 7951. If deviation of real price change from statistical change is bigger, judge that spread is widened, then create position (start trading). All these apply the same for the case where dimensions are higher than two here. 

In this example, stock 1812 dropped JPY57 on Jan 18th, hence stock 7951 should have dropped JPY151 (=57*2.637) however, it has gone up JPY10 instead. Hence deviation is JPY161 and exceeding the temporal threshold set as JPY100.  Thus, position to be created is to buy oversold stock 1812 and short-sell corresponding stock 7951. The CF (Cash Flow) for 1 unit buy of stock 1812 is minus, while CF for short sold stock 7951 is plus (ignoring margin). The units of short sold stock 7951 should be divided by relative sensitivity of 2.6 to make final position(portfolio) to be market neutral. The condition for portfolio unwinds is the deviation of market to opposite direction over threshold level of -JPY100.

Risk amount is less than outright portfolio for systemic risk due to offsetting nature of portfolio leaving only spread risk.

Put some notes below in random to be considered but not touched here.

1) Interest rate cost for margins, rules and regulations of market
2) Market liquidity check (such as position size limit < 1/100 of daily volume)
3) Order timing (use end of day price to decide, then trade next morning etc)
4) Scope of time span (millisecond or hour or day, observation period etc)
5) Workflow to choose multiple assets, names, and test to decide portfolio
6) System development (such as for global real time monitoring & auto trading)
7) Threshold to judge buy/sell as well as threshold to decide loss cut
8) Fundamental analysis (on the composition of eigen vector)
9) Normalization of market price (when combining numbers in different scale)


2019年5月30日木曜日

統計的裁定(スタットアーブ)の考え方 How Stat Arb(Statistical Arbitrage) Works?

統計的裁定(スタットアーブ)の考え方
(English follows)



統計的裁定は、期間、資産クラスを問わず適用可能な運用手法だ。
「裁定」と呼ばれるが、実際はリスクを取っており、古くは鞘取りとして知られてきた方法を、統計数学を利用して2資産以上の複数資産に拡張したものだ。

手順
ステップ1)対象資産時系列の主成分分析(=固有値解析)を行い、主成分(固有ベクトル)を得る。各モード毎の主成分(固有ベクトル)が統計的裁定ポートフォリオの資産ウエイトとなる。固有値は、自由度数だけ算出されるが、有意なモードは上位数モードとなる。
ステップ2)有意なモードで構成される統計的裁定ポートフォリオについて、過去の時系列を当てはめ、過去データ基準でチャートの動きをみる。このうち、市場中立的で回帰的な動きをするモードを選択し、売買の閾値を設定する。
ステップ3)テスト運用を行い、収益性を検証する。



特徴
1)株、債券、為替、コモディティーが混在できる。
2)算出された有意な固有ベクトルの根源的意味については必ずしも明確ではない(実際の投資に当たっては、可能な限り解明する)。
3)統計的特徴を捉えたい期間を過去時系列のサンプル期間とする。
4)ミリ秒単位の市場の特徴を捉えた投資を行いたい場合は、ミリ秒単位の時系列データが必要(高頻度トレーディング=HFT)となる。



How Stat Arb(Statistical Arbitrage) Works?





Statistical arbitrage is a fund management method applicable irrespective of investment terms or asset class. It is called arbitrage but it is taking risk as historically known `pair trade`, extended to multiple assets powered by statistical math.

Procedure
Step1) Perform principal component analysis (=eigenvalue analysis) on time series of target assets to get principal components (eigen vectors). Here principal components (eigen vector) become asset weight of stat arb portfolio. We get as many eigen vectors as number of freedoms however, only few upper modes are significant.
Step2) Apply historical time series to stat arb portfolio consists of significant mode to see portfolio value movement on historical basis(charts). Choose mode that shows market neutral as well as some reversion characteristics and set threshold level for buy/sell.
Step3) Conduct test management to check performance.



Characteristics
1)Stock, Bond, Currency, Commodity can be co-mingled.
2) Resulting significant eigen vector does not necessarily have logical explanation (but try to find out as best as possible before making actual investment).
3) Historical time series sample period should match the period you want to capture statistical characteristics.
4) Milliseconds data is required to make milliseconds investment (HFT) capturing market characteristics valid during milliseconds.