[r-cran-mnp] 40/51: Import Upstream version 2.5-6
Andreas Tille
tille at debian.org
Fri Sep 8 14:14:48 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 a37291f49d32a61a84be10d125f6648d98d84e4e
Author: Andreas Tille <tille at debian.org>
Date: Fri Sep 8 15:54:59 2017 +0200
Import Upstream version 2.5-6
---
DESCRIPTION | 8 ++++----
R/ymatrix.mnp.R | 11 +++++------
man/mnp.Rd | 2 +-
src/MNP.c | 6 ++++--
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 93691f7..09f5cfa 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: MNP
-Version: 2.5-5
-Date: 2007-08-01
+Version: 2.5-6
+Date: 2008-03-24
Title: R Package for Fitting the Multinomial Probit Model
Author: Kosuke Imai <kimai at princeton.edu>,
David A. van Dyk <dvd at uci.edu>.
@@ -25,6 +25,6 @@ Description: MNP is a publicly available R package that fits the Bayesian
Vol. 14, No. 3 (May), pp. 1-32.
LazyLoad: yes
LazyData: yes
-License: GPL (version 2 or later)
+License: GPL (>= 2)
URL: http://imai.princeton.edu/research/MNP.html
-Packaged: Wed Aug 1 20:15:11 2007; kimai
+Packaged: Mon Mar 24 23:57:37 2008; kimai
diff --git a/R/ymatrix.mnp.R b/R/ymatrix.mnp.R
index 7c1e2f2..9d46a55 100644
--- a/R/ymatrix.mnp.R
+++ b/R/ymatrix.mnp.R
@@ -10,17 +10,16 @@ ymatrix.mnp <- function(data, base=NULL, extra=FALSE, verbose=verbose) {
if(!is.null(base))
stop("Error: The last column of the response matrix must be the base category.\n No need to specify `base.'")
base <- lev[p]
- }
- else { # standard Multinomial Probit model
+ } else { # standard Multinomial Probit model
Y <- as.factor(Y)
lev <- levels(Y)
if (!is.null(base))
if (base %in% lev) {
- lev <- c(base, lev[-pmatch(base, lev)])
- levels(Y) <- lev
+ Y <- relevel(Y, ref = base)
+ lev <- levels(Y)
+ } else {
+ stop(paste("Error: `base' does not exist in the response variable."))
}
- else
- stop(paste("Error: `base' does not exist in the response variable."))
base <- lev[1]
counts <- table(Y)
if (any(counts == 0)) {
diff --git a/man/mnp.Rd b/man/mnp.Rd
index 5240a3e..82dacca 100644
--- a/man/mnp.Rd
+++ b/man/mnp.Rd
@@ -200,9 +200,9 @@ pre2 <- predict(res2, newdata = japan[10,], type = "prob", n.draws = 100,
\item{p.scale}{The prior scale matrix for the covariance matrix.}
\item{burnin}{The number of initial burnin draws.}
\item{thin}{The thinning interval.}
- }
}
+
\references{
Imai, Kosuke and David A. van Dyk. (2005a) \dQuote{A Bayesian Analysis
of the Multinomial Probit Model Using the Marginal Data
diff --git a/src/MNP.c b/src/MNP.c
index 9280caf..6928776 100644
--- a/src/MNP.c
+++ b/src/MNP.c
@@ -112,8 +112,10 @@ void cMNPgibbs(int *piNDim, int *piNCov, int *piNSamp, int *piNGen,
itemp = 0;
for (k = 0; k < n_cov; k++)
for (j = 0; j < n_dim; j++)
- for (i = 0; i < n_samp; i++) X[i*n_dim+j][k] = pdX[itemp++];
-
+ for (i = 0; i < n_samp; i++)
+ X[i*n_dim+j][k] = pdX[itemp++];
+
+ /* PdoubleMatrix(X, n_dim*3, n_cov); */
itemp = 0;
for (k = 0; k < n_cov; k++)
for (j = 0; j < n_cov; j++) A0[j][k] = pdA0[itemp++];
--
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