Commit 6de2ec12 by Eric Coissac

### Rename parameter equal.var equal_var

parent 48ce57d0
 ... @@ -11,7 +11,7 @@ ... @@ -11,7 +11,7 @@ #' @param n an \code{int} value indicating the number of observations. #' @param n an \code{int} value indicating the number of observations. #' @param p an \code{int} value indicating the number of dimensions (variables) #' @param p an \code{int} value indicating the number of dimensions (variables) #' simulated #' simulated #' @param equal.var a \code{logical} value indicating if the dimensions must be scaled #' @param equal_var a \code{logical} value indicating if the dimensions must be scaled #' to force \code{sd=1}. \code{TRUE} by default. #' to force \code{sd=1}. \code{TRUE} by default. #' #' #' @return a numeric matrix of \code{n} rows and \code{p} columns #' @return a numeric matrix of \code{n} rows and \code{p} columns ... @@ -24,11 +24,11 @@ ... @@ -24,11 +24,11 @@ #' @author Eric Coissac #' @author Eric Coissac #' @author Christelle Gonindard-Melodelima #' @author Christelle Gonindard-Melodelima #' @export #' @export simulate_matrix <- function(n, p, equal.var = TRUE) { simulate_matrix <- function(n, p, equal_var = TRUE) { new <- rnorm(n * p, mean = 0, sd = 1) new <- rnorm(n * p, mean = 0, sd = 1) dim(new) <- c(n, p) dim(new) <- c(n, p) new <- scale(new, center = TRUE, scale = equal.var) new <- scale(new, center = TRUE, scale = equal_var) attributes(new)$scaled:center <- NULL attributes(new)$scaled:center <- NULL attributes(new)$scaled:scale <- NULL attributes(new)$scaled:scale <- NULL ... @@ -57,7 +57,7 @@ simulate_matrix <- function(n, p, equal.var = TRUE) { ... @@ -57,7 +57,7 @@ simulate_matrix <- function(n, p, equal.var = TRUE) { #' simulated #' simulated #' @param r2 the fraction of variation shared between the \code{reference} and the #' @param r2 the fraction of variation shared between the \code{reference} and the #' simulated data #' simulated data #' @param equal.var a \code{logical} value indicating if the dimensions must be scaled #' @param equal_var a \code{logical} value indicating if the dimensions must be scaled #' to force \code{sd=1}. \code{TRUE} by default. #' to force \code{sd=1}. \code{TRUE} by default. #' #' #' @return a numeric matrix of \code{nrow(reference)} rows and \code{p} columns #' @return a numeric matrix of \code{nrow(reference)} rows and \code{p} columns ... @@ -73,11 +73,11 @@ simulate_matrix <- function(n, p, equal.var = TRUE) { ... @@ -73,11 +73,11 @@ simulate_matrix <- function(n, p, equal.var = TRUE) { #' @author Christelle Gonindard-Melodelima #' @author Christelle Gonindard-Melodelima #' @export #' @export simulate_correlation <- function(reference, p, r2, equal.var = TRUE) { simulate_correlation <- function(reference, p, r2, equal_var = TRUE) { n <- nrow(reference) n <- nrow(reference) maxdim <- max(ncol(reference), p) maxdim <- max(ncol(reference), p) noise <- simulate_matrix(n, p, equal.var = equal.var) noise <- simulate_matrix(n, p, equal_var = equal_var) if (maxdim == p && maxdim > ncol(reference)) { if (maxdim == p && maxdim > ncol(reference)) { # noise is the largest matrix # noise is the largest matrix ... ...
 ... @@ -4,7 +4,7 @@ ... @@ -4,7 +4,7 @@ \alias{simulate_correlation} \alias{simulate_correlation} \title{Simulate n points of dimension p correlated with a reference matrix.} \title{Simulate n points of dimension p correlated with a reference matrix.} \usage{ \usage{ simulate_correlation(reference, p, r2, equal.var = TRUE) simulate_correlation(reference, p, r2, equal_var = TRUE) } } \arguments{ \arguments{ \item{reference}{a numeric matrix to which the simulated data will be correlated} \item{reference}{a numeric matrix to which the simulated data will be correlated} ... @@ -15,7 +15,7 @@ simulated} ... @@ -15,7 +15,7 @@ simulated} \item{r2}{the fraction of variation shared between the \code{reference} and the \item{r2}{the fraction of variation shared between the \code{reference} and the simulated data} simulated data} \item{equal.var}{a \code{logical} value indicating if the dimensions must be scaled \item{equal_var}{a \code{logical} value indicating if the dimensions must be scaled to force \code{sd=1}. \code{TRUE} by default.} to force \code{sd=1}. \code{TRUE} by default.} } } \value{ \value{ ... ...
 ... @@ -4,7 +4,7 @@ ... @@ -4,7 +4,7 @@ \alias{simulate_matrix} \alias{simulate_matrix} \title{Simulate n points of dimension p.} \title{Simulate n points of dimension p.} \usage{ \usage{ simulate_matrix(n, p, equal.var = TRUE) simulate_matrix(n, p, equal_var = TRUE) } } \arguments{ \arguments{ \item{n}{an \code{int} value indicating the number of observations.} \item{n}{an \code{int} value indicating the number of observations.} ... @@ -12,7 +12,7 @@ simulate_matrix(n, p, equal.var = TRUE) ... @@ -12,7 +12,7 @@ simulate_matrix(n, p, equal.var = TRUE) \item{p}{an \code{int} value indicating the number of dimensions (variables) \item{p}{an \code{int} value indicating the number of dimensions (variables) simulated} simulated} \item{equal.var}{a \code{logical} value indicating if the dimensions must be scaled \item{equal_var}{a \code{logical} value indicating if the dimensions must be scaled to force \code{sd=1}. \code{TRUE} by default.} to force \code{sd=1}. \code{TRUE} by default.} } } \value{ \value{ ... ...
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
 ... @@ -301,8 +301,8 @@ h0_sims = array(0,dim = c(n_sim,length(p_qs),8)) ... @@ -301,8 +301,8 @@ h0_sims = array(0,dim = c(n_sim,length(p_qs),8)) for (k in seq_len(n_sim)) for (k in seq_len(n_sim)) for (i in seq_along(p_qs)) { for (i in seq_along(p_qs)) { X <- simulate_matrix(n_indivdual,p_qs[i],equal.var = TRUE) X <- simulate_matrix(n_indivdual,p_qs[i],equal_var = TRUE) Y <- simulate_matrix(n_indivdual,p_qs[i],equal.var = TRUE) Y <- simulate_matrix(n_indivdual,p_qs[i],equal_var = TRUE) h0_sims[k,i,1] <- ProcMod::corls(X,Y,nrand = 0)[1,2] h0_sims[k,i,1] <- ProcMod::corls(X,Y,nrand = 0)[1,2] h0_sims[k,i,2] <- ProcMod::corls(X,Y,nrand = n_rand)[1,2] h0_sims[k,i,2] <- ProcMod::corls(X,Y,nrand = n_rand)[1,2] ... @@ -396,7 +396,7 @@ initial_var <- 3 ... @@ -396,7 +396,7 @@ initial_var <- 3 n_indivdual <- 20 n_indivdual <- 20 supplement_vars <- 0:50 supplement_vars <- 0:50 X = simulate_matrix(n = n_indivdual,p = initial_var,equal.var = TRUE) X = simulate_matrix(n = n_indivdual,p = initial_var,equal_var = TRUE) Y = simulate_correlation(reference = X, p = initial_var, r2 = 0.4) Y = simulate_correlation(reference = X, p = initial_var, r2 = 0.4) h1_sims_over = array(0,dim = c(length(supplement_vars),8)) h1_sims_over = array(0,dim = c(length(supplement_vars),8)) ... @@ -462,11 +462,11 @@ if (compute) { ... @@ -462,11 +462,11 @@ if (compute) { for (r in seq_along(r2s)) { for (r in seq_along(r2s)) { X <- simulate_matrix(n_indivduals[i], X <- simulate_matrix(n_indivduals[i], p_qs[j], p_qs[j], equal.var = TRUE) equal_var = TRUE) Y <- simulate_correlation(X, Y <- simulate_correlation(X, p_qs[j], p_qs[j], r2 = r2s[r], r2 = r2s[r], equal.var = TRUE) equal_var = TRUE) r2_sims[k,i,j,r,1] <- corls(X,Y,nrand = n_rand)[1,2] r2_sims[k,i,j,r,1] <- corls(X,Y,nrand = n_rand)[1,2] r2_sims[k,i,j,r,2] <- corls(X,Y,nrand = 0)[1,2] r2_sims[k,i,j,r,2] <- corls(X,Y,nrand = 0)[1,2] ... @@ -566,11 +566,11 @@ for (k in seq_len(n_sim)) { ... @@ -566,11 +566,11 @@ for (k in seq_len(n_sim)) { for (r in seq_along(r2s)) { for (r in seq_along(r2s)) { X <- simulate_matrix(n_indivduals[i], X <- simulate_matrix(n_indivduals[i], 1, 1, equal.var = TRUE) equal_var = TRUE) Y <- simulate_correlation(X, Y <- simulate_correlation(X, 1, 1, r2 = r2s[r], r2 = r2s[r], equal.var = TRUE) equal_var = TRUE) r2_sims_vec[k,i,r,1] <- corls(X,Y,nrand = n_rand)[1,2]^2 r2_sims_vec[k,i,r,1] <- corls(X,Y,nrand = n_rand)[1,2]^2 r2_sims_vec[k,i,r,2] <- corls(X,Y,nrand = 0)[1,2]^2 r2_sims_vec[k,i,r,2] <- corls(X,Y,nrand = 0)[1,2]^2 ... @@ -691,22 +691,22 @@ if (compute) { ... @@ -691,22 +691,22 @@ if (compute) { } else { } else { A <- simulate_matrix(n_indivdual, A <- simulate_matrix(n_indivdual, p_q, p_q, equal.var = TRUE) equal_var = TRUE) B <- simulate_correlation(A, B <- simulate_correlation(A, p_q, p_q, r2 = r2_AB, r2 = r2_AB, equal.var = TRUE) equal_var = TRUE) C <- simulate_correlation(B, C <- simulate_correlation(B, p_q, p_q, r2 = r2_BC, r2 = r2_BC, equal.var = TRUE) equal_var = TRUE) D <- simulate_correlation(C, D <- simulate_correlation(C, p_q, p_q, r2 = r2_CD, r2 = r2_CD, equal.var = TRUE) equal_var = TRUE) partial.data = procmod_frame(A=A,B=B,C=C,D=D) partial.data = procmod_frame(A=A,B=B,C=C,D=D) partial_r2_sims[k, , ,1] <- corls_partial(partial.data,nrand = n_rand) partial_r2_sims[k, , ,1] <- corls_partial(partial.data,nrand = n_rand) ... @@ -799,8 +799,8 @@ h0_alpha = array(0,dim = c(n_sim,length(p_qs),3)) ... @@ -799,8 +799,8 @@ h0_alpha = array(0,dim = c(n_sim,length(p_qs),3)) for (k in seq_len(n_sim)) for (k in seq_len(n_sim)) for (i in seq_along(p_qs)) { for (i in seq_along(p_qs)) { X <- simulate_matrix(n_indivdual,p_qs[i],equal.var = TRUE) X <- simulate_matrix(n_indivdual,p_qs[i],equal_var = TRUE) Y <- simulate_matrix(n_indivdual,p_qs[i],equal.var = TRUE) Y <- simulate_matrix(n_indivdual,p_qs[i],equal_var = TRUE) h0_alpha[k,i,1] <- attr(corls(X,Y,nrand = n_rand),"p.value")[1,2] h0_alpha[k,i,1] <- attr(corls(X,Y,nrand = n_rand),"p.value")[1,2] h0_alpha[k,i,2] <- vegan::protest(X,Y,permutations = n_rand)$signif h0_alpha[k,i,2] <- vegan::protest(X,Y,permutations = n_rand)$signif ... @@ -865,11 +865,11 @@ if (compute) { ... @@ -865,11 +865,11 @@ if (compute) { for (r in seq_along(r2s)) { for (r in seq_along(r2s)) { X <- simulate_matrix(n_indivduals[i], X <- simulate_matrix(n_indivduals[i], p_qs[j], p_qs[j], equal.var = TRUE) equal_var = TRUE) Y <- simulate_correlation(X, Y <- simulate_correlation(X, p_qs[j], p_qs[j], r2 = r2s[r], r2 = r2s[r], equal.var = TRUE) equal_var = TRUE) h1_sims[k,i,j,r,1] <- attr(corls(X,Y,nrand = n_rand),"p.value")[1,2] h1_sims[k,i,j,r,1] <- attr(corls(X,Y,nrand = n_rand),"p.value")[1,2] h1_sims[k,i,j,r,2] <- suppressWarnings(vegan::protest(X,Y,permutations = n_rand)$signif) h1_sims[k,i,j,r,2] <- suppressWarnings(vegan::protest(X,Y,permutations = n_rand)$signif) ... ...
No preview for this file type
 ... @@ -373,7 +373,7 @@ To evaluate relative the power of the three considered tests, pairs of to random ... @@ -373,7 +373,7 @@ To evaluate relative the power of the three considered tests, pairs of to random \begin{table}[!t] \begin{table}[!t] \processtable{Estimation of $\overline{\rcovls(\X,\Y)}$ according to the number of random matrices (k) aligned.\label{tab:mrcovls}}{ \processtable{Estimation of $\overline{\rcovls(\X,\Y)}$ according to the number of random matrices (k) aligned.\label{tab:mrcovls}}{ % latex table generated in R 3.5.2 by xtable 1.8-4 package % latex table generated in R 3.5.2 by xtable 1.8-4 package % Tue Oct 1 15:28:19 2019 % Tue Oct 1 18:48:35 2019 \begin{tabular}{rrrrrrr} \begin{tabular}{rrrrrrr} \hline \hline & & \multicolumn{2}{c}{normal} & & \multicolumn{2}{c}{exponential}\\ \cline{3-4} \cline{6-7}p & k &\multicolumn{1}{c}{mean} & \multicolumn{1}{c}{sd} & \multicolumn{1}{c}{ } &\multicolumn{1}{c}{mean} & \multicolumn{1}{c}{sd}\\\hline\multirow{3}{*}{10} & 10 & 0.5746 & $1.3687 \times 10^{-2}$ & & 0.5705 & $1.1714 \times 10^{-2}$ \\ & & \multicolumn{2}{c}{normal} & & \multicolumn{2}{c}{exponential}\\ \cline{3-4} \cline{6-7}p & k &\multicolumn{1}{c}{mean} & \multicolumn{1}{c}{sd} & \multicolumn{1}{c}{ } &\multicolumn{1}{c}{mean} & \multicolumn{1}{c}{sd}\\\hline\multirow{3}{*}{10} & 10 & 0.5746 & $1.3687 \times 10^{-2}$ & & 0.5705 & $1.1714 \times 10^{-2}$ \\ ... @@ -475,7 +475,7 @@ whatever the $p$ tested (Table~\ref{tab:alpha_pvalue}). This ensure that the pro ... @@ -475,7 +475,7 @@ whatever the $p$ tested (Table~\ref{tab:alpha_pvalue}). This ensure that the pro of the distribution of $P_{values}$ correlation test to $\mathcal{U}(0,1)$ of the distribution of $P_{values}$ correlation test to $\mathcal{U}(0,1)$ under the null hypothesis.\label{tab:alpha_pvalue}} { under the null hypothesis.\label{tab:alpha_pvalue}} { % latex table generated in R 3.5.2 by xtable 1.8-4 package % latex table generated in R 3.5.2 by xtable 1.8-4 package % Tue Oct 1 15:28:22 2019 % Tue Oct 1 18:48:38 2019 \begin{tabular*}{0.98\linewidth}{@{\extracolsep{\fill}}crrr} \begin{tabular*}{0.98\linewidth}{@{\extracolsep{\fill}}crrr} \hline \hline & \multicolumn{3}{c}{Cramer-Von Mises p.value} \\ & \multicolumn{3}{c}{Cramer-Von Mises p.value} \\ ... @@ -497,7 +497,7 @@ Power of the $CovLs$ test based on the estimation of $\overline{RCovLs(X,Y)}$ is ... @@ -497,7 +497,7 @@ Power of the $CovLs$ test based on the estimation of $\overline{RCovLs(X,Y)}$ is \begin{table}[!t] \begin{table}[!t] \processtable{Power estimation of the procruste tests for two low level of shared variations $5\%$ and $10\%$.\label{tab:power}} { \processtable{Power estimation of the procruste tests for two low level of shared variations $5\%$ and $10\%$.\label{tab:power}} { % latex table generated in R 3.5.2 by xtable 1.8-4 package % latex table generated in R 3.5.2 by xtable 1.8-4 package % Tue Oct 1 15:28:22 2019 % Tue Oct 1 18:48:38 2019 \begin{tabular}{lcrrrrrrrrr} \begin{tabular}{lcrrrrrrrrr} \hline \hline & $R^2$ & \multicolumn{4}{c}{5\%} & &\multicolumn{4}{c}{10\%} \\ & $R^2$ & \multicolumn{4}{c}{5\%} & &\multicolumn{4}{c}{10\%} \\ ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!