capReg {cap} | R Documentation |

This function identifies the first *k* projection directions that satisfies the log-linear model assumption.

capReg(Y, X, nD = 1, method = c("CAP", "CAP-C"), CAP.OC = FALSE, max.itr = 1000, tol = 1e-04, trace = FALSE, score.return = TRUE, gamma0.mat = NULL, ninitial = NULL)

`Y` |
a data list of length |

`X` |
a |

`nD` |
an integer, the number of directions to be identified. Default is 1. |

`method` |
a character of optimization method. |

`CAP.OC` |
a logic variable. Whether the orthogonal constraint is imposed when identifying higher-order PCs. When |

`max.itr` |
an integer, the maximum number of iterations. |

`tol` |
a numeric value of convergence tolerance. |

`trace` |
a logic variable. Whether the solution path is reported. Default is |

`score.return` |
a logic variable. Whether the log-variance in the transformed space is reported. Default is |

`gamma0.mat` |
a data matrix, the initial value of |

`ninitial` |
an integer, the number of different initial value is tested. When it is greater than 1, multiple initial values will be tested, and the one yields the minimum objective function will be reported. Default is |

Considering *y_{it}* are *p*-dimensional independent and identically distributed random samples from a multivariate normal distribution with mean zero and covariance matrix *Σ_{i}*. We assume there exits a *p*-dimensional vector *γ* such that *z_{it}:=γ'y_{it}* satisfies the multiplicative heteroscedasticity:

*\log(\mathrm{Var}(z_{it}))=\log(γ'Σ_{i}γ)=β_{0}+x_{i}'β_{1}*

,
where *x_{i}* contains explanatory variables of subject *i*, and *β_{0}* and *β_{1}* are model coefficients.

Parameters *γ* and *β=(β_{0},β_{1}')'* are study of interest, and we propose to estimate them by maximizing the likelihood function,

*\ell(β,γ)=-\frac{1}{2}∑_{i=1}^{n}T_{i}(x_{i}'β)-\frac{1}{2}∑_{i=1}^{n}\exp(-x_{i}'β)γ'S_{i}γ,*

where *S_{i}=∑_{t=1}^{T_{i}}y_{it}y_{it}'*. To estimate *γ*, we impose the following constraint

*γ' Hγ=1,*

where *H* is a positive definite matrix. In this study, we consider the choice that

*H=\bar{Σ}, \quad \bar{Σ}=\frac{1}{n}∑_{i=1}^{n}\frac{1}{T_{i}}S_{i}.*

For higher order projecting directions, an orthogonal constraint is imposed as well.

When `method = "CAP"`

,

`gamma` |
the estimate of |

`beta` |
the estimate of |

`orthogonality` |
an ad hoc checking of the orthogonality between |

`DfD` |
output of both average (geometric mean) and individual level of “deviation from diagonality”. |

`score` |
an output when |

When `method = "CAP-C"`

,

`gamma` |
the estimate of |

`beta` |
the estimate of |

`orthogonality` |
an ad hoc checking of the orthogonality between |

`PC.idx` |
a vector of length |

`aPC.idx` |
the order index of all the principal components that satisfy the log-linear model and the eigenvalue condition. |

`minmax` |
a logic output, whether the identified |

`score` |
an output when |

Yi Zhao, Johns Hopkins University, <zhaoyi1026@gmail.com>

Bingkai Wang, Johns Hopkins University, <bwang51@jhmi.edu>

Stewart Mostofsky, Johns Hopkins University, <mostofsky@kennedykrieger.org>

Brian Caffo, Johns Hopkins University, <bcaffo@gmail.com>

Xi Luo, Brown University, <xi.rossi.luo@gmail.com>

Zhao et al. (2018) *Covariate Assisted Principal Regression for Covariance Matrix Outcomes* <doi:10.1101/425033>

############################################# data(env.example) X<-get("X",env.example) Y<-get("Y",env.example) # method = "CAP" # without orthogonal constraint re1<-capReg(Y,X,nD=2,method=c("CAP"),CAP.OC=FALSE) # with orthogonal constraint re2<-capReg(Y,X,nD=2,method=c("CAP"),CAP.OC=TRUE) # method = "CAP-C" re3<-capReg(Y,X,nD=2,method=c("CAP-C")) #############################################

[Package *cap* version 1.0 Index]