Sha256: 5fb4b572c2b068ac7011eeb97e4446d41dd8bfeb0e56fee74ad665f236fe9e2b
Contents?: true
Size: 1.7 KB
Versions: 4
Compression:
Stored size: 1.7 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>sd (RFuzz::Sampler)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre> <span class="ruby-comment cmt"># File lib/rfuzz/stats.rb, line 79</span> 79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sd</span> 80: <span class="ruby-comment cmt"># (sqrt( ((s).sumsq - ( (s).sum * (s).sum / (s).n)) / ((s).n-1) ))</span> 81: <span class="ruby-keyword kw">begin</span> 82: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>( (<span class="ruby-ivar">@sumsq</span> <span class="ruby-operator">-</span> ( <span class="ruby-ivar">@sum</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@sum</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@n</span>)) <span class="ruby-operator">/</span> (<span class="ruby-ivar">@n</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>) ) 83: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EDOM</span> 84: <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span><span class="ruby-value">.0</span> 85: <span class="ruby-keyword kw">end</span> 86: <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
4 entries across 4 versions & 1 rubygems