Displaying 2 results from an estimated 2 matches for "gradvec".
2007 Jun 15
0
Question with nlm
...*% invQ %*% (y- xM %*% Bt);
# log likelihood function
loglik <- -0.5*log(abs(det(diag(rep(sigma2,totalTime)))))-0.5*log(abs(det(Q)))-
(0.5/sigma2)* (t(y- (xM%*% Bt)) %*% invQ %*% (y-(xM %*% Bt)));
sgm <- sigma;
# gradients eq. (4.16)
gr <- function(sgm) {
gradVecs <- c();
# sgm <- c(sigma1, sigma2);
sgm <- sgm*sgm;
for (i in 1:length(sgm)) {
Eij <- matrix(rep(0, length(sgm)^2), nrow=length(sgm), ncol=length(sgm));
Eij[i,i] <- 1.0;
# trace term
term1 <- -sum(diag((invQ %*% A) %*%...
2010 Mar 27
1
R runs in a usual way, but simulations are not performed
...conditional on x, y, z
# obsahuje podfunkciu dl.dalphai, ktor? spo??tava deriv?ciu
likelihood function pod?a alpha i
#########################################################################################
######## gradientn? vektor adit?vneho modelu
############################################
gradvec_ADD = function(alpha) { dl.dalphai <- function(i) {
SIGMA <- sigma_ADD(alpha)
FI <- fi(SIGMA)
FIxs <- fixs(SIGMA)
sxFIxs <- sxfixs(SIGMA)
Pi <- pi_ADD(SIGMA,i)
dSIGMA.dalphai <- dsigma.dalphai_ADD(i)
SIGMAderiviSIGMA <- sigmaDERIVisigma_ADD(SIGMA,i)
dl.dalphai.1 <- -1/...