Skip to content

How to plot a shifted Gamma distribution

3 messages · Rodrigo Cesar Silva, (Ted Harding), Greg Snow

#
On 13-Feb-2014 15:30:43 Rodrigo Cesar Silva wrote:
Mean = shape*scale + x0 = 76.23
If all that is happening is that the distribution is the same as that
of a Gamma distribution with origin at 0, but simply shifted to the
right by an amount x0 (though I am wondering what context this could
arise in), then the commands

  x <- seq(from=0, to=100, length.out=100)
  x0 <- 65.44945
  plot(x+x0, dgamma(x, shape=2, scale=5.390275),
       main="Gamma",type='l')

will produce such a plot. However, I wonder if you have correctly
expressed the problem!

Ted.
-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 13-Feb-2014  Time: 17:27:29
This message was sent by XFMail
#
It is not hard to write your own function:

dsgamma <- function(x, x0=0, ...) {
  dgamma(x-x0,...)
}

and similar for the other functions.

You might also want to look at ?curve for plotting (your plotting is
fine, curve is just another option).

On Thu, Feb 13, 2014 at 8:30 AM, Rodrigo Cesar Silva
<rodrigocesar.jo at gmail.com> wrote: