How do I interpolate missing data points in one data set so I can create an ensemble with multiple data sets?

6 views (last 30 days)
Vince Clementi
Vince Clementi on 25 May 2017
Commented: Star Strider on 26 May 2017
I need to interpolate missing data points in an x,y data set (Age (ka), chemical value). I will need to interpolate chemical values between two given values at times that match with another data set. Ultimately, I will average out these values across multiple data sets in an ensemble.
What function will I need to use, or how would I go about the interpolation step. (If anyone has advice on how to average across multiple data sets, that would also be appreciated.) Thanks.

Answers (1)

Star Strider
Star Strider on 25 May 2017
The method you use depends on the data you have. If the ‘chemical value’ changes according to a known function of time (for example an exponential decay of a radioactive substance), it would probably be best to do a nonlinear (exponential) fit to your known data and then interpolate using the estimated parameters.
If the change is linear, or if there is no clear, known relationship, I would use the interp1 function with the appropriate method.
Star Strider
Star Strider on 26 May 2017
Well, no. The time vector is the independent variable and the isotope ratio (guessing here) is the dependent variable. So if you have vectors for time ‘t’ and isotope ratio ‘IR’, and interpolation time ‘ti’ (single values or a vector), the syntax would be:
IRi = interp1(t, IR, ti);
where ‘IRi’ is the interpolated isotope ratio. Choose the appropriate method depending on your data. Plot your data first, and also the interpolated values, to be certain they make sense.
You can extrapolate with the interpolation functions, but I advise against that because of the nature of your data. Extrapolated values without specifying that option will (appropriately) be NaN.

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by