Thread Subject: Error using mnrfit

Subject: Error using mnrfit

From: Ketan

Date: 20 Jun, 2008 21:22:01

Message: 1 of 4

Hello,

I am getting the following error while using mnrfit.

====ERROR====
??? Error using ===> mnrfit
Inputs to mnrfit must be floats, namely single or double.

Error in ==> mnrfit at 125
dataClass = superiorfloat(x,y);
====ERROR====

The variable x is double. I tried type casting it by
x=single(x); but the error persists.

Any help will be much appreciated.

Regards,

Subject: Error using mnrfit

From: Steven Lord

Date: 23 Jun, 2008 02:35:35

Message: 2 of 4


"Ketan " <useless.id@gmail.com> wrote in message
news:g3h71p$615$1@fred.mathworks.com...
> Hello,
>
> I am getting the following error while using mnrfit.
>
> ====ERROR====
> ??? Error using ===> mnrfit
> Inputs to mnrfit must be floats, namely single or double.
>
> Error in ==> mnrfit at 125
> dataClass = superiorfloat(x,y);
> ====ERROR====
>
> The variable x is double. I tried type casting it by
> x=single(x); but the error persists.

Hint from the error message:

Input***_s_*** to mnrfit must be floats, namely single or double.

[Emphasis mine.]

Both the X and Y inputs to MNRFIT must be floats (i.e. single or double).
You've eliminated X as the cause of the problem, which means ...

--
Steve Lord
slord@mathworks.com


Subject: Error using mnrfit

From: Ketan

Date: 24 Jun, 2008 04:36:02

Message: 3 of 4

"Steven Lord" <slord@mathworks.com> wrote in message
<g3n25n$qlf$1@fred.mathworks.com>...
>
> "Ketan " <useless.id@gmail.com> wrote in message
> news:g3h71p$615$1@fred.mathworks.com...
> > Hello,
> >
> > I am getting the following error while using mnrfit.
> >
> > ====ERROR====
> > ??? Error using ===> mnrfit
> > Inputs to mnrfit must be floats, namely single or
double.
> >
> > Error in ==> mnrfit at 125
> > dataClass = superiorfloat(x,y);
> > ====ERROR====
> >
> > The variable x is double. I tried type casting it by
> > x=single(x); but the error persists.
>
> Hint from the error message:
>
> Input***_s_*** to mnrfit must be floats, namely single or
double.
>
> [Emphasis mine.]
>
> Both the X and Y inputs to MNRFIT must be floats (i.e.
single or double).
> You've eliminated X as the cause of the problem, which
means ...
>
> --
> Steve Lord
> slord@mathworks.com
>
>

Steve,

Thanks for your reply.

I tried that.

Actually at first, I was getting the following error:

??? Error using ==> mnrfit at 164
If Y is a column vector, it must contain positive integer
category numbers.

So, I type casted Y as integer. Then I get the error that I
mentioned in my earlier message, asking me to convert Y
into float. I do not understand why is this happening?

--
Ketan

Subject: Error using mnrfit

From: Peter Perkins

Date: 24 Jun, 2008 12:36:41

Message: 4 of 4

Ketan wrote:

> Actually at first, I was getting the following error:
>
> ??? Error using ==> mnrfit at 164
> If Y is a column vector, it must contain positive integer
> category numbers.
>
> So, I type casted Y as integer. Then I get the error that I
> mentioned in my earlier message, asking me to convert Y
> into float. I do not understand why is this happening?

 From the help:

"Y is an N-by-K matrix, where Y(I,J) is the number of outcomes of the
multinomial category J for the predictor combinations given by X(I,:). The
sample sizes for each observation (rows of X and Y) are given by the row sums
SUM(Y,2). Alternatively, Y can be an N element column vector of scalar integers
from 1 to K indicating the value of the response for each observation, and all
sample sizes are taken to be 1."

I don't know what you had in Y originally, but since you got the message, "If Y
is a column vector, it must contain positive integer category numbers",
presumably you had a column vector containing something other than integer
values. The message was telling you to supply integer _values_, not an integer
array.

Hope this helps.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com