ラベル

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)

2020年2月27日木曜日

Google Home Mini, あなたは一体?Google Home Mini, You Drive Me Crazy!

Google Home Mini, あなたは一体?Google Home Mini, You Drive Me Crazy!

1月末に文鎮化したはずの、Google Home Mini。The Google Home Mini, that was supposed to become paper weight at the end of January. 

どうせ壊れたなら、いわゆる「カラ割」をして見ようかと思ったり、いやいや、まだ内部コンデンサーの完全放電を待つべきと考えたりしているうちに、1か月弱放置状態にしてあった。I thought of disassembling shells, or may better to wait longer expecting total discharge etc, and ended up leaving it for almost a month. 

それが、なんと、4週間近くの放置の後、再通電をしたところ、復旧してしまった!Amazingly however, after leaving the device for almost 4 weeks, it came back when I plugged in power USB! 

白いランプが最初2つ点灯。そして、4つ、そして!なんと、虹色の起動シグナルが!Two white LED first, then four, and finally rainbow LED booting signal came out! 

あーGoogle Home Mini!なんて手をかけさせるんだ!思わずもう一つ買っちゃったじゃないか!Oh Google Home Mini, why you are so troublemaker! I ended up purchasing one more! 

ということで、一つはリビングに、もう一つは子供部屋に置くことにした。As a result, I put one in living while another in kid's room. 

治ったということは、ファームウエアのUpdate失敗で内部のEEPROMが完全に破壊されたわけではないことは分かった。でも、治ったのは、もう一段低レベルのBootStrapがあって、それをGoogleがキックしたのだろうか?それとも、コンデンサーの完全放電には1か月が必要だったのか。Since it is fixed, I learned that internal EEPROM was not completely destroyed by failure of firmware update. But how it was fixed?  There is actually more lower level bootstrap exists which google kicked when I boot? Or it takes almost 1 month to have complete discharge? 

詳細は不明だが、2台体制で相互バックアップすれば問題なさそう。Not sure about the detail but now I am sure that we need two mini backing up each other going forward. 

2020年2月26日水曜日

花粉症とR1 Pollen Allergy and R1

花粉症とR1

Pollen Allergy and R1

なにか、R1ヨーグルトの宣伝のようになってしまったが、これは「実話」である。実話であると書くと、なお、嘘くさく聞こえるが、数日前、私に起こったことだ。It starts to look like advertisement of R1 but this is a 'real' story. If I write 'real' story, it sounds more like made-up story but this really happened to me few days ago.

川崎喘息の華やかりしころに生まれ、富士山など見えたことがなかった光化学スモッグ(今でいうPM2.5)の東京でそだった私は、なぜか花粉症にかかることはなかった。I grew up when Kawasaki asthma was at peak, never had chance to see Mt.Fuji from Tokyo due to air pollution(PM2.5 nowadays) but magically never had chance to get pollen allergy.

ところが、つい最近、春を目前にして、とうとうかかってしまった。最初はのどのかゆみと痛み。それが過ぎると、止まらない鼻水。熱はない。典型的な花粉症である。However, all of a sudden, I got allergy as spring comes close. Running nose never stops, itchy throat, all typical pollen allergy symptoms.

気が付いたのは、食べ続けていたR1をここ数か月食べなくなったこと。R1は小さなワンカップが130円もするので、1Lの牛乳で培養して増やして食べていた。培養すると、ワンカップサイズ(112g)10個弱相当に増えるので、牛乳代1L200円を考慮しても、ワンカップ相当の単価が概略330円/10個=33円に圧縮できる。What I notice was that I stopped taking R1 for the last few month although I got used to. R1 costs JPY130 hence I culture to 1L milk always. If you culture, it will multiply up to 10 cup size(each112g) equivalent hence even considering Milk cost of JPY200/L, can reduce cost down to JPY33/pieces=JPY330/10pieces roughly.

しかし、R1が特殊なヨーグルトでないと考えると、ブルガリアヨーグルトなどは1Lが200円ぐらいで買えるので、培養の手間も含めると、R1以外のヨーグルトをそのまま買ってきて食べたほうが安い。However, if you do not assume R1 as special yogurt, since Bulgarian yogurt costs only JPY200/L, considering the overhead for culturing, it will be cheaper simply purchase yogurt other than R1. 

「合理的」な説得に負けて、数か月R1以外のヨーグルトにしていた。Yielding to this "rational" persuasion, I started getting yogurt other than R1 for the last few month.

ところが、花粉症の発症。However pollen allergy happened.

そこで、R1を緊急復活した。Hence activated emergency resumption measure of R1 process.

結果、摩訶不思議、花粉症は完治、胃腸の調子も以前に戻った! R1万歳!As a result, amazingly, pollen allergy has gone and stomach disorder came back to normal. Viva R1!

嘘のようなホントの話だ。Believe it or not, this is a real story...

2020年2月21日金曜日

AI 株価予測 20200220 の状況 Stock Price AI Forecast - 20200220 Status

AI 株価予測 20200220 の状況 Stock Price AI Forecast - 20200220 Status


新値3本のAIの、ポスト後の動向を見た。下図は日次、週次、月次の予測だ。Just took a look how three line break AI goes afterward. Below is the move for Daily, Weekly and monthly projection.

注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.




日次、週次は内部乱数による影響が大きく、RUNの度の結果の振れが大きい。ただ、月次はRUNの影響は少なく、大きな下落を予測している。Daily and Weekly have big impact from internal random number generation and result fluctuate in each run. However, monthly is rather stable with big down trend.

新値3本なので、予測するのは方向性のみで、実現する日次は予測しない。Since this is three line break, it predicts only direction but not the date when it comes.

現状、過去20年のデータを用い、過去20新値から次の新値を学習させ、予測している。It predicts based on historical 20yr data, based on education for the last 20 line breaks.


株価の推測において、テクニカルはファンダメンタルと同様重要だ。Technical is important as well as fundamentals for stock price prediction.

ギャンコヘレトの言葉を市場の本質を表す言葉として信奉していた。Gann believed Koheret's word to represent the nature of market.

市場に参加する人の心理が需給を作り、それは今も昔も、未来も変わりないものだ。過去の動きを学習することで、市場の値動きはある程度の予測が可能だ。The psychology of market participants creates demand/supply, that remains the same from past, current and to the future. By studying the historical move, we can predict market move to certain level.

この予測を現在まではチャーチストと呼ばれる人たちがいろいろな手法を編み出してやってきた。この株価予測AIはこれらの株価変化のパターン認識を自動で行わせることが目的だ。These prediction has been done by the works of so-called chartists. This stock price AI recognized historical pattern automatic. This is the objective of this AI.

同様の予測AIは多い中で、ここでは新値3本を用いることで通常のオシレーター系、自己相関系の手法が苦手な移相の伸縮に対応している。Among other prediction AI, this post is different to be able to cope with phase expansion/shrinkage, unlike conventional oscillator as well as auto-correlation approach, thanks to three line break's nature to focus only order but not time.








2020年2月14日金曜日

ニューラルネットと遺伝子アルゴリズム Neural Net and Genetic Algorithm

ニューラルネットと遺伝子アルゴリズム Neural Net and Genetic Algorithm



 ニューラルネットの教育は結局、最適化の問題だ。最適化を行うのに、最急降下法と遺伝子アルゴリズムがある。Neural Net Training is an optimization process after all.  To perform optimization, we can use steepest gradient method as well as genetic algorithm.

 現状のニューラルネットはほとんど、最急降下法で作られている。このため、微分で発散しがちな関数は学習に時間がかかってしまい、様々なテクニックが毎週のように発表されている。Current majority of Neural Net is built on steepest gradient method. Hence it takes time for functions with jumpy 1st order derivatives, resulting in lots of techniques developed and presented almost weekly.

 しかし、遺伝子アルゴリズムは微分を用いないため、効率的な教育が可能。現在、多くの研究が発表されており、Tensorflow等にも組み込まれる日も近いかもしれない。楽しみだ。However, since genetic algorithm does not use derivation, it provides efficient training. Currently lots of researches are done and the day may come soon when it will be part of Tensorflow functionality.  I am very much looking forward to seeing it.


2020年2月13日木曜日

Tensorflow.js 正規化の効用 Tensorflow.js Impact by Normalization

Tensorflow.js 正規化の効用 Tensorflow.js Impact of Normalization



Tensorflowは数あるAIエンジンの一つであり、本ブログでは、そのJavascript版を利用している。Tensorflow, that this blog makes use of, is one of several other major AI engines.

Tensorflowに限ったことはないと思うが、AIエンジンは収束計算を行う際に最急降下法を使うため、微分の値が飛ばないように入力値を管理しないと、収束が良くない。This should not be limited to Tensorflow only but in general, input value needs to be controlled so that steepest gradient converges in AI engine.

AIエンジンの機能として初めから標準装備されていれば問題ないのだが、現状ではAPI 利用者が正規化を行う必要がある。最大最小の中の範囲を[-1,1]で表すなどいろいろな方法はあるが、ここでは2次モーメント情報(分散)をもとに、標準正規分布への写像を行う方法を使った。If AI engine has normalization function by default it will be no issue but as of now, such normalization needs to be done by API users.  There are number of ways to do normalization such as using max/min to project to [-1,1] however, here we use standard normal distribution approach based on 2nd order information, that is variance.


\begin{align}  X' &= \frac{X - \mu}{\sigma }(標準偏差) \\ & \end{align} \begin{align} X'   &:  Varible In Normalized Space(正規化空間の変数)  \\X   &:  VariableInOriginalSpace(元の空間の変数) \\ \mu   &:  Average(平均値) \\ \sigma  &:  StandardDeviation(標準偏差) \end{align}

その結果、先に掲載したPOCツールは早く正確に収束するようになった。上図は、四角形の真ん中が-10と凹み、周辺が+10と高くなっているデータを教育した結果比較だ。右は現データをそのままTensorflowで処理したケース、左は、正規化後、Tensorflowで処理したケースである。正規化した方がデータをよく表していることがわかる。As a result, POC tool presented earlier started to show better convergence. Picture above is the comparison result of education of rectangular surface where value is 10 at peripheral while -10 in center. Right picture is without normalization while left picture is with normalization. It is observed that normalization result shows better presentation of data space.


2020年2月8日土曜日

AI化、5分でチェック・簡単無料PoC ! 5min PoC (Proof of Concept) on AI

AI化、5分でチェック・簡単無料PoC!

5min PoC(Proof Of Concept) on AI!

(2020/2/23 入力データ保存機能追加 Input Data Saving Function Added)


自分の仕事がAI化できるか試してみたい人は多いだろう。Many may wish to check if the task working on can be on AI basis.

出来そうな気がするが、人に頼むとお金がかかるし、自分でやるには大変だし。いろんなシステムも宣伝しているが、使い方を覚えるだけで大変だ。決心してやってみて結局だめだったらお金と時間の無駄だし。It looks possible but will cost if ask someone. But looks hassle if do it your own. Google search shows many advertisements on AI systems but looks hard to learn. Also, even if you decided to do it, if it fails eventually, it will be  a waste of time and money.

そんな時、無料で、簡単に、可能性をチェックできるのがこのページだ。先に書いた温度管理のプログラムを読み替えただけだ。プログラムはこちら。In such a case, this page provides you, for free and ease, the feasibility check of concept of your idea. This is just another interpretation of previously shown temperature control program I presented. GitHub is here.

下のアプリの使い方は簡単。ただ、画面に自分の手持ちデータをそのまま入力し、ボタンを収束するまで、数回押すだけで完了。AIといっても、言語処理、画像、制御などいろいろあるが、ここでは制御が対象。It is very easy to use below application. Simply, just input your data onto the screen, then click button couple of times until you see convergence. There are lots of AI out there such as language processing, image processing and control, here we focus on control.

農業、製造、教育など、あらゆる場面でAIは助けになる何でも屋だ。AI is all rounder covering agriculture, manufacturing, education and many other fields.

深く考えずに、まずは身近のデータを入れて実験してみよう! Just jump in before think too much, then input your local data and experiment.

何らかの状態xのもと、何らかの制御zを行うと、結果yが出る。では、ある状態xの場合、ある結果yを実現するには、どんな制御zをおこなえばいいの?という問題に適用できる。Under some circumstance X, by making some control Z, then got result Y. Now to achieve result Y under some circumstance X, how much control Z should be applied? This is the problem we can test here.

使い方は簡単。データ1-9に何らかの観測値(x軸)、制御値(z軸)、そしてその結果生じた値(y軸)を入れ、空色のボタンを押す。右側に表示される収束グラフで収束不足の場合は、再度ボタンを押す。計算後、観測値、目標とする結果を実現する制御値(縦軸z)が表示される。グラフが表示されない場合は、グラフのホームアイコンを押す。The usage is easy. Input data set 1-9, i.e., some observation(x-axis), control value(z-axis) and resulting value(y-axis), then push sky blue button. If convergence is not sufficient on right hand side graph, click button once more. After calculation, control value(vertical z-axis) is shown as surface to achieve target value at observation value. Click Home Icon on the graph if it is not shown.

活性化関数は全部で11ある。There are all 11 activation functions you can try (elu, hardsigmoid, linear, relu, relu6, selu, sigmoid, softmax, softplus, softsign, tanh).

利用中の端末上で、PoC入力データの保存と読込ができる。Capable of saving and loading PoC input data on your device in use.


Simple AI POC(Proof Of Concept) Tool
Decide control level to achieve target result level

#OfNeurons/layerニューロン数/層
#ofEpoc教育繰り返し回数
InputLyrActivFunc入力層活性化関数
HidnLyrActivFunc中間層活性化関数
#ofHiddenLayer中間層の数

データーセット番号 data set number       
               
x. 観測値Observation   Value    
               
z. 制御値Control Level Value (+/-)
               
y. 結果Final Result Value
               



SavePC InputData 入力データPC保存 ==>
LoadPC InputData 入力データPC読込 ==>

2020年2月7日金曜日

転覆防止装置の設置義務化 Anti-Capsize Device Compulsory Installation

転覆防止装置の設置義務化

Anti-Capsize Device Compulsory Installation




時折ある悲惨な客船転覆事故。見ていて本当に歯がゆい。非常に巨大な風船を緊急時に船体の両側に膨らませるなどして、転覆は簡単に防げそうだからだ。We see capsize accident of large carrier once in a while but I always feel tantalized seeing it. It is because such capsize looks prevented by simply placing huge balloon floater besides the ship in emergency. 

現代の技術であれば低コスト化は容易だろう。By modern technology, cost reduction will not be a problem. 

早期に転覆防止装置の設置を国際基準として義務化するべきだ。I do wish earlier implementation of international law mandating such anti-capsize device as default installation equipment.

以下、簡単に思いつく方法を書いた。Wrote some ideas easily pop up in mind.

風船方式Balloon method : 非常に巨大な風船を船体の両側に膨らませることで、転覆を防ぐ Prevent capsize by inflating huge balloon on both sides of ship at emergency.
アウトリガー方式Outrigger method : アウトリガーのモーメントで風船を軽量化するMake use of moment of outrigger to reduce weight.

転覆復旧装置 Capsize Recovery Device : ケーブルを外部から設置し巨大な風船を膨らませる。Set cable from outside and inflate huge balloon.



2020年2月6日木曜日

ドローン水難救助 Drone Rescue for Water Accident [20220802 added]

ドローン水難救助

Drone Rescue for Water Accident


昨年の夏、悲惨な水難事故に遭遇した。海水浴中、人が海岸流に流されて亡くなってしまった。I encountered terrible water accident in last summer. A man was drifted by ripple current and drowned.

ボードを2つもって皆が言う方向へ泳いで行ったが、いなかった。結局反対方向に流されていたことが後で分かった。I swam up to the direction people said with two boards but could not find the man. Later found out that the man was drifted further down to opposite direction.

水難救助はプロの人ほど慎重だ。いかに泳ぎが上手でも大の大人を救助して岸まで引っ張ることはできない。また、少し波が立つと、岸からはもう見えない。Water rescue needs to be done in prudent manner, that is more so for professional rescue team. However good you are at swimming, you cannot drag adult man toward shore.  Also, even a small wave make objects invisible from shore.

海岸流(リップルカレント)、風向き(オンショア、オフショア)、水深の激変は海岸で水泳をする前の必須チェック項目だが、忘れられることも多い。Ripple Current, Wind direction(On-Shore, Off-Shore), water depth change are must check items before swimming at the seashore but sometimes, they are forgotten.

ライフガードはすべての海岸に配備されているわけではない。でも、気持ちの良い海岸にはライフガードが居ない場合も多い。Life guards are not deployed to all beaches. However, cozy beaches sometimes have no life guard.

ドローンが安価になった今、ライフガードの居ない海岸に、溺れている人をAIで検出して、浮き輪を投下するドローンを標準配備できないものだろうか。Now drone became much cheaper, so I wonder if it is possible to default implement rescue drone to all beaches without life guard, that through in floater onto drowned person detected by AI.

仕組みはこうだ。It works like this,

1)数機のドローンを常時旋回させ、現状で泳ぎに出ている人を把握させる。Multiple drone will fly over the beach all the time and real time identify who is swimming in the sea.
2)異変をAIなどで、検出し、浮き輪などをもって該当の人の上を旋回し、必要があれば自動で膨らむ浮き輪、ボートなどを投下する。Detect abnormality by AI, fly over the person in problem, then throw down auto inflation floater or boat.
3)同時に警察などに連絡する。Inform police at the same time.

現状の技術で実現可能だと思う。This can be achieved by current technologies.

日本の沿岸警備の一環として、全国の沿岸に展開してはどうだろうか? How about cascading to all beaches as a part of coastal defense initiative of Japan?

[スペインでは配備 Ready in Spain 20220802追記]


2020年2月5日水曜日

TSE8306MUFGの20200204現状メモ Memo on Status20200204 of TSE8306MUFG

TSE8306MUFGの20200204現状メモ

 Memo on Status20200204 of TSE8306MUFG 



TSE8306MUFG月足は3本で陽転模様。週足は陰転模様、日足は乱高下の状態だ。Monthly three line break of 8306MUFG looks going positive, while weekly looks going negative and daily looks jumping around.

注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.

20200204時点で配当利回りは4.4%。銀行株は全般、稼ぎ頭のギャッピングが異次元緩和によるイールドカーブのフラット化で機能していないため不調であるが、TSE8306MUFGは比較的、収益が安定している。At the point of 20200204, dividend coupon yield is 4.4%. Bank sector's leading profit making machine, gapping, is suffering from flattening of yield curve in general due to BOJ's drastic monetary policy however, TSE8306MUFG's profit is rather stable.

NYダウが30,000に、日経225は24,000に挑戦中、円は108円台、金利はマイナス金利緩和継続中、日本市場の主要参加者は海外勢、米中貿易戦争など世界情勢の不透明感は高まっている。NY Dow is heading 30,000 while Nikkei225 is challenging 24,000 level, JPY is around 108, interest rate is still on negative zone, prevailing TSE player is foreign investors and world economy is getting unclear due to continuation of trade war between US and China.

また、ここ2週間はコロナウイルスで世界中大騒ぎだ。Also, for the last two weeks, world is in confusion due to Coronavirus.

しかし、新値三本を使う場合、すべてが逆転してからでは遅すぎる。下値不安の少ない高い配当利回りの銘柄について新値が詰まってきたところが狙い目。外したら貯金だと思って配当を待つか、損切りで対応。資金管理は非常に重要。However, when you play on three line break, it will be too late if you wait for whole breaks(month/week/day) to go positive. Choosing the stock with less worry for breaking floor and wait for the moment the break amount starts getting small. If it does not work, can hold as deposit or do loss cut but never ever should miss the point of investment size management.






2020年2月4日火曜日

AI 株価予測 ー 新値3本(週次)Stock Price AI Forecast - Three Line Break (Weekly)

AI 株価予測 ー 新値3本(週次)

Stock Price AI Forecast - Three Line Break (Weekly)

日次月次とAI 株価予測ー新値3本を掲載したので、週次もやってみた。日次、月次とはまった違った見方ができて面白い。Posted daily and weekly Stock Price AI Forecast - Three Line Break, so tried weekly also. It's interesting to see the market from different perspective compared to daily and monthly

注)この投稿はあくまで実験ベースです。計算結果に基づく実際の投資は一切行わないでください。
Caution) This article is for experiment only.  Never make any actual investment based on the result.


JS FileReader
TLB(Three Line Break) Neural Net Prediction on TSE東証 8306 MUFG (株)三菱UFJフィナンシャル・グループ
Normalized Version
#OfNeurons/layerニューロン数/層
#ofEpoc教育繰り返し回数
InputLyrActivFunc入力層活性化関数
HidnLyrActivFunc中間層活性化関数
#ofHiddenLayer中間層の数
#ofThreeLineBreaks入力 新値 本数
ValidationSplit 検証用データ割合
ObservationStartDate 時系列開始日
ObservationEndDate 時系列最終日

Input most recent three line break width
 TLB width last 20 新値幅 20 本前
 TLB width last 19 新値幅 19 本前
 TLB width last 18 新値幅 18 本前
 TLB width last 17 新値幅 17 本前
 TLB width last 16 新値幅16 本前
 TLB width last 15 新値幅 15 本前
 TLB width last 14 新値幅 14 本前
 TLB width last 13 新値幅 13 本前
 TLB width last 12 新値幅 12 本前
 TLB width last 11 新値幅 11 本前
 TLB width last 10 新値幅 10 本前
 TLB width last 9 新値幅 9 本前
 TLB width last 8 新値幅 8 本前
 TLB width last 7 新値幅 7 本前
 TLB width last 6 新値幅 6 本前
 TLB width last 5 新値幅 5 本前
 TLB width last 4 新値幅 4 本前
 TLB width last 3 新値幅 3 本前
 TLB width last 2 新値幅 2 本前
 TLB width last 1 新値幅 1 本前
Output forecast of next three line break width
 ThreeLineBreak Forecast 新値幅予測