SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: error in Multivariate Probit Model estimation [ Reply ]
By: Arne Henningsen on 2017-05-04 08:46
[forum:45114]
If you want help, please follow my previous advice and provide a minimal reproducible example. Anyway, perhaps you want to estimate more parameters (650) than you have observations (631)?

error in Multivariate Probit Model estimation [ Reply ]
By: Kisito Gandji on 2017-04-18 20:33
[forum:45100]
I was trying to estimate a Multivariate Probit Model and I got an error message. This error is produced in the line 7 "algorithm = "GHK", nGHK = 5000" (see the code and results below)

Code:

estResult <- mvProbit(
cbind( Malaria, HyperT, Headach, Diabetes, Stomach, Heamor, Eyedis, Digestaid, FeverH, Anaemia, Ulcer, Bodyenh, Tiredness, Antibiotic, Sprain, Nutriimpr, SalVeg, MixLeaves, Forage, Livfenc)
~ BIOGZ + Gender + Age + Ethnicity + Religion + Education + Socioprofact,
data = dataSU, method = "BHHH",
algorithm = "GHK", nGHK = 5000 )
summary( estResult )


Result in R Console:

> View(dataSU)
> estResult <- mvProbit(
+ cbind( Malaria, HyperT, Headach, Diabetes, Stomach, Heamor, Eyedis, Digestaid, FeverH, Anaemia, Ulcer, Bodyenh, Tiredness, Antibiotic, Sprain, Nutriimpr, SalVeg, MixLeaves, Forage, Livfenc)
+ ~ BIOGZ + Gender + Age + Ethnicity + Religion + Education + Socioprofact,
+ data = dataSU, method = "BHHH",
+ algorithm = "GHK", nGHK = 5000 )
Error in checkBhhhGrad(g = gr, theta = theta, analytic = (!is.null(attr(f, :
the matrix returned by the gradient function (argument 'grad') must have at least as many rows as the number of parameters (650), where each row must correspond to the gradients of the log-likelihood function of an individual (independent) observation:
currently, there are (is) 650 parameter(s) but the gradient matrix has only 631 row(s)
In addition: There were 13 warnings (use warnings() to see them)
> summary( estResult )

Call:
mvProbit(formula = cbind(y1, y2, y3) ~ x1 + x2, data = as.data.frame(cbind(xMat,
yMat)), tol = 0.5)

Coefficients:
Estimate Std. error t value Pr(> t)
b_1_0 0.82493 Inf 0 1
b_1_1 6.36052 Inf 0 1
b_1_2 -1.27206 Inf 0 1
b_2_0 -1.08872 Inf 0 1
b_2_1 1.32361 Inf 0 1
b_2_2 -1.69187 Inf 0 1
b_3_0 0.68852 Inf 0 1
b_3_1 -0.66187 Inf 0 1
b_3_2 2.87142 Inf 0 1
R_1_2 0.60795 Inf 0 1
R_1_3 -0.57138 Inf 0 1
R_2_3 -0.06897 Inf 0 1

BHHH maximisation, 1 iterations
Return code 2: successive function values within tolerance limit
Log-likelihood: -42.29254 on 12 Df

RE: error in mvProbit [ Reply ]
By: Kisito Gandji on 2017-04-18 18:40
[forum:45099]
Dear Arne, feedback well received. But I did not put all the error message, I forgot a first part. Here is the whole message:
Error in checkBhhhGrad(g = gr, theta = theta, analytic = (!is.null(attr(f, :
the matrix returned by the gradient function (argument 'grad') must have at least as many rows as the number of parameters (650), where each row must correspond to the gradients of the log-likelihood function of an individual (independent) observation:
currently, there are (is) 650 parameter(s) but the gradient matrix has only 631 row(s)

Maybe you can understand it now

RE: error in mvProbit [ Reply ]
By: Arne Henningsen on 2017-04-18 17:12
[forum:45098]
The second set of messages is not a set of error messages but a set of warning messages. The returned warning messages indicate that for some observations the term betaHat ' x is so large (positive) or so small (negative) that the fitted probabilities are numerically 0 or 1, which could indicate "too high" explanatory power of the model.

I don't know the reason for the first message (indeed, an error message). Please provide a minimal self-contained reproducible example (see, e.g., http://stackoverflow.com/help/mcve) so that someone can investigate this.

error in mvProbit [ Reply ]
By: Kisito Gandji on 2017-04-18 15:50
[forum:45097]
I was running a Multivariate Probit Model and I got the following error messages:
1- The matrix returned by the gradient function (argument 'grad') must have at least as many rows as the number of parameters (650), where each row must correspond to the gradients of the log-likelihood function of an individual (independent) observation: currently, there are (is) 650 parameter(s) but the gradient matrix has only 631 row(s)

2-In addition: There were 13 warnings (use warnings() to see them)
Warning messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred
2: glm.fit: fitted probabilities numerically 0 or 1 occurred
3: glm.fit: fitted probabilities numerically 0 or 1 occurred
4: glm.fit: fitted probabilities numerically 0 or 1 occurred
5: glm.fit: fitted probabilities numerically 0 or 1 occurred
6: glm.fit: fitted probabilities numerically 0 or 1 occurred
7: glm.fit: fitted probabilities numerically 0 or 1 occurred
8: glm.fit: fitted probabilities numerically 0 or 1 occurred
9: glm.fit: fitted probabilities numerically 0 or 1 occurred
10: glm.fit: fitted probabilities numerically 0 or 1 occurred
11: glm.fit: fitted probabilities numerically 0 or 1 occurred
12: glm.fit: fitted probabilities numerically 0 or 1 occurred
13: glm.fit: fitted probabilities numerically 0 or 1 occurred

First, I don't understand these error messages. Second, I don't know how can I fix it.
Please someone can help me?


Thanks to:
Vienna University of Economics and Business Powered By FusionForge