Home > chronux_1_50 > locfit > aicplot.m

aicplot

PURPOSE ^

Computes and plots the -2*AIC

SYNOPSIS ^

function g=aicplot(alpha,varargin)

DESCRIPTION ^

 Computes and plots the -2*AIC
 for local fits with different smoothing parameters.

 Usage: g=aicplot(alpha,varargin)

 The first argument to aicplot(), alpha, should be a matrix with one
 or two columns (first column = nearest neighbor component, second
 column = constant component). Each row of this matrix is, in turn,
 passed as the 'alpha' argument to aic() (and locfit()). The results
 are stored in a matrix, and aic score ploted against the degrees of
 freedom.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function g=aicplot(alpha,varargin)
0002 % Computes and plots the -2*AIC
0003 % for local fits with different smoothing parameters.
0004 %
0005 % Usage: g=aicplot(alpha,varargin)
0006 %
0007 % The first argument to aicplot(), alpha, should be a matrix with one
0008 % or two columns (first column = nearest neighbor component, second
0009 % column = constant component). Each row of this matrix is, in turn,
0010 % passed as the 'alpha' argument to aic() (and locfit()). The results
0011 % are stored in a matrix, and aic score ploted against the degrees of
0012 % freedom.
0013 
0014 k = size(alpha,1);
0015 z = zeros(k,4);
0016 
0017 for i=1:k
0018   z(i,:) = aic(varargin{:},'alpha',alpha(i,:));
0019 end;
0020 
0021 plot(z(:,3),z(:,4));
0022 xlabel('Fitted DF');
0023 ylabel('AIC');
0024 
0025 g = [alpha z];
0026 return;

Generated on Mon 09-Oct-2006 00:54:52 by m2html © 2003