/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.math.stats"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.math.stats"]){_4._hasResource["dojox.math.stats"]=true;_4.provide("dojox.math.stats");_4.getObject("math.stats",true,_6);(function(){var st=_6.math.stats;_4.mixin(st,{sd:function(a){return Math.sqrt(st.variance(a));},variance:function(a){var _7=0,_8=0;_4.forEach(a,function(_9){_7+=_9;_8+=Math.pow(_9,2);});return (_8/a.length)-Math.pow(_7/a.length,2);},bestFit:function(a,_a,_b){_a=_a||"x",_b=_b||"y";if(a[0]!==undefined&&typeof (a[0])=="number"){a=_4.map(a,function(_c,_d){return {x:_d,y:_c};});}var sx=0,sy=0,_e=0,_f=0,sxy=0,stt=0,sts=0,n=a.length,t;for(var i=0;i<n;i++){sx+=a[i][_a];sy+=a[i][_b];_e+=Math.pow(a[i][_a],2);_f+=Math.pow(a[i][_b],2);sxy+=a[i][_a]*a[i][_b];}for(i=0;i<n;i++){t=a[i][_a]-sx/n;stt+=t*t;sts+=t*a[i][_b];}var _10=sts/(stt||1);var d=Math.sqrt((_e-Math.pow(sx,2)/n)*(_f-Math.pow(sy,2)/n));if(d===0){throw new Error("dojox.math.stats.bestFit: the denominator for Pearson's R is 0.");}var r=(sxy-(sx*sy/n))/d;var r2=Math.pow(r,2);if(_10<0){r=-r;}return {slope:_10,intercept:(sy-sx*_10)/(n||1),r:r,r2:r2};},forecast:function(a,x,_11,_12){var fit=st.bestFit(a,_11,_12);return (fit.slope*x)+fit.intercept;},mean:function(a){var t=0;_4.forEach(a,function(v){t+=v;});return t/Math.max(a.length,1);},min:function(a){return Math.min.apply(null,a);},max:function(a){return Math.max.apply(null,a);},median:function(a){var t=a.slice(0).sort(function(a,b){return a-b;});return (t[Math.floor(a.length/2)]+t[Math.ceil(a.length/2)])/2;},mode:function(a){var o={},r=0,m=Number.MIN_VALUE;_4.forEach(a,function(v){(o[v]!==undefined)?o[v]++:o[v]=1;});for(var p in o){if(m<o[p]){m=o[p],r=p;}}return r;},sum:function(a){var sum=0;_4.forEach(a,function(n){sum+=n;});return sum;},approxLin:function(a,pos){var p=pos*(a.length-1),t=Math.ceil(p),f=t-1;if(f<0){return a[0];}if(t>=a.length){return a[a.length-1];}return a[f]*(t-p)+a[t]*(p-f);},summary:function(a,_13){if(!_13){a=a.slice(0);a.sort(function(a,b){return a-b;});}var l=st.approxLin,_14={min:a[0],p25:l(a,0.25),med:l(a,0.5),p75:l(a,0.75),max:a[a.length-1],p10:l(a,0.1),p90:l(a,0.9)};return _14;}});})();}}};});