kindly help me fine what is the mistake with following: 
my aim is to compute those steps and obtain a vector with values (3,5) 
but i am geting (NAN,NAN)

Q<-matrix(c(5,-3,-3,2),2,2)
b<-rbind(0,1)
H0<-diag(2)
x0<-rbind(0,0)
d0<-b
g0<--b
a0<--(t(g0)%*%d0)/(t(d0)%*%Q%*%d0)
x1<-x0+a0[,1]*d0
dx0<-x1-x0
g1<-Q%*%x1-b
dg0<-g1-g0
exp1<-(t(dg0)%*%H0%*%dg0)/(t(dg0)%*%dx0)
exp2<-(dx0%*%t(dx0))/(dg0%*%t(dx0))
exp3<-(dx0%*%t(dg0)%*%H0 +H0%*%dg0%*%t(dx0))/(dx0%*%t(dg0))
H1<-H0+(1+exp1[,1])*exp2-exp3
d1<--H1%*%g1
a2<-(t(g1)%*%d1)/(t(d1)%*%Q%*%d1)
x2<-x1+a2[,1]*d1

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to