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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? utils.java

?? 搞算法預(yù)測的可以來看。有移動(dòng)平均法
?? JAVA
字號:
////  OpenForecast - open source, general-purpose forecasting package.//  Copyright (C) 2002-2004  Steven R. Gould////  This library is free software; you can redistribute it and/or//  modify it under the terms of the GNU Lesser General Public//  License as published by the Free Software Foundation; either//  version 2.1 of the License, or (at your option) any later version.////  This library is distributed in the hope that it will be useful,//  but WITHOUT ANY WARRANTY; without even the implied warranty of//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU//  Lesser General Public License for more details.////  You should have received a copy of the GNU Lesser General Public//  License along with this library; if not, write to the Free Software//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//package net.sourceforge.openforecast.models;import java.util.ArrayList;import java.util.Iterator;import net.sourceforge.openforecast.ForecastingModel;import net.sourceforge.openforecast.DataPoint;import net.sourceforge.openforecast.DataSet;/** * This class implements a variety of helper methods that typically help out * with the computational components of the models. These static methods are * not really suitable for general purpose use, and are therefore not made * public. * @author Steven R. Gould */final class Utils{    /**     * A private default constructor to prevent instantiation of this class.     */    private Utils()    {    }    /**     * Implements a Gaussian elimination on the given matrix. The last column     * being the Right Hand Side values. All rows in the matrix are used.     * @param a the matrix to be solved.     */    static double[] GaussElimination( double a[][] )    {        int n = a.length;        return GaussElimination( n, a );    }    /**     * Implements a Gaussian elimination on the given matrix. The matrix     * <code>a</code> should be n rows by n+1 columns. Column <code>n+1</code>     * being the Right Hand Side values.     * @param n the number of rows in the matrix.     * @param a the matrix to be solved.     */    static double[] GaussElimination( int n, double a[][] )    {        // Forward elimination        for ( int k=0; k<n-1; k++ )            {                for ( int i=k+1; i<n; i++ )                    {                        double qt = a[i][k] / a[k][k];                        for ( int j=k+1; j<n+1; j++ )                            a[i][j] -= qt * a[k][j];                        a[i][k] = 0.0;                    }            }        /*        // DEBUG        for ( int i=0; i<n; i++ )            for ( int j=0; j<n+1; j++ )                System.out.println( "After forward elimination, a["+i+"]["+j+"]="+a[i][j] );        */        double x[] = new double[n];        // Back-substitution        x[n-1] = a[n-1][n] / a[n-1][n-1];        for ( int k=n-2; k>=0; k-- )            {                double sum = 0.0;                for ( int j=k+1; j<n; j++ )                    sum += a[k][j]*x[j];                                x[k] = ( a[k][n] - sum ) / a[k][k];            }        /*        // DEBUG        for ( int k=0; k<n; k++ )            System.out.println( "After back-substitution, x["+k+"]="+x[k] );        */        return x;    }    /**     * Calculates and returns the seasonal indices for the given set of     * observations and the given seasonal cycle. To determine any seasonality     * at least 2 full seasons of data are required. If the seasonal cycle is     * say, 12 months, then at least 2 years of data is required - more is     * preferred and recommended if available. If the "seasonal cycle" is say,     * 7 days then at least 2 weeks of data is required. Again, more is both     * recommended and preferred for better - more reliable - results.     *     * For more information on the detailed approach implemented here, refer to     * "Business Statistics" (4th Ed.) by Daniel and Terrell     * (ISBN 0-395-35651-2), section 13.7 "Measuring Seasonal Variation" (pp.     * 615-621).     * @param observations the observed values of the dependent variable over     * past seasons.     * @param seasonalCycle the number of observations in a "season". Note that     * this could be 12 months in a year, 4 quarters in a year, but also     * something like 7 days in a week (where the "seasonality" of interest is     * weekly by day).     * @throws IllegalArgumentException if there are insufficient observations     * available to determine seasonal indices. Basically the number of     * observations should be at least twice the number of observations in a     * seasonal cycle. For example, if the observations are monthly and the     * seasonal cycle is 12 months, then there should be at least 24     * observations in order to determine the seasonal indices. More is     * recommended. In this case, 4-5 years or more of observations (depending     * on the data) would be a good starting point.     */    static double[] calculateSeasonalIndices( double observation[],                                              int seasonalCycle )    {        int numberOfCycles = observation.length / seasonalCycle;        if ( numberOfCycles < 2 )            throw new IllegalArgumentException("Too few observations. Need at least "+seasonalCycle*2+" observations - preferably more - to calculate the seasonal indices");        if ( seasonalCycle % 2 != 0 )            throw new IllegalArgumentException("seasonalCycle must be even - for now at least");        if ( observation.length % seasonalCycle > 0 )            numberOfCycles++;        double seasonalIndex[] = new double[ seasonalCycle ];        // Calculate "Ratio to Moving Average" for each period and cycle        ArrayList ratioToMovingAverage = new ArrayList( observation.length );        double movingTotal = 0.0;        for ( int t=0; t < seasonalCycle; t++ )            {                movingTotal += observation[t];                ratioToMovingAverage.add(t,null);            }                        int numberOfObservations = observation.length;        for ( int t=seasonalCycle; t < numberOfObservations; t++ )            {                double movingAverage = movingTotal / (seasonalCycle*2);                // For efficiency (to avoid recalculating sums), we                // drop the oldest observation, and add the current one                movingTotal -= observation[t-seasonalCycle];                movingTotal += observation[t];                movingAverage += movingTotal / (seasonalCycle*2);                // The "+1" below is to correctly handle an odd number of                // seasons within a cycle - e.g. 7 days in a week.                int period = t - (seasonalCycle+1)/2;                ratioToMovingAverage.add(period,                            new Double(observation[period]/movingAverage));            }        // if more than 4 cycles, then drop min/max outliers        // else we'll just average what we have        boolean dropOutliers = (numberOfCycles > 4);        // Calculate mean indices        double sumIndices = 0.0;        for ( int season=0; season<seasonalCycle; season++ )            {                int count = 0;                double sum = 0.0;                double minIndex = Double.POSITIVE_INFINITY;                double maxIndex = Double.NEGATIVE_INFINITY;                for ( int cycle=0; cycle<numberOfCycles; cycle++ )                    {                        int t = season + cycle*seasonalCycle;                        if ( ratioToMovingAverage.get(t) != null )                            {                                double currentIndex                                    = ((Double)ratioToMovingAverage.get(t)).doubleValue();                                if ( dropOutliers )                                    {                                        if ( currentIndex < minIndex )                                            minIndex = currentIndex;                                        if ( currentIndex > maxIndex )                                            maxIndex = currentIndex;                                    }                                sum += currentIndex;                                count++;                            }                    }                                if ( dropOutliers )                    {                        sum -= minIndex;                        count--;                                                sum -= maxIndex;                        count--;                    }                seasonalIndex[season] = sum / count;                                sumIndices += seasonalIndex[season];            }                  // Scale indices to sum to seasonalCycle        for ( int season=0; season<seasonalCycle; season++ )            seasonalIndex[season] *= (seasonalCycle/sumIndices);        return seasonalIndex;    }}// Local Variables:// tab-width: 4// End:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一二三四高清不卡| 精品一区二区久久久| 成人欧美一区二区三区黑人麻豆| 欧美xfplay| 日韩精品最新网址| 337p粉嫩大胆噜噜噜噜噜91av| 欧美一区二区三区免费视频| 欧美一区午夜视频在线观看 | 色偷偷成人一区二区三区91| 成人黄色在线看| av激情综合网| 99久久综合精品| 91亚洲国产成人精品一区二三| 91免费国产在线| 欧美色偷偷大香| 91麻豆精品国产91久久久资源速度 | 亚洲视频在线观看三级| 国产精品国产三级国产普通话蜜臀| 国产精品久久久久久亚洲伦| 亚洲图片另类小说| 亚洲国产一二三| 日韩成人精品在线| 国产成人啪免费观看软件| 成人午夜在线免费| 欧美影院午夜播放| 日韩亚洲欧美成人一区| 久久久亚洲精华液精华液精华液| 日本一区二区三区视频视频| 亚洲精选在线视频| 日韩成人免费电影| 成人午夜在线播放| 欧美性淫爽ww久久久久无| 日韩一区二区中文字幕| 久久青草欧美一区二区三区| 成人欧美一区二区三区1314| 亚洲电影视频在线| 国产精品影视在线观看| 不卡av免费在线观看| 日本大香伊一区二区三区| 这里是久久伊人| 国产视频视频一区| 一区二区三区在线视频播放| 日本不卡一二三| 国产麻豆9l精品三级站| 色播五月激情综合网| 欧美成人video| 亚洲欧美精品午睡沙发| 日本欧美肥老太交大片| 97久久超碰国产精品电影| 欧美蜜桃一区二区三区| 日本一区二区在线不卡| 亚洲成av人片观看| 不卡一二三区首页| 日韩欧美在线观看一区二区三区| 国产精品乱人伦中文| 日韩福利视频网| 成人av电影在线观看| 欧美一级理论性理论a| 亚洲欧美色图小说| 国产乱对白刺激视频不卡| 欧美三电影在线| 中文字幕久久午夜不卡| 日本成人在线看| 色哟哟一区二区在线观看| www激情久久| 午夜欧美在线一二页| 从欧美一区二区三区| 69堂成人精品免费视频| 亚洲天堂av老司机| 国产一区二区精品久久| 制服丝袜激情欧洲亚洲| 最新久久zyz资源站| 韩国v欧美v日本v亚洲v| 欧美日韩综合在线| 亚洲精品国产成人久久av盗摄| 国内精品免费**视频| 欧美日韩久久久一区| 1区2区3区精品视频| 成人午夜视频福利| 精品国产91洋老外米糕| 青青草原综合久久大伊人精品 | 91色九色蝌蚪| 国产午夜三级一区二区三| 日本女优在线视频一区二区| 在线免费观看日本一区| 国产精品麻豆欧美日韩ww| 精品影视av免费| 日韩视频一区二区三区在线播放| 一区二区三区中文字幕| av午夜精品一区二区三区| 久久九九国产精品| 久久国产精品免费| 日韩一级在线观看| 丝袜诱惑制服诱惑色一区在线观看| 色偷偷久久一区二区三区| 亚洲欧美日本在线| 色婷婷国产精品| 亚洲图片激情小说| 91丨porny丨户外露出| 国产精品人成在线观看免费| 成人做爰69片免费看网站| 国产日韩欧美a| 国产一区视频导航| 久久视频一区二区| 国产剧情一区在线| 国产亚洲欧洲997久久综合 | 丁香婷婷综合激情五月色| 精品国产乱码久久久久久夜甘婷婷| 日本亚洲欧美天堂免费| 3d成人h动漫网站入口| 天天色图综合网| 日韩午夜小视频| 国产一区二区精品在线观看| 久久麻豆一区二区| 波多野结衣一区二区三区| 亚洲欧洲99久久| 欧美影院一区二区三区| 午夜精品久久久久久久99樱桃| 欧美喷潮久久久xxxxx| 视频一区二区中文字幕| 日韩精品专区在线| 国产精品一级在线| 最新不卡av在线| 欧美日韩激情一区| 久久丁香综合五月国产三级网站| 2017欧美狠狠色| 99久久久无码国产精品| 亚洲最大成人综合| 日韩一区二区三区四区| 国产精品99久久不卡二区| 1000精品久久久久久久久| 欧洲av一区二区嗯嗯嗯啊| 免费看欧美女人艹b| 久久久久久夜精品精品免费| 成人一级片在线观看| 亚洲欧美国产三级| 欧美一级生活片| 成人中文字幕合集| 亚洲国产欧美日韩另类综合| 日韩手机在线导航| 成人午夜精品在线| 亚洲成人av福利| 久久久久久久久久看片| 色婷婷精品久久二区二区蜜臂av | 蜜臀久久久久久久| 国产午夜精品福利| 欧美色电影在线| 国内精品视频一区二区三区八戒 | 丁香天五香天堂综合| 亚洲一区电影777| 精品国产亚洲在线| 色噜噜久久综合| 国模无码大尺度一区二区三区| 国产精品短视频| 51精品秘密在线观看| 国产麻豆精品theporn| 一区二区三区美女视频| 久久久午夜电影| 欧美日韩性生活| 国产不卡视频一区| 日韩在线观看一区二区| 中文字幕一区二区三区四区不卡| 欧美一区二区美女| 色欧美88888久久久久久影院| 久草这里只有精品视频| 亚洲色图欧洲色图| 久久久.com| 欧美一卡二卡在线| 欧洲精品一区二区| 99久久99久久综合| 国产真实精品久久二三区| 玉足女爽爽91| 久久精品网站免费观看| 91麻豆精品国产91久久久久| 99久久精品国产网站| 国产在线日韩欧美| 天堂va蜜桃一区二区三区漫画版| 国产精品久久久久久久久晋中| 日韩精品一区二区三区老鸭窝| 欧美亚洲国产一区二区三区va| 国产精品18久久久久久久久 | 国产一区二区三区在线观看免费| 亚洲一二三四在线| 综合在线观看色| 国产亚洲精品资源在线26u| 5858s免费视频成人| 91视频免费观看| a美女胸又www黄视频久久| 韩国精品一区二区| 久久se这里有精品| 青椒成人免费视频| 肉色丝袜一区二区| 一区二区三区美女| 尤物av一区二区| 亚洲欧洲综合另类在线| 中文字幕一区二区在线播放| 中文字幕乱码久久午夜不卡| 国产亚洲短视频| 久久色视频免费观看| 日韩欧美一级二级三级久久久|