aicplot.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/REC-html40/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Description of aicplot</title>
  6. <meta name="keywords" content="aicplot">
  7. <meta name="description" content="">
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  9. <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  10. <meta name="robots" content="index, follow">
  11. <link type="text/css" rel="stylesheet" href="../../../m2html.css">
  12. <script type="text/javascript">
  13. if (top.frames.length == 0) { top.location = "../../../index.html"; };
  14. </script>
  15. </head>
  16. <body>
  17. <a name="_top"></a>
  18. <!-- ../../menu.html chronux_2_10 --><!-- # locfit --><!-- menu.html m -->
  19. <h1>aicplot
  20. </h1>
  21. <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  22. <div class="box"><strong></strong></div>
  23. <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  24. <div class="box"><strong>function g=aicplot(alpha,varargin) </strong></div>
  25. <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  26. <div class="fragment"><pre class="comment">
  27. Computes and plots the -2*AIC
  28. for local fits with different smoothing parameters.
  29. The first argument to aicplot(), alpha, should be a matrix with one
  30. or two columns (first column = nearest neighbor component, second
  31. column = constant component). Each row of this matrix is, in turn,
  32. passed as the 'alpha' argument to aic() (and locfit()). The results
  33. are stored in a matrix, and aic score ploted against the degrees of
  34. freedom.</pre></div>
  35. <!-- crossreference -->
  36. <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  37. This function calls:
  38. <ul style="list-style-image:url(../../../matlabicon.gif)">
  39. <li><a href="aic.html" class="code" title="function g=aic(varargin)">aic</a> </li></ul>
  40. This function is called by:
  41. <ul style="list-style-image:url(../../../matlabicon.gif)">
  42. <li><a href="../../../chronux_2_10/locfit/Book/fig4_4.html" class="code" title="">fig4_4</a> Local Regression and Likelihood, Figure 4.4.</li></ul>
  43. <!-- crossreference -->
  44. <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  45. <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function g=aicplot(alpha,varargin)</a>
  46. 0002 <span class="comment">%</span>
  47. 0003 <span class="comment">% Computes and plots the -2*AIC</span>
  48. 0004 <span class="comment">% for local fits with different smoothing parameters.</span>
  49. 0005 <span class="comment">%</span>
  50. 0006 <span class="comment">% The first argument to aicplot(), alpha, should be a matrix with one</span>
  51. 0007 <span class="comment">% or two columns (first column = nearest neighbor component, second</span>
  52. 0008 <span class="comment">% column = constant component). Each row of this matrix is, in turn,</span>
  53. 0009 <span class="comment">% passed as the 'alpha' argument to aic() (and locfit()). The results</span>
  54. 0010 <span class="comment">% are stored in a matrix, and aic score ploted against the degrees of</span>
  55. 0011 <span class="comment">% freedom.</span>
  56. 0012
  57. 0013 k = size(alpha,1);
  58. 0014 z = zeros(k,4);
  59. 0015
  60. 0016 <span class="keyword">for</span> i=1:k
  61. 0017 z(i,:) = <a href="aic.html" class="code" title="function g=aic(varargin)">aic</a>(varargin{:},<span class="string">'alpha'</span>,alpha(i,:));
  62. 0018 <span class="keyword">end</span>;
  63. 0019
  64. 0020 plot(z(:,3),z(:,4));
  65. 0021 xlabel(<span class="string">'Fitted DF'</span>);
  66. 0022 ylabel(<span class="string">'AIC'</span>);
  67. 0023
  68. 0024 g = [alpha z];
  69. 0025 <span class="keyword">return</span>;</pre></div>
  70. <hr><address>Generated on Fri 12-Aug-2011 11:36:15 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
  71. </body>
  72. </html>