Plotting extrapolated data using curve fitting:
Curve fitting: is the process of constructing a curve (a mathematical function) that better fits to a series of data points. This process is related to other two concepts:
• interpolation: A method of constructing new data points within the range of a known set of points----插值法
• extrapolation: A method of constructing new data points outside a known set of points.---外推法. The results of extrapolation are subject to a greater degree of uncertainty and are influenced a lot by the fitting function that is used. So it works this way: 1) First, a known set of measures is passed to the curve fitting procedure that computes a function to approximate these values. 外推法首先适用于已知的一组数据集合从而拟合出适合这些已知数据的函数;2) First, a known set of measures is passed to the curve fitting procedure that computes a function to approximate these values 然后基于此拟合函数,外推出其他数据。
这里需要介绍一个函数 zip() function: 用于将可迭代对象作为参数,将对象中对应的元素打包成一个个的元组,然后返回由这些元组组成的对象。 如果各个可迭代对象的元素个数不一致,则返回的对象长度与最短的可迭代对象相同。 利用 * 号操作符,与zip相反,进行解压。
比如说:In:data = [[2,2],[5,0],[9,5],[11,4],[12,7],[13,11],[17,12]] a = zip(*data)
out: [(2, 5, 9, 11, 12, 13, 17), (2, 0, 5, 4, 7, 11, 12)], 反之亦然
关于内插法(插值法)以及外推法拟合函数举例:
Interpolation (scipy.interpolate) — SciPy v1.1.0 Reference Guide