[r-cran-mnp] 15/51: Import Upstream version 2.3-3
Andreas Tille
tille at debian.org
Fri Sep 8 14:14:45 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository r-cran-mnp.
commit e2d5c8adf2bf4ed0adb6b83cb4de09658c552f65
Author: Andreas Tille <tille at debian.org>
Date: Fri Sep 8 15:54:47 2017 +0200
Import Upstream version 2.3-3
---
DESCRIPTION | 6 +++---
R/onLoad.R | 9 ++++-----
src/MNP.c | 4 +---
src/rand.c | 32 --------------------------------
src/rand.h | 1 -
5 files changed, 8 insertions(+), 44 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 005bfcb..ae483d3 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: MNP
-Version: 2.3-2
-Date: 2005-06-02
+Version: 2.3-3
+Date: 2005-06-23
Title: R Package for Fitting the Multinomial Probit Model
Author: Kosuke Imai <kimai at princeton.edu>,
David A. van Dyk <dvd at uci.edu>.
@@ -24,4 +24,4 @@ LazyLoad: yes
LazyData: yes
License: GPL (version 2 or later)
URL: http://www.princeton.edu/~kimai/research/MNP.html
-Packaged: Thu Jun 2 22:01:08 2005; kimai
+Packaged: Thu Jun 23 14:11:21 2005; kimai
diff --git a/R/onLoad.R b/R/onLoad.R
index 39784cf..e85275b 100644
--- a/R/onLoad.R
+++ b/R/onLoad.R
@@ -1,8 +1,7 @@
".onLoad" <- function(lib, pkg) {
- mylib <- dirname(system.file(package = "MNP"))
- title <- paste("MNP:", packageDescription("MNP", lib = mylib)$Title)
- ver <- packageDescription("MNP", lib = mylib)$Version
- url <- packageDescription("MNP", lib = mylib)$URL
- cat(title, "\nVersion:", ver, "\nURL:", url, "\n")
+ mylib <- dirname(system.file(package = pkg))
+ title <- packageDescription(pkg, lib = mylib)$Title
+ ver <- packageDescription(pkg, lib = mylib)$Version
+ cat(paste(pkg, ": ", title, "\nVersion", ver, "\n", sep=""))
}
diff --git a/src/MNP.c b/src/MNP.c
index 8951b1b..aeec2e1 100644
--- a/src/MNP.c
+++ b/src/MNP.c
@@ -233,9 +233,7 @@ void cMNPgibbs(int *piNDim, int *piNCov, int *piNSamp, int *piNGen,
for (k=0;k<n_dim;k++)
if(j!=k) vtemp[itemp++]=W[i][k]-Xbeta[i][k];
/* conditional mean and variance */
- cmean=0.0;
- for(k=0;k<n_cov;k++)
- cmean+=X[i*n_dim+j][k]*beta[k];
+ cmean=Xbeta[i][j];
cvar=1/PerSig[j][n_dim-1][n_dim-1];
for(k=0;k<(n_dim-1);k++)
cmean-=PerSig[j][n_dim-1][k]*vtemp[k]*cvar;
diff --git a/src/rand.c b/src/rand.c
index f3c36e9..bb35be4 100644
--- a/src/rand.c
+++ b/src/rand.c
@@ -15,38 +15,6 @@
#include "subroutines.h"
#include "rand.h"
-
-/* Multivariate Normal density */
-double dMVN(
- double *Y, /* The data */
- double *MEAN, /* The parameters */
- double **SIGMA, /* covariance matrix */
- int dim, /* dimension */
- int give_log){ /* 1 if log_scale 0 otherwise */
-
- int j,k;
- double value=0.0;
- double **SIG_INV = doubleMatrix(dim, dim);
-
- dinv(SIGMA, dim, SIG_INV);
- for(j=0;j<dim;j++){
- for(k=0;k<j;k++)
- value+=2*(Y[k]-MEAN[k])*(Y[j]-MEAN[j])*SIG_INV[j][k];
- value+=(Y[j]-MEAN[j])*(Y[j]-MEAN[j])*SIG_INV[j][j];
- }
-
- value=-0.5*value-0.5*dim*log(2*M_PI)-0.5*ddet(SIGMA, dim, 1);
-
- FreeMatrix(SIG_INV, dim);
-
- if(give_log)
- return(value);
- else
- return(exp(value));
-
-}
-
-
/* Sample from a univariate truncated Normal distribution
(truncated both from above and below):
if the range is too far from mu, it uses standard rejection
diff --git a/src/rand.h b/src/rand.h
index daa003b..857d596 100644
--- a/src/rand.h
+++ b/src/rand.h
@@ -5,7 +5,6 @@
Copyright: GPL version 2 or later.
*******************************************************************/
-double dMVN(double *Y, double *MEAN, double **SIGMA, int dim, int give_log);
double TruncNorm(double lb, double ub, double mu, double var);
void rMVN(double *Sample, double *mean, double **inv_Var, int size);
void rWish(double **Sample, double **S, int df, int size);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-mnp.git
More information about the debian-science-commits
mailing list