ラベル

AI Forecast 8306MUFG (211) Social (75) life (70) Financial (62) IT (57) Proposal (56) idea (50) Fund Management (48) Trading (43) economics (42) Covid-19 (40) AI (38) Hedge Fund (36) Risk (36) Culture (31) BOJ (29) Science (26) hobby (24) accounting (17) Apps (16) career (11) job (7) Travel (5) emotion (5) Hiking (4) music (3) Statarb (2) piano (2)

2019年6月28日金曜日

AGI (汎用型人工知能) 赤ちゃんモデル AGI (Artificial General Intelligence) Baby Model



AGI (汎用型人工知能) 赤ちゃんモデル

English Follows



現状のAIは関数の補間に過ぎないとは言え、ニューラルネットの実用化は、AIの分野で、人類の偉大な成功の第一ステップであるのは間違いない。

一方、現状で、人間レベルのAIは存在していないのも明らかだ。現存する会話ロボットは、それ自体はなにも「理解」していないことがすぐに分かってしまうレベルだ。

ここから人間並みの知性(AGI)を作り上げるためには、まだ多くのハードルを越えなくてはいけないのは明らかだ。

いくつかのアプローチが考えられ、研究が進められている。

1)哲学的アプローチ
  言語分析、時空把握、などの世界観を知能に組み込むことで人間並みの知性を作る。

2)脳分析アプローチ
  脳の構造を詳細に分析することで脳のエミュレーターを作る。

3)遺伝子アプローチ
  人間に関するすべてのことは遺伝子に書かれているので、遺伝子を解析する。

アプローチ3)は現状で遺伝子はコード配列が分かったのみで、その解読は始まったばかりだ。究極のアプローチであり、ある時点で加速度的な進展が期待できるだろうが、現状ではお手上げ状態だ。

完成品である脳をハード、ソフト両面から分析するアプローチ2)は、設計図を解析するアプローチ3)より近道であることは分かる。

アプローチ1)については、システム化は容易であるが、自ら全く新規のことを分析発展させていく機能を持たせないと、新しい機能が必要な度に、大規模システム開発が必要となってしまい、エキスパートシステムの域を出ない。

そこで、ここに第4のアプローチを提案したい。それは「赤ちゃんモデル」である。

生まれた瞬間に眩しそうな眼をしながら、肺呼吸を開始し、ミルクから栄養を補給。この瞬間から学習が始まる。上手くいかない場合は泣いて救助シグナルを送る。

赤ちゃんは生まれた時点では、3次元の世界も理解できていない。いないいないバーで喜ぶのは3次元の世界の理解の過程である。

ハンドリガードは、赤ちゃんが生後3か月ぐらいで自分の手をグーパーさせているのをじっと注視する現象である。脳がハードウエアとの連結プロトコルを確認している瞬間である。

そして、ハイハイ、伝い歩き、喜びの初めての2足歩行、映像と言語のマッチング。世界の把握。

赤ちゃんの成長過程については深い研究がなされており、これは利用しない手はないだろう。赤ちゃんは白紙だ。どんなことも、飽くなき好奇心で追及し、習得してしまう。このプロセスを出来上がった大人のモデルでなく、赤ちゃんレベルで作ることで、AGIが実現できるのではないだろうか。

AGI (Artificial General Intelligence) Baby Model



Current AI is nothing but generalized interpolation of function however, there is no doubt that recent successful neural net implementation is a great 1st step for human being.

On the other hand, it is clear that there is no AI now at human intelligence level. Lots of chat bots are at the level to be able to see that there is no real understanding done.

Obviously there are lots of hurdles from here to get over to achieve human level intelligence (AGI).

Currently couple of approaches are sought out.

1) Philosophical approach

Create human level intelligence incorporating the functions for language analysis, space recognition etc.

2) Brain analysis approach

Create brain emulator by the study on brain structure.

3) Genetic approach

All related to human are written in gene code after all, so study gene structure.

Approach 3) is the ultimate way and development may accelerate from certain level however there is no chance to go anywhere at this point since genetic code order is almost everything we know but not the way to interpret it.

Approach 2) has better chance than approach 3) since it starts from brain already reflecting the design and actually working.

Approach 1) looks most easy for implementation but unless equipped with auto functionality to investigate and develop brand new things, there will be a constant need for huge system development, hence it will not go beyond expert systems.

Hence I wish to propose 4th approach here. That is Baby Model.

Dazzled by lights and starts breathing by own lang, then get nutrition from milk. Learning starts from this moment. Cry to request for help if things are not going right.

The baby has no understanding on 3D world at the time of birth. Peekaboo makes baby excited since it is a process of understanding of 3D world.

Hand Regard is a phenomena that 3-month baby stares own hands to do open shut. It is a moment when brain and hardware is confirming joint protocol.

Then crawling, walking by holding rail, happy 2-leg walking for the 1st time, matching between visions and words. Understanding of the world.

Lots of studies have been done for the growth process of baby, so why not making use of them. Baby is empty in the beginning but will go after and learn anything driven by curiosity. AGI can be realized by achieving this learning process not from adult model but from baby model.

情報一元化 One Fact One Place

情報一元化


多くの会社で実現できていない情報一元化。

特に大きな会社ほど、情報の冗長性は高い。

おなじような情報が一貫性を欠いて会社にはあふれている。

意図的な冗長性はシステムの信頼性の向上には役立つが、

殆どの場合、冗長性は無駄の元凶だ。

まずは身近なところから、情報を集約していってはどうだろうか?

One Fact One Place 


Most company has no repository for essential information.

The bigger the firm, the higher the redundancy.

We see inflation of similar but inconsistent information.

Intentional redundancy helps increase reliability of system.

However, in most cases, redundancy is the source of waste.

Let's start consolidating information from anywhere close to you.




2019年6月22日土曜日

妙義山石門巡りハイキング Mt. Myohgi Stone Gate Trail Hiking

妙義山石門巡りハイキング

Mt. Myohgi Stone Gate Trail Hiking 


子供と妙義山の石門巡りを日帰りハイキングしてきた。Went down to day hiking to Myohgi-san (Mt.Myohgi) stone gate trail with kids.

東京から電車で2時間で高崎。そこからレンタカー妙義公園駐車場へ1時間。Two hours by train from Tokyo to Takasaki.   Another one hour rental car drive up to Myohgi-san park parking.

JR信越本線の松井田駅からのバスは妙義神社へしか行かないので、妙義公園駐車場へはレンタカーがベター。 Bus from JR Matsuida station (Shinetsu-Honsen) goes only to Myohgi-shrine hence rental car is better to go Myohgi-san park parking.



妙義山が遠くに見えてきた。Myohgi-san started to look afar. 


ノコギリ状の山々がかなりはっきり見えてきた。Zigzag mountain top started to look  very much distinct.


妙義公園駐車場へ到着。石門巡りは駐車場のすぐ上。Arrived at Myohgi-san park parking. Stone gate trail is right above the parking space.


来た道を若干戻ると、Backtracking the road a bit, 


登り口が見えてくる。You will see the entrance to the trail.


案内図があちこちにあり迷子にはならない。No chance to get lost since signs are everywhere. 



上の地図の緑ラインをすべて歩いて戻ってくるコースにした。Decided to take all green line trails on the map above.



多くのクサリ場があり、子供は大喜びだが、危険なのは間違いない。注意して登る。Lots of climbing chain works. Kids were excited but definitely dangerous.  Keep climbing carefully.




大砲岩近く。Near cannon rock.





やっと帰り道。無事でよかった。Finally way back to start point. Happy to be safe. 




中之獄神社の階段。Stairs of shrine Nakanogoku.



境内を通って駐車場へ。To the parking lot through shrine. 


電車+レンタで日帰りハイキングができた。ただ、正直な感想として、このコースは経験者向けで、体力に自信がない場合は避けるのが賢明だと思った。実際、重大事故も起きているようだ。One day trip hiking completed by train & rental car.  However, honestly speaking, I felt this trail is for experienced person, hence it is better to avoid if not really confident about oneself physically. Looks there were actually some serious accidents happened in the past. 

2019年6月21日金曜日

秦野ー鶴巻温泉ハイキング Hatano-Tsurumaki Hotspring Hiking

秦野ー鶴巻温泉ハイキング 

Hatano-Tsurumaki Hot-spring Hiking


 東京中心から1時間半ぐらいの秦野丹沢の麓町だ。Hatano city. An hour and a half train ride from central Tokyo. This is a town at the foot of Tanzawa mountain area.


水はきれい。秦野の町中を流れる水無川は整備された上下水道のせいか透明度が高い。Water is clear. Mizunashi-river running through center of Hatano is clean probably due to well build sewage system. 


小田急電鉄の「小田急沿線 自然ふれあい歩道 コースマップ」を秦野の駅舎でもらい、弘法山経由、鶴巻温泉への1時間半のコース確認。Got hiking map `Odakyu-line Nature walking course map` at Hatano-station and confirmed 1 and a half hour hiking course to Tsurumaki-hotspring through mount Kohboh. 


 急坂を20分ほど登って、弘法山山頂へ到着。Arrived at the top of Kohbo mountain after climbing steep trail 20 minutes.


 江の島、伊豆半島、富士山が一望できる。一休みしてお弁当。 Panorama covering Enoshima-island, Izu-peninsula, mount-Fuji. Rested for lunch. 


帰りは里山の水田に降りると、オタマジャクシがいっぱい。Went down to rice paddy and found lots of tadpoles.


水田の横にはシオカラトンボも。Also found Shiokara-dragonfly by the rice paddy.


あとは、急行でひと眠りすると新宿到着! Woke up from short nap on the train to find arrived at Shinjuku-station.

VaR変化の要因分析 VaR Change Attribute Analysis

VaR変化の要因分析

English Follows


銀行の市場リスク管理部に勤めるあなたが、ある日会社に行ってシステムを見ると、あれあれ? VaRが突然増えた!なにが起こったんだ? なにも新規のトレードはしていないのに。

もし、金利系商品を扱っているなら、まず、金利レベルの変化に注目。それは、方法は問わず、金利系の場合のvolatilityは、年率%換算のvolatility表示に、現在の金利レベルを掛けて計算されるからだ。

金利が1%近辺で5bp動いてもVaR変動は5%だが、金利が5bp近辺の場合、5bp動くとVaRの変動は100%(2倍)になってしまう。

VaRの計算方法にはいくつかある。また、対象商品によって計算方法が若干異なる。ざっくり言って、
  • VCVの場合
       FixedIncomeの場合 
       VaR
  = BPV X 2.33(C.I.99%) X Vola(%pa) / sqrt(240) X Current MarketLevel(bp)
  Equityの場合 
         VaR = Position X 2.33(C.I.99%) X Vola(%pa) / sqrt(240)

  • Historicalの場合
   FixedIncomeの場合 
        VaR =
          Percentile ( BPV X  HistoricalDailyChange(%) X Current MarketLevel(bp) )
     Equityの場合 
          VaR = Percentile (Current Position amt X HistoricalDailyChange(%) )

  • MonteCarloの場合
      FixedIncomeの場合 
         VaR = BPV X SimulationChange(%)  X Current MarketLevel(bp)
  Equityの場合 
         VaR = Position X SimulationChange(%)   

この他、チェックポイントとしては、

1)為替変動がベース通貨に対し再評価による変動を与えていないか?
2)Historicalの場合、シナリオの変化で説明できないか?
3)マーケットデータ採取は適切か?Bidしかない場合、Bidを使っていないか?

VaR Change Attribute Analysis


 One day, you , as a market risk manager of bank, go to office and open up system then find out that VaR increased suddenly! Oh my god, what is going on? No new trade done.

If you deal with fixed income products, check the level change of interest rate 1st. It is because, irrespective of methodologies, the volatility of fixed income products is calculated as a product of interest rate level and annualized % based volatility quote.

If interest rate of the market is around 1% and it increased 5bp, then VaR will increase 5% however, if interest rate is around 5bp and it increased 5bp, VaR will increase for 100%(doubles).

There are couple of approach to calculate VaR.  Calculation method will differ a bit by products. In nutshell, roughly,
  • VCV`s case  
      FixedIncome's case 
       VaR
  = BPV X 2.33(C.I.99%) X Vola(%pa) / sqrt(240) X Current MarketLevel(bp)
  Equity's case 
         VaR = Position X 2.33(C.I.99%) X Vola(%pa) / sqrt(240)

  • Historical's case
   FixedIncome's case 
        VaR =
          Percentile ( BPV X  HistoricalDailyChange(%) X Current MarketLevel(bp) )
     Equity's case 
       VaR = Percentile (Current Position amt X HistoricalDailyChange(%) )

  • MonteCarlo's case
      FixedIncome's case 
         VaR = BPV X SimulationChange(%)  X Current MarketLevel(bp)
  Equity's case 
         VaR = Position X SimulationChange(%)   

Other check points are,

1) FX change might have impact against denominating base currency used
2) Scenario transition might have impact when historical simulation is used
3) Check if market data is taken properly such as taking only bid when only bid is available etc.

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年6月12日水曜日

廃校小学校の幼稚園、保育園への無償開放/小子化問題への切り札 Re-Use of Closed Public Schools for Day Nursery - How to Stop Declining Birth Rate -

廃校小中学校の幼稚園、保育園への無償開放
ー小子化問題への切り札ー

(English Follows)




現在、小子化により、公立小中学校の統廃合が進んでいる。廃校になった校舎が都内に散見され、長期にわたり放置されている。一方、子供を持つ女性の社会進出は、幼稚園、保育園の不足により、阻まれている。

これを、少ないコストで一気に解決するのが、廃校となった公立小中学校の、幼稚園、保育園への無償開放である。

予算をかけずに、頭を使って社会の新しい仕組みを作り出すのが、真の政治の使命である。


利点
  • 事業者にとってコストが抑えられ、進出意欲が増す
  • 新規事業により新規雇用も生まれる
  • 幼稚園、保育園の環境が改善できる
  • 公共財を無駄に寝かせておかず、真に必要な目的のために活用できる
  • 女性の社会進出が大幅に支援される
  • 子育ての障壁が減った女性は一人であきらめていた子供を二人以上産むようになる
  • 結果的に小子化問題は解消する

Re-Use of Closed Public Schools for Day Nursery 
- How to Stop Declining Birth Rate - 



Due to declining kids population, number of public elementary and junior high schools are closed or consolidated. There are lots of closed school buildings in Tokyo metropolitan area left deserted for no use. Meanwhile lots of women with kids cannot go to work due to lack of day nursery.

Offering this unused public facility free to nursery industry will solve the problem with minimum cost.

It is a mission of politics to create social frameworks with minimal expenditure.

Advantages

  • Higher cost reduction incentive for nursery enterprise
  • New job creation in nursery industry
  • Can improve squeezing infrastructure of nursery in Tokyo metropolitan area
  • Can stop public assets left deserted and unused
  • Great assistance for women with kids to go work
  • Woman who gave up to have two kid can afford extra kid
  • As a result, can stop declining birth rate