「ドローダウン機能が見つかりませんでした」というエラーが表示されます。既に PerformanceAnalytics ライブラリをロードしています。
コード:
install.packages("quantmod")
install.packages("PerformanceAnalytics")
require(quantmod)
require(PerformanceAnalytics)
getSymbols("AAPL")
AAPL.DF<-data.frame(Date=index(AAPL), coredata(AAPL[,1]))
AAPL.DF[,2]<-ROC(AAPL.DF[,2])
colnames(AAPL.DF)<-c("Date","rtn")
dailyRtn <- as.numeric(substring(AAPL.DF[,"rtn"],1,nchar(as.character(AAPL.DF[,"rtn"]))-1))
dailyDD <- as.vector(Drawdowns(dailyRtn/100))
以下はコンソールウィンドウのo/pです
> getSymbols("AAPL")
[1] "AAPL"
Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
downloaded length 109721 != reported length 200
> AAPL.DF<-data.frame(Date=index(AAPL), coredata(AAPL[,1]))
> AAPL.DF[,2]<-ROC(AAPL.DF[,2])
> colnames(AAPL.DF)<-c("Date","rtn")
> dailyRtn <- as.numeric(substring(AAPL.DF[,"rtn"],1,nchar(as.character(AAPL.DF[,"rtn"]))-1))
> dailyDD <- as.vector(Drawdowns(dailyRtn/100))
Error in as.vector(Drawdowns(dailyRtn/100)) :
could not find function "Drawdowns"
PerformanceAnalytics ライブラリを正常にインストールしてロードしたのに、Drawdowns function could not be found のエラー メッセージが表示される理由がわかりません