extrapolation from correlated data

조회 수: 5 (최근 30일)
Fan Hu
Fan Hu 2019년 12월 2일
답변: Image Analyst 2019년 12월 3일
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

채택된 답변

Adam Danz
Adam Danz 2019년 12월 2일
Hint:
If you're data are linear, the regression slope is the covariance between X and Y divided by the variance of X
m = cov(x,y)/var(x);
where a point (x0) would fall along the line at
y0 = m(2,1)*x0
assuming the y-intercept is at 0.
  댓글 수: 4
Fan Hu
Fan Hu 2019년 12월 3일
Screen Shot 2019-12-03 at 11.42.38 am.png
Adam Danz
Adam Danz 2019년 12월 3일
편집: Adam Danz 2019년 12월 3일
Without knowing anything about the data, I see three trends that I'm not certain of.
  1. Both data sets (orange and blue) seem to be noise that varies about a flat line (slope=0)
  2. The difference between the trends is a vertical offset.
  3. The blue seems to have a slightly larger modulation amplitude.
To estimate the vertical offset, I'd average the difference between the blue and orange.
vOffset = mean(orange - blue)
which should be a postive number (mayby around 300)
To estimate the gain in modulation, you could try
gain = mean(diff(blue)./diff(orange))
assuming the blue and orange data have the same number of data points. This should also be a positive value.
Given a new value of orange, the blue would be something like
% b0 is the new blue value
% g0 is the given orange value
b0 = g0*gain + vOffset
Of course none of this has been tested so you might have to play around with it.
You may also want to add noise to the estimate. Otherwise all of your estimate values will have a correlation of 1 but your real data is obviously not as highly correlated.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2019년 12월 3일
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?

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by