Skip to content

Make multinom.reg accept a matrix with outcome counts & optionally also output variance-covariance matrix #19

@tomwenseleers

Description

@tomwenseleers

I was wondering if it would be possible to change the multinom.reg function so that it would accept a matrix with outcome counts Y (with different outcome levels in different columns), similar to the input format expected by the MGLMreg function in library(MGLM). Now it seems multinom.reg expects each individual count in long format, but this will of course become unfeasible & become very slow when one is dealing with large counts.

It could also be nice if there was an option to output the variance covariance matrix (input argument vcov=T or F). Here I posted a bit of Rcpp code to calculate that for a multinomial fit using Kronecker products: https://stackoverflow.com/questions/73811835/faster-way-to-calculate-the-hessian-fisher-information-matrix-of-a-nnetmulti

Very efficient multinomial regression algorithms with L2 norm (ridge) or L1 norm (LASSO) regularisation have also been described by
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1424458. I haven't yet seen those ported to R, though I saw a Matlab, C & C# implementation here :
https://github.com/slavomir-sidor/princeton-mvpa-toolbox/blob/master/core/learn/smlr.m
https://github.com/slavomir-sidor/princeton-mvpa-toolbox/blob/master/core/learn/smlr_mex.c
https://github.com/inzxx/adastra/blob/master/src/Accord24/Accord.Statistics/Models/Regression/Nonlinear/Fitting/LowerBoundNewtonRaphson.cs

There would be a closed-form formula for the variance-covariance matrix only for the ones with a ridge penalty though I believe...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions