BayesSizeAndShape

Package Features

Function Documentation

BayesSizeAndShape.SizeAndShapeWithReflectionMCMCFunction
SizeAndShapeWithReflectionMCMC(
    landmarks::Array{Float64,3}, 
    fm::FormulaTerm,
    covariates::DataFrame, 
    iterations::NamedTuple{(:iter, :burnin, :thin),Tuple{Int64,Int64,Int64}},
    betaprior::ContinuousUnivariateDistribution,
    sigmaprior::ContinuousMatrixDistribution
)

Posterior samples from the size-and-shape model - in this version, only two-dimensional data with reflection information are allowed.
The functions returns an object of type SizeAndShapeModelOutput.

Arguments

Let

  • n be the number of objects;
  • k+1 be the number of recorded landmark for each object
  • p be the dimension of each landmark (only p=2 or p=3)

The arguments of the functions are

  • landmarks: a three-dimensional Array of dimension $(k+1)\times p \times n$ with the data;
  • fm: a formula, where on the left-hand side there must be 1 and on the right-hand side there is the actual regressive formula - an intercept is needed;
  • covariates: a DataFrame of covariates. The formula fm search for the covariates in the DataFrame column names;
  • iterations: a NamedTuple with iter, burnin, and thin values of the MCMC algorithm
  • betaprior: a Normal distribution that is used as prior for all regressive coefficients
  • sigmaprior: an InverseWishart distribution that is used as prior for the covariance matrix.
source
BayesSizeAndShape.sizeshape_helmertproduct_reflectionFunction
sizeshape_helmertproduct_reflection(dataset::Array{Float64,3})

The function computes the Size-And-Shape version of the data dataset, with reflection information. The output is computed using the helmert matrix and the SVD trasformation

source

Posterior Samples

BayesSizeAndShape.posterior_samples_sigmaFunction
posterior_samples_sigma(modeloutput::SizeAndShapeModelOutput{KeepReflection,RL,P,DoNotRemoveSize,GramSchmidtMean,<:MCMCNormalDataKeepSize,<:LinearMean,<:MCMCLinearMean,CT,CM,PS}) where {
    RL<:RemoveLocation,
    CT<:TypeModelCoVariance,
    CM<:MCMCTypeModelCoVariance,
    PS<:MCMCObjectOUT,
    P<:ValueP
    }

The function extract the posterior sample of the covariance matrix from an object of type SizeAndShapeModelOutput

source
BayesSizeAndShape.posterior_samples_betaFunction
posterior_samples_beta(modeloutput::SizeAndShapeModelOutput{KeepReflection,RL,P,DoNotRemoveSize,GramSchmidtMean,<:MCMCNormalDataKeepSize,<:LinearMean,<:MCMCLinearMean,CT,CM,PS}) where {
    RL<:RemoveLocation,
    CT<:TypeModelCoVariance,
    CM<:MCMCTypeModelCoVariance,
    PS<:MCMCObjectOUT,
    P<:ValueP   
}

The function extract the posterior sample of the regressive coefficients from an object of type SizeAndShapeModelOutput

source