comparison rDiff/src/locfit/m/aicplot.m @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0f80a5141704
1 function g=aicplot(alpha,varargin)
2 %
3 % Computes and plots the -2*AIC
4 % for local fits with different smoothing parameters.
5 %
6 % The first argument to aicplot(), alpha, should be a matrix with one
7 % or two columns (first column = nearest neighbor component, second
8 % column = constant component). Each row of this matrix is, in turn,
9 % passed as the 'alpha' argument to aic() (and locfit()). The results
10 % are stored in a matrix, and aic score ploted against the degrees of
11 % freedom.
12
13 k = size(alpha,1);
14 z = zeros(k,4);
15
16 for i=1:k
17 z(i,:) = aic(varargin{:},'alpha',alpha(i,:));
18 end;
19
20 plot(z(:,3),z(:,4));
21 xlabel('Fitted DF');
22 ylabel('AIC');
23
24 g = [alpha z];
25 return;