6
$\begingroup$

Following code plots Quantiles for a GBM process.

ranges = {.01, .05, .25, .5, .75, .95, .99};
Manipulate[
 Plot[
  Quantile[
    GeometricBrownianMotionProcess[μ, σ, 100000][t],ranges],
 {t, 1, 30},PlotRange -> {0, 1500000}], 
{μ, .07, .1}, {σ, .07, .20}]

I would like to shade the area between the ranges

.01 to .05 and .95 to .99 say lt. blue .05 to .25 and .75 to .95 say med. blue .25 to .75 say dark blue with the .5 quantile line thick black

Plot options seems to allow filling between curves using

Filling->{{1}->2} 

syntax but not sure how or if that can be applied here?

$\endgroup$

1 Answer 1

10
$\begingroup$

Note that your list spec in the Filling suggestion is the other way around. You mean

Filling->{1->{2}} 

With this style you can incorporate the filling style directly there and therefore, what you want can be written down as

ranges = {.01, .05, .25, .5, .75, .95, .99};
col =col = RGBColor[.6, .6, 1];
Manipulate[
 Plot[Evaluate@
   Quantile[
    GeometricBrownianMotionProcess[μ, σ, 100000][t], 
    ranges], {t, 1, 30}, PlotRange -> {0, 1500000}, 
  PlotStyle -> Black, 
  Filling -> {1 -> {{2}, col}, 2 -> {{3}, Darker[col]}, 
              3 -> {{5}, Darker@Darker[col]}, 5 -> {{6}, Darker[col]},
              6 -> {{7}, col}}], 
{μ, .07, .1}, {σ, .07, .20}]

Mathematica graphics

For more functions to plot, you should maybe create this specification automatically.

$\endgroup$
1
  • $\begingroup$ Thank you! Yes, had list spec reversed which didn't help ;-) $\endgroup$
    – RobK
    Commented Jan 2, 2014 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.