Plotting confidence intervals-lines in one graph with means inside
Afficher commentaires plus anciens
I need to plot 12 confidence intervals in one graph using MATLAB and each with mean marked inside. Any ideas how I can do it?
I am using a code below for computing confidence intervals:
S=10; E=9; sigma=0.1; r=0.06; T=1;
Dt=1e-3; N=T/Dt; M=2^17;
V = zeros(M,1);
for i=1:M
Sfinal = S*exp((r-0.5*sigma^2)*T+sigma*sqrt(T)*randn);
V(i)=exp(-r*T)*max(Sfinal-E,0);
end
aM=mean(V); bM=std(V);
conf=[aM-1.96*bM/sqrt(M),aM+1.96*bM/sqrt(M)]
You can find an example of what I need in the following picture:

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Errorbars dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
