55 MLogit(
const arma::uvec &choice,
56 const arma::uvec &alt,
57 const arma::uvec &id_idx,
62 arma::vec weights = arma::vec());
64 arma::mat hessian(
bool update =
false);
65 arma::mat score(
bool update =
false,
bool indiv =
true);
68 void updateRef(
unsigned basealt);
69 void updatePar(arma::vec theta);
70 arma::vec getPar() {
return theta; }
72 void updateProb(arma::vec theta) {
77 const arma::vec* Weights() {
return &_weights; }
78 double Weights(
unsigned i) {
return _weights(i); }
80 const arma::uvec* Choice() {
return &_choice; }
81 unsigned Choice(
unsigned i) {
return _choice(i); }
83 const arma::uvec* Alt() {
return &_alt; }
84 unsigned Alt(
unsigned i) {
return _alt(i); }
86 const arma::mat* X() {
return &_x; }
87 arma::rowvec X(
unsigned row) {
return _x.row(row); }
89 const arma::mat* Z1() {
return &_z1; }
90 arma::rowvec Z1(
unsigned row) {
return _z1.row(row); }
92 const arma::mat* Z2() {
return &_z2; }
93 arma::rowvec Z2(
unsigned row) {
return _z2.row(row); }
95 const arma::uvec* cluster() {
return &_id_idx; }
96 unsigned cluster(
unsigned index) {
return _id_idx(index); }
98 void updateData(
const arma::uvec &choice,
99 const arma::uvec &alt,
100 const arma::uvec &id_idx,
104 const arma::vec &weights) {
Utility functions for Generalized Linear Models.
Various utility functions and constants.