JWS C Library
C language utility library
dynamics.c File Reference

Collection of functions for stochastic dynamics on a function to generate random samples. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include <assert.h>
#include "jwsc/base/error.h"
#include "jwsc/base/limits.h"
#include "jwsc/vector/vector.h"
#include "jwsc/vector/vector_math.h"
#include "jwsc/vector/vector_io.h"
#include "jwsc/matrix/matrix.h"
#include "jwsc/prob/pdf.h"
#include "jwsc/prob/mv_pdf.h"
#include "jwsc/stat/dynamics.h"
Include dependency graph for dynamics.c:

Go to the source code of this file.

Functions

stochastic_dynamics

Leapfrog discretization of stochastic dynamics to sample from an energy function.

Errorstochastic_dynamics_1_d (uint32_t iterations, double delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params))
 Double precision leapfrog stochastic dynamics.
Errorstochastic_dynamics_2_d (uint32_t iterations, const Vector_d *delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params))
 Double precision leapfrog stochastic dynamics.
hybrid_monte_carlo

Stochastic dynamics combined with Metropolis-Hastings for quickly converging and unbiased sampling.

Errorhybrid_monte_carlo_1_d (uint32_t iterations, uint32_t leap_iter, double delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params), Error *(*reject_sample)(const Vector_d *sample, const Vector_d *momenta, void *params))
 Double precision hybrid monte carlo.
Errorhybrid_monte_carlo_2_d (uint32_t iterations, uint32_t leap_iter, const Vector_d *delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params), Error *(*reject_sample)(const Vector_d *sample, const Vector_d *momenta, void *params))
 Double precision hybrid monte carlo.
langevin

Langevin dynamics for generating samples from an energy function.

Errorlangevin_1_f (uint32_t iterations, float delta_t, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params))
 Single precision Langevin dynamics.
Errorlangevin_2_f (uint32_t iterations, const Vector_f *delta_t, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params))
 Single precision Langevin dynamics.
Errorlangevin_1_d (uint32_t iterations, double delta_t, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params))
 Double precision Langevin dynamics.
Errorlangevin_2_d (uint32_t iterations, const Vector_d *delta_t, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params))
 Double precision Langevin dynamics.
hyperdynamics_hessian_eigenvalue

Estimates the lowest eigenvalue for the energy function Hessian matrix.

static Errorhyperdynamics_hessian_eigenvalue_f (float *e_out, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *))
static Errorhyperdynamics_hessian_eigenvalue_d (double *e_out, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *))
hyperdynamics_hessian_eigenvector

Estimates the lowest eigenvector for the energy function Hessian matrix.

static Errorhyperdynamics_hessian_eigenvector_f (Vector_f **v_out, float eta, float gamma, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *))
static Errorhyperdynamics_hessian_eigenvector_d (Vector_d **v_out, double eta, double gamma, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *))
hyperdynamics_dx_hessian_eigenvalue

Estimates the gradient of the lowest eigenvalue for the energy function Hessian matrix w.r.t. the parameters.

static Errorhyperdynamics_dx_hessian_eigenvalue_f (Vector_f **e_dx_out, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*grad_energy_func)(Vector_f **, void *))
static Errorhyperdynamics_dx_hessian_eigenvalue_d (Vector_d **e_dx_out, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*grad_energy_func)(Vector_d **, void *))
hyperdynamics_hessgrad_eigenvalue

Estimates the lowest eigenvalue for the energy function Hessian matrix plus the gradient (squared) matrix w.r.t. the parameters.

static Errorhyperdynamics_hessgrad_eigenvalue_f (float *e_out, float lambda, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), uint8_t positive)
static Errorhyperdynamics_hessgrad_eigenvalue_d (double *e_out, double lambda, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), uint8_t positive)
static Errorhyperdynamics_dx_hessgrad_eigenvalue_f (Vector_f **e_lambda_dx_out, float lambda, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *), uint8_t positive)
static Errorhyperdynamics_dx_hessgrad_eigenvalue_d (Vector_d **e_lambda_dx_out, double lambda, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *), uint8_t positive)
hyperdynamics_proj_hessian_eigenvector

Estimates the projected gradient vector on the lowest eigenvector of the Hessian matrix.

static Errorhyperdynamics_proj_hessian_eigenvector_f (float *g1p_out, float e_pos, float e_neg, float lambda)
static Errorhyperdynamics_proj_hessian_eigenvector_d (double *g1p_out, double e_pos, double e_neg, double lambda)
hyperdynamics_hessgrad_eigenvector

Estimates the lowest eigenvector for the energy function Hessian matrix plus the gradient (squared) matrix w.r.t. the parameters.

static Errorhyperdynamics_hessgrad_eigenvector_f (float *lambda_out, Vector_f **v_pos_out, Vector_f **v_neg_out, float eta, float gamma, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *))
static Errorhyperdynamics_hessgrad_eigenvector_d (double *lambda_out, Vector_d **v_pos_out, Vector_d **v_neg_out, double eta, double gamma, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *))
hyperdynamics_dx_proj_hessian_eigenvector

Estimates the derivative of the projected gradient vector on the lowest eigenvector of the Hessian matrix.

static Errorhyperdynamics_dx_proj_hessian_eigenvector_f (Vector_f **g1p_dx_out, const Vector_f *e_pos_dx, const Vector_f *e_neg_dx, float g1p, float lambda)
static Errorhyperdynamics_dx_proj_hessian_eigenvector_d (Vector_d **g1p_dx_out, const Vector_d *e_pos_dx, const Vector_d *e_neg_dx, double g1p, double lambda)
langevin_hyperdynamics

Voter's hyperdynamics biasing for generating samples from an energy function using Langevin dynamics.

Errorlangevin_hyperdynamics_1_f (uint32_t iterations, float delta_t, float gamma, float eta, float h, float d, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_f *p, void *params), Error *(*energy_func)(float *energy_out, void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params, float energy_bias))
 Single precision Voter hyperdynamics.
Errorlangevin_hyperdynamics_2_f (uint32_t iterations, const Vector_f *delta_t, float gamma, float eta, float h, float d, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_f *p, void *params), Error *(*energy_func)(float *energy_out, void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params, float energy_bias))
 Single precision Voter hyperdynamics.
Errorlangevin_hyperdynamics_1_d (uint32_t iterations, double delta_t, double gamma, double eta, double h, double d, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params, double energy_bias))
 Double precision Voter hyperdynamics.
Errorlangevin_hyperdynamics_2_d (uint32_t iterations, const Vector_d *delta_t, double gamma, double eta, double h, double d, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params, double energy_bias))
 Double precision Voter hyperdynamics.

Detailed Description

Collection of functions for stochastic dynamics on a function to generate random samples.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file dynamics.c.


Function Documentation

Error* stochastic_dynamics_1_d ( uint32_t  iterations,
double  delta_t,
double  alpha,
uint32_t  kick,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  accept_sample 
)

Double precision leapfrog stochastic dynamics.

See Neal '93 for details.

Preserves phase space volume.

Parameters:
iterationsNumber of leapfrog steps to take; number of samples to generate.
delta_tTime discretization step size.
alphaParameter for stochastic dynamics. Should be in in the interval [0,1].
kickFrequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 97 of file dynamics.c.

Error* stochastic_dynamics_2_d ( uint32_t  iterations,
const Vector_d delta_t,
double  alpha,
uint32_t  kick,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  accept_sample 
)

Double precision leapfrog stochastic dynamics.

See Neal '93 for details.

Preserves phase space volume.

Parameters:
iterationsNumber of leapfrog steps to take; number of samples to generate.
delta_tTime discretization step size.
alphaParameter for stochastic dynamics. Should be in in the interval [0,1].
kickFrequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 152 of file dynamics.c.

Error* hybrid_monte_carlo_1_d ( uint32_t  iterations,
uint32_t  leap_iter,
double  delta_t,
double  alpha,
uint32_t  kick,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_d *p, void *params)  set_params_from_pt,
Error *(*)(double *energy_out, void *params)  energy_func,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  accept_sample,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  reject_sample 
)

Double precision hybrid monte carlo.

See Neal '93 for details.

Preserves phase space volume and generates unbiased samples.

Parameters:
iterationsNumber of Metropolis-Hastings iterations. Proportional to the number of samples generated, depending on the rejection rate.
leap_iterNumber of leapfrog iterations between each Metropolis-Hastings iterations.
delta_tTime discretization step size.
alphaParameter for stochastic dynamics. Should be in in the interval [0,1].
kickFrequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the parameters in params from a point.
energy_funcComputes the energy function at a point specified in params
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
reject_sampleRejects a generated sample. This is optional and can be set to NULL.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 301 of file dynamics.c.

Error* hybrid_monte_carlo_2_d ( uint32_t  iterations,
uint32_t  leap_iter,
const Vector_d delta_t,
double  alpha,
uint32_t  kick,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_d *p, void *params)  set_params_from_pt,
Error *(*)(double *energy_out, void *params)  energy_func,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  accept_sample,
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params)  reject_sample 
)

Double precision hybrid monte carlo.

See Neal '93 for details.

Preserves phase space volume and generates unbiased samples.

Parameters:
iterationsNumber of Metropolis-Hastings iterations. Proportional to the number of samples generated, depending on the rejection rate.
leap_iterNumber of leapfrog iterations between each Metropolis-Hastings iterations.
delta_tTime discretization step size.
alphaParameter for stochastic dynamics. Should be in in the interval [0,1].
kickFrequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the parameters in params from a point.
energy_funcComputes the energy function at a point specified in params
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample. Updates the params with the sample.
reject_sampleRejects a generated sample. This is optional and can be set to NULL.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 368 of file dynamics.c.

Error* langevin_1_f ( uint32_t  iterations,
float  delta_t,
void *  params,
void(*)(Vector_f **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_f **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_f *sample, void *params)  accept_sample 
)

Single precision Langevin dynamics.

Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 598 of file dynamics.c.

Error* langevin_2_f ( uint32_t  iterations,
const Vector_f delta_t,
void *  params,
void(*)(Vector_f **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_f **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_f *sample, void *params)  accept_sample 
)

Single precision Langevin dynamics.

Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 645 of file dynamics.c.

Error* langevin_1_d ( uint32_t  iterations,
double  delta_t,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, void *params)  accept_sample 
)

Double precision Langevin dynamics.

Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 718 of file dynamics.c.

Error* langevin_2_d ( uint32_t  iterations,
const Vector_d delta_t,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, void *params)  accept_sample 
)

Double precision Langevin dynamics.

Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 765 of file dynamics.c.

Error* langevin_hyperdynamics_1_f ( uint32_t  iterations,
float  delta_t,
float  gamma,
float  eta,
float  h,
float  d,
void *  params,
void(*)(Vector_f **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_f *p, void *params)  set_params_from_pt,
Error *(*)(float *energy_out, void *params)  energy_func,
Error *(*)(Vector_f **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_f *sample, void *params, float energy_bias)  accept_sample 
)

Single precision Voter hyperdynamics.

Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
gammaStep size for gradient descent for each parameter. Very small positive value.
etaDifference parameter for derivative numerical approximations. Small positive value.
hBias scaling of the Voter's function (h). Height of the smallest transition area is good starting value.
dDistance scale from one minima to another in terms of 2*pi*d.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the params from a point.
energy_funcComputes the energy function at a point specified in params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 2711 of file dynamics.c.

Error* langevin_hyperdynamics_2_f ( uint32_t  iterations,
const Vector_f delta_t,
float  gamma,
float  eta,
float  h,
float  d,
void *  params,
void(*)(Vector_f **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_f *p, void *params)  set_params_from_pt,
Error *(*)(float *energy_out, void *params)  energy_func,
Error *(*)(Vector_f **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_f *sample, void *params, float energy_bias)  accept_sample 
)

Single precision Voter hyperdynamics.

Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
gammaStep size for gradient descent for each parameter. Very small positive value.
etaDifference parameter for derivative numerical approximations. Small positive value.
hBias scaling of the Voter's function (h). Height of the smallest transition area is good starting value.
dDistance scale from one minima to another in terms of 2*pi*d.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the params from a point.
energy_funcComputes the energy function at a point specified in params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample by. Updates the params with the sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 2777 of file dynamics.c.

Error* langevin_hyperdynamics_1_d ( uint32_t  iterations,
double  delta_t,
double  gamma,
double  eta,
double  h,
double  d,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_d *p, void *params)  set_params_from_pt,
Error *(*)(double *energy_out, void *params)  energy_func,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, void *params, double energy_bias)  accept_sample 
)

Double precision Voter hyperdynamics.

Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
gammaStep size for gradient descent for each parameter. Very small positive value.
etaDifference parameter for derivative numerical approximations. Small positive value.
hBias scaling of the Voter's function (h). Height of the smallest transition area is good starting value.
dDistance scale from one minima to another in terms of 2*pi*d.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the params from a point.
energy_funcComputes the energy function at a point specified in params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 2970 of file dynamics.c.

Error* langevin_hyperdynamics_2_d ( uint32_t  iterations,
const Vector_d delta_t,
double  gamma,
double  eta,
double  h,
double  d,
void *  params,
void(*)(Vector_d **p_out, const void *params)  get_pt_from_params,
Error *(*)(const Vector_d *p, void *params)  set_params_from_pt,
Error *(*)(double *energy_out, void *params)  energy_func,
Error *(*)(Vector_d **grad_out, void *params)  grad_energy_func,
Error *(*)(const Vector_d *sample, void *params, double energy_bias)  accept_sample 
)

Double precision Voter hyperdynamics.

Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.

Parameters:
iterationsNumber of Langevin dynamcs steps to take; number of samples to generate.
delta_tStochastics dynamics integration step size.
gammaStep size for gradient descent for each parameter. Very small positive value.
etaDifference parameter for derivative numerical approximations. Small positive value.
hBias scaling of the Voter's function (h). Height of the smallest transition area is good starting value.
dDistance scale from one minima to another in terms of 2*pi*d.
paramsParameter(s) for the callback functions.
get_pt_from_paramsGets the parameters as a point from params.
set_params_from_ptSets the params from a point.
energy_funcComputes the energy function at a point specified in params.
grad_energy_funcComputes the gradient of the energy function at a point specified in params
accept_sampleAccepts a generated sample.
Returns:
On success, NULL is returned. On error, an Error is returned.

Definition at line 3035 of file dynamics.c.