altar.cuda.bayesian.cudaMetropolis

Module Contents

Classes

class altar.cuda.bayesian.cudaMetropolis.cudaMetropolis(name, locator, **kwds)

Bases: altar.component

The Metropolis algorithm as a sampler of the posterior distribution

scaling
doc = the parameter covariance Σ is scaled by the square of this
acceptanceWeight
doc = the weight of accepted samples during covariance rescaling
rejectionWeight
doc = the weight of rejected samples during covariance rescaling
useFixedScaling
doc = whether to use a fixed scaling
scalingMin
doc = the minimum value of the scaling factor
scalingMax
doc = the maximum value of the scaling factor
mcsteps = 1
dispatcher
ginit = False
gstep
gcandidate
gproposal
gsigma_chol
gvalid_indices
gvalid_samples
ginvalid_flags
gacceptance_flags
precision
gdice
curng
initialize(self, application)

Initialize me and my parts given an {application} context

cuInitialize(self, application)
samplePosterior(self, annealer, step)

Sample the posterior distribution :param annealer - the controller: :param step - cpu CoolingStep:

Returns:

statistics (accepted/rejected/invalid) or (accepted/unlikely/rejected)

resample(self, annealer, statistics)

Update my statistics based on the results of walking my Markov chains

prepareSamplingPDF(self, annealer, step)

Re-scale and decompose the parameter covariance matrix, in preparation for the Metropolis update

finishSamplingPDF(self, step)

procedures after sampling, e.g, copy data back to cpu

walkChains(self, annealer, step)

Run the Metropolis algorithm on the Markov chains :param annealer: cudaAnnealer :param step: cudaCoolingStep

Returns:

statistics = (accepted, rejected, unlikely)

displace(self, displacement)

Construct a set of displacement vectors for the random walk from a distribution with zero mean and my covariance

adjustCovarianceScaling(self, accepted, invalid, rejected)

Compute a new value for the covariance sacling factor based on the acceptance/rejection ratio

allocateGPUData(self, samples, parameters)

initialize gpu work data