NNLM icon indicating copy to clipboard operation
NNLM copied to clipboard

nnlm with vector response

Open RamilNurtdinov opened this issue 2 years ago • 0 comments

Hi

I am trying to run nnlm functions. It is written that y : a vector or matrix of responses. However I cannot run the function with single column response.

Your example: x <- matrix(runif(5020), 50, 20); beta <- matrix(rexp(202), 20, 2); y <- x %% beta + 0.1matrix(runif(50*2), 50, 2);

beta.hat <- nnlm(x, y, loss = 'mkl'); This works perfectly

However beta.hat <- nnlm(x, y[,1], loss = 'mkl'); Error in colSums(sol$coefficients) : 'x' must be an array of at least two dimensions

I can make a temporary solution that works somehow z = cbind(y[,1], y[,1]) beta.hat <- nnlm(x, z, loss = 'mkl');

RamilNurtdinov avatar Aug 23 '22 23:08 RamilNurtdinov