plot_levels_seq_mixG: Plot kernel density of samples in sequential tree

Description Usage Arguments Value Examples

Description

This function plots the kernel densities of the samples in the sequential tree (in red) and the tempered target densities that they were targetting (in blue)

Usage

1
2
plot_levels_seq_mixG(seq_result, weights, means, sds, from, to, plot_rows,
  plot_columns, bw = rep("nrd0", length(seq_result$samples)))

Arguments

from, to

the range over which the function will be plotted: integer (if want to have it constant throughout) or vector of length L, where L is the number of levels in the hierarchy

plot_rows

number of rows in plot (should make is so plot_rows x plot_columns = L)

plot_columns

number of rows in plot (should make is so plot_rows x plot_columns = L)

bw

the smoothing bandwidth used: integer (if want to have it constant throughout) or vector of length L, where L is the number of levels in the hierarchy

hier_result

sequential Monte Carlo fusion result

whole

boolean value: defaults to F, determines whether or not to plot kde for all samples in the level or for each node (T)

Value

none

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# setting variables
w_example <- c(0.35, 0.65)
m_example <- c(-3, 8)
s_example <- c(1, 1.5)
b_example <- 1/4

# sampling from tempered density
nsamples <- 500000
base <- hmc_base_sampler_mixG(w_example, m_example, s_example, b_example, nsamples, 4)

test <- parallel_sequential_fusion_TA_mixG(N_schedule = rep(10000, 3), global_T = 1,
                                           start_beta = b_example, base_samples = base,
                                           weights = w_example, means = m_example, sds = s_example, study = T)

# plot results
plot_levels_seq_mixG(test, weights = w_example, means = m_example, sds = s_example,
                     from = -15, to = 20, plot_rows = 2, plot_columns = 2, bw = c(0.2, 0.3, 0.3, 0.35))

rchan26/mixGaussTempering documentation built on June 14, 2019, 3:26 p.m.