Package examples.montecarlo
Class TestMetropolisHastings.PropFunction
- java.lang.Object
-
- examples.montecarlo.TestMetropolisHastings.PropFunction
-
- All Implemented Interfaces:
ProposalFunction1DIfc
- Enclosing class:
- TestMetropolisHastings
public static class TestMetropolisHastings.PropFunction extends java.lang.Object implements ProposalFunction1DIfc
-
-
Constructor Summary
Constructors Constructor Description PropFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegenerateProposedGivenCurrent(double current)doublegetProposalRatio(double x, double y)The ratio of g(y,x)/g(x,y).
-
-
-
Method Detail
-
getProposalRatio
public double getProposalRatio(double x, double y)Description copied from interface:ProposalFunction1DIfcThe ratio of g(y,x)/g(x,y). The ratio of the proposal function evaluated at x = current and y = proposed, where g() is some proposal function of x and y. The implementor should ensure that the returned ratio is a valid double- Specified by:
getProposalRatioin interfaceProposalFunction1DIfc- Parameters:
x- the x to evaluatey- the y to evaluate- Returns:
- the ratio of the proposal function
-
generateProposedGivenCurrent
public double generateProposedGivenCurrent(double current)
- Specified by:
generateProposedGivenCurrentin interfaceProposalFunction1DIfc- Parameters:
current- the current state value of the chain (i.e. x)- Returns:
- the generated possible state (i.e. y) which may or may not be accepted
-
-