@PublicationReference(author="Christopher M. Bishop",title="Pattern Recognition and Machine Learning",type=Book,year=2006,pages={152,159}) @PublicationReference(author="Jan Drugowitsch",title="Bayesian Linear Regression",type=Misc,year=2009,url="http://www.bcs.rochester.edu/people/jdrugowitsch/code/bayes_linear_notes_0.1.1.pdf") public class BayesianRobustLinearRegression extends AbstractCloneableSerializable implements BayesianRegression<java.lang.Double,MultivariateGaussianInverseGammaDistribution>
Modifier and Type | Class and Description |
---|---|
static class |
BayesianRobustLinearRegression.IncrementalEstimator
Incremental estimator for BayesianRobustLinearRegression
|
class |
BayesianRobustLinearRegression.PredictiveDistribution
Predictive distribution of future data given the posterior of
the weights given the data.
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_WEIGHT_VARIANCE
Default weight variance, 1.0.
|
Constructor and Description |
---|
BayesianRobustLinearRegression(int dimensionality)
Creates a new instance of BayesianLinearRegression
|
BayesianRobustLinearRegression(InverseGammaDistribution outputVariance,
MultivariateGaussian weightPrior)
Creates a new instance of BayesianRobustLinearRegression
|
Modifier and Type | Method and Description |
---|---|
BayesianRobustLinearRegression |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
UnivariateGaussian |
createConditionalDistribution(Vectorizable input,
Vector weights)
Creates the distribution from which the outputs are generated, given
the weights and the input to consider.
|
BayesianRobustLinearRegression.PredictiveDistribution |
createPredictiveDistribution(MultivariateGaussianInverseGammaDistribution posterior)
Creates the predictive distribution of outputs given the weight posterior
|
InverseGammaDistribution |
getOutputVariance()
Getter for outputVariance
|
MultivariateGaussian |
getWeightPrior()
Getter for weightPrior
|
MultivariateGaussianInverseGammaDistribution |
learn(java.util.Collection<? extends InputOutputPair<? extends Vectorizable,java.lang.Double>> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
setOutputVariance(InverseGammaDistribution outputVariance)
Setter for outputVariance
|
void |
setWeightPrior(MultivariateGaussian weightPrior)
Setter for weightPrior
|
public static final double DEFAULT_WEIGHT_VARIANCE
public BayesianRobustLinearRegression(int dimensionality)
dimensionality
- Sets up the parameters (except featureMap) for the given dimensionality
of objects in feature space.public BayesianRobustLinearRegression(InverseGammaDistribution outputVariance, MultivariateGaussian weightPrior)
outputVariance
- Distribution of the output (measurement) varianceweightPrior
- Prior distribution of the weights, typically a zero-mean,
diagonal-variance distribution.public BayesianRobustLinearRegression clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public MultivariateGaussian getWeightPrior()
public void setWeightPrior(MultivariateGaussian weightPrior)
weightPrior
- Prior distribution of the weights, typically a zero-mean,
diagonal-variance distribution.public MultivariateGaussianInverseGammaDistribution learn(java.util.Collection<? extends InputOutputPair<? extends Vectorizable,java.lang.Double>> data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends Vectorizable,java.lang.Double>>,MultivariateGaussianInverseGammaDistribution>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public InverseGammaDistribution getOutputVariance()
public void setOutputVariance(InverseGammaDistribution outputVariance)
outputVariance
- Distribution of the output (measurement) variancepublic UnivariateGaussian createConditionalDistribution(Vectorizable input, Vector weights)
createConditionalDistribution
in interface BayesianRegression<java.lang.Double,MultivariateGaussianInverseGammaDistribution>
input
- Input to condition onweights
- Weights that determine the meanpublic BayesianRobustLinearRegression.PredictiveDistribution createPredictiveDistribution(MultivariateGaussianInverseGammaDistribution posterior)
BayesianRegression
createPredictiveDistribution
in interface BayesianRegression<java.lang.Double,MultivariateGaussianInverseGammaDistribution>
posterior
- Posterior distribution of weights.