Message Boards Message Boards

gamma distribution

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 10 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}] // 
   Flatten;

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
Attachments
Remove
or Discard

Group Abstract Group Abstract