Skip to content

Trouble with mixreg

1 message · Rolf Turner

#
Just read your email about mixreg.  The problem is the assignment

	y <- as.matrix(LRINTER)

The y argument has to be a ***vector***, not a matrix.  Deep in the
bowels of mixreg, yhat is formed as a matrix of fitted values for all
of the models in the mixture.  (The first column of yhat consists of
the fitted values from model 1, the second of the fitted values from
model 2, und so weiter.)

If y is a vector then y - yhat is the matrix whose columns are
y - (the respective columns of yhat).  This is standard R syntax.  If
y is a matrix, R won't touch the subtraction with a sterilized
barge-pole, and rightly so.

Remember that in R there is a big difference between a vector and
1-dimensional array, much as the two may seem to resemble each other.

				cheers,

					Rolf Turner
					rolf at math.unb.ca

P. S.  The usual protocol for asking questions about
***contributed*** packages is to attempt firstly to contact the
author of the package.  (In this case me.)  Only if the author is a
recalcitrant guttersnipe, and fails to respond, should you bug the
r-help list about the problem.

					R. T.

===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===
Massimiliano Marinucci wrote: