extrapolation from correlated data
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Fan Hu
le 2 Déc 2019
Réponse apportée : Image Analyst
le 3 Déc 2019
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
0 commentaires
Réponse acceptée
Adam Danz
le 2 Déc 2019
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 commentaires
Adam Danz
le 3 Déc 2019
Modifié(e) : Adam Danz
le 3 Déc 2019
Without knowing anything about the data, I see three trends that I'm not certain of.
- Both data sets (orange and blue) seem to be noise that varies about a flat line (slope=0)
- The difference between the trends is a vertical offset.
- 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.
Plus de réponses (1)
Image Analyst
le 3 Déc 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?
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

