Library
Contents
MeasurementErrorModels.BBml
MeasurementErrorModels.Bmem
MeasurementErrorModels.Bml
MeasurementErrorModels.Bout
MeasurementErrorModels.Priors.makeprior
MeasurementErrorModels.Priors.makeprior
MeasurementErrorModels.CovEst.OmegaV
MeasurementErrorModels.CovEst.SigmaA
Functions
MeasurementErrorModels.BBml
— MethodBBml(e, W::T Xa::T, ΣA::AbstractMatrix, BI::T) where T<:AbstractMatrix
Compute the covariance matrix of the weighted TLS solution ($\Sigma_B$), using a Sandwich estimator. Requires the computed error vector e
and it's weight matrix W
, the predictor matrix Xa
(with intercept term) and its covariance matrix ΣA
, and $BI = B ⊗ I_n$.
MeasurementErrorModels.Bmem
— MethodBmem(Y::AbstractVector, X::AbstractMatrix, Ωv::AbstractMatrix, ΣA::AbstractMatrix; Bprior=MvNormal(I(size(X,2)+1)))
Compute a quasi-Bayesian posterior for the Measurement Error Model (one iteration). Requires the response vector Y
and the predictor matrix X
(without intercept term), and their respective covariance matrices Ωv
and ΣA
.
MeasurementErrorModels.Bml
— MethodBml(Y::AbstractVector, X::AbstractMatrix, Ωv::AbstractMatrix, ΣA::AbstractMatrix; Bprior=MvNormal(I(size(X,2)+1)))
Compute the weighted TLS solution {$B_\text{ml}$}, using a fixed point iteration. Requires the response vector Y
and the predictor matrix X
(without intercept term), and their respective covariance matrices Ωv
and ΣA
.
MeasurementErrorModels.Bout
— MethodBout(D::DataFrame; Bprior=MvNormal(size(D,2)-1), lags=0:25, ycol=:ya)
Compute a quasi-Bayesian posterior for the Measurement Error Model (two-step iteration). Requires a DataFrame D
containing all variables, the name of the response variable can be specified by ycol
. lags
are the lags retained for modelling the lagged covariance matrix of the predictor noise, $\Sigma_A$.
MeasurementErrorModels.Priors.makeprior
— Functionmakeprior(Y::AbstractVector, X::AbstractMatrix, Bprior=MvNormal(I(size(D,2)-1)); ip=1.0)
Construct a prior with an informed intercept from Y
, X
and Bprior
, where Bprior
is the distribution of the predictor coefficients (not including the intercept). A prior for the intercept is calculated using Y
, X
and Bprior
. ip
scales the estimated variance of the intercept.
MeasurementErrorModels.Priors.makeprior
— Functionmakeprior(D::DataFrame, Bprior=MvNormal(I(size(D,2)-1)); ycol=:ya, ip=1.0)
Construct a prior with an informed intercept from a dataframe D
. ycol
is the column name of the response variable. Bprior
is the distribution of the predictor coefficients (not including the intercept). ip
scales the estimated variance of the intercept.
MeasurementErrorModels.CovEst.OmegaV
— MethodOmegaV(V::AbstractVector, εV::AbstractVector; lags=0:25)
Estimate covariance matrix $\Omega_V$ from the error vector V
, subject to known εV
. $n$-length vector εV
is the heteroscedastic standard deviation of $V$. The underlying matrix Ω is assumed to be toeplitz for lags lags
.
MeasurementErrorModels.CovEst.SigmaA
— MethodSigmaA(A::AbstractMatrix, εA::AbstractMatrix; lags=0:25)
Estimate $\Sigma_A$ from the error field A
, subject to known εA
. The underlying Ω matrices are assumed to be toeplitz for lags lags
.