slm_fit_csr | R Documentation |
[SparseM's slm.fit.csr()] expects a full-rank x that's not just a column of 1s. This variant somewhat relaxes these expectations.
slm_fit_csr(x, y, ...)
x |
As slm.fit.csr |
y |
As slm.fit.csr |
... |
As slm.fit.csr |
'slm.fit.csr' has a bug for intercept only models (admittedly, these are generally a little silly to be done as a sparse matrix), but in order to avoid duplicate code, if everything is in a single strata, we use the intercept only model.
This function's expectation of x is that either it has full column rank, or the reduced submatrix of x that excludes all-zero columns has full column rank. (When this expectation is not met, it's likely that [SparseM::chol()] will fail, causing this function to error; the error messages won't necessarily suggest this.) The positions of nonzero x-columns (ie columns with nonzero entries) are returns as the value of 'gramian_reduction_index', while 'chol' is the Cholesky decomposition of that submatrix's Gramian.
A list consisting of:
coefficients |
coefficients |
chol |
Cholesky factor of Gramian matrix |
residuals |
residuals |
fitted |
fitted values |
df.residual |
degrees of freedom |
gramian_reduction_index |
Column indices identifying reduction of x matrix of which Gramian is taken; see Details |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.