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

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

?? lsq.cpp

?? orange源碼 數據挖掘技術
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
			pos1 = start;
			pos2 = pos;
			total = zero;
			for( k = row+1; k <= col-1; ++k) {
				pos2 = pos2 + nreq - k;
				total = total - r[pos1] * rinv[pos2];
				pos1 = pos1 + 1;
			}
			rinv[pos] = total - r[pos1];
			pos = pos - 1;
		}
	}
}


void lsq::partial_corr(int in, double *cormat, int dimc, double *ycorr, int& ifault) {
/*
!     Replaces subroutines PCORR and COR of:
!     ALGORITHM AS274  APPL. STATIST. (1992) VOL.41, NO. 2

  !     Calculate partial correlations after the variables in rows
  !     1, 2, ..., IN have been forced into the regression.
  !     If IN = 1, and the first row of R represents a constant in the
  !     model, then the usual simple correlations are returned.
  !	    If IN = 0, the value returned in array CORMAT for the correlation
  !     of variables Xi & Xj is:
  !       sum ( Xi.Xj ) / sqrt ( sum (Xi^2) . sum (Xj^2) )
  !     On return, array CORMAT contains the upper triangle of the matrix of
  !     partial correlations stored by rows, excluding the 1's on the diagonal.
  !     e.g. if IN = 2, the consecutive elements returned are:
  !     (3,4) (3,5) ... (3,ncol), (4,5) (4,6) ... (4,ncol), etc.
  !     Array YCORR stores the partial correlations with the Y-variable
  !     starting with YCORR(IN+1) = partial correlation with the variable in
  !     position (IN+1).
  !
  !--------------------------------------------------------------------------
	*/
	
	
	int base_pos, pos, row, col, col1, col2, pos1, pos2,k;
	double *rms, sumxx, sumxy, sumyy, *work;
	
	rms = new double[ncol+1];
	work = new double[ncol+1];
	
	
	ifault = 0;
	if (in < 0 || in > ncol-1) ifault = ifault + 4;
	if (dimc < (ncol-in)*(ncol-in-1)/2) ifault = ifault + 8;
	if (ifault != 0) return;
	
	//!     Base position for calculating positions of elements in row (IN+1) of R.
	
	base_pos = in*ncol - (in+1)*(in+2)/2;
	
	
	//!     Calculate 1/RMS of elements in columns from IN to (ncol-1).
	
	if (d[in+1] > zero) 
		rms[in+1] = one / sqrt(d[in+1]);
	for (col = in+2;col<= ncol; ++col) {
		pos = base_pos + col;
		sumxx = d[col];
		for(row = in+1; row <= col-1; ++row) {
			sumxx = sumxx + d[row] * r[pos]*r[pos];
			pos = pos + ncol - row - 1;
		}
		if (sumxx > zero) 
			rms[col] = one / sqrt(sumxx);
		else {
			rms[col] = zero;
			ifault = -col;
			
		}
	}
	
	//    Calculate 1/RMS for the Y-variable
	
	sumyy = sserr;
	for(row = in+1;row <= ncol;++row) {
		sumyy = sumyy + d[row]* rhs[row]*rhs[row];
	}
	if (sumyy > zero) sumyy = one / sqrt(sumyy);
	
	/*
	!     Calculate sums of cross-products.
	!     These are obtained by taking dot products of pairs of columns of R,
	!     but with the product for each row multiplied by the row multiplier
	!     in array D.
	*/
	pos = 1;
	for (col1 = in+1; col1 <= ncol; ++col1) {
		sumxy = zero;
		for (k = col1+1; k <= ncol; ++k) {
			work[k] = zero;
		}
		pos1 = base_pos + col1;
		for(row = in+1; row <= col1-1; ++row) {
			pos2 = pos1 + 1;
			for(col2 = col1+1; col2 <= ncol; ++col2) {
				work[col2] = work[col2] + d[row] * r[pos1] * r[pos2];	  
				pos2 = pos2 + 1;
			}
			sumxy = sumxy + d[row] * r[pos1] * rhs[row];
			pos1 = pos1 + ncol - row - 1;
		}
		
		//!     Row COL1 has an implicit 1 as its first element (in column COL1)
		
		pos2 = pos1 + 1;
		for (col2 = col1+1; col2<= ncol; ++col2) {
			work[col2] = work[col2] + d[col1] * r[pos2];
			pos2 = pos2 + 1;
			cormat[pos] = work[col2] * rms[col1] * rms[col2];
			pos = pos + 1;
		}
		sumxy = sumxy + d[col1] * rhs[col1];
		ycorr[col1] = sumxy * rms[col1] * sumyy;
	}
	
	for (k = 1; k <= in; ++k) {
		ycorr[k] = zero;
	}
	
	return;
}




void lsq::vmove(int from, int to, int& ifault) {
/*
!     ALGORITHM AS274 APPL. STATIST. (1992) VOL.41, NO. 2
!     Move variable from position FROM to position TO in an
!     orthogonal reduction produced by AS75.1.
!
!--------------------------------------------------------------------------
	*/
	
	double d1, d2, x, d1new, d2new, cbar, sbar, y;
	int m, first, last, inc, m1, m2, mp1, col, pos, row,k;
	
	//!     Check input parameters
	
	ifault = 0;
	if (from < 1 || from > ncol) ifault = ifault + 4;
	if (to < 1 || to > ncol) ifault = ifault + 8;
	if (ifault != 0) return;
	
	if (from == to) {
		return;
	}
	
	if (!rss_set) ss();
	
	if (from < to) {
		first = from;
		last = to;
		inc = 1;
	} else {
		first = from - 1;
		last = to-1;
		inc = -1;
	}
	
	for (m = first; m != last; m += inc) { 
		
		//!     Find addresses of first elements of R in rows M and (M+1).
		
		m1 = (m-1)*(ncol+ncol-m)/2 + 1;
		m2 = m1 + ncol - m;
		mp1 = m + 1;
		d1 = d[m];
		d2 = d[mp1];
		
		//!     Special cases.
		
		if ((d1 < vsmall && d2 < vsmall)) {
			goto l40;
		}
		x = r[m1];
		if (fabs(x) * sqrt(d1) < tol[mp1]) {
			x = zero;
		}
		if (d1 < vsmall || fabs(x) < vsmall) {
			d[m] = d2;
			d[mp1] = d1;
			r[m1] = zero;
			for(col = m+2;col<= ncol; ++col) {
				m1 = m1 + 1;
				x = r[m1];
				r[m1] = r[m2];
				r[m2] = x;
				m2 = m2 + 1;
			}
			x = rhs[m];
			rhs[m] = rhs[mp1];
			rhs[mp1] = x;
		} else if (d2 < vsmall) {
			d[m] = d1 * x*x;
			r[m1] = one / x;
			for (k = m1+1; k <=m1+ncol-m-1; ++k) {
				r[k] /= x;
			}
			rhs[m] = rhs[m] / x;
		} else {
			l40:
			
			//!
			//!     Planar rotation in regular case.
			//!
			d1new = d2 + d1*x*x;
			cbar = d2 / d1new;
			sbar = x * d1 / d1new;
			d2new = d1 * cbar;
			d[m] = d1new;
			d[mp1] = d2new;
			r[m1] = sbar;
			for(col = m+2; col <= ncol; ++col) {
				m1 = m1 + 1;
				y = r[m1];
				r[m1] = cbar*r[m2] + sbar*y;
				r[m2] = y - x*r[m2];
				m2 = m2 + 1;
			}
			y = rhs[m];
			rhs[m] = cbar*rhs[mp1] + sbar*y;
			rhs[mp1] = y - x*rhs[mp1];
		}
		//!     Swap columns M and (M+1) down to row (M-1).
		
		if (m != 1) {
			pos = m;
			for (row = 1; row<= m-1; ++row) {
				x = r[pos];
				r[pos] = r[pos-1];
				r[pos-1] = x;
				pos = pos + ncol - row - 1;
			}
			
			//!     Adjust variable order (VORDER), the tolerances (TOL) and
			//!     the vector of residual sums of squares (RSS).
			
			m1 = vorder[m];
			vorder[m] = vorder[mp1];
			vorder[mp1] = m1;
			//printf("%i %i %f %f\n",m,mp1,tol[m],tol[mp1]);
			x = tol[m];
			tol[m] = tol[mp1];
			tol[mp1] = x;
			rss[m] = rss[mp1] + d[mp1] * rhs[mp1]*rhs[mp1];
		}
	}
	
	return;
}


void lsq::reordr(int *list, int n, int pos1, int& ifault) {
/*
!     ALGORITHM AS274  APPL. STATIST. (1992) VOL.41, NO. 2

  !     Re-order the variables in an orthogonal reduction produced by
  !     AS75.1 so that the N variables in LIST start at position POS1,
  !     though will not necessarily be in the same order as in LIST.
	!     Any variables in VORDER before position POS1 are not moved.		*/
	int next, i, l, j;
	
	//!     Check N.
	
	ifault = 0;
	if (n < 1 || n > ncol+1-pos1) ifault = ifault + 4;
	if (ifault != 0) return;
	
	//!     Work through VORDER finding variables which are in LIST.
	
	next = pos1;
	i = pos1;
	l10:   l = vorder[i];
	for(j = 1; j <= n; ++j) {
		if (l == list[j]) goto l40;
	}
	l30:
	i = i + 1;
	if (i <= ncol) goto l10;
	
	//!     If this point is reached, one or more variables in LIST has not
	//!     been found.
	
	ifault = 8;
	return;
	
	//!     Variable L is in LIST; move it up to position NEXT if it is not
	//!     already there.
	
	l40:
	if (i > next) 
		vmove(i, next,ifault);
	next = next + 1;
	if (next < n+pos1) goto l30;
	
	return;
}



void lsq::hdiag(double *xrow, int nreq, double& hii,int& ifault) {
	int  col, row, pos;
	double total, *wk;
	
	//!     Some checks
	
	ifault = 0;
	if (nreq > ncol) ifault = ifault + 4;
	if (ifault != 0) {
		return;
	}
	
	wk = new double[ncol+1];
	
	//!     The elements of xrow.inv(R).sqrt(D) are calculated and stored
	//!     in WK.
	
	hii = zero;
	for( col = 1; col <= nreq; ++col) {
		if (sqrt(d[col]) <= tol[col]) {
			wk[col] = zero;
		} 
		else {
			pos = col - 1;
			total = xrow[col];
			for (row = 1; row <= col-1; ++row) {
				total = total - wk[row]*r[pos];
				pos = pos + ncol - row - 1;
			}
			wk[col] = total;
			hii = hii + total*total / d[col];
		}
	}
	delete[] wk;
	return;
}		


double lsq::varprd(double *x, int nreq, double& var, int& ifault) {
	
	//!     Calculate the variance of x'b where b consists of the first nreq
	//!     least-squares regression coefficients.
	
	int  row;
	double *wk, rvarprd;
	
	//!     Check input parameter values
	
	rvarprd = zero;
	ifault = 0;
	if (nreq < 1 || nreq > ncol) ifault = ifault + 4;
	if (nobs <= nreq) ifault = ifault + 8;
	if (ifault != 0) 
		return 0.0;
	
	wk = new double[nreq+1];
	
	//!     Calculate the residual variance estimate.
	
	var = sserr / (nobs - nreq);
	
	//!     Variance of x'b = var.x'(inv R)(inv D)(inv R')x
	//!     First call BKSUB2 to calculate (inv R')x by back-substitution.
	
	bksub2(x, wk, nreq);
	for( row = 1; row <= nreq; ++row) {
		if(d[row] > tol[row]) 
			rvarprd += wk[row]*wk[row] / d[row];
	}
	rvarprd = rvarprd * var;
	
	delete[] wk;
	
	return rvarprd;
}



void lsq::bksub2(double *x, double *b, int nreq) {
	
	//!     Solve x = R'b for b given x, using only the first nreq rows and
	//!     columns of R, and only the first nreq elements of R.
	
	int  pos, row, col;
	double temp;
	
	//!     Solve by back-substitution, starting from the top.
	
	for( row = 1; row<= nreq; ++row) {
		pos = row - 1;
		temp = x[row];
		for(col = 1; col <= row-1; ++col) {
			temp = temp - r[pos]*b[col];
			pos = pos + ncol - col - 1;
		}
		b[row] = temp;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美群妇大交群的观看方式| 久久精品在这里| 一区二区三区不卡视频在线观看| 91色乱码一区二区三区| 亚洲欧美日韩中文播放 | 在线观看日韩一区| 一区二区欧美在线观看| 欧美精品久久一区二区三区| 石原莉奈在线亚洲二区| 26uuu久久天堂性欧美| 福利电影一区二区| 亚洲最新视频在线播放| 欧美日韩激情在线| 久久精品久久久精品美女| 久久久久久电影| 91麻豆swag| 青青草原综合久久大伊人精品优势 | 亚洲一区二区三区免费视频| 91年精品国产| 免费欧美在线视频| 国产精品理论片在线观看| 欧美性生活影院| 国内一区二区视频| 一区二区三区四区蜜桃 | 国产成人免费视频网站| 亚洲精品国产精华液| 日韩一区二区免费电影| 99久久精品国产网站| 婷婷六月综合网| 国产精品久久久久桃色tv| 欧美群妇大交群中文字幕| 国产91对白在线观看九色| 亚洲国产视频在线| 国产精品久久久久永久免费观看| 欧美日韩一区在线| 成人综合婷婷国产精品久久蜜臀| 亚洲高清三级视频| 国产精品久久久久久久久久久免费看 | 色综合一个色综合| 国产做a爰片久久毛片| 一区二区视频免费在线观看| 精品国产一区二区三区四区四 | 欧美日韩精品一区二区三区| 国产99久久久国产精品潘金| 日本v片在线高清不卡在线观看| 亚洲视频电影在线| 国产婷婷一区二区| 精品国产区一区| 欧美二区三区的天堂| 色综合激情五月| 成人综合激情网| 国产一区二区影院| 久久国内精品自在自线400部| 亚洲国产成人高清精品| 国产精品不卡视频| 国产精品污污网站在线观看| 日韩一级二级三级| 69堂成人精品免费视频| 日本道在线观看一区二区| 成人精品小蝌蚪| 国产一区二区三区观看| 免费av成人在线| 日本欧美肥老太交大片| 午夜精品福利一区二区蜜股av| 亚洲欧美欧美一区二区三区| 国产精品电影一区二区三区| 国产欧美一区二区三区鸳鸯浴| 欧美一个色资源| 欧美剧情片在线观看| 欧美日本国产一区| 欧美一区二区美女| 欧美一级免费大片| 日韩视频不卡中文| 日韩欧美国产一区二区三区| 日韩免费性生活视频播放| 日韩欧美一区二区不卡| 精品国产sm最大网站| 精品动漫一区二区三区在线观看| 日韩午夜小视频| 精品捆绑美女sm三区| 久久久久国产精品免费免费搜索| 欧美精品一区二区三| 久久先锋影音av鲁色资源网| 国产丝袜欧美中文另类| 国产精品色哟哟| 一色屋精品亚洲香蕉网站| 夜夜揉揉日日人人青青一国产精品| 亚洲免费av高清| 午夜精品久久久久久久久| 日韩成人一区二区| 国产精品自拍毛片| 成人18视频在线播放| 色屁屁一区二区| 欧美一区二区三区免费在线看 | 欧美激情中文字幕| 亚洲免费资源在线播放| 亚洲成av人片在www色猫咪| 蜜桃精品在线观看| 成人午夜电影网站| 欧美日韩一区不卡| 精品国产不卡一区二区三区| 国产精品美女久久久久久2018| 一区二区三区视频在线看| 全部av―极品视觉盛宴亚洲| 国产精品一区二区x88av| 99久久精品免费看国产免费软件| 在线观看日韩电影| 精品福利一区二区三区免费视频| 中文字幕不卡的av| 天天av天天翘天天综合网| 韩国欧美国产1区| 91同城在线观看| 欧美v日韩v国产v| 18欧美亚洲精品| 久久99久久99| 91成人在线免费观看| 久久久亚洲精品石原莉奈 | 久久久一区二区| 亚洲在线观看免费| 国产精品91xxx| 欧美日韩国产大片| 欧美激情一区二区三区在线| 亚洲第一成人在线| 成人美女视频在线看| 91精品国产综合久久久久| 国产精品国产三级国产普通话蜜臀| 日韩一区精品视频| 91蜜桃在线免费视频| 2020日本不卡一区二区视频| 亚洲与欧洲av电影| av在线不卡电影| 久久久久久免费| 秋霞电影一区二区| 色噜噜狠狠色综合中国 | 中文字幕一区二区在线观看| 日日摸夜夜添夜夜添国产精品| 99久久伊人精品| 久久久久久久国产精品影院| 亚洲成人精品一区| 91麻豆产精品久久久久久| 欧美国产欧美亚州国产日韩mv天天看完整 | 五月婷婷综合在线| 色偷偷成人一区二区三区91| 国产午夜精品一区二区三区视频 | 国产午夜三级一区二区三| 日韩精品亚洲专区| 欧美色偷偷大香| 亚洲三级在线看| 从欧美一区二区三区| 久久综合99re88久久爱| 久草这里只有精品视频| 日韩三级中文字幕| 蜜桃av一区二区三区| 欧美久久久久免费| 亚洲成人av电影| 欧美日韩国产高清一区二区| 一区二区三区在线免费播放 | 午夜精品久久久久久久久久久| 色综合久久中文字幕| 中文字幕综合网| 91尤物视频在线观看| 亚洲日本va在线观看| 99国产精品视频免费观看| 亚洲欧洲日韩av| 91婷婷韩国欧美一区二区| 亚洲美女免费视频| 欧美亚洲国产一卡| 亚洲第一成人在线| 69堂国产成人免费视频| 男女激情视频一区| 精品1区2区在线观看| 国产精品一二三四五| 欧美激情综合在线| 91论坛在线播放| 亚洲国产欧美在线| 日韩欧美另类在线| 国产98色在线|日韩| 国产精品美女久久久久久久网站| 成人高清视频在线观看| 中文字幕人成不卡一区| 欧洲精品在线观看| 日韩国产在线观看一区| 精品久久久久久久久久久久包黑料 | 九一九一国产精品| 久久精品免视看| 91在线视频网址| 日韩国产精品久久久久久亚洲| 精品国产凹凸成av人导航| av成人免费在线| 午夜精品福利一区二区蜜股av| 精品蜜桃在线看| 不卡视频一二三四| 五月天激情综合| 国产亚洲欧美色| 欧美午夜精品久久久久久超碰| 麻豆精品精品国产自在97香蕉| 欧美激情一二三区| 欧美精品1区2区3区| 激情综合网最新| 一区二区三区波多野结衣在线观看|