search for: logdet

Displaying 11 results from an estimated 11 matches for "logdet".

Did you mean: logdev
2011 Jan 16
1
\examples{} in Rd file
...he full transcript of the outcome is copied below (it includes details on my installation) but the critical point is where the \examples{} section includes a %*%. The relevant portion of the source file is \examples{ x <- toeplitz(rev(1:4)) x.inv <- pd.solve(x) print(x.inv %*% x) logDet <- attr(x.inv, "log.det") print(abs(logDet - determinant(x, logarithm=TRUE)$modulus)) } which leads to the message ### ** Examples > > x <- toeplitz(rev(1:4)) > x.inv <- pd.solve(x) > print(x.inv + logDet <- attr(x.inv, "log.det") Error...
2001 Nov 22
2
optim ???
...eta,x,z) { n <- length(x) sigma <- matrix(c(s2ksi+s2eps,beta*s2ksi-s2eps,beta*s2ksi-s2eps, beta^2*s2ksi+s2eta+2*s2eps),2,2) xz <- sum((x-mu)*(z-delta)) A <- matrix(c(sum((x-mu)^2),xz,xz,sum((z-delta)^2)),2,2) A <- (1/2)*solve(sigma) %*% A logdet <- (-1)*n*log(det(sigma)) logdet-sum(diag(A)) } optim(par=c(mu=mean(santes),delta=mean(sdespues-santes),s2ksi=422,s2eps=1,s2eta=75), fn=function(mu,delta,s2ksi,s2eps,s2eta) logvero(mu,delta,s2ksi,s2eps,0,s2eta,santes,sdespues-santes), control=list(trace=1, f...
2013 Aug 27
1
Error in simulation. NAN
...I *****************************************/ // MATRICI COVARIANZA E AFFINI double *C_P = (double *) R_alloc(nn_j, sizeof(double)); double *C_cand_P = (double *) R_alloc(nn_j, sizeof(double)); double Sum_Sigma_inv; double Sigma_inv_one[n_j-1]; double logdet; // // /***************************************** // // PARAMETRI PARTE ADATTIVA // *****************************************/ // /***************************************** // // STARTING MCMC // *****************************************/ // MATRICE DI...
2008 Mar 22
1
Vectorization Problem
I have the code for the bivariate Gaussian copula. It is written with for-loops, it works, but I wonder if there is a way to vectorize the function. I don't see how outer() can be used in this case, but maybe one can use mapply() or Vectorize() in some way? Could anyone help me, please? ## Density of Gauss Copula rho <- 0.5 #corr R <- rbind(c(1,rho),c(rho,1)) #vcov matrix id <-
2012 Mar 19
2
hypergeometric function in ‘ mvtnorm’
Is there any way to know how the "dmvt" function computes the hypergeometric function needed in the calculation for the density of multivariate t distribution? -- View this message in context: http://r.789695.n4.nabble.com/hypergeometric-function-in-mvtnorm-tp4483730p4483730.html Sent from the R help mailing list archive at Nabble.com.
2002 May 21
4
setClass() and packages
Where should the setClass() ('methods' package) calls be placed in a package? I try to follow a one-class-one-file principe, but since setClass("ClassA", "ClassB") has to come a after setClass("ClassB", [snip]) it is not possible to fully follow this rule. So the best I can do now is to put all setClass() calls in a file named "000.R" (I know this
2001 Mar 14
0
segmentation fault of unknown cause (PR#877)
...ue" assign("COUNTER", COUNTER + 1, envir = ENVIR) if (is.numeric(cov.matrix)) { if (any(diag(cov.matrix) < 0)) { stop("chol det<0!") } } else { return(1e+30) } logdet <- 2 * sum(log(diag(cov.matrix))) cov.matrix <- chol2inv(cov.matrix) dummy <- t(CoVariate) %*% cov.matrix m <- (solve(dummy %*% CoVariate) %*% (dummy %*% data)) V <- data - CoVariate %*% m quadratic <- (t(V) %*% cov.matrix %*% V) res...
2011 Jan 17
2
How to still processing despite bug errors?
...on my installation) but the critical point is where the \examples{} > > section includes a %*%. The relevant portion of the source file is > > > > \examples{ > > x<- toeplitz(rev(1:4)) > > x.inv<- pd.solve(x) > > print(x.inv %*% x) > > logDet<- attr(x.inv, "log.det") > > print(abs(logDet - determinant(x, logarithm=TRUE)$modulus)) > > } > > > > which leads to the message > > > > ### ** Examples > > > > > > x<- toeplitz(rev(1:4)) > > > x.inv&...
2005 Feb 01
3
polynomials REML and ML in nlme
Hello everyone, I hope this is a fair enough question, but I don’t have access to a copy of Bates and Pinheiro. It is probably quite obvious but the answer might be of general interest. If I fit a fixed effect with an added quadratic term and then do it as an orthogonal polynomial using maximum likelihood I get the expected result- they have the same logLik.
2007 Jan 04
1
Parameter changes and segfault when calling C code through .Call
...REAL(res)[0] = logans; UNPROTECT(1); return(res); } The logpdf function is here double gsl_MB_mvnorm_logpdf(gsl_vector * beta, gsl_vector * betaMean, gsl_matrix * sigma, int k) { // computes density of multivariate normal vector at vector beta, with mean betaMean and cov sigma double logdetSigma = 0; double res; double * kern; int i, err; // pointer to Cholesky decomp of sigma gsl_matrix * sigmaChol = gsl_matrix_alloc(k, k); // define matrix that will store Chol decomp gsl_matrix_memcpy(sigmaChol, sigma); gsl_linalg_cholesky_decomp(sigmaChol); // compute logdet of si...
2013 Oct 20
5
nlminb() - how do I constrain the parameter vector properly?
Greets, I'm trying to use nlminb() to estimate the parameters of a bivariate normal sample and during one of the iterations it passes a parameter vector to the likelihood function resulting in an invalid covariance matrix that causes dmvnorm() to throw an error. Thus, it seems I need to somehow communicate to nlminb() that the final three parameters in my parameter vector are used to