ComponentArrays.jl icon indicating copy to clipboard operation
ComponentArrays.jl copied to clipboard

Dispatchable ComponentArrays

Open jonniedie opened this issue 3 years ago • 2 comments

It would be nice to dispatch on ComponentArrays. Unfortunately, the type of the ComponentArray is pretty coupled with the size of its components. For example, it's reasonable to want these two to have the same dispatchable type:

x1 = ComponentArray(a=rand(1))
x2 = ComponentArray(a=rand(4))

This will require some reconfiguring of the AbstractAxis stuff. I think some metadata is going to have to be stored in the AbstractAxis types rather than the ComponentArray type. I'll have to give this some thought.

jonniedie avatar Jul 16 '21 14:07 jonniedie

Thank you for opening the issue! My initial use case required using a ComponentArray as a struct containing the parameters of a stochastic model. I wanted to maximize its likelihood, and write a generic MLE algorithm with autodiff, whose logpdf function would then dispatch onto the model type.

gdalle avatar Jul 17 '21 06:07 gdalle