extrapolation from correlated data
Show older comments
Hi,
I've got a bit of a problem.
I've got 2 data sets, which are very highly correlated with one another. Knowing the future values of one set of data, I would like to extrapolate the other set. How would I go about doing this
Accepted Answer
More Answers (1)
Image Analyst
on 3 Dec 2019
Can you attach some data?
If the values are correlated, how about if you scatter one versus the other, then fit a line between them? Now if you have the future values of set #1, y1, then you must have the future times, tFuture. So what if you just extrapolate them? You can add some noise if you want.
coefficients = polyfit(y1, y2, 1); % Fit a line through the scatterplot ov y2 vs. y1.
y1Future = y1(tFuture); % Get the y1 values at the future times.
y2Future = polyval(coefficients, y1Future); % Predict the y2 values when y1 are these values.
plot(tFuture, y2Future, 'ms-'); % Plot the y2Future values vs. time.
That's just off the top of my head. Can you attach some data so we can see if it seems reasonable?
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
