How to extrapolate the fit line and uncertainty bands?
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Descriptive Statistics and Visualization 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!