1 #ifndef __STAN__MCMC__ADAPTIVE_SAMPLER_HPP__
2 #define __STAN__MCMC__ADAPTIVE_SAMPLER_HPP__
41 std::ostream* error_msgs = 0,
42 std::ostream* output_msgs = 0)
107 const std::vector<int>& z) = 0;
An abstract base class for adaptive samplers.
void unset_output_stream()
Unset the stream into which errors are written to 0 so that output messages are ignored.
virtual void get_sampler_param_names(std::vector< std::string > &names)
Get any sampler-specific parameter namess.
virtual void write_sampler_param_names(std::ostream &o)
Write out any sampler-specific parameter names for output.
std::ostream * _output_msgs
bool adapting()
Return whether or not parameter adaptation is on.
int n_adapt_steps()
Return how many iterations parameter adaptation has happened for.
int n_steps()
Return the number of iterations for this sampler.
void update_mean_stat(double avg_eta, double adapt_stat)
Updates the mean statistic given the specified adaptation statistic and weighting.
std::ostream * _error_msgs
virtual void set_params(const std::vector< double > &x, const std::vector< int > &z)=0
Set the model real and integer parameters to the specified values.
virtual ~adaptive_sampler()
Destructor.
adaptive_sampler(bool adapt, std::ostream *error_msgs=0, std::ostream *output_msgs=0)
Constructs an adaptive sampler with specified adaptation status.
virtual void adapt_on()
Turn on parameter adaptation.
virtual sample next_impl()=0
Returns the next sample from this sampler.
void set_output_stream(std::ostream &output_msgs)
Set the stream into which output will be written as the sampler runs.
void nfevals_plus_eq(int n)
Add the specified number of evaluations to the number of function evaluations.
sample next()
Returns the next sample from this sampler.
void set_mean_stat(double v)
Sets the mean statistic to the specified value.
virtual void get_sampler_params(std::vector< double > &values)
Get any sampler-specific parameters.
unsigned int nfevals()
Returns the number of times that the (possibly unnormalized) log probability function has been evalua...
virtual void find_reasonable_parameters()
Find a reasonable initial setting for the adaptable parameters.
void unset_error_stream()
Unset the stream into which errors are written to 0 so that error messages are ignored.
virtual void adapt_off()
Turn off parameter adaption.
virtual void write_sampler_params(std::ostream &o)
Write out any sampler-specific parameters for output.
virtual void get_parameters(std::vector< double > ¶ms)
Sets the specified parameter vector to the sequence of tunable parameters for this sampler.
void set_error_stream(std::ostream &error_msgs)
Set the stream into which errors will be written as the sampler runs.
double mean_stat()
Returns the value of the statistic we are trying to coerce.
virtual void write_adaptation_params(std::ostream &o)
Use this method to write the adaptation parameters into the output.
Representation of a MCMC sample.
Probability, optimization and sampling library.