I'm seeking advice here as to how to employ Associations both for reporting tabular summaries of "BestFitParameters", "ParameterConfidenceIntervals", etc for n-component such as:
cModel[n_Integer] /; n >= 1 :=
M + Sum[A[i]*Cos[t*((2*Pi)/tau[i]) + phase[i]], {i, n}]
Also, use the Association to create cModelExec:
cModelExec =
Function[t, Evaluate[cModel[2] /. <| M -> 100, tau[1] -> 86400, A[1] -> 10,
phase[1] -> - Pi, tau[2] -> 89280, A[2] -> 3,
phase[2] -> - Pi/2|>]]
In the above, sometimes I'm collecting results from a FittedModel; other times, I'm using my own solvers to estimate the fits and fit metrics.
Currently, my thought process is heading me to use flat Associations with Lists as Keys:
Using a flat Association is attractive for the ease of a ReplaceAll and avoid collisions on re-used strings such as "CI", "StdErr", etc. For example:
<| {tau, 1} -> 86400, {tau, 1, "CI"} -> {29.1, 32.3}, ..., {A, 1} ->
10, {A, 1, "CI"} -> {1.1, 1.2}, ... |>
Using a nested Association is possible , but it is prone to errors in construction
<| tau -> {<|1 -> <|"Value" -> 86400, "CI" -> {29.1, 32.3}, ... |>,
2 -> <| ...|>|>},
A -> {<|1 -> <|"CI" -> {1.1, 1.2}, ... |>, 2 -> <| ...|>|>}|>
Question : Relative to my requirements listed above, am I heading in the right direction to use a flat association with Lists as keys, or should I be solving my problem here in an entirely different way?
Attachments: