BayesianLinearRegressors.jl
BayesianLinearRegressors.BLRFunctionSample
BayesianLinearRegressors.BasisFunctionRegressor
BayesianLinearRegressors.BayesianLinearRegressor
BayesianLinearRegressors.BLRFunctionSample
— TypeBLRFunctionSample{Tw,Tϕ}
A function sampled from b::Union{BayesianLinearRegressor,BasisFunctionRegressor}
by taking a fixed weight sample w ~ p(w)
. ϕ
is the feature mapping if sampled from a BasisFunctionRegressor
, or is the identity function if sampled from a BayesianLinearRegressor
.
BayesianLinearRegressors.BasisFunctionRegressor
— TypeBasisFunctionRegressor{Tblr,Tϕ}
A Basis Function Regressor represents a Bayesian Linear Regressor where the input x
is first mapped to a feature space through a basis function ϕ.
ϕ must be a function which accepts one of the allowed input types for BayesianLinearRegressors (ColVecs, RowVecs or Matrix{<:Real} - see the package readme for more details) and it must output one of these allowed types.
x = RowVecs(hcat(range(-1.0, 1.0, length=5)))
blr = BayesianLinearRegressor(zeros(2), Diagonal(ones(2)))
ϕ(x::RowVecs) = RowVecs(hcat(ones(length(x)), prod.(x)))
bfr = BasisFunctionRegressor(blr, ϕ)
var(bfr(x))
See [1], Section 3.1 for more details on basis function regression.
[1] - C. M. Bishop. "Pattern Recognition and Machine Learning". Springer, 2006.
BayesianLinearRegressors.BayesianLinearRegressor
— TypeBayesianLinearRegressor{Tmw, TΛw}
A Bayesian Linear Regressor is a distribution over linear functions given by
w ~ Normal(mw, Λw)
f(x) = dot(x, w)
where mw
and Λw
are the mean and precision of w
, respectively.