How to linear extrapolate?
21 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146904/image.jpeg)
Hi,
I have a set of x and y data as shown in image. I am looking to find the y-intercept (i.e, when x=0) that is outside the range of data. My graph is roughly linear, in fact, towards the left it is linear. What is the best approach to extrapolate this plot to x=0?
(Edit: plot on the right is the one to be extrapolated) Thanks in advance.
0 个评论
采纳的回答
Star Strider
2015-1-24
You haven’t uploaded your image yet. That and a .mat file of your data would help.
It is generally not advisable to extrapolate beyond the region of fit. You have no idea what your data are beyond what you have.
However, if you know the process that produced your data and you have a good mathematical model of it that you know extends to x=0, you can estimate it at x=0.
2 个评论
Star Strider
2015-1-26
The plot on the left seems to have an established y-intercept at 1 (log10(1) = 0).
If you must extrapolate, for the plot on the right, I would regress x less than x=4 (log10(4)=0.6), and y less than y=1.5E-15 (log10(1.5E-15)=-14.8), using polyfit and taking log10 of both x and y:
B = polyfit(log10(x), log10(y), 1)
The output will yield ‘B(1)’ as the slope, and ‘B(2)’ as the intercept, in the context of:
log10(y) = B(1)*log10(x) + B(2)
y = 10^B(2) * x^B(1)
if my maths are correct (late evening here).
I again caution about the inherent uncertainty of extrapolating beyond your available data. That it appears linear in the left-most region of the plot does not in any way suggest that it actually is linear from x=1 (the y-intercept on the log-log plot), to x=2, where your data end. The ‘linearity’ you see could simply be an artifact of the log-log plot itself.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!