Esempio n. 1
0
 def get_StaticMetropolis_instance(D, target_log_pdf):
     step_size = 0.002
     instance = StaticMetropolis(D, target_log_pdf, step_size)
     
     # oracle scaling
     instance.L_C = np.linalg.cholesky(true_cov)
     
     return instance
Esempio n. 2
0
    def get_StaticMetropolis_instance(D, target_log_pdf):
        step_size = 0.002
        instance = StaticMetropolis(D, target_log_pdf, step_size)

        # oracle scaling
        instance.L_C = np.linalg.cholesky(true_cov)

        return instance
 def get_StaticMetropolis_instance(D, target_log_pdf):
     step_size = 0.002
     acc_star = None
     schedule = None
     instance = StaticMetropolis(D, target_log_pdf, step_size, schedule, acc_star)
     
     # give proposal variance a meaningful shape from previous samples
     benchmark_samples_fname = "pmc_sv_benchmark_samples.txt"
     benchmark_samples_sha1 = "d53e505730c41fbe413188530916d9a402e21a87"
     assert_file_has_sha1sum(benchmark_samples_fname, benchmark_samples_sha1)
     
     benchmark_samples = np.loadtxt(benchmark_samples_fname)
     benchmark_samples = benchmark_samples[np.arange(0, len(benchmark_samples), step=50)]
     instance.L_C = np.linalg.cholesky(np.cov(benchmark_samples.T))
     
     return instance
    def get_StaticMetropolis_instance(D, target_log_pdf):
        step_size = 0.002
        acc_star = None
        schedule = None
        instance = StaticMetropolis(D, target_log_pdf, step_size, schedule,
                                    acc_star)

        # give proposal variance a meaningful shape from previous samples
        benchmark_samples_fname = "pmc_sv_benchmark_samples.txt"
        benchmark_samples_sha1 = "d53e505730c41fbe413188530916d9a402e21a87"
        assert_file_has_sha1sum(benchmark_samples_fname,
                                benchmark_samples_sha1)

        benchmark_samples = np.loadtxt(benchmark_samples_fname)
        benchmark_samples = benchmark_samples[np.arange(0,
                                                        len(benchmark_samples),
                                                        step=50)]
        instance.L_C = np.linalg.cholesky(np.cov(benchmark_samples.T))

        return instance