Hi(adsbygoogle = window.adsbygoogle || []).push({});

I have a data set of the form:

This data set is a probability density function (PDF), and I need to be able to integrate it from 0 to some x<22. I thought that I would use an interpolating function for this. However, there is a "gap" between 4 and 20, where the PDF is zero, but an interpolating function doesn't take that into account by itself (I think). Is there a smarter way of accounting for this other than manually inserting data points?Code (Text):data = {{0, 0}, {1, 1}, {2, 2}, {3, 20}, {4, 1}, {20, 1}, {21, 1}, {22, 0}};

The second problem is that ListInterpolation only takes a 1D-list. So I can only feed it the 2nd coordinate of the data points. However, I need somehow for the interpolation function to run from 0 to 22. I don't know how to do that.

I appreciate any help and suggestions.

Best regards,

Niles.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica: Interpolation Functions

Loading...

Similar Threads - Mathematica Interpolation Functions | Date |
---|---|

Find all roots of an interpolating function in Mathematica | Jun 8, 2012 |

Working with functions defined by Interpolation in Mathematica | Oct 13, 2011 |

Mathematica: Find Maximum Value of Interpolating Function | May 25, 2011 |

Partial derivative of an interpolated function (with Mathematica) | Apr 20, 2011 |

Using interpolating functions in Mathematica | Feb 5, 2010 |

**Physics Forums - The Fusion of Science and Community**