parallel_h_fusion_exp_4_rcpp: Standard Hierarchical Monte Carlo Fusion

Description Usage Arguments Value Examples

View source: R/h_fusion_exp_4.R

Description

Hierarchical Monte Carlo Fusion with base level of the form exp(-((x^4)*beta)/2)

Usage

1
2
parallel_h_fusion_exp_4_rcpp(N_schedule, mean = 0, time_schedule,
  start_beta, C_schedule, L, base_samples, seed = NULL)

Arguments

N_schedule

vector of length (L-1), where N_schedule[l] is the number of samples per node at level l

mean

mean value

time_schedule

vector of legnth(L-1), where time_schedule[l] is the time chosen for Fusion at level l

start_beta

beta for the base level

C_schedule

vector of length (L-1), where C_schedule[l] is the number of samples to fuse for level l

L

total number of levels in the hierarchy

base_samples

list of length (1/start_beta), where samples_to_fuse[c] containg the samples for the c-th node in the level

seed

seed number - default is NULL, meaning there is no seed

Value

samples: samples from hierarchical fusion

time: vector of length (L-1), where time[l] is the run time for level l

rho_acc: vector of length (L-1), where rho_acc[l] is the acceptance rate for first fusion step for level l

Q_acc: vector of length (L-1), where Q_acc[l] is the acceptance rate for second fusion step for level l

input_betas: list of length (L), where input_betas[[l]] is the input betas for level l

output_beta: vector of length(L-1), where output_beta[l] is the beta for level l

diffusion_times: vector of length (L-1), where diffusion_times[l] are the times for fusion in level l (= time_schedule)

Examples

1
2
3
4
5
6
7
input_samples <- base_rejection_sampler_exp_4(beta = 1/4, nsamples = 100000,  proposal_mean = 0, proposal_sd = 1.5, dominating_M = 1.4)
test <- parallel_h_fusion_exp_4_rcpp(N_schedule = rep(10000, 2), time_schedule = rep(1, 2),
                                     start_beta = 1/4, C_schedule = rep(2, 2), L = 3,
                                     base_samples = input_samples)

# plot results
plot_levels_hier_exp_4(test, from = -3, to = 3, plot_rows = 3, plot_columns = 1)

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