[r-cran-bayesm] 09/44: Import Upstream version 1.1-1

Andreas Tille tille at debian.org
Thu Sep 7 11:16:20 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-bayesm.

commit 1f94f41b3e39f481de1624b355133bb6f0a2fa43
Author: Andreas Tille <tille at debian.org>
Date:   Thu Sep 7 13:08:25 2017 +0200

    Import Upstream version 1.1-1
---
 DESCRIPTION                |   6 +++---
 R/llmnp.R                  |   4 ++--
 inst/doc/bayesm-manual.pdf | Bin 390357 -> 390397 bytes
 man/detailing.Rd           |   4 ++--
 man/rhierNegbinRw.Rd       |   2 +-
 src/bayesmc.c              |  16 ++++++++++++----
 6 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 23ca4a5..a8ce985 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: bayesm
-Version: 1.1-0
-Date: 2005-06-10
+Version: 1.1-1
+Date: 2005-07-01
 Title:Bayesian Inference for Marketing/Micro-econometrics 
 Author: Peter Rossi <peter.rossi at ChicagoGsb.edu>, 
         Rob McCulloch <robert.mcculloch at ChicagoGsb.edu>.
@@ -27,4 +27,4 @@ Description: bayesm covers many important models used
   Marketing by Allenby, McCulloch and Rossi. 
 License: GPL (version 2 or later)
 URL: http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html
-Packaged: Fri Jun 10 13:10:33 2005; per
+Packaged: Fri Jul  1 11:33:45 2005; per
diff --git a/R/llmnp.R b/R/llmnp.R
index 6e1c9b2..57975e4 100755
--- a/R/llmnp.R
+++ b/R/llmnp.R
@@ -54,7 +54,7 @@ for (j in 1:pm1) {
    trunpt=as.vector(-Aj%*%muj)
    Lj=t(chol(Aj%*%Sigma%*%t(Aj)))
 #     note: rob's routine expects lower triangular root
-   logl=logl + sum(log(ghkvec(Lj,trunpt,above,r)))
+   logl=logl + sum(log(ghkvec(Lj,trunpt,above,r)+1.0e-50))
 #     note:  ghkvec does an entire vector of n probs each with different truncation points but the
 #            same cov matrix.  
 }
@@ -64,7 +64,7 @@ for (j in 1:pm1) {
 trunpt=as.vector(-mu[,y==(pm1+1)])
 Lj=t(chol(Sigma))
 above=rep(1,pm1)
-logl=logl+sum(log(ghkvec(Lj,trunpt,above,r)))
+logl=logl+sum(log(ghkvec(Lj,trunpt,above,r)+1.0e-50))
 return(logl)
 
 }
diff --git a/inst/doc/bayesm-manual.pdf b/inst/doc/bayesm-manual.pdf
index 899bbed..bfcc87b 100755
Binary files a/inst/doc/bayesm-manual.pdf and b/inst/doc/bayesm-manual.pdf differ
diff --git a/man/detailing.Rd b/man/detailing.Rd
index 9c0d19c..f76b99d 100755
--- a/man/detailing.Rd
+++ b/man/detailing.Rd
@@ -4,7 +4,7 @@
 \title{ Physician Detailing Data from Manchanda et al (2004)}
 \description{
   Monthly data on detailing (sales calls) on 1000 physicians. 23 mos of data
-  for each Physician. Includes physician covariates. Dependent Variable is the
+  for each Physician. Includes physician covariates. Dependent Variable (\code{scripts}) is the
   number of new prescriptions ordered by the physician for the drug detailed.
 }
 \usage{data(detailing)}
@@ -26,7 +26,7 @@
   \ldots\$ mean\_samples: num [1:1000] 0.722 0.491 0.339 3.196 0.348 
 }
 \details{
-  generalphy is dummy for if doc is a "general practitioner," specialist is dummy for
+  generalphys is dummy for if doctor is a "general practitioner," specialist is dummy for
   if the physician is a specialist in the theraputic class for which the drug is 
   intended, mean\_samples is the mean number of free drug samples given the doctor
   over the sample.
diff --git a/man/rhierNegbinRw.Rd b/man/rhierNegbinRw.Rd
index 1776eb5..999b466 100755
--- a/man/rhierNegbinRw.Rd
+++ b/man/rhierNegbinRw.Rd
@@ -46,7 +46,7 @@ rhierNegbinRw(Data, Prior, Mcmc)
     \item{\code{b}}{ Gamma prior parm (def: .1)}
     \item{\code{R}}{ number of MCMC draws}
     \item{\code{keep}}{ MCMC thinning parm: keep every keepth draw (def: 1)}
-    \item{\code{s\_beta}}{ scaling for beta| alpha RW inc cov (def: 2.93/sqrt(nvar)}
+    \item{\code{s\_beta}}{ scaling for beta| alpha RW inc cov (def: 2.93/sqrt(nvar))}
     \item{\code{s\_alpha}}{ scaling for alpha | beta RW inc cov (def: 2.93)}
     \item{\code{c}}{ fractional likelihood weighting parm (def:2)}
     \item{\code{Vbeta0}}{ starting value for Vbeta (def: I)}
diff --git a/src/bayesmc.c b/src/bayesmc.c
index 6d44ce9..73c5833 100755
--- a/src/bayesmc.c
+++ b/src/bayesmc.c
@@ -147,10 +147,11 @@ void ghk_oneside(double *L, double* trunpt, int *above, int *dim, int *n, double
         L is lower triangular root of Sigma
 	random vector is assumed to have zero mean
     	n is number of draws to use in GHK	
+	modified 6/05 by rossi to check arg into qnorm
 */
 {
    int i,j,k;
-   double mu,tpz,u,prod,pa,pb;
+   double mu,tpz,u,prod,pa,pb,arg;
    double *z;
    z = (double *)R_alloc(*dim,sizeof(double));
    GetRNGstate();
@@ -168,7 +169,10 @@ void ghk_oneside(double *L, double* trunpt, int *above, int *dim, int *n, double
 	 }
 	 prod *= pb-pa;
 	 u = unif_rand();
-	 z[j] = qnorm(u*pb + (1-u)*pa,0.0,1.0,1,0);
+	 arg=u*pb+(1.-u)*pa;
+	 if(arg > .999999999) arg=.999999999;
+	 if(arg < .0000000001) arg=.0000000001;
+	 z[j] = qnorm(arg,0.0,1.0,1,0);
       }
       *res += prod;
    }
@@ -181,10 +185,11 @@ void ghk(double *L, double* a, double *b, int *dim, int *n, double *res)
         L is lower triangular root of Sigma
 	random vector is assumed to have zero mean
     	n is number of draws to use in GHK	
+	modified 6/05 by rossi to check arg into qnorm
 */
 {
    int i,j,k;
-   double aa,bb,pa,pb,u,prod,mu;
+   double aa,bb,pa,pb,u,prod,mu,arg;
    double *z;
    z = (double *)R_alloc(*dim,sizeof(double));
    GetRNGstate();
@@ -197,7 +202,10 @@ void ghk(double *L, double* a, double *b, int *dim, int *n, double *res)
 	 pa = pnorm(aa,0.0,1.0,1,0); pb = pnorm(bb,0.0,1.0,1,0);
 	 prod *= pb-pa;
 	 u = unif_rand();
-	 z[j] = qnorm(u*pb + (1-u)*pa,0.0,1.0,1,0);
+	 arg=u*pb+(1.-u)*pa;
+	 if(arg > .999999999) arg=.999999999;
+	 if(arg < .0000000001) arg=.0000000001;
+	 z[j] = qnorm(arg,0.0,1.0,1,0);
       }
       *res += prod;
    }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-bayesm.git



More information about the debian-science-commits mailing list