org.omegahat.Simulation.MCMC.Proposals
Class NormalMetropolisComponentProposal

java.lang.Object
  |
  +--org.omegahat.Simulation.MCMC.Proposals.NormalMetropolisComponentProposal
All Implemented Interfaces:
ConditionalDensity, ConditionalGenerator, GeneralProposal, MarkovProposal, SymmetricProposal, TimeDependentProposal

public class NormalMetropolisComponentProposal
extends java.lang.Object
implements GeneralProposal, SymmetricProposal, TimeDependentProposal


Field Summary
protected  boolean DEBUG
           
protected  PRNGDistributionFunctions prob
           
protected  double[] sigma
           
protected  int time
           
protected  int which
           
 
Constructor Summary
NormalMetropolisComponentProposal(double[] var, PRNG prng)
          Constructor for normal increments with specified covariance matrix.
NormalMetropolisComponentProposal(int length, PRNG prng)
          Constructor for normal increments with identity covariance matrix.
 
Method Summary
 double conditionalPDF(java.lang.Object state, java.lang.Object conditionals)
           
 java.lang.Object generate(java.lang.Object center)
          Generate a single random value conditional on conditionals
 int getTime()
          Get the time
 double logConditionalPDF(java.lang.Object state, java.lang.Object conditionals)
           
 double logTransitionProbability(java.lang.Object from, java.lang.Object to)
          Convenience method for computing the log probability of proposing a move.
static void main(java.lang.String[] argv)
           
protected  double normalLogPDF(double x, double mu, double sigma)
           
protected  double normalPDF(double x, double mu, double sigma)
           
 void resetTime()
          Reset time to 0
 void setCovariance(double[] cov)
           
 void setCovariance(double[][] cov)
           
 void timeInc()
          Increment time
 double transitionProbability(java.lang.Object from, java.lang.Object to)
          Convenience method for computing the probability of proposing a move.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

prob

protected PRNGDistributionFunctions prob

DEBUG

protected boolean DEBUG

sigma

protected double[] sigma

time

protected int time

which

protected int which
Constructor Detail

NormalMetropolisComponentProposal

public NormalMetropolisComponentProposal(int length,
                                         PRNG prng)
Constructor for normal increments with identity covariance matrix.
Parameters:
length - number of dimensions

NormalMetropolisComponentProposal

public NormalMetropolisComponentProposal(double[] var,
                                         PRNG prng)
Constructor for normal increments with specified covariance matrix. Note that off diagonal elements will be ignored.
Parameters:
var - variance matrix
Method Detail

setCovariance

public void setCovariance(double[][] cov)

setCovariance

public void setCovariance(double[] cov)

normalPDF

protected double normalPDF(double x,
                           double mu,
                           double sigma)

normalLogPDF

protected double normalLogPDF(double x,
                              double mu,
                              double sigma)

timeInc

public void timeInc()
Description copied from interface: TimeDependentProposal
Increment time
Specified by:
timeInc in interface TimeDependentProposal

resetTime

public void resetTime()
Description copied from interface: TimeDependentProposal
Reset time to 0
Specified by:
resetTime in interface TimeDependentProposal

getTime

public int getTime()
Description copied from interface: TimeDependentProposal
Get the time
Specified by:
getTime in interface TimeDependentProposal

generate

public java.lang.Object generate(java.lang.Object center)
Description copied from interface: ConditionalGenerator
Generate a single random value conditional on conditionals
Specified by:
generate in interface ConditionalGenerator

conditionalPDF

public double conditionalPDF(java.lang.Object state,
                             java.lang.Object conditionals)
Specified by:
conditionalPDF in interface ConditionalDensity

logConditionalPDF

public double logConditionalPDF(java.lang.Object state,
                                java.lang.Object conditionals)
Specified by:
logConditionalPDF in interface ConditionalDensity

transitionProbability

public double transitionProbability(java.lang.Object from,
                                    java.lang.Object to)
Description copied from interface: GeneralProposal
Convenience method for computing the probability of proposing a move.

Probably implemented as:

double transitionProbability( Object from, Object to );

{

return conditionalPDF( to, from );

}

Specified by:
transitionProbability in interface GeneralProposal

logTransitionProbability

public double logTransitionProbability(java.lang.Object from,
                                       java.lang.Object to)
Description copied from interface: GeneralProposal
Convenience method for computing the log probability of proposing a move.

Probably implemented as:

double logTransitionProbability( Object from, Object to );

{

return logConditionalPDF( to, from );

}

Specified by:
logTransitionProbability in interface GeneralProposal

main

public static void main(java.lang.String[] argv)