ページ

2011年4月29日金曜日

三頭山に行ってきた

今日から最大10連休の大型ゴールデンウィークがスタートしますが、今日は三頭山に行ってきました!!
下働きをさせていただいている研究者のお手伝い(!?冷やかしかな!?)のため

しかし、いい季節になりましたね〜
スミレが見頃を迎えています

また植物のお勉強が始まります

エイザンスミレ Viola eizanensis (Makino) Makino
2011年4月29日三頭山


ナガバノスミレサイシン Viola bissetii Maxim.
2011年4月29日三頭山

ハリモミ Picea torano (Siebold ex K.Koch) Koehne.
2011年4月29日三頭山

2011年4月12日火曜日

BAM

しばらく自粛していましたが,投稿を再開します。

今日はBAMについて

Rで一般化加法モデル(Generalized Additive Model)を使うにはmgcvを使うことが多いと思う。
mgcvでGAMを行うには,関数gam()を使うが,これとは別に関数bam()もある。


ヘルプページによると
Generalized additive models for very large datasets
とある。


詳しく説明を読むと
Description:

Fits a generalized additive model (GAM) to a very large data set,the term `GAM' being taken to include any quadratically penalized GLM. The degree of smoothness of model terms is estimated as part of fitting. In use the function is much like ‘gam’, except that the numerical methods are designed for datasets containing upwards of several tens of thousands of data. The advantage of ‘bam’ is much lower memory footprint than ‘gam’, but it can also be much faster, for large datasets.
gamとは推定方法が異なるが,どうも計算が速いらしい。


実際に使ってみると確かに速い。
(もう少し確認が必要だが...)結果はほとんど変わらないように見える。
自分のデータ(約7000件)では,これまで80秒ぐらいかかっていたが,約半分ぐらいまで短くなる。


もし大規模なデータを使っていて,さらにMuMInでモデル選択をしたい方はお試しあれ。
ただバージョンによってcontrolの指定方法が異なるので要注意。

1ヵ月

原発事故と余震でまだまだ余談を許さない状況ですが,震災からようやく1ヵ月が経ちました。
被災された方に心からお見舞い申し上げるとともに,一日も早い復興を心より祈っています。