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
Multivariate Distributions #26
Comments
I'm misunderstanding why adding the following will not work...
with error message,
but the following does,
|
Abstracting I'm unsure on what's the best way to approach this, but the first thing that comes to mind isn't very elegant: module type UnivariateDistribution = sig
type t
type elt = float
include BaseDistribution with type t := t and type elt := elt
end
module type MultivariateDistribution = sig
type t
type elt
include BaseDistribution with type t := t and type elt := elt
end
(* And, the boilerplate for discrete-continuous cases. *) The reasons we currently have discrete continuous cases separated are:
As for the compiler error, I've never seen this one before, I think we should ask for clarifications in the mailing list. |
Update: compiler error is documented here:
|
I've tried to generalize distribution signatures, so now each distribution also has an module type Mean = sig
type elt
type t
val mean : t -> elt
end Most discrete distributions have real means, so we can't just |
Yeah that's a tough one. |
Actually, what do you think about switching to objects for distributions? that way can get rid of all of the micro-signatures, like type 'a mean = < mean : 'a; .. >
type 'a mean_opt = < mean_opt : 'a option; .. > |
Okay, I've chosen to stick with modules for now, multivariate normal distribution can be expressed as: module MultiNormal : sig
type elt = float array
include BaseDistribution with type elt := elt
include Features with type t := t and type elt := elt
include MLE with type t := t and type elt := elt
end However, I'm unsure if we should focus on this now: neither |
I prefer modules too. I thought R/scipy provided a fairly full distribution suite, but I see that (looking at [1] and [2]) they have only a few basic ones as you've pointed out. I think at least allowing some generality to implement them is important along with a few basic ones. [1] - http://docs.scipy.org/doc/numpy/reference/routines.random.html |
Well, for SciPy a list of supported distributions is a little longer, but still, all of them are univariate. |
Is there a way to abstract the 'float' from the distribution modules to also include 'float array' (or other data-types) to fully extend the distribution modules? and is that sufficient to extend distributions to multivariate ones? Something like...
The text was updated successfully, but these errors were encountered: