fig6_3.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 fig6_3</title>
  6. <meta name="keywords" content="fig6_3">
  7. <meta name="description" content="Local Regression and Likelihood, Figure 6.3.">
  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 Book -->
  19. <h1>fig6_3
  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>Local Regression and Likelihood, Figure 6.3.</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>This is a script file. </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"> Local Regression and Likelihood, Figure 6.3.
  27. Author: Catherine Loader
  28. Local smooth of CO2 dataset. Estimate the main trend,
  29. then use periodic smoothing of the residuals to estimate
  30. the annual effect.
  31. A periodic smooth is specified by 'style','a'.
  32. Note that year+month/12 scales the predictor to have a period
  33. of 1. The 'scale' argument to locfit() is period/(2*pi).</pre></div>
  34. <!-- crossreference -->
  35. <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  36. This function calls:
  37. <ul style="list-style-image:url(../../../matlabicon.gif)">
  38. <li><a href="../../../chronux_2_10/locfit/m/lfplot.html" class="code" title="function lfplot(varargin)">lfplot</a> Plot (for one or two dimensions) a locfit() fit.</li><li><a href="../../../chronux_2_10/locfit/m/locfit.html" class="code" title="function fit=locfit(varargin)">locfit</a> Smoothing noisy data using Local Regression and Likelihood.</li><li><a href="../../../chronux_2_10/locfit/m/residuals.html" class="code" title="function y = residuals(fit,type)">residuals</a> Residuals (or a few other things) from a locfit() fit.</li></ul>
  39. This function is called by:
  40. <ul style="list-style-image:url(../../../matlabicon.gif)">
  41. <li><a href="runbook.html" class="code" title="">runbook</a> </li></ul>
  42. <!-- crossreference -->
  43. <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  44. <div class="fragment"><pre>0001 <span class="comment">% Local Regression and Likelihood, Figure 6.3.</span>
  45. 0002 <span class="comment">% Author: Catherine Loader</span>
  46. 0003 <span class="comment">%</span>
  47. 0004 <span class="comment">% Local smooth of CO2 dataset. Estimate the main trend,</span>
  48. 0005 <span class="comment">% then use periodic smoothing of the residuals to estimate</span>
  49. 0006 <span class="comment">% the annual effect.</span>
  50. 0007 <span class="comment">%</span>
  51. 0008 <span class="comment">% A periodic smooth is specified by 'style','a'.</span>
  52. 0009 <span class="comment">% Note that year+month/12 scales the predictor to have a period</span>
  53. 0010 <span class="comment">% of 1. The 'scale' argument to locfit() is period/(2*pi).</span>
  54. 0011
  55. 0012 load co2;
  56. 0013 fit1 = <a href="../../../chronux_2_10/locfit/m/locfit.html" class="code" title="function fit=locfit(varargin)">locfit</a>(year+month/12,co2,<span class="string">'alpha'</span>,0.5,<span class="string">'deg'</span>,1);
  57. 0014 res = <a href="../../../chronux_2_10/locfit/m/residuals.html" class="code" title="function y = residuals(fit,type)">residuals</a>(fit1);
  58. 0015 fit2 = <a href="../../../chronux_2_10/locfit/m/locfit.html" class="code" title="function fit=locfit(varargin)">locfit</a>(year+month/12,res,<span class="string">'alpha'</span>,[0 2],<span class="string">'style'</span>,<span class="string">'a'</span>,<span class="string">'scale'</span>,1/(2*pi));
  59. 0016 figure(<span class="string">'Name'</span>,<span class="string">'fig6_3: CO2 Dataset: Local smoothing'</span> );
  60. 0017 <a href="../../../chronux_2_10/locfit/m/lfplot.html" class="code" title="function lfplot(varargin)">lfplot</a>(fit2,<span class="string">'nodata'</span>);</pre></div>
  61. <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>
  62. </body>
  63. </html>