[R-SIG-Finance] Bloomberg

Alexander Wurzer alexander.wurzer at fin4cast.com
Mon Aug 27 09:26:18 CEST 2007


Hi,

this is a really good solution for my problem!

Thanks a lot!

Alex

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Dan Davison
Sent: Friday, 24. August 2007 13:11
To: Thomas Steiner
Cc: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Bloomberg


On Thu, Aug 23, 2007 at 10:38:00PM +0200, Thomas Steiner wrote:
> > (1) http://commons.wikimedia.org/wiki/Image:Quantile_graph.png
> > The R code is included at the bottom of the page.
> 
> :) my image :))
> but it's really very "pseudo".

This approach does give a good pure R solution doesn't it? e.g. something
like

gradient.under.graph <- function(n=100, y0=0, mu=-0.7, sd=1, nrects=1000) {
    y <- y0 + cumsum(rnorm(n, mean=mu, sd=sd))
    plot(NA, xlim=c(1,n), ylim=range(y), bty="n")
    col <- colorRampPalette(colors=c("dark blue","light blue"))(nrects)
    incr <- (max(y) - min(y)) / nrects
    rect(0, seq(min(y), max(y)-incr, length=nrects), n, seq(min(y)+incr,
max(y), length=nrects), col=col, border=NA)
    polygon(x=c(1,1:n,n), y=c(max(y), y, max(y)), col="white", border=NULL)
}

is not slow.

Dan




> Thomas
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. 
-- If you want to post, subscribe first.



More information about the R-SIG-Finance mailing list