Skip to content

Simple logit example

Keith O'Hara edited this page Mar 15, 2017 · 2 revisions

Simple example:

arma::mat U(2,3);
U  << 1.6 << 3.2 << 1.1 << arma::endr
   << 2.9 << 1.0 << 3.1 << arma::endr;
    
arma::mat mu(2,3);
mu << 1.0 << 3.0 << 1.0 << arma::endr
   << 2.0 << 1.0 << 3.0 << arma::endr;

int nbX = U.n_rows;
int nbY = U.n_cols;
    
arma::vec n = arma::sum(mu,1);

trame::logit logits(nbX,nbY);

logits.U = U;
logits.mu = mu;

double G_val = logits.G(n);
double Gstar_val = logits.Gstar(n);
Clone this wiki locally