Question
Year    Population
1900     200507
1910     430980
1920     732016
1930    1265258
1940    1394711
1950    1451277
1960    1424815
1970    1471701
1980    1168972
1990    1203789
2000    1332650
2010    1385108

the census populations of the Bronx from 1900 to 2010 is given above. Estimate the Bronx's 2005 population using the following methods:

(a) Linear interpolation interp1 (year, population, 2005)) (b) Polynomial interpolation of just the last three censuses (poly

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Matlab code for interpolation clear all close all all year and populations year-1900 10:2010; pop [200507 430980 732016 12652 a.Linear interpolation (interpl for population of 2005) 1358879.000000 b.polynomial interpolation last three censuses (polyfi

%Matlab code for interpolation
clear all
close all
%all year and populations
year=1900:10:2010;
pop=[200507 430980 732016 1265258 1394711 1451277 1424815 1471701 1168972 1203789 1332650 1385108];

%linear interpolation interp1
pop1=interp1(year,pop,2005);
fprintf('\n\ta.Linear interpolation (interp1 for population of 2005) = %f\n',pop1)

%polynomial interpolation last three censuses
nn=length(year);
plp2=polyfit(year(10:12),pop(10:12),1);
pop2=polyval(plp2,2005);

fprintf('\n\tb.polynomial interpolation last three censuses (polyfit and polyval)=%f\n',pop2)

%polynomial interpolation all censuses

plp3=polyfit(year,pop,1);
pop3=polyval(plp3,2005);

fprintf('\n\tc.polynomial interpolation of all censuses (polyfit and polyval)=%f\n',pop3)

%2nd degree polynomial regression

plp4=polyfit(year,pop,2);
pop4=polyval(plp4,2005);
fprintf('\n\td.2nd degree polynomial regression of all censuses =%f\n',pop4)

%Cubic spline interpolation using all cencsus
pop5=spline(year,pop,2005);
fprintf('\n\te.Cubic spline interpolation using all cencsus =%f\n',pop5)

%Cubic spline interpolation using all cencsus using csape
pop6= csapi(year,pop,2005);
fprintf('\n\tf.Cubic spline interpolation using all cencsus using csape = %f\n',pop6)

%Piecewise cubic Hermite polynomial using all census
pop7 = pchip(year,pop,2005);
fprintf('\n\tg.Piecewise cubic Hermite polynomial using all census =%f\n',pop7)

%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
Year Population 1900 200507 1910 430980 1920 732016 1930 1265258 1940 1394711 1950 1451277 1960 1424815 1970 1471701 1980 1168972 1990 1203789 2000 1332650 2010...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Consider interpolating the data (x0,yo), . . . , (x64%) given by Xi | 0.1...

    2. Consider interpolating the data (x0,yo), . . . , (x64%) given by Xi | 0.1 | 0.15 | 0.2 | 0.3 | 0.35 | 0.5 | 0.75 yi 4.0 1.0 1.22.12.02.52.5 For all tasks below, please submit your MATLAB code and your plots. You can write all code in a single (a) Using MATLAB, plot the interpolating (6th degree) polynomial given these data on the domain .m-file [0.1,0.75] using the polyfit and polyval commands. To learn how to use...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT