How to extrapolate the fit line and uncertainty bands?

2 次查看(过去 30 天)
I used the function 'fit' and 'predint' to plot the data, fit line and 95% bound from the year 1965 to 1990 as below. How can I extrapolate these lines to the year 2100?
x=[1:27]';
for i=1:12
subplot(3,4,i);
y_var=RCM_Var_time{i,1}(:,1);
fitresult=fit(x,y_var,'poly1');
a=coeffvalues(fitresult);
p11=predint(fitresult,x,0.95,'functional','on');
if (a(1,1)>0)
plot(fitresult,'b',x,y_var,'.k');
else
plot(fitresult,'r',x,y_var,'.k');
end
hold on;
plot(x,p11,'m-.');
hold on;
set(gca,'XTick',1:5:30);
set(gca,'XTickLabel',{1965:5:1995});
set(gca,'YTick',0:0.5:3.5);
set(gca, 'YLim', [0 3.5])
title([Month{1,i}]);
xlabel([]);
ylabel('Q4 Variance');
legend off;
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by