Description Usage Arguments Details Value Author(s) References See Also Examples

When testing for the covariance structure of modes, this function may be used to draw a sample from the null distribution of the likelihood ratio test stistics, whose distribution doesn't depend on any unknown parameters under the null.

1 2 3 |

`p` |
A vector of integers. The dimensions of the array. |

`null_ident` |
A vector of integers. The modes that under the null have identity covariance. |

`alt_ident` |
A vector of integers. The modes that under the alternative have the identity covariance. |

`null_diag` |
A vector of integers. The modes that under the null have diagonal covariance. |

`alt_diag` |
A vector of integers. The modes that under the alternative have diagonal covariance. |

`reference_dist` |
Two options are supported, 'normal' and 't'. If 't' is
specified, you have to specify |

`t_df` |
A numeric. If |

`itermax` |
An integer. The number of draws from the null distribution of the likelihood ratio test statistic that is to be performed. |

`holq_itermax` |
An integer. The maximum number of block coordinate ascent iterations to perform when calculating the MLE at each step. |

`holq_tol` |
A numeric. The stopping criterion when calculating the MLE. |

Let *vec(X)* be *N(0,Σ)*. Given two nested hypotheses,

*H_1:
Σ = Ψ_K\otimes\cdots\otimesΨ_1*

versus

*H_0: Σ =
Ω_K\otimes\cdots\otimesΩ_1,*

this function will draw from the null
distribution of the likelihood ratio test statistic. The possible options are
that *Ψ_i* or *Ω_i* are the identity matrix, a diagonal
matrix, or any positive definite matrix. By default, it's assumed that these
matrices are any positive definite matrix.

Unfortunately, this fuction does not support testing for the hypothesis of modeling the covariance between two modes with a single covariance matrix. I might code this up in later versions.

A vector of draws from the null distribution of the likelihood ratio test statistic.

David Gerard.

Gerard, D., & Hoff, P. (2016). A higher-order LQ
decomposition for separable covariance models.
*Linear Algebra and its Applications*, 505, 57-84.
https://doi.org/10.1016/j.laa.2016.04.033
http://arxiv.org/pdf/1410.1094v1.pdf

`lrt_stat`

for calculating the likelihood ratio test
statistic.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ```
#Test for all identity versus all unconstrained.
p = c(4,4,4)
null1 <- lrt_null_dist_dim_same(p,null_ident = 1:3)
#Generate Null Data
X <- array(stats::rnorm(prod(p)), dim = p)
sig_null <- holq(X, mode_rep = 1:3)$sig
sig_alt <- holq(X)$sig
lrt_x <- lrt_stat(sig_null, sig_alt, p = p)
p_value <- mean(null1 > lrt_x)
hist(null1,main = 'Null Distribution of LRT', xlab = 'LRT Statistic')
abline(v = lrt_x, lty = 2, col = 2, lwd = 2)
legend('topleft', 'Observed LRT Statistic', lty = 2, col = 2, lwd = 2)
mtext(side = 1, paste('P-value = ', round(p_value, digits = 2), sep = ''),
line = 2)
#-------------------------------------------------------------------------
#Test for all identity versus all mode 1 identity,
# mode 2 diagonal, mode 3 unconstrained.
p = c(4,4,4)
null2 <- lrt_null_dist_dim_same(p,null_ident = 1:3,
alt_ident = 1, alt_diag = 2)
#Generate Null Data
X <- array(stats::rnorm(prod(p)), dim = p)
sig_null <- holq(X, mode_rep = 1:3)$sig
sig_alt <- holq(X, mode_rep = 1, mode_diag = 2)$sig
lrt_x <- lrt_stat(sig_null, sig_alt, p = p)
p_value <- mean(null2 > lrt_x)
hist(null2,main = 'Null Distribution of LRT', xlab = 'LRT Statistic')
abline(v = lrt_x, lty = 2, col = 2, lwd = 2)
legend('topleft', 'Observed LRT Statistic', lty = 2, col = 2, lwd = 2)
mtext(side = 1, paste('P-value = ', round(p_value, digits = 2), sep = ''),
line = 2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.