Closed statasaurus closed 3 weeks ago
Thanks, I don't mind a wider format method for mixture distributions.
Definitely would want to use {pillar} as a Suggest, with the methods dynamically registered in .onLoad()
.
I do think all of the parameters of the mixture should be inside the mixture parenthesis, i.e. mixture(<params>)
. A denser display would also be preferable.
Perhaps mixture(n=2)
for small widths, and mixture([w=0.5: N(0,1)], [w=0.5: t(10, 0, 1)])
for wider widths? Any other dense suggestions are welcomed.
What about something that echoes the cdf/density formula, like mixture(0.5*N(0,1) + 0.5*t(10, 0, 1))
?
I'd want to be a bit careful not to confuse mixtures with convolutions (#106), but perhaps the short form of w*<dist>
can be used here?
Example: mixture(0.5*N(0,1), 0.5*t(10, 0, 1))
?
Oh yeah good point, I like that instead.
That seems great. I will update my pull request soon
So I have updated the print message to match what we discussed. I wasn't able to get the dynamic length adjustment working. {pillar} uses the class of the object and because all the distributions have the same class the formatting method would have to cover all the distributions.
Instead of using {pillar}
, could you update it to use a width = getOption("width")
option? This option should ensure that at most 1 line is used per distribution.
For example:
So I ended up with an option in the middle. I am using pillar and the width option. Basically all the other formats don't take width in as an option it was actually easy to apply to all the other distributions. Now it looks something like this:
@mitchelloharawild Sorry I realised I forgot to update the tests and tag you in this. But I think it should be good to go now
This is a small pull request to update the formatting for mixture distributions. It is hard for users to understand the contents of the mixture when only given the number of components so I have added information about the components. The new format method creates the following output
If there is a concern about the length I am happy to use {pillar} so it can dynamically print, but I didn't want to add the dependancy without running it by you.