Displaying 1 result from an estimated 1 matches for "gradiant".
Did you mean:
radiant
2011 May 19
3
problem with optim()
...[,t])%*%X[i,]-x4[t]))^(-1))^(abs(Y[i,t]-Yb[i])))*(((1+exp(-t(x3[,t])%*%X[i,]-x4[t]))^(-1))^(1-abs(Y[i,t]-Yb[i])))
log.res2[i,t]=log(res2[i,t])
res2.b[i]=res2.b[i]+log.res2[i,t]
}
res3[i] = p_tilde[i]*log(res1[i])
res3.b[i] = p_tilde[i]*(res2.b[i])
}
-(ncol(Y)*sum(res3)+sum(res3.b))
}
$B!!(B
##### Gradiants:
gr=function(x)
{
x1 = x[1:ncol(X)]
x2 = x[(ncol(X)+1)]
x3 = matrix(x[(ncol(X)+2):(ncol(X)+1+ncol(X)*ncol(Y))],nrow=ncol(X),ncol=ncol(Y))
x4 = x[(ncol(X)+1+ncol(X)*ncol(Y)+1):length(x)]
gr1 = rep(0,ncol(X))
gr4 = rep(0,ncol(Y))
gr3 = matrix(0,nrow=ncol(X),ncol=ncol(Y))
gr1.b = matrix(0,nrow=nrow...