tags:

views:

116

answers:

3

Hi!

I need to plot, in 3D, a set of densities associated to a time series. More precisely, I would like to be able in R to build an image close to this example alt text

This image is taken from [1]. The transparency plays an important role as let us see the trajectory of the "measures" in the x-y plane.

Any help will be greatly appreciated.

[1]: Juban and Kariniotakis, "Uncertainty Estimation of Wind Power Forecasts", presentation at EWEC 2008 - 01 April - Brussels, Belgium. (I can't post the link, google will help interested readers).

+3  A: 

In 1996 I wrote a paper (published in JCGS) with a figure very similar to that but without the transparency. See http://robjhyndman.com/papers/estimating-and-visualizing-conditional-densities/ for the details. The plotting function is implemented in the R package hdrcde available on CRAN. The package contains some examples in the help files. You should be able to adapt my code to add the transparency.

Rob Hyndman
Thanks!I'm looking into your code, but I think I need to master the persp function first... doesn't look as an easy task!
José Luis
+4  A: 

This is pretty, but is it really useful? Even with the transparency, it is very hard to track and compare different trajectories.

hadley
Yes it is useful. The trick is not to track or compare trajectories, but to have a visual estimation of the uncertainty of a forecaster. The usefulness concept is very context dependent, and in my context such a pretty graph can be a very useful graph.
José Luis
I am skeptical that this is the best plot for any task - the perceptual decoding of a rotated 3d plot like this is extremely difficult, not to mention the problems with foreground objects obscuring background objects.
hadley
Would you suggest any alternative to display this information?
José Luis
The third dimension (z-axis in this case) could be color. In your plot, it seems that color and height are conveying the same variable.
Vince
I would think facetted line plots would be the way to go.
hadley
+1  A: 

This is how far I got thanks to Rob's hint. I used persp() to create an empty plot and added polygons and lines to it:

alt text

However, it is not as pretty as the original one... :(

José Luis