Skip to content

Commit

Permalink
minor documentation changes and adding xlim specification to plot met…
Browse files Browse the repository at this point in the history
…hod for cd.fit objects
  • Loading branch information
nickreich committed Jul 17, 2013
1 parent f46b26d commit ebb10ce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
9 changes: 5 additions & 4 deletions R/S4stuff.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ setMethod("logLik",
##'
##' @param add add to exisiting plot?
##'
##' @param xlim xlim for plot, defaults to the range of the data slot in x
##'
##' @param ... other options to pass to plot
##' @rdname plot-methods
##' @aliases plot plot,cd.fit-method
Expand All @@ -123,7 +125,7 @@ setMethod("plot",
col.main=rgb(230, 85, 13,maxColorValue=255),
col.samps=rgb(99,99,99,10,maxColorValue=255),
plot.n.samps=200,
add=F,
add=F, xlim=range(x@data),
...) {

par1 <- x@ests[1,1]
Expand All @@ -134,9 +136,8 @@ setMethod("plot",
plot.samples <- x@samples[sample(nrow(x@samples),min(plot.n.samps,nrow(x@samples))),]
}

xlims <- range(x@data)
xs <-seq(xlims[1],xlims[2],length=100)
if (!add) plot(-100,-100,xlim=xlims,ylim=c(0,1),...)
xs <-seq(xlim[1],xlim[2],length=100)
if (!add) plot(-100,-100,xlim=xlim,ylim=c(0,1),...)
if (x@dist == "L"){
if (plot.n.samps> 0 & nrow(x@samples) > 0){
apply(plot.samples,1,function(y) lines(xs,plnorm(xs,meanlog=y[1],sdlog=y[2]),col=col.samps))
Expand Down
3 changes: 2 additions & 1 deletion R/dic.fit.mcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
##' \deqn{Gamma model: f(x) = \frac{1}{\theta^k \Gamma(k)} x^{k-1} exp\{-\frac{x}{\theta}\}}
##'
##' \deqn{Gamma Default Prior Specification: p(k,\theta) \propto \frac{1}{\theta} * \sqrt{k*TriGamma(k)-1}}
##' (Note: this is Jeffery's Prior when both parameters are unknown, and \eqn{Trigamma(x) = \frac{\partial}{\partial x^2} ln(\Gamma(x))}.)
##' (Note: this is Jeffery's Prior when both parameters are unknown), and
##' \deqn{Trigamma(x) = \frac{\partial}{\partial x^2} ln(\Gamma(x))}.)
##' \deqn{Erlang model: f(x) = \frac{1}{\theta^k (k-1)!} x^{k-1} exp\{-\frac{x}{\theta}\}}
##' \deqn{Erlang Default Prior Specification: k \sim NBinom(100,1), log(\theta) \sim N(0,1000)}
##' (Note: parameters in the negative binomial distribution above represent mean and size, respectivley)
Expand Down
17 changes: 9 additions & 8 deletions man/dic.fit.mcmc.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ as implemented in MCMCpack.}

\deqn{Gamma Default Prior Specification: p(k,\theta)
\propto \frac{1}{\theta} * \sqrt{k*TriGamma(k)-1}} (Note:
this is Jeffery's Prior when both parameters are unknown,
and \eqn{Trigamma(x) = \frac{\partial}{\partial x^2}
ln(\Gamma(x))}.) \deqn{Erlang model: f(x) =
\frac{1}{\theta^k (k-1)!} x^{k-1}
exp\{-\frac{x}{\theta}\}} \deqn{Erlang Default Prior
Specification: k \sim NBinom(100,1), log(\theta) \sim
N(0,1000)} (Note: parameters in the negative binomial
distribution above represent mean and size, respectivley)
this is Jeffery's Prior when both parameters are
unknown), and \deqn{Trigamma(x) =
\frac{\partial}{\partial x^2} ln(\Gamma(x))}.)
\deqn{Erlang model: f(x) = \frac{1}{\theta^k (k-1)!}
x^{k-1} exp\{-\frac{x}{\theta}\}} \deqn{Erlang Default
Prior Specification: k \sim NBinom(100,1), log(\theta)
\sim N(0,1000)} (Note: parameters in the negative
binomial distribution above represent mean and size,
respectivley)
}
3 changes: 3 additions & 0 deletions man/plot-methods.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

\item{add}{add to exisiting plot?}

\item{xlim}{xlim for plot, defaults to the range of the
data slot in x}

\item{...}{other options to pass to plot}
}
\description{
Expand Down

0 comments on commit ebb10ce

Please sign in to comment.