ipolate |

Fill in missing values, or NAs, within a series by interpolating from values that are not missing.

Syntax

series_name.ipolate(options) series_name

Options

type = key | Specify the interpolation method. key is either “lin” (linear, default), “log” (log-linear), “cs” (Cardinal spline), “cr” (Catmull-Rom spline), “cb” (Cubic spline), “lcs” (log-cardinal spline), “lcr” (log-Catmull-Rom spline), or “lcb” (log-cubic spline). |

tension = number | Sets the tension parameter for the Cardinal spline method of interpolation. number should be a number between 0 and 1. |

f = arg (default = “actual”) | Out-of-sample fill behavior: “actual” (fill observations outside the interpolated sample with values from the source series). “na” (fill observations outside the sample with missing values” |

prompt | Force the dialog to appear from within a program. |

Examples

The following lines interpolate the missing values of series X1 using linear interpolation, and store the new interpolated series with a name X_INTER:

x1.ipolate x_inter

This line performs the same interpolation, but this time using the Cardinal spline, with a tension value of 0.8:

x1.ipolate(type=cs, tension=0.8) x_inter

Cross-references

See “Interpolate” for discussion.