reconhub / distcrete

:chart_with_upwards_trend::point_right::bar_chart: Discretise distributions
http://reconhub.github.io/distcrete
Other
5 stars 1 forks source link

Allow easier changing of parameters #13

Open richfitz opened 7 years ago

richfitz commented 7 years ago

For things like #9, the pattern of recreating a distribution seems really ugly. Better might be to replace parameters. So the workflow would look more like:

ll2 <- function(param, obj, x) {
  obj$d(x, scale = param[[1]], rate = param[[2]])
}

or

ll2 <- function(param, obj, x) {
  obj$d(x, parameters = param)
}

Thoughts @thibautjombart?