亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? statistics.java

?? java程序包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

        for (int counter = 0; counter < data.length; counter++) {
            double diff = data[counter] - avg;
            sum = sum + diff * diff;
        }
        return Math.sqrt(sum / (data.length - 1));
    }

    public static double getStdDev(double[] data, double mean) {
        double sum = 0.0;

        for (int counter = 0; counter < data.length; counter++) {
            double diff = data[counter] - mean;
            sum = sum + diff * diff;
        }
        return Math.sqrt(sum / (data.length - 1));
    }

    /**
     * Fits a straight line to a set of (x, y) data, returning the slope and
     * intercept.
     *
     * @param xData  the x-data.
     * @param yData  the y-data.
     *
     * @return A double array with the intercept in [0] and the slope in [1].
     */
    public static double[] getLinearFit(Number[] xData, Number[] yData) {

        // check arguments...
        if (xData.length != yData.length) {
            throw new IllegalArgumentException(
                "Statistics.getLinearFit(): array lengths must be equal.");
        }

        double[] result = new double[2];
        // slope
        result[1] = getSlope(xData, yData);
        // intercept
        result[0] = calculateMean(yData) - result[1] * calculateMean(xData);

        return result;

    }

    /**
     * Finds the slope of a regression line using least squares.
     *
     * @param xData  an array of Numbers (the x values).
     * @param yData  an array of Numbers (the y values).
     *
     * @return The slope.
     */
    public static double getSlope(Number[] xData, Number[] yData) {

        // check arguments...
        if (xData.length != yData.length) {
            throw new IllegalArgumentException("Array lengths must be equal.");
        }

        // ********* stat function for linear slope ********
        // y = a + bx
        // a = ybar - b * xbar
        //     sum(x * y) - (sum (x) * sum(y)) / n
        // b = ------------------------------------
        //     sum (x^2) - sum(x)^2 / n
        // *************************************************

        // sum of x, x^2, x * y, y
        double sx = 0.0, sxx = 0.0, sxy = 0.0, sy = 0.0;
        int counter;
        for (counter = 0; counter < xData.length; counter++) {
            sx = sx + xData[counter].doubleValue();
            sxx = sxx + Math.pow(xData[counter].doubleValue(), 2);
            sxy = sxy + yData[counter].doubleValue()
                      * xData[counter].doubleValue();
            sy = sy + yData[counter].doubleValue();
        }
        return (sxy - (sx * sy) / counter) / (sxx - (sx * sx) / counter);

    }

    /**
     * Calculates the correlation between two datasets.  Both arrays should
     * contain the same number of items.  Null values are treated as zero.
     * <P>
     * Information about the correlation calculation was obtained from:
     *
     * http://trochim.human.cornell.edu/kb/statcorr.htm
     *
     * @param data1  the first dataset.
     * @param data2  the second dataset.
     *
     * @return The correlation.
     *
     */
    public static double getCorrelation(Number[] data1, Number[] data2) {
        if (data1 == null) {
            throw new IllegalArgumentException("Null 'data1' argument.");
        }
        if (data2 == null) {
            throw new IllegalArgumentException("Null 'data2' argument.");
        }
        if (data1.length != data2.length) {
            throw new IllegalArgumentException(
                "'data1' and 'data2' arrays must have same length."
            );
        }
        int n = data1.length;
        double sumX = 0.0;
        double sumY = 0.0;
        double sumX2 = 0.0;
        double sumY2 = 0.0;
        double sumXY = 0.0;
        for (int i = 0; i < n; i++) {
            double x = 0.0;
            if (data1[i] != null) {
                x = data1[i].doubleValue();
            }
            double y = 0.0;
            if (data2[i] != null) {
                y = data2[i].doubleValue();
            }
            sumX = sumX + x;
            sumY = sumY + y;
            sumXY = sumXY + (x * y);
            sumX2 = sumX2 + (x * x);
            sumY2 = sumY2 + (y * y);
        }
        return (n * sumXY - sumX * sumY) / Math.pow((n * sumX2 - sumX * sumX)
                * (n * sumY2 - sumY * sumY), 0.5);
    }

    /**
     * Calculates the correlation between two datasets.
     *
     *@param data1  the first dataset.
     * @param data2  the second dataset.
     *
     * @return The correlation.
         zhangweian  2006/03/08
     */
    public static double getCorrelation(double[] data1, double[] data2) {
       if (data1 == null) {
           throw new IllegalArgumentException("Null 'data1' argument.");
       }
       if (data2 == null) {
           throw new IllegalArgumentException("Null 'data2' argument.");
       }
       if (data1.length != data2.length) {
           throw new IllegalArgumentException(
               "'data1' and 'data2' arrays must have same length."
           );
       }
       int n = data1.length;
       double sumX = 0.0;
       double sumY = 0.0;
       double sumX2 = 0.0;
       double sumY2 = 0.0;
       double sumXY = 0.0;
       double x = 0.0;
       double y = 0.0;
       for (int i = 0; i < n; i++) {
           x = data1[i];
           y = data2[i];
           sumX = sumX + x;
           sumY = sumY + y;
           sumXY = sumXY + (x * y);
           sumX2 = sumX2 + (x * x);
           sumY2 = sumY2 + (y * y);
       }
       return (n * sumXY - sumX * sumY) / Math.pow((n * sumX2 - sumX * sumX)
               * (n * sumY2 - sumY * sumY), 0.5);
   }


    /**
     * Returns a data set for a moving average on the data set passed in.
     *
     * @param xData  an array of the x data.
     * @param yData  an array of the y data.
     * @param period  the number of data points to average
     *
     * @return A double[][] the length of the data set in the first dimension,
     *         with two doubles for x and y in the second dimension
     */
    public static double[][] getMovingAverage(Number[] xData,
                                              Number[] yData,
                                              int period) {

        // check arguments...
        if (xData.length != yData.length) {
            throw new IllegalArgumentException("Array lengths must be equal.");
        }

        if (period > xData.length) {
            throw new IllegalArgumentException(
                "Period can't be longer than dataset."
            );
        }

        double[][] result = new double[xData.length - period][2];
        for (int i = 0; i < result.length; i++) {
            result[i][0] = xData[i + period].doubleValue();
            // holds the moving average sum
            double sum = 0.0;
            for (int j = 0; j < period; j++) {
                sum += yData[i + j].doubleValue();
            }
            sum = sum / period;
            result[i][1] = sum;
        }
        return result;

    }

    /**
     * Returns the square deviation of a set of numbers.
     *
     * @param data  the data.
     *
     * @return The square deviation of a set of numbers.
     *  zhangweian 2006/03/08
     */
    public static double getSquareDev(double[] data) {
        double avg = calculateMean(data);
        double sum = 0.0;

        for (int counter = 0; counter < data.length; counter++) {
            double diff = data[counter] - avg;
            sum = sum + diff * diff;
        }
        return sum;
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品欧美日韩精品| 日韩精品1区2区3区| 日韩欧美中文字幕精品| av不卡一区二区三区| 亚洲美女一区二区三区| 欧美一区二区国产| 色综合 综合色| 国产大陆a不卡| 日韩av中文字幕一区二区| 2023国产精华国产精品| 国产经典欧美精品| 亚洲免费观看高清完整版在线观看熊| 日韩一区二区三区在线观看| 91女厕偷拍女厕偷拍高清| 蜜臂av日日欢夜夜爽一区| 亚洲免费伊人电影| 欧美精品一区二区久久婷婷| 色哟哟欧美精品| 成人精品视频一区二区三区尤物| 精品在线一区二区三区| 亚洲一区二区不卡免费| 国产精品久久午夜夜伦鲁鲁| 久久奇米777| 欧美私人免费视频| www.欧美精品一二区| 成人免费观看视频| 国内精品久久久久影院色| 午夜婷婷国产麻豆精品| 天天综合日日夜夜精品| 亚洲成人免费观看| 日韩国产在线观看一区| 日本人妖一区二区| 极品瑜伽女神91| 福利电影一区二区三区| 成人精品国产免费网站| 色哟哟日韩精品| 51午夜精品国产| www欧美成人18+| 国产欧美日韩卡一| 怡红院av一区二区三区| 麻豆成人免费电影| 国产成人午夜精品影院观看视频| 久久精品国产999大香线蕉| 亚洲成av人综合在线观看| 精品午夜久久福利影院| 91蜜桃在线免费视频| 成人av动漫在线| 91麻豆精品91久久久久久清纯 | 亚洲免费观看高清完整版在线| 亚洲欧美国产三级| 亚洲一区二区三区美女| 三级在线观看一区二区| 国产一区亚洲一区| 欧美美女一区二区三区| 欧美精品一区二区精品网| 久久蜜桃av一区二区天堂| 一区二区三区产品免费精品久久75| 奇米精品一区二区三区四区 | 国产精品国产三级国产三级人妇 | 亚洲成人av中文| 成人一区在线看| 欧美日韩高清在线播放| 国产亚洲成av人在线观看导航| 香蕉成人啪国产精品视频综合网| 日韩一级精品视频在线观看| 久久你懂得1024| 美女一区二区视频| 欧美二区三区91| 性做久久久久久久久| 91国偷自产一区二区三区成为亚洲经典| 欧美成人aa大片| 日韩制服丝袜先锋影音| 麻豆专区一区二区三区四区五区| 欧美美女一区二区在线观看| 亚洲一卡二卡三卡四卡无卡久久 | 日韩不卡手机在线v区| 在线观看视频一区| 成人黄色电影在线| 亚洲欧美另类综合偷拍| 色婷婷久久久亚洲一区二区三区| 亚洲一区在线电影| 678五月天丁香亚洲综合网| 一二三区精品视频| 99这里都是精品| 亚洲欧洲成人自拍| 在线亚洲一区二区| 蜜臀久久99精品久久久画质超高清 | 亚洲第四色夜色| 欧美zozo另类异族| 成人激情动漫在线观看| 玉米视频成人免费看| 欧美一区二区三区日韩| 轻轻草成人在线| 欧美日韩国产成人在线免费| 狠狠色丁香久久婷婷综合丁香| 日本一区二区视频在线| 国产视频不卡一区| 欧美日韩免费高清一区色橹橹| 久久国产夜色精品鲁鲁99| 久久久综合激的五月天| 在线视频国内一区二区| 青青草97国产精品免费观看无弹窗版| 中文字幕免费一区| 日韩精品一区二区三区swag| 91小宝寻花一区二区三区| 久久不见久久见免费视频7| 在线不卡一区二区| 99视频热这里只有精品免费| 性久久久久久久久久久久| 亚洲国产精品黑人久久久| 欧美精品自拍偷拍动漫精品| 成人黄页在线观看| 国产毛片精品国产一区二区三区| 亚洲成人激情综合网| 国产精品久久99| 日本一区二区三区在线不卡 | 91丨九色丨黑人外教| 亚洲成av人片在线观看| 国产精品嫩草影院av蜜臀| 欧美一级欧美一级在线播放| 成人avav在线| av午夜精品一区二区三区| 一区二区三区精品久久久| 亚洲视频资源在线| 国产精品视频第一区| 中文幕一区二区三区久久蜜桃| 久久综合一区二区| 国产日韩欧美综合在线| 国产亚洲一区二区三区| 国产欧美一区二区在线| 国产精品乱码一区二区三区软件| 国产欧美一区二区精品性色 | 视频一区二区三区在线| 日韩电影在线免费看| 免费的成人av| 国产iv一区二区三区| 国产69精品久久久久777| 欧美一区日本一区韩国一区| 在线精品视频免费观看| 色哟哟一区二区三区| 在线观看亚洲成人| 精品视频全国免费看| 日韩欧美在线网站| 亚洲国产高清不卡| 日韩一区在线看| 日本美女视频一区二区| 不卡一区二区三区四区| 激情伊人五月天久久综合| 亚洲一本大道在线| 日韩欧美一区在线观看| 久久这里只精品最新地址| 亚洲精品日韩专区silk| 天天操天天干天天综合网| 国产很黄免费观看久久| 欧美影院一区二区| 欧美极品美女视频| 日本午夜精品视频在线观看| 成人午夜在线视频| 日韩美女天天操| 亚洲综合区在线| 亚洲一区二区在线观看视频| 日韩成人精品在线观看| 在线观看日韩毛片| 亚洲欧洲日产国码二区| 丝袜a∨在线一区二区三区不卡| 不卡电影一区二区三区| 日韩视频一区二区三区| 亚洲国产综合色| 成人av免费在线播放| 日韩欧美国产综合| 最近中文字幕一区二区三区| 国产成人精品www牛牛影视| ㊣最新国产の精品bt伙计久久| 免费观看91视频大全| 精品国产免费久久| 国产suv一区二区三区88区| 国产精品视频观看| 欧美影视一区二区三区| 亚洲国产日韩在线一区模特| 欧美欧美午夜aⅴ在线观看| 美女脱光内衣内裤视频久久影院| 日韩天堂在线观看| 成人免费视频国产在线观看| 自拍偷在线精品自拍偷无码专区| 97久久精品人人做人人爽| 亚洲一二三四区| 6080午夜不卡| 成人激情黄色小说| 蜜臀av在线播放一区二区三区| 久久精品无码一区二区三区| 在线观看网站黄不卡| 韩国欧美国产1区| 亚洲一区二区视频| 精品久久久久一区二区国产| 91色视频在线| 国产一区二区日韩精品| 一区二区三区精密机械公司| 欧美岛国在线观看| 色国产综合视频| 国产制服丝袜一区|