Fit a multinomial model the Global Adaptive Generative Adjustment algorithm
cpp_multinomial_gaga(
X,
y,
s_alpha,
s_itrNum,
s_thresh,
s_flag,
s_lamda_0,
s_fdiag,
s_subItrNum
)
Coefficient matrix with K-1 columns, where K is the class number. For k=1,..,K-1, the probability $$Pr(G=k|x)=exp(x^T beta_k) /(1+sum_{k=1}^{K-1}exp(x^T beta_k))$$. For k=K, the probability $$Pr(G=K|x)=1/(1+sum_{k=1}^{K-1}exp(x^T beta_k))$$.
Input matrix, of dimension nobs*nvars; each row is an observation.
If the intercept term needs to be considered in the estimation process, then the first column of X
must be all 1s.
a One-hot response matrix or a nc>=2
level factor
Hyperparameter. The suggested value for alpha is 1 or 2. When the collinearity of the load matrix is serious, the hyperparameters can be selected larger, such as 5.
The number of iteration steps. In general, 20 steps are enough.
If the condition number of X
is large, it is recommended to greatly increase the
number of iteration steps.
Convergence threshold for beta Change, if max(abs(beta-beta_old))<threshold
, return.
It identifies whether to make model selection. The default is TRUE
.
The initial value of the regularization parameter for ridge regression. The running result of the algorithm is not sensitive to this value.
It identifies whether to use diag Approximation to speed up the algorithm.
Maximum number of steps for subprocess iterations.