# VAR模型风险计量分析简单整理

data1=read_excel("检验（0.2，0）.xlsx")
str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

str(data1)
data=data1[1:3]
data1=data[-2]

y=data1$每日收益率 t=data1$时间
str(data)
length(y)
mean(y)
mean.fun <- function(d, i)
{    m <- mean(y[i])
n <- sd(y[i])
v <- (n-1)*var(y[i])/n^2
return(c(m,n,v))
}

mean.fun (y,1:500)

air.boot <- boot(data, mean.fun, R = 500)
print(air.boot)

https://blog.csdn.net/yujunbeta/article/details/24142545

https://blog.csdn.net/yujunbeta/article/details/9255965

https://blog.csdn.net/weixin_43452592/article/details/83893349

http://blog.sina.com.cn/s/blog_5cd2f1e201019dz2.html

https://blog.csdn.net/u013421629/article/details/73124004【直方图添加曲线】
https://blog.csdn.net/yucan1001/article/details/13169687
https://blog.csdn.net/it_beecoder/article/details/83090689

https://blog.csdn.net/kmd8d5r/article/details/79366648

par(mar=c(5,5,4,5)+0.1)
bar <- barplot(absolute,ylab="总数",col="skyblue",col.axis="skyblue",col.lab="skyblue")
mtext(LETTERS[1:8],side=1,line=1,at=bar,col="black")
#mtext(" ",side=1,line=3,col="black")
par(new=T)
plot(bar,cum_per,axes=F,xlab="",ylab="",col="red",type="b")
axis(4,col="red",col.ticks="red",col.axis="red")
mtext("累计百分比%",side=4,line=3,col="red")
title(main = '帕累托图')


http://www.cnblogs.com/wuzhitj/p/4363848.html 【累积分布函数：累计概率分布，将多个利润用折线图表示】

https://blog.csdn.net/PyDarren/article/details/79850368

https://zhuanlan.zhihu.com/p/26517940

http://www.sohu.com/a/67508574_116235

https://weibo.com/p/230418659ec1310102wnes

https://blog.csdn.net/qq_23851075/article/details/52052449

12-12
09-29 3358

06-26 2万+
04-30 5083
10-18 1万+
04-24 5657
08-26
11-21 1万+
12-04
07-04 1600