fig9_2.html 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 fig9_2</title>
  6. <meta name="keywords" content="fig9_2">
  7. <meta name="description" content="Local Regression and Likelihood, Figure 9.2.">
  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>fig9_2
  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 9.2.</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 9.2.
  27. Hardle's Motorcycle accelaration dataset.
  28. Local Variance Estimation.
  29. Author: Catherine Loader
  30. NEED: lfknots function to extract fit points.</pre></div>
  31. <!-- crossreference -->
  32. <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  33. This function calls:
  34. <ul style="list-style-image:url(../../../matlabicon.gif)">
  35. <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/predict.html" class="code" title="function [y, se] = predict(varargin)">predict</a> Interpolate a fit produced by locfit().</li></ul>
  36. This function is called by:
  37. <ul style="list-style-image:url(../../../matlabicon.gif)">
  38. <li><a href="runbook.html" class="code" title="">runbook</a> </li></ul>
  39. <!-- crossreference -->
  40. <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
  41. <div class="fragment"><pre>0001 <span class="comment">% Local Regression and Likelihood, Figure 9.2.</span>
  42. 0002 <span class="comment">%</span>
  43. 0003 <span class="comment">% Hardle's Motorcycle accelaration dataset.</span>
  44. 0004 <span class="comment">% Local Variance Estimation.</span>
  45. 0005 <span class="comment">%</span>
  46. 0006 <span class="comment">% Author: Catherine Loader</span>
  47. 0007 <span class="comment">%</span>
  48. 0008 <span class="comment">% NEED: lfknots function to extract fit points.</span>
  49. 0009
  50. 0010 load mcyc;
  51. 0011 fit = <a href="../../../chronux_2_10/locfit/m/locfit.html" class="code" title="function fit=locfit(varargin)">locfit</a>(time,<span class="string">'y'</span>,accel,<span class="string">'nn'</span>,0.1);
  52. 0012 y = -2*<a href="../../../chronux_2_10/locfit/m/predict.html" class="code" title="function [y, se] = predict(varargin)">predict</a>(fit,<span class="string">'fitp'</span>,<span class="string">'what'</span>,<span class="string">'lik'</span>);
  53. 0013 w = <a href="../../../chronux_2_10/locfit/m/predict.html" class="code" title="function [y, se] = predict(varargin)">predict</a>(fit,<span class="string">'fitp'</span>,<span class="string">'what'</span>,<span class="string">'rdf'</span>);
  54. 0014 x = fit.fit_points.evaluation_points';
  55. 0015 [x y w]
  56. 0016 fitv = <a href="../../../chronux_2_10/locfit/m/locfit.html" class="code" title="function fit=locfit(varargin)">locfit</a>(x,y,<span class="string">'weights'</span>,w,<span class="string">'family'</span>,<span class="string">'gamma'</span>,<span class="string">'nn'</span>,0.4);
  57. 0017 figure(<span class="string">'Name'</span>,<span class="string">'fig9_2: Motorcycle acceleration'</span>);
  58. 0018 <a href="../../../chronux_2_10/locfit/m/lfplot.html" class="code" title="function lfplot(varargin)">lfplot</a>(fitv);
  59. 0019 xlabel(<span class="string">'Time'</span>);
  60. 0020 ylabel(<span class="string">'Variance'</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>