Description Usage Arguments Value Examples
View source: R/analysis_exp_4.R
This function obtains the 'difference density', i.e. the density |pi - tildepi|, where tildepi is the kernel density of the samples
1 | diff_density_true_exp_4(samples, bw = "nrd0")
|
samples |
samples of exp(-(x^4)/2) |
bw |
bandwidth for kernel density estimation (same bw as for density()) |
difference density of kernel density of the samples and the true density, exp(-(x^4)/2)
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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(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, study = T)
# plot true density
curve(target_density_exp_4(x), -3, 3)
# plot density of samples
lines(density(test$samples[[1]]))
# plot density of the difference between samples obtained and true density
lines(diff_density_true_exp_4(test$samples[[1]]))
@export
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.