Displaying 1 result from an estimated 1 matches for "yrmarry".
Did you mean:
marry
2011 Nov 30
1
How can I pick a matrix from a function? (Out Product of Gradient)
...to pick the Gradient matrix
from the gradient function.
Moreover, could R show the process of calculation on gradient function I
written by using "optim( )" or other commands?
Thanks,
Yanghao
============================================================
X <- cbind(rep(1,n),sex,age,yrmarry,children,rating)
dy <- (mydata$y>0)*1
# *********************************************
# Probit model: log-likelihood
# *********************************************
fprobit <- *function*(beta,y,X) {
n <- length(y)
k <- ncol(X)
b <- beta[1:k]
kk <- 2*y-1
z <- X %*% b
L <...