stockdata<-read.csv(choose.file(),header=TRUE)
close<-stockdata$Close returns<-(close[1:(length(close)-1)]-close[2:length(close)])/close[2:length(close)]
library(PerformanceAnalytics)
Var99<-(VaR(returns,p=0.99,method="historical")*100)
Var95<-(VaR(returns,p=0.95, method = "historical")*100)
var90<-(VaR(returns,p=0.90,method = "historical")*100)
varmatrix<-cbind(var90,Var95,Var99)
colnames(varmatrix)<-c("var90","Var95","Var99")
varmatrix
write.csv(varmatrix,file = "VAR of stock")
barplot(varmatrix,ylab = "Risk in %",ylim = c(-1:-2))
The main motive of the Big data solutions companies is to spread the knowledge so that they can give more big data engineers to the world.
ReplyDelete