在下面的代码中,我想共享在使用LOOP的图上,当rho.AB为-0.9、0和0.9时改变的图的形状。我也想表达这个传说。请帮助我。...
mu.A = 0.075
sig.A = 0.258
sig2.A = sig.A^2
mu.B = 0.055
sig.B = 0.115
sig2.B = sig.B^2
rho.AB = -0.164
sig.AB = rho.AB*sig.A*sig.B
x.A = seq(from=0.0, to=1.0, by=0.1)
x.B = 1 - x.A
mu.p = x.A*mu.A + x.B*mu.B
sig2.p = x.A^2 * sig2.A + x.B^2 * sig2.B + 2*x.A*x.B*sig.AB
sig.p = sqrt(sig2.p)
dev.new()
cex.val = 1.5
plot(sig.p, mu.p, type="b", pch=16, cex = cex.val,
ylim=c(0.052, max(mu.p)), xlim=c(0.08, max(sig.p)+0.04),
xlab=expression(sigma[p]), ylab=expression(mu[p]), cex.lab=cex.val,