本文整理汇总了C++中CData::logY方法的典型用法代码示例。如果您正苦于以下问题:C++ CData::logY方法的具体用法?C++ CData::logY怎么用?C++ CData::logY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CData
的用法示例。
在下文中一共展示了CData::logY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void CParam::Initialize(CData &Data){
n_pheno = Data.Y.n_rows ; n_SNP = Data.Y.n_cols ; // constants but stored in CParam for convienence
Data.logY = arma::zeros<arma::mat>(n_pheno,n_SNP) ;
// Note 1. This is used to calculate sum of log y_it when e_it=1.
// 2. (Weak signal) Because e_it=0 with y_it <= 0 by definition (model assumption),
// we will not use log y_it for e_it=0 and store zero here.
// 3. (Strong signal) Also, we put e_it=1 when y_it > threshold // V 1.3.1
for (int i_pheno=0; i_pheno<n_pheno; i_pheno++ ){
for (int i_SNP=0; i_SNP<n_SNP; i_SNP++ ){
if ( Data.Y(i_pheno,i_SNP) > 0){ // V 2.0.2
Data.logY(i_pheno,i_SNP) = log(Data.Y(i_pheno,i_SNP)) ;
if ( Data.Y(i_pheno,i_SNP) > Data.threshold_on ) E_mat(i_pheno,i_SNP) = 1 ;
} else {
E_mat(i_pheno,i_SNP) = 0 ;
}
}
}
normC = normC_fn(Beta, Data) ; // Ver_1_4_1
if ( normC < 0 ){
Rcpp::stop("The initialized normC has a negative value.") ;
}
Data.msg_level = 0; //0 errors only; 1: errors and warnings; 2: errors, warnings and information
sum_E_ijt = arma::zeros<arma::cube>(n_pheno,n_pheno,n_SNP) ;
is_initialized = 1 ;
}