You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add the functionality to transform parameter dicts, not just arrays. This should be straightforward as we must use the prior to perform the transform, and the prior also contains the parameter names.
Example setting:
Currently, to transform samples from a Samples distribution, we must convert it into an array first with the correct ordering
# S, Samples distribution (e.g. a posterior), # P, distribution (e.g. a prior with same parameter names)
samples_dict =get_distribution(S)
param_names =get_name(S)
samples_arr =zeros(sum([size(samples_dict[n],1) for n in param_names]), size(samples_dict[param_names[1]],2))
for (i,k) inenumerate(param_names)
samples_arr[i,:] = samples_dict[k]
end
constrained_samples =transform_unconstrained_to_constrained(priors, samples_arr)
Suggested solution
This is what we would want to transform samples from a Samples distribution
# S, Samples distribution (e.g. a posterior), # P, distribution (e.g. a prior with same parameter names)
samples_dict =get_distribution(S) #a Dict(param_name => samples_for_name)
constrained_samples_dict =transform_unconstrained_to_constrained(samples_dict)
Which can be done by adding the code snippet into functions transform_constrained_to_unconstrained(pd::ParameterDistribution, d::Dict), transform_unconstrained_to_constrained(pd::ParameterDistribution, d::Dict) into ParameterDistributions.jl
The text was updated successfully, but these errors were encountered:
Issue
We should add the functionality to transform parameter dicts, not just arrays. This should be straightforward as we must use the prior to perform the transform, and the prior also contains the parameter names.
Example setting:
Currently, to transform samples from a
Samples
distribution, we must convert it into an array first with the correct orderingSuggested solution
This is what we would want to transform samples from a
Samples
distributionWhich can be done by adding the code snippet into functions
transform_constrained_to_unconstrained(pd::ParameterDistribution, d::Dict)
,transform_unconstrained_to_constrained(pd::ParameterDistribution, d::Dict)
intoParameterDistributions.jl
The text was updated successfully, but these errors were encountered: