MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Get Distribution from Interpolated Function


Hi All

    I'm trying to get a distribution from an interpolated function but with no success.

(*Creating Dist from interpolation*)
ff = Interpolation[Table[{i, 1 + RandomReal[1]}, {i, 0, 10, 1}], Method -> "Spline"];
dist = ProbabilityDistribution[ff[x], {x, 0, 10}];

 (*Plot Interpolation ok!*)
Plot[ff[x], {x, 0, 10}]

(*Plot Dist ok!*)
Plot[Evaluate@PDF[dist, x], {x, 0, 10}]

(*do not work as spected, the histogram don't have the curve format*)
randonData = RandomVariate[dist, 100000];
Histogram[randonData, {0.1}, "Probability",  PlotRange -> {{0, 10}, All}]

tks in advance
Murta



  • Prev by Date: Re: Stylesheet for input side by side with output
  • Next by Date: Remove Mesh/Grid Lines when using 'Show'
  • Previous by thread: Re: Stylesheet for input side by side with output
  • Next by thread: Re: Get Distribution from Interpolated Function