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

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

?? pacematrix.java

?? 一個小型的數據挖掘器應用軟件,綜合數據挖掘的各種功能
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
			 boolean adjoin ) {    final int kp = pvt.size(); // number of columns under consideration    int [] p = pvt.getArray();	    if( adjoin ) {     // adjoining       int pj = p[j];      pvt.swap( ks, j );      double dq[] = h1( pj, ks );      int pk;      for( int k = ks+1; k < kp; k++ ){	pk = p[k];	h2( pj, ks, dq[1], this, pk);      }      h2( pj, ks, dq[1], b, 0 ); // for matrix. ???      A[ks][pj] = dq[0];      for( int k = ks+1; k < m; k++ )	A[k][pj] = 0;    }    else {          // removing       int pj = p[j];      for( int i = j; i < ks-1; i++ ) 	p[i] = p[i+1];      p[ks-1] = pj;      double [] cs;      for( int i = j; i < ks-1; i++ ){	cs = g1( A[i][p[i]], A[i+1][p[i]] );	for( int l = i; l < kp; l++ ) 	  g2( cs, i, i+1, p[l] );	for( int l = 0; l < b.n; l++ )	  b.g2( cs, i, i+1, l );      }    }  }      /** Solves upper-triangular equation <br/>   *   	R x = b <br/>   *  On output, the solution is stored in b   *  @param b the response   *  @param pvt the pivoting vector   *  @param kp the number of the first columns involved    */  public void  rsolve( PaceMatrix b, IntVector pvt, int kp) {    if(kp == 0) b.m = 0;    int i, j, k;    int [] p = pvt.getArray();    double s;    double [][] ba = b.getArray();    for( k = 0; k < b.n; k++ ) {      ba[kp-1][k] /= A[kp-1][p[kp-1]];      for( i = kp - 2; i >= 0; i-- ){	s = 0;	for( j = i + 1; j < kp; j++ )	  s += A[i][p[j]] * ba[j][k];	ba[i][k] -= s;	ba[i][k] /= A[i][p[i]];      }    }     b.m = kp;  }      /** Returns a new matrix which binds two matrices together with rows.    *  @param b  the second matrix   *  @return the combined matrix   */  public PaceMatrix  rbind( PaceMatrix b ){    if( n != b.n )       throw new IllegalArgumentException("unequal numbers of rows.");    PaceMatrix c = new PaceMatrix( m + b.m, n );    c.setMatrix( 0, m - 1, 0, n - 1, this );    c.setMatrix( m, m + b.m - 1, 0, n - 1, b );    return c;  }  /** Returns a new matrix which binds two matrices with columns.   *  @param b the second matrix    *  @return the combined matrix   */  public PaceMatrix  cbind( PaceMatrix b ) {    if( m != b.m )       throw new IllegalArgumentException("unequal numbers of rows: " + 					 m + " and " + b.m);    PaceMatrix c = new PaceMatrix(m, n + b.n);    c.setMatrix( 0, m - 1, 0, n - 1, this );    c.setMatrix( 0, m - 1, n, n + b.n - 1, b );    return c;  }  /** Solves the nonnegative linear squares problem. That is, <p>   *   <center>   min || A x - b||, subject to x >= 0.  </center> <p>   *    *  For algorithm, refer to P161, Chapter 23 of C. L. Lawson and   *  R. J. Hanson (1974).  "Solving Least Squares   *  Problems". Prentice-Hall.   * 	@param b the response   *  @param pvt vector storing pivoting column indices   *	@return solution */  public DoubleVector nnls( PaceMatrix b, IntVector pvt ) {    int j, t, counter = 0, jm = -1, n = pvt.size();    double ma, max, alpha, wj;    int [] p = pvt.getArray();    DoubleVector x = new DoubleVector( n );    double [] xA = x.getArray();    PaceMatrix z = new PaceMatrix(n, 1);    PaceMatrix bt;	    // step 1     int kp = 0; // #variables in the positive set P    while ( true ) {         // step 2       if( ++counter > 3*n )  // should never happen	throw new RuntimeException("Does not converge");      t = -1;      max = 0.0;      bt = new PaceMatrix( b.transpose() );      for( j = kp; j <= n-1; j++ ) {   // W = A' (b - A x) 	wj = bt.times( 0, kp, m-1, this, p[j] );	if( wj > max ) {        // step 4	  max = wj;	  t = j;	}      }	          // step 3       if ( t == -1) break; // optimum achieved 	          // step 5       pvt.swap( kp, t );       // move variable from set Z to set P      kp++;      xA[kp-1] = 0;      steplsqr( b, pvt, kp-1, kp-1, true );      // step 6      ma = 0;      while ( ma < 1.5 ) {	for( j = 0; j <= kp-1; j++ ) z.A[j][0] = b.A[j][0];	rsolve(z, pvt, kp); 	ma = 2; jm = -1;	for( j = 0; j <= kp-1; j++ ) {  // step 7, 8 and 9	  if( z.A[j][0] <= 0.0 ) { // alpha always between 0 and 1	    alpha = xA[j] / ( xA[j] - z.A[j][0] ); 	    if( alpha < ma ) {	      ma = alpha; jm = j;	    }	  }	}	if( ma > 1.5 ) 	  for( j = 0; j <= kp-1; j++ ) xA[j] = z.A[j][0];  // step 7 	else { 	  for( j = kp-1; j >= 0; j-- ) { // step 10	    // Modified to avoid round-off error (which seemingly 	    // can cause infinite loop).	    if( j == jm ) { // step 11 	      xA[j] = 0.0;	      steplsqr( b, pvt, kp, j, false );	      kp--;  // move variable from set P to set Z	    }	    else xA[j] += ma * ( z.A[j][0] - xA[j] );	  }	}      }    }    x.setSize(kp);    pvt.setSize(kp);    return x;  }  /** Solves the nonnegative least squares problem with equality   *	constraint. That is, <p>   *  <center> min ||A x - b||, subject to x >= 0 and c x = d. </center> <p>   *   *  @param b the response   *  @param c coeficients of equality constraints   *  @param d constants of equality constraints   *  @param pvt vector storing pivoting column indices   *  @return the solution   */  public DoubleVector nnlse( PaceMatrix b, PaceMatrix c, PaceMatrix d, 			     IntVector pvt ) {    double eps = 1e-10 * Math.max( c.maxAbs(), d.maxAbs() ) /    Math.max( maxAbs(), b.maxAbs() );	    PaceMatrix e = c.rbind( new PaceMatrix( times(eps) ) );    PaceMatrix f = d.rbind( new PaceMatrix( b.times(eps) ) );    return e.nnls( f, pvt );  }  /** Solves the nonnegative least squares problem with equality   *	constraint. That is, <p>   *  <center> min ||A x - b||,  subject to x >= 0 and || x || = 1. </center>   *  <p>   *  @param b the response    *  @param pvt vector storing pivoting column indices   *  @return the solution   */  public DoubleVector nnlse1( PaceMatrix b, IntVector pvt ) {    PaceMatrix c = new PaceMatrix( 1, n, 1 );    PaceMatrix d = new PaceMatrix( 1, b.n, 1 );	    return nnlse(b, c, d, pvt);  }  /** Generate matrix with standard-normally distributed random elements      @param m    Number of rows.      @param n    Number of colums.      @return An m-by-n matrix with random elements.  */  public static Matrix randomNormal( int m, int n ) {    Random random = new Random();         Matrix A = new Matrix(m,n);    double[][] X = A.getArray();    for (int i = 0; i < m; i++) {      for (int j = 0; j < n; j++) {	X[i][j] = random.nextGaussian();      }    }    return A;  }  /**   * for testing only   *    * @param args the commandline arguments - ignored   */  public static void  main( String args[] ) {    System.out.println("================================================" + 		       "===========");    System.out.println("To test the pace estimators of linear model\n" + 		       "coefficients.\n");    double sd = 2;     // standard deviation of the random error term    int n = 200;       // total number of observations    double beta0 = 100;   // intercept    int k1 = 20;       // number of coefficients of the first cluster    double beta1 = 0;  // coefficient value of the first cluster    int k2 = 20;      // number of coefficients of the second cluster    double beta2 = 5; // coefficient value of the second cluster     int k = 1 + k1 + k2;    DoubleVector beta = new DoubleVector( 1 + k1 + k2 );    beta.set( 0, beta0 );    beta.set( 1, k1, beta1 );    beta.set( k1+1, k1+k2, beta2 );    System.out.println("The data set contains " + n + 		       " observations plus " + (k1 + k2) + 		       " variables.\n\nThe coefficients of the true model"		       + " are:\n\n" + beta );	    System.out.println("\nThe standard deviation of the error term is " + 		       sd );	    System.out.println("===============================================" 		       + "============");		    PaceMatrix X = new PaceMatrix( n, k1+k2+1 );    X.setMatrix( 0, n-1, 0, 0, 1 );    X.setMatrix( 0, n-1, 1, k1+k2, random(n, k1+k2) );	    PaceMatrix Y = new       PaceMatrix( X.times( new PaceMatrix(beta) ).		  plusEquals( randomNormal(n,1).times(sd) ) );    IntVector pvt = (IntVector) IntVector.seq(0, k1+k2);    /*System.out.println( "The OLS estimate (by jama.Matrix.solve()) is:\n\n" +       (new PaceMatrix(X.solve(Y))).getColumn(0) );*/	    X.lsqrSelection( Y, pvt, 1 );    X.positiveDiagonal( Y, pvt );    PaceMatrix sol = (PaceMatrix) Y.clone();    X.rsolve( sol, pvt, pvt.size() );    DoubleVector betaHat = sol.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe OLS estimate (through lsqr()) is: \n\n" + 			betaHat );    System.out.println( "\nQuadratic loss of the OLS estimate (||X b - X bHat||^2) = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaHat)) )))			.getColumn(0).sum2() );    System.out.println("=============================================" + 		       "==============");    System.out.println("             *** Pace estimation *** \n");    DoubleVector r = Y.getColumn( pvt.size(), n-1, 0);    double sde = Math.sqrt(r.sum2() / r.size());	    System.out.println( "Estimated standard deviation = " + sde );    DoubleVector aHat = Y.getColumn( 0, pvt.size()-1, 0).times( 1./sde );    System.out.println("\naHat = \n" + aHat );	    System.out.println("\n========= Based on chi-square mixture ============");    ChisqMixture d2 = new ChisqMixture();    int method = MixtureDistribution.NNMMethod;    DoubleVector AHat = aHat.square();    d2.fit( AHat, method );     System.out.println( "\nEstimated mixing distribution is:\n" + d2 );	    DoubleVector ATilde = d2.pace2( AHat );    DoubleVector aTilde = ATilde.sqrt().times(aHat.sign());    PaceMatrix YTilde = new       PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    DoubleVector betaTilde =     YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe pace2 estimate of coefficients = \n" + 			betaTilde );    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );	    ATilde = d2.pace4( AHat );    aTilde = ATilde.sqrt().times(aHat.sign());    YTilde = new PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    betaTilde = YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe pace4 estimate of coefficients = \n" + 			betaTilde );    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );	    ATilde = d2.pace6( AHat );    aTilde = ATilde.sqrt().times(aHat.sign());    YTilde = new PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    betaTilde = YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe pace6 estimate of coefficients = \n" + 			betaTilde );    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );	    System.out.println("\n========= Based on normal mixture ============");	    NormalMixture d = new NormalMixture();    d.fit( aHat, method );     System.out.println( "\nEstimated mixing distribution is:\n" + d );	    aTilde = d.nestedEstimate( aHat );    YTilde = new PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    betaTilde = YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "The nested estimate of coefficients = \n" + 			betaTilde );    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );		    aTilde = d.subsetEstimate( aHat );    YTilde = new PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    betaTilde =     YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe subset estimate of coefficients = \n" + 			betaTilde );    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );	    aTilde = d.empiricalBayesEstimate( aHat );    YTilde = new PaceMatrix((new PaceMatrix(aTilde)).times( sde ));    X.rsolve( YTilde, pvt, pvt.size() );    betaTilde = YTilde.getColumn(0).unpivoting( pvt, k );    System.out.println( "\nThe empirical Bayes estimate of coefficients = \n"+			betaTilde );	    System.out.println( "Quadratic loss = " + 			( new PaceMatrix( X.times( new 			  PaceMatrix(beta.minus(betaTilde)) )))			.getColumn(0).sum2() );	  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品久久久久久久91蜜桃 | 久久这里只有精品首页| 精品欧美久久久| 亚洲情趣在线观看| 久久机这里只有精品| 91在线视频观看| 精品国产一区a| 亚洲一卡二卡三卡四卡无卡久久| 韩国一区二区三区| 91精品中文字幕一区二区三区| 国产精品不卡一区| 国产一区二区免费在线| 91精品综合久久久久久| 亚洲男帅同性gay1069| 国产成人免费在线| 九色综合狠狠综合久久| 日韩理论在线观看| 激情欧美日韩一区二区| 5858s免费视频成人| 亚洲女爱视频在线| 成人性视频网站| 久久这里都是精品| 精品一区二区三区在线观看| 欧美精品一二三| 一区二区日韩av| 99精品在线观看视频| 国产精品日产欧美久久久久| 九九精品一区二区| 欧美大白屁股肥臀xxxxxx| 国产一区二区精品久久| 777午夜精品视频在线播放| 亚洲一区二区影院| 欧美日韩一区二区在线视频| 一区二区欧美视频| 欧美中文字幕一二三区视频| 亚洲一区二区三区小说| 欧美日韩亚洲高清一区二区| 亚洲成a人在线观看| 欧美人牲a欧美精品| 日韩精品一级二级 | 亚洲免费色视频| 色综合久久久久| 亚洲一区影音先锋| 欧美精品丝袜久久久中文字幕| 日韩精品一级中文字幕精品视频免费观看 | 国产一区二区三区久久久 | 国内精品嫩模私拍在线| 国产午夜久久久久| av不卡免费电影| 亚洲综合在线五月| 欧美一区二区三区公司| 久久91精品久久久久久秒播| 久久久99精品免费观看| www..com久久爱| 一区二区在线免费观看| 91.麻豆视频| 国内精品第一页| 一区精品在线播放| 欧美日韩成人一区二区| 精品无人码麻豆乱码1区2区 | 一区二区三区中文免费| 欧洲精品视频在线观看| 日韩电影一区二区三区四区| 精品国产成人在线影院 | 亚洲精品欧美专区| 3751色影院一区二区三区| 国产真实乱偷精品视频免| 亚洲丝袜精品丝袜在线| 3d动漫精品啪啪| av网站一区二区三区| 丝袜诱惑亚洲看片| 日本一区二区动态图| 欧美麻豆精品久久久久久| 国产精一品亚洲二区在线视频| 亚洲美女偷拍久久| 日韩精品一区二| 在线观看亚洲专区| 国产美女一区二区| 亚洲成av人片在线观看无码| 国产欧美综合在线观看第十页| 欧美日韩www| 99精品视频免费在线观看| 亚洲成人7777| 综合欧美亚洲日本| 国产日韩欧美一区二区三区综合| 欧美日韩mp4| 色偷偷一区二区三区| 国产成人aaaa| 久久精品国产秦先生| 亚洲综合在线五月| 中文字幕一区二区三区乱码在线 | 国产精品一区二区在线播放| 亚洲成人一区二区| 亚洲美女视频在线| 国产精品萝li| 国产精品全国免费观看高清| 精品裸体舞一区二区三区| 欧美中文字幕一区二区三区| eeuss鲁一区二区三区| 国产乱码精品一区二区三| 图片区小说区区亚洲影院| 亚洲一区二区中文在线| 亚洲蜜臀av乱码久久精品 | 国产精品婷婷午夜在线观看| 精品剧情在线观看| 欧美一区二区三区系列电影| 欧美视频完全免费看| 欧美在线|欧美| 91免费观看国产| av不卡一区二区三区| 99精品桃花视频在线观看| 成人永久免费视频| 不卡在线视频中文字幕| 成人中文字幕合集| 91在线精品一区二区三区| av在线播放不卡| 99精品黄色片免费大全| eeuss影院一区二区三区| 色哟哟国产精品| 欧美优质美女网站| 欧美美女一区二区三区| 欧美一区二区三区视频在线| 日韩午夜激情视频| 精品国产免费视频| 久久精品欧美一区二区三区不卡| 久久精品男人天堂av| 国产精品无码永久免费888| 最新国产精品久久精品| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲永久精品大片| 亚洲成人免费观看| 日本午夜精品一区二区三区电影 | 日韩美女视频在线| 久久精品在线免费观看| 中文字幕在线不卡一区| 亚洲与欧洲av电影| 久久国产三级精品| 成人一区二区三区中文字幕| 99久久精品免费观看| 欧美在线小视频| 精品盗摄一区二区三区| 国产精品初高中害羞小美女文| 亚洲午夜免费视频| 狠狠色综合播放一区二区| av综合在线播放| 91精品蜜臀在线一区尤物| 亚洲国产成人自拍| 午夜免费久久看| 国产一区二区三区在线观看精品| jvid福利写真一区二区三区| 3751色影院一区二区三区| 中文字幕高清一区| 午夜精品久久久久久久久| 国产成人自拍高清视频在线免费播放| 94-欧美-setu| 欧美tickling挠脚心丨vk| 亚洲欧美经典视频| 狠狠色狠狠色合久久伊人| 色综合天天在线| 精品久久久久久无| 亚洲成人综合视频| 成人av免费在线观看| 欧美tk—视频vk| 亚洲电影在线免费观看| 成人免费视频app| 日韩一级高清毛片| 一区二区三区国产豹纹内裤在线| 国产一区二区精品在线观看| 欧美剧情电影在线观看完整版免费励志电影 | 一区二区三区在线免费| 国产不卡高清在线观看视频| 欧美精品在线一区二区三区| 成人免费一区二区三区视频| 精品一区二区三区在线播放视频 | 国产日产欧产精品推荐色| 亚洲成a人v欧美综合天堂下载 | av在线播放一区二区三区| 精品国产免费一区二区三区四区| 性感美女极品91精品| 91在线观看成人| 欧美国产1区2区| 国产精品正在播放| 精品福利一二区| 另类小说欧美激情| 在线播放国产精品二区一二区四区 | 狠狠色丁香婷综合久久| 91精品国产日韩91久久久久久| 一区二区三区不卡在线观看| 99久久99久久久精品齐齐| 亚洲国产精品99久久久久久久久| 国产精品综合视频| 久久夜色精品一区| 国产精品一级在线| 久久久午夜电影| 国产精品性做久久久久久| www精品美女久久久tv| 黄网站免费久久| 国产日韩精品一区| 成人激情综合网站| 亚洲欧美日韩中文字幕一区二区三区|