format short
format compact
echo on
% Read in Alaskan Tree Data
% http://www.lter.uaf.edu/ascii/files/230_tree_biomass_data.csv
% Documented in
% http://tinyurl.com/2wc6rf
% Translated to .txt format
%
fid = fopen('TreeNums1.txt');
TD = textscan(fid, '%f %f %f %f', 200);
fclose(fid);
figure(1);
plot(TD{:,1},TD{:,3}, 'rx');
figure(2)
plot(TD{:,1}.^2, TD{:,3}, 'rd');
figure(3);
plot(TD{:,2},TD{:,3}, 'bo');
figure(4)
plot(TD{:,2}.*(TD{:,1}.^2), TD{:,3}, 'bx');

w = TD{:,3};
DH = [ones(length(w),1) TD{:,1} TD{:,2}];
H = [ones(length(w),1) TD{:,2}];
[B, bint, R, Rint, Stats] = regress(w,DH(:,1:2));
[B, bint, R, Rint, Stats] = regress(w,H);
[B, bint, R, Rint, Stats] = regress(w,DH);

NDH = [ones(length(w),1) DH(:,3).*(DH(:,2).^2)];
[B, bint, R, Rint, Stats] = regress(w,NDH);
