sample_from_fc: Rejection sampler for tempered target...

Description Usage Arguments Value Examples

View source: R/rejection_sampler_exp_4.R

Description

Sample from tempered target using rejection sampling with normal proposals

Usage

1
2
sample_from_fc(N, mean = 0, proposal_mean, proposal_sd, dominating_M,
  beta)

Arguments

N

number of samples

mean

mean value, defaults to 0

proposal_mean

mean of proposal density for rejection sampler

proposal_sd

st.dev of proposal density for rejection sampler

beta

real value between 0 and 1

dominiating_M

constant M to bound the target density

Value

samples from tempered target density

Examples

1
2
3
4
5
dominating_dnorm <- function(x) 1.3*dnorm(x, mean = 0, sd = 1)
curve(dominating_dnorm(x), -5, 5, col = 'red')
curve(dnorm(x, mean = 0, sd = 1), -5, 5, add = T, col = 'green')
curve(tempered_target_density_exp_4(x, 1/2), -5, 5, add = T, col = 'blue')
sample_from_fc(N = 100000, proposal_mean = 0, proposal_sd = 1, dominating_M = 1.3)

rchan26/exp4FusionRCPP documentation built on Nov. 6, 2019, 7:01 p.m.