Message Boards Message Boards


gamma distribution

Posted 9 years ago
2 Replies
0 Total Likes

I am working with this but instead of giving me the points it says graphics complex and i am not able to get the results in The form of table. Can anyoone suggest a way out?

p = Plot[Evaluate@
   Table[PDF[GammaDistribution[alpha, beta], 
     x], {alpha, {0.31867}}, {beta, {268470}}], {x, 0, 50000}, 
  Filling -> Axis]
data = (InputForm@p)[[1, 1, 1, 3, 2, 1]] 
2 Replies

Try this to see if it works for you

  p = Plot[Evaluate@Table[PDF[GammaDistribution[alpha, beta], x], {alpha, {0.31867}}, {beta, {268470}}], {x, 0, 50000}, Filling -> Axis]

now in new cell type

  data = Cases[Normal[p], x_Line :> First[x], Infinity];
  data = Flatten[data, 1];
  TableForm[data[[1 ;; 10]]]  (*show first x,y points, etc...*)
POSTED BY: Nasser M. Abbasi
Posted 9 years ago

This works. The Table output is flattened to a list of points. ListPlot (rather than Plot) is used to plot the result.

data = Table[
    PDF[GammaDistribution[alpha, beta], 
     x], {alpha, {0.31867}}, {beta, {268470}}, {x, 0, 50000}] // 

ListPlot[data, Filling -> Axis]
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract