# Learn from the Experts Ep 1: Full Algorithm Creation with Vedran(https://lnkd.in/fa4Gcsq)を学ぶ
## $10K Third-Party Challenge: Design a Factor for a Large US Corporate Pension で優秀な結果を出した人たちへのインタビュー
## 1回目は、NCRのエンジニアのVedran Rusmaさん
Vedran Rusmaさん
https://www.linkedin.com/in/rusman-vedran-33926477/
インタビューの模様(YouTube)
https://lnkd.in/fa4Gcsq
Quantopinanのフォーラム
New Video: Learn from the Experts Ep 1 -- Full Algorithm Creation with Vedran Rusman
https://www.quantopian.com/posts/new-video-learn-from-the-experts-ep-1-full-algorithm-creation-with-vedran-rusman
## 質疑応答・デモ
Q.バックグラウンドやファイナンスに興味を持った理由
https://youtu.be/7PyKtUvuHNU?t=63
Q.結果が出るまでにどれぐらい掛ったのか、また、学んだスキルは?
https://youtu.be/7PyKtUvuHNU?t=240
Q.コンテストに参加する時やチャレンジに参加するときのアイディアの出し方は?
https://youtu.be/7PyKtUvuHNU?t=373
> 「売上だけでは、適切なパラメータとは言えない。インフレ率、従業員数、他社平均も考慮しなければならない」
> などなど考えて、幾重にもフィルターを組み込んだ複雑なアルゴリズムは、結局オーバーフィッティングしてしまった。
Q.チャレンジに最終的なアルゴリズムを投稿するまでに、どれだけのアルゴリズムを探し、どれぐらい、テストをするの?
https://youtu.be/7PyKtUvuHNU?t=740
> 色々複雑なものを作ったが、結局70~80%のアルゴリズムは捨てた。
## $10K Third-Party Challenge: Design a Factor for a Large US Corporate Pensionについて
使用したDataSets
https://youtu.be/7PyKtUvuHNU?t=928
FactSet Estimates - Consensus
https://www.quantopian.com/docs/data-reference/estimates_consensus
FactSet Estimates - Actuals のEPS(1株当たり純利益)
> * up (dtype float64) - The number of estimates revised up within FactSet’s consensus window for the specified slice.
> * down (dtype float64) - The number of estimates revised down within FactSet’s consensus window for the specified slice.
>
>up/downからアナリストの予測の変化をとらえる事が出来るのではないかと考えた。
デモ/仮説の検証
https://youtu.be/7PyKtUvuHNU?t=1072
1.Null records notebook を使って実際のデータのチェック
```
QTU = QTradableStocksUS()
fq1_eps_cons = fe.PeriodicConsensus.slice('EPS', 'qf', 1)
fq1_eps_cons_up = fq1_eps_cons.up.latest
fq1_eps_cons_down = fq1_eps_cons.down.latest
# Add columns for the fractions to the result.
pipe = Pipeline(
columns={
'fq1_eps_cons_up': fq1_eps_cons_up,
'fq1_eps_cons_down': fq1_eps_cons_down,
},
domain=US_EQUITIES,
screen=QTU,
)
df = run_pipeline(pipe, '2014-04-01', '2017-12-19')
# df
```
| | null_records/total_records NULL値の割合 |
| -------- | -------- |
| fq1_eps_cons_down | 0.014043 |
| fq1_eps_cons_up | 0.014043 |
NULL値も1%程度だから、使えそう
Appleについて目視確認
https://youtu.be/7PyKtUvuHNU?t=1184
>| |fq1_eps_cons_down |fq1_eps_cons_up|
>|------------------|-------|---|
>|Equity(24 [AAPL]) |38.0 |4.0|
>
>'2014-04-01'から'2017-12-19'の間、downが38.0、upが4.0。
>株価が下げる傾向にあると出ている。実際のAppleの株価も下げていたので、この考え方は使えそう。
メモ:実際のAppleの株価は2014年から2015年には上げて、その後2017年まで下げていましたので、私の聞き間違いかも。
2.Alphalens tearsheet を使って検証
https://youtu.be/7PyKtUvuHNU?t=1233
```
def make_factors():
class result(CustomFactor):
inputs = [fq1_eps_cons_up,
fq1_eps_cons_down]
window_length = 1
def compute(self, today, assets, out, up, down):
ratio_1 = up[-1] - down[-1]
out[:] = ratio_1
return {
'result': (result,1.0),
}
```
>特に重みづけなどはしていません。
メモ:ほとんど聞き取れず。また、時間かけて見てみます。
Quantopinan Contestへの実装
https://youtu.be/7PyKtUvuHNU?t=1726
結果の確認
https://youtu.be/7PyKtUvuHNU?t=1922
まとめ
https://youtu.be/7PyKtUvuHNU?t=2568