Error message

  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in book_prev() (line 775 of /home3/gardeoi3/public_html/iamrandom/modules/book/book.module).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home3/gardeoi3/public_html/iamrandom/includes/common.inc).

dmvnorm (uses Sigma inverse)

This is a special form of the dmvnorm. You have to invert Sigma before passing it into this function, ie. Siginvf=solve(Sig). 

double dmvnorm(Rcpp::NumericVector dataf, Rcpp::NumericVector meanf, Rcpp::NumericMatrix Siginvf )
   {     RNGScope scope;
         const double pi=3.141593;   /* pi */
         double send;
         double d = dataf.size();        /* *.size() */
 
         double four=0;
         for (int i = 0; i < d; i++)
         {  for (int j = 0; j < d; j++)
            {  four=four + Siginvf(i,j)*(dataf(i)-meanf(i))*(dataf(j)-meanf(j));
            }
         }                      
         /* pow() and exp() are touchy about 1/2 (int) and 0.5 (double) */
         send= pow(2*pi,double(-d/2))*pow(det(Siginvf),0.5) *exp(-0.5*four);  
        
         return send;
   }