[R] Can not replicate estimates with rScreen function from ROSSI "Bayesian Statistics and Marketing"
eugen pircalabelu
eugen_pircalabelu at yahoo.com
Sat Mar 21 17:41:08 CET 2009
Hi R-users,
I have the following problem: I am trying to learn something about bayes methodology and started paying around bayesm package, but could not replicate the Conjunctive model's estimates as they appear in Rossi et al "Bayesian Statistics and Marketing", 2005, JWS, pages 264-265, Table CS4.4.
I have downloaded in my working directory the documents from
http://faculty.chicagobooth.edu/peter.rossi/research/bsm.html
and then i have sourced the functions 2 times: one with 1000 MCMC iterations (i simply sourced without any kind of modifications) and one with 4000 iterations (i have modified in the source code the number of iterations to 4000 instead of the defaulted value 1000, and changed the name "out" into "out2").
Can anyone tell me what am I doing wrong, and why don't i get the same estimates? Do i need more iterations or other modifications in the source code?
Thank you very much and have a great day ahead!
PS: I have no problem replicating the estimates of the "BANK EXAMPLE" in the "A.3 HIERARCHICAL BAYES MODELING – AN EXAMPLE" pages 303- 322
Eugen.
> source("C:\\Documents and Settings\\Administrator\\My Documents\\rScreen.R")
> source("C:\\Documents and Settings\\Administrator\\My Documents\\run screening rules.R")
> t(matrix(apply(out$betadraw[,,500:1000],2,mean),ncol=18))
[,1]
[1,] -1.832448426
[2,] -0.355615613
[3,] -1.210309206
[4,] -0.052342073
[5,] 0.182849361
[6,] 0.350787951
[7,] 0.598865166
[8,] -0.186233704
[9,] 0.652014888
[10,] -0.625699004
[11,] 0.469491733
[12,] 0.921956623
[13,] 1.304895684
[14,] -0.003796531
[15,] 0.680552062
[16,] 0.693060152
[17,] 0.881657248
[18,] 0.004990399
> t(matrix(apply(out2$betadraw[,,3000:4000],2,mean),ncol=18))
[,1]
[1,] -1.21287139
[2,] 0.30380276
[3,] -0.44522457
[4,] 0.12716930
[5,] 0.18397110
[6,] 0.36007492
[7,] 0.66189078
[8,] -0.17114451
[9,] 0.71097740
[10,] -0.32130846
[11,] 0.52676240
[12,] 0.84596696
[13,] 1.22110159
[14,] -0.02148484
[15,] 0.44813543
[16,] 0.47782513
[17,] 0.65008370
[18,] 0.01589271
> sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bayesm_2.2-2
loaded via a namespace (and not attached):
[1] tools_2.8.1
More information about the R-help
mailing list