MATLAB Answers

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

33 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.

  0 Comments

Sign in to comment.

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.

  2 Comments

Vince Clementi
Vince Clementi on 25 May 2017
Great, thank you. There is no clear relationship in this data set. The chemical isotopes change over time, but not as a function of time. So I am trying to interpolate between two known chemical isotope values, and then ensemble them with a higher resolution data set of the same parameters.
So if I assign A as a shorthand for this dataset, would I just enter interpl A?
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.


Translated by