search for: probdist

Displaying 1 result from an estimated 1 matches for "probdist".

Did you mean: probdistr
2012 Apr 26
0
Problem with constrOptim when hitting boundary
...0] transMat<-rbind(rep(-1,K),diag(K)) Aid<-A%*%transMat numGr<-wtMat %*% Aid #N x K matrix init<-rep(1/(K+1),length=K) #equal distribution; could perhaps choose better init value getProbFromTheta<-function(theta){ return(c(1-sum(theta),theta)) } neglik<-function(theta){ probDist<-as.vector(A%*%getProbFromTheta(theta)) #should be a vector of probabilities if(length(probDist)!=K+1) stop("Programming error -- wrong length") if(any(probDist< -1e-10)) stop("Programming error -- negative probabilities") if(any(probDist> 1+1e-10)) stop("Pro...