Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined distributions #71

Closed
assignUser opened this issue Oct 18, 2020 · 5 comments
Closed

User defined distributions #71

assignUser opened this issue Oct 18, 2020 · 5 comments
Labels
feature feature request or enhancement

Comments

@assignUser
Copy link
Collaborator

This is of course already possible through using functions in nonrandom distribution. But how about formalizing user defined distributions by allowing to pass either one of the usual dist strings or a double-dot prefixed function name that is then used to generate the data. What do you think @kgoldfeld?

Something like

newDistribution <- function(n, formula, variance, link, dtSim, envir) {
    # some funky new data generation function
}
def <- defData( varname = "ud", dist = "..newDistribution", formula =5)
@assignUser assignUser added the feature feature request or enhancement label Oct 18, 2020
@kgoldfeld
Copy link
Owner

It sounds cool in concept - I guess it would be good to come up with a couple of specific examples. Everything that has been introduced into simstudy has had a specific use (for me) or request from someone else, which means they have a specific use in mind. Which is not to say that we can't introduce totally new ideas - but I think they need to be grounded in something tangible - hence the need for an example. And barring any example, maybe we keep the idea around until we do come up with a case to motivate it.

And a more specific questions - how would the data be generated? (Again, a specific example would help here so we could see that in action.)

@assignUser
Copy link
Collaborator Author

I see what you mean.

Well we would just use the provided function via .generate instead of e.g. .genunif. I will think about an example at somepoint 👍

@assignUser
Copy link
Collaborator Author

This was one of the main ideas behind the switch (#75) as it would be much easier to implement new and custom distributions with the new system.

@kgoldfeld
Copy link
Owner

This has sort of been addressed with the new custom distribution option. I'll keep it open in case the solution does not fully address all the issues here.

@assignUser
Copy link
Collaborator Author

I think your solution is great and working on a project with 4k open issues has lead me to have a much easier time closing issues :D

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants