Lately I’ve been using @Tamas_Papp’s excellent DynamicHMC package (thank you, Tamas!) and it’s been a lot of fun, but was hoping someone could point me in the right direction with a few more esoteric variable transformations using TransformVariables.jl, e.g.
- A matrix each column of which is L1 normalized (to be used with a Dirichlet prior)
- A symmetric matrix
I realise that similar examples to these exist in the special_arrays.jl
, namely UnitVector
and CorrCholeskyFactor
. Does the following seem like the right approach?
- Declare a struct in each case, e.g.
TransformVariables.@calltrans struct UnitColumnMatrix <: TransformVariables.VectorTransform
n_rows::Int
n_cols::Int
end
- Implement
dimension
,transform_with
,inverse_eltype
, andinverse!
for each type.