post_bmr

0th

Percentile

Function post_bmr

Simulates the joint posterior based upon a dataset and specified marginal posterior distribution of the mean of selected variables.

Usage
post_bmr(nsims, weights_bmr)
Arguments
nsims

The number of posterior simulations to draw.

weights_bmr

An object of class 'tweights_bmr' created using the 'tweights_bmr' function.

Value

A matrix of simulations from the posterior.

See Also

tweights_bmr

Aliases
  • post_bmr
Examples
# NOT RUN {
#Use winsorized marginal to keep marginal simulation within feasible bootstrap region
winsor=function(marginalSims,y)  {
  l=min(y)
  u=max(y)
  ifelse(marginalSims<l,l,ifelse(marginalSims>u,u, marginalSims))
}
#Create an example marginal posterior
marginal = list(Sepal.Length=winsor(rnorm(10000,mean=5.8, sd=.2),iris$Sepal.Length),
               Sepal.Width=winsor(rnorm(10000,mean=3,sd=.2), iris$Sepal.Width),
               Petal.Length=winsor(rnorm(10000,mean=3.7,sd=.2), iris$Petal.Length)
)

#simulate
w = tweights_bmr(dataset = iris, marginal = marginal, silent = TRUE)
post_sims = post_bmr(1000, weights = w)

# }
Documentation reproduced from package tboot, version 0.2.0, License: GPL-3

Community examples

Looks like there are no examples yet.