(お知らせ)現在、記事をhttps://qiita.com/fxst24に移行中です。 目次 01 FX 12 通貨ペアの自己相関 13 通貨ペアの平均回帰 14 通貨ペアのブレイクアウト 15 通貨ペアのブレイクアウト後 02 バックテストの陥穽 01 先読みバイアス 02 データ・スヌーピング・バイアス 03 政府の市場介入によるバイアス 04 為替・株価の予測で注意すべきこと 03 パフォーマンス評価 02 週単位、月単位で勝つためのトレード数 04 リスク管理 01 2%ルール 02 最適レバレッジ 05 勝率とドローダウン期間の関係 06 季節性 01 日中効果とレート水準 07 変化率 01 Zスコアと変化率 02 トレンド期間と変化率 04 イベントとディレクション 05 ラウンドナンバーと変化率 08 ボラティリティ 02 新高値・新安値とボラティリティ 03 ラウンドナン
2015-07-05 ■PortfolioAnalyticsによるポートフォリオ最適化 R Finance ポートフォリオ最適化 + バックテストをやらないといけない時がちょくちょくある。こういう時にRmetricsに内包されたfPortfolioを使えばいいんだけど、制約を文字列で指定するのが鬱陶しいとか、risk軸に特定の指標しか使えない(?)感じでいまいち肌感に合わなかった。(weightsPlotは見やすいし、weightsSliderとかは面白いと思うけど。)自分的にはずっと前からReturnAnalytics Projectに注目していて、このprojectのコアライブラリとして位置づけられているのが、PerformanceAnalytics、PortfolioAnalytics、factorAnalyticsである。この内2つはCRANにも登録されており、ヘッジファンドとかで
極値統計 極値分布:最小値や最大値が(漸近的に)従う分布。リスク管理などで使われる。 一般極値分布(generalized extreme value distribution, GEV)は,3つのパラミターをもつ。 位置パラミター スケールパラミター 形状パラミター 形状パラミターの値によって,分布のかたちはかわる。ガンベル型,フレシェ型,ワイブル型など。それぞれ番号があって,1,2,3。これらを総じて(一般化して),一般極値分布とよぶそうだ。 Rでいろいろやるには, ismev evir など,いろいろあるようだけども,evdパッケージが良さそうだった。以下例。 #正規分布乱数で最大値のセットを再現 r<-numeric(0) for(i in 1:1000){ r[i]<-max(rnorm(100)) } fgev(r)#最尤法によるパラミター推定 #確率密度分布の描画 x<-se
2014-11-12 ■単変量/多変量GARCHモデル R Finance GARCHモデルの計算を行うRのパッケージはいくつかあるけど、その中でもRcpp実装のrugarchとrmgarchを自分はよく使っている。これまでコードをきちんと管理してなくて使う度に再実装していたので、使いたい時にいつでも使えるようにメモっておく。 概要 単変量GARCHがrugarchで多変量がrmgarchという構成になっている。これらのパッケージはAlexios Ghalanosという人物によって作成されており、使い方やモデル構成などにある程度の一貫性がある。また、この人はR/Financeとかでも発表しているので動向をチェックしておくと良いかもしれない。加えて、この人は非線形最適化パッケージRsolnpの作者でもあり、精力的にパッケージ開発を行っている。 インストール options(repos="ht
PDFと音楽のデータをPCからスマフォにコピーしているときに、昔ダウンロードして放置していた「RcompHam94」というRのパッケージを見つけた。これはJ.D.ハミルトンの名著『時系列解析』の一部のサンプルをRで再現するというものらしいので、早速試してみた。 まず以下のリンク先のzipファイルをPCの任意の場所に解凍しないでそのまま保存する。 http://dss.ucsd.edu/~jhamilto/RcompHam94_0.1.zip zipパッケージのなかにCompanion.pdfという解説のファイルがあるので参考にそれを開いておくと便利。表紙のタイトルは"An R Companion to James Hamilton's Time Series Analysis with R"。
RR Advent Calendar2012、3日目です。 Rで時系列データを扱うの便利ですよね。 Rではファイナンス系の時系列を扱うには、様々なパッケージまたはクラスが用意されています。 今回はそれらを紹介していこうかと思います。 tsクラスtsクラスとは、元々用意されている時系列クラスです。 周期(四半期とか月次)や刻み時間で構成されています。 例えば、デフォルトでセットされているtsクラスのデータは > nhtemp Time Series: Start = 1912 End = 1971 Frequency = 1 [1] 49.9 52.3 49.4 51.1 49.4 47.9 49.8 50.9 49.3 51.9 50.8 49.6 49.3 50.6 48.4 50.7 50.9 [18] 50.6 51.5 52.8 51.8 51.1 49.8 50.2 50.4 5
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く