Skip to content

Commit

Permalink
version 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fmcron authored and gaborcsardi committed Oct 1, 2012
1 parent 59ea107 commit 04185b2
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 22 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2012-10-01 Fabio Mathias Correa <fmcorrea@uesc.br>

* Changes in initial parameters for the MCMC process
* Change in the summary function Bayes.factor
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Bayesthresh
Version: 0.1.1
Date: 2012-08-08
Version: 0.2
Date: 2012-10-01
Title: Bayesian thresholds mixed-effects models for categorical data
Author: Fabio Mathias Correa <fmcron@gmail.com> and Julio Silvio de
Souza Bueno Filho <juliobuenof@gmail.com>
Expand All @@ -16,5 +16,5 @@ Depends: R(>= 2.10.1), lme4 (>= 0.999375-35), MASS, VGAM, mvtnorm,
matrixcalc
License: GPL (>= 2)
Repository: CRAN
Date/Publication: 2012-08-16 07:09:31
Packaged: 2012-08-08 08:04:18 UTC; fmcron
Date/Publication: 2012-10-01 18:58:13
Packaged: 2012-10-01 17:21:53 UTC; fmc
11 changes: 6 additions & 5 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
e33a45ee693436d529c3b1a99f3afb23 *DESCRIPTION
344da2fdd6d9bbbe824e4dfe83fadf00 *ChangeLog
887f45889eda6062beec80f929899592 *DESCRIPTION
637174c4b580e5e2f976596269734abc *NAMESPACE
4b742abdb54c0f674c2f06b880d63a6f *R/Bayes.factor.R
ca79ffb9476bc8c8726ec09db03183f7 *R/Bayesthresh.R
61e49276d3548f6b4199d30cb27630d4 *R/Bayes.factor.R
a1a2b02ccadaff165b99099ca6b0752a *R/Bayesthresh.R
97d72f8e990f3a229d4ddd7408ccb010 *R/coef.Bayesthresh.R
2433b9d274c1b12429f632c0eee7fa31 *R/compVar.R
f52b3e962fcf1c240d68304c2b98d08c *R/plot.random.effects.R
Expand All @@ -11,8 +12,8 @@ bd4a5ef6aad4293f4ff514233e794b7e *data/sensory.rda
3b4c692402cf955ad72ec62c0a1beb17 *inst/CITATION
ca591a030c5407c420cdcba3a31c06f2 *man/ACGaussian.Rd
e02f57831b3a1c651460698503742667 *man/ACt.Rd
0d794c2437253de1db61ec284b8fb9b1 *man/Bayes.factor.Rd
2c1b8d20e1bbfb0461662fc6029f988a *man/Bayesthresh.Rd
bd6b443a851de7cb18ec62be750a9a68 *man/Bayes.factor.Rd
6851787816acc28d1629c2dc2d42da67 *man/Bayesthresh.Rd
5f1450d8675c66f5a4d7f56569408e4a *man/MCGaussian.Rd
3f0ab3eb6a77313f0e041b975e9819ef *man/MCt.Rd
f1ccbd0f52aa5675a6c605d736f9ab21 *man/NCGaussian.Rd
Expand Down
16 changes: 15 additions & 1 deletion R/Bayes.factor.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bayes.factor <- function(model1, model2)
Bayes.factor <- function(model1, model2, inter=TRUE)
{
if(!inherits(model1, "Bayesthresh"))
stop("Model1 does not belong a class Bayesthresh")
Expand All @@ -18,5 +18,19 @@ Bayes.factor <- function(model1, model2)
cat("Model 2:", deparse(model2$formula), "\n")
cat("\n \n")
print(result)
if(inter==TRUE){
cat("\n","Scale for interpretation of the Bayes factor","\n")
cat("--------------------------------------------","\n")
cat("B_ij Evidence in favor of M_1","\n")
cat("--------------------------------------------","\n")
cat(" <1 negative (favor of M_2)","\n")
cat("1 to 3 doubtfull","\n")
cat("3 to 10 substantial","\n")
cat("10 to 30 strong","\n")
cat("30 to 100 very strong","\n")
cat(" >100 decisive","\n")
cat("--------------------------------------------","\n")
cat("Jeffreys(1961)","\n")
}
}

2 changes: 1 addition & 1 deletion R/Bayesthresh.R
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ print.Bayesthresh <- function(x,...)
### The main function
Bayesthresh <-function(formula, data, subset, na.action, A=NULL, algor = list(algorithm = "NC", link = "Gaussian"),
Write = FALSE, priors = list(ru=10, su=2, dre=20, dse=5),
burn = 100, jump = 10, ef.iter = 4000, model=TRUE)
burn = 50, jump = 2, ef.iter = 4000, model=TRUE)
### Linear Mixed-Effects in R with threshold models
{
mc <- match.call()
Expand Down
10 changes: 5 additions & 5 deletions man/Bayes.factor.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

\description{Compares two models by evaluating their Bayes factor}

\usage{Bayes.factor(model1, model2)}
\usage{Bayes.factor(model1, model2, inter=TRUE)}

\arguments{
\item{model1}{object of the class model \code{"Bayesthresh"}}
\item{model2}{object of the class model \code{"Bayesthresh"}}
\item{inter}{If TRUE, print to scale for interpretation of the Bayes factor}
}

\details{
Expand Down Expand Up @@ -41,16 +42,15 @@ Sacarose <- factor(sensory$sacarose)
# Model with Gaussian link

dex1 <- Bayesthresh(flavor ~ (1|Consumer) + Sacarose, burn = 0, jump = 1,
ef.iter = 10, data=sensory)
ef.iter = 10, data=sensory)
summary(dex1)

#### Model 2

# Model with t-Student link

dex2 <- Bayesthresh(flavor ~ (1|Consumer) + Sacarose, burn = 0, jump = 1,
ef.iter = 10, algor=list(algorithm="NC", link="t"),
data=sensory)
dex2 <- Bayesthresh(flavor ~ (1|Consumer) + Sacarose, burn = 0, jump = 1,
ef.iter = 10, algor=list(algorithm="NC", link="t"),data=sensory)
summary(dex2)

Bayes.factor(dex1,dex2)
Expand Down
11 changes: 5 additions & 6 deletions man/Bayesthresh.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
Student's "t" link function and for saving the full chains.
}
\usage{
Bayesthresh(formula, data, subset, na.action, A=NULL,
algor = list(algorithm="NC", link="Gaussian"),
Write, priors = list(ru = 10, su = 2, dre = 20, dse = 5),
burn = 100, jump = 10, ef.iter = 4000, model=TRUE)
\usage{Bayesthresh(formula, data, subset, na.action, A=NULL,
algor = list(algorithm="NC", link="Gaussian"),
Write, priors = list(ru = 10, su = 2, dre = 20, dse = 5),
burn = 50, jump = 2, ef.iter = 4000, model=TRUE)
}
\arguments{
\item{formula}{a two-sided linear formula object describing the fixed-effects part of the model,
Expand All @@ -34,7 +33,7 @@
\item{priors}{priors is a list that contains the parameters of the priors used to estimate the
variance components of random effects}
\item{burn, jump, ef.iter}{are of the arguments of iteraction. By default the burn, jump and ef.iter
(effective iteractions) are 100, 5 e 1000 respectively}
(effective iteractions) are 50, 2 e 4000 respectively}
\item{model}{logical scalar. If \code{FALSE} the model frame in slot \code{frame} is truncated to zero rows.}
}
\details{
Expand Down

0 comments on commit 04185b2

Please sign in to comment.