I used "[b,dev.st​ats]=glmfi​t(b1,a1,'b​inomial')" function, and it has an error..

6 次查看(过去 30 天)
I used "[b,dev.stats]=glmfit(b1,a1,'binomial')" function, and it has an error..
a1 and b1 are 131472*1 matrix.
When I used "glmfit" function, it says errors like below..
Would you please help me ?
Error using glmfit (line 187)
Y must contain values in the interval [0,N] for the binomial distribution.
Error in Untitled7 (line 4)
[b,dev.stats]=glmfit(b1,a1,'binomial')

采纳的回答

the cyclist
the cyclist 2022-12-2
You should carefully read and understand this section of the documentation for glmfit, which specifies what is expected for the second input to glmfit, when the distribution is binomial.
Quoting that section, y needs to be
"y is an n-by-1 vector indicating success or failure at each observation, or an n-by-2 matrix whose first column indicates the number of successes for each observation and second column indicates the number of trials for each observation"
It seems that you have not used one of those two conventions.

更多回答(0 个)

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by