Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated help files name starting with mcmc #257

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
update spelling mistakes
  • Loading branch information
TahminaMojumder committed Sep 29, 2023
commit 9f21e84d9957618eaf9e01aa9cdd53f48cba85e1
4 changes: 2 additions & 2 deletions BayesianTools/R/VSEM.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ VSEMgetDefaults <- function(){

#' Allows to mix a given parameter vector with a default parameter vector
#' @param pars vector with new parameter values
#' @param defaults vector with defaukt parameter values
#' @param defaults vector with default parameter values
#' @param locations indices of the new parameter values
#' @rdname package-deprecated
#' @description This function is deprecated and will be removed by v0.2.
Expand All @@ -166,7 +166,7 @@ VSEMcreatePAR <- function(days = 1:(3*365)){

#' Create an example dataset, and from that a likelihood or posterior for the VSEM model
#' @author Florian Hartig
#' @param likelihoodOnly switch to devide whether to create only a likelihood, or a full bayesianSetup with uniform priors.
#' @param likelihoodOnly switch to decide whether to create only a likelihood, or a full bayesianSetup with uniform priors.
#' @param plot switch to decide whether data should be plotted
#' @param selection vector containing the indices of the selected parameters
#' @details The purpose of this function is to be able to conveniently create a likelihood for the VSEM model for demonstration purposes. The function creates example data --> likelihood --> BayesianSetup, where the latter is the
Expand Down
4 changes: 2 additions & 2 deletions BayesianTools/inst/examples/marginalLikelihoodHelp.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exp(M1$ln.ML - M2$ln.ML)

# it has therefore been suggested that ML should not be calculated on uninformative priors. But
# what to do if there are no informative priors?
# one option is to calculate the fractional BF, which means that one splites the data in half,
# one option is to calculate the fractional BF, which means that one splits the data in half,
# uses the first half to fit the model, and then use the posterior as a new (now informative)
# prior for the ML - let's do this for the previous case

Expand Down Expand Up @@ -145,7 +145,7 @@ exp(M1$ln.ML - M2$ln.ML)
# Low dimensional case with narrow priors - all methods have low error

# we use a truncated normal for the likelihood to make sure that the density
# integrates to 1 - makes it easier to calcuate the theoretical ML
# integrates to 1 - makes it easier to calculate the theoretical ML
likelihood <- function(x) sum(msm::dtnorm(x, log = TRUE, lower = -1, upper = 1))
prior = createUniformPrior(lower = rep(-1,2), upper = rep(1,2))
bayesianSetup <- createBayesianSetup(likelihood = likelihood, prior = prior)
Expand Down
2 changes: 1 addition & 1 deletion BayesianTools/man/VSEMcreateLikelihood.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BayesianTools/man/package-deprecated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions BayesianTools/vignettes/BayesianTools.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Once you have your setup, you may want to run a calibration. The runMCMC functio
- The sampler name
- A list with settings - if a parameter is not provided, the default will be used

As an example, choosing the sampler name "Metropolis" calls a versatile Metropolis-type MCMC with options for covariance adaptation, delayed rejection, tempering and Metropolis-within-Gibbs sampling. For details, see the the later reference on MCMC samplers. This is how we would call this sampler with default settings
As an example, choosing the sampler name "Metropolis" calls a versatile Metropolis-type MCMC with options for covariance adaptation, delayed rejection, tempering and Metropolis-within-Gibbs sampling. For details, see the later reference on MCMC samplers. This is how we would call this sampler with default settings

```{r}
iter = 10000
Expand All @@ -99,7 +99,7 @@ print(out)
summary(out)
```

and plottted with several plot functions. The marginalPlot can either be plotted as histograms with density overlay, which is also the default, or as a violin plot (see "?marginalPlot").
and plotted with several plot functions. The marginalPlot can either be plotted as histograms with density overlay, which is also the default, or as a violin plot (see "?marginalPlot").

```{r}
plot(out) # plot internally calls tracePlot(out)
Expand Down