(all-vals maps)
Alpha - subject to change. Given a collection of maps, each with the same keys, return a map of keys to set of possible values.
Alpha - subject to change. Given a collection of maps, each with the same keys, return a map of keys to set of possible values.
(ancestors m x)
Returns An(x)_m i.e. the ancestors of the nodes in x for model m, inclusive.
Returns An(x)_m i.e. the ancestors of the nodes in x for model m, inclusive.
(bind formula bindings)
Associate bindings with unbound formula, returning a formula suitable as an argument for (estimate ...). bind does not currently check that the bindings are valid.
Associate bindings with unbound formula, returning a formula suitable as an argument for (estimate ...). bind does not currently check that the bindings are valid.
(bound-query effect do given)
Returns a representation of a causal effect query with variable bindings. do and given should be maps. effect should be a set or vector. Formulas returned from (identify ...) will be bound, i.e. suitable as a parameter for (estimate ...)
Returns a representation of a causal effect query with variable bindings. do and given should be maps. effect should be a set or vector. Formulas returned from (identify ...) will be bound, i.e. suitable as a parameter for (estimate ...)
(c-components m)
Returns the confounded components of m as a set of sets of vertices.
Returns the confounded components of m as a set of sets of vertices.
(categorical dataset & {:as options})
Estimate a categorical distribution, where dataset is one of:
Estimate a categorical distribution, where dataset is one of: - a clojure.core.matrix dataset - a seq of maps of random variables to values
(cut-incoming m x)
Returns G_{\overline{x}} i.e. a model where all incoming edges to nodes in x have been severed.
Returns G_{\overline{x}} i.e. a model where all incoming edges to nodes in x have been severed.
(data v)
Returns a representation of the known joint probability function.
Returns a representation of the known joint probability function.
(data? f)
Returns true iff f is an instance of Fail.
Returns true iff f is an instance of Fail.
(define symbol & init?)
Alpha - subject to change. Define a symbol as with def, but return the value.
Alpha - subject to change. Define a symbol as with def, but return the value.
(defmodel name docstring? & args)
Alpha - subject to change. Define a model, as with (def ...), but return the value of the model.
Alpha - subject to change. Define a model, as with (def ...), but return the value of the model.
(estimate distribution formula & {:as options})
Estimate the result of applying the bound formula to distribution. Returns a new distribution. Options are passed to the underlying protocol.
If bindings for :event are included in the formula, then estimate acts as 'syntatic sugar' for (measure (estimate distribution bindings) event).
Note that estimate does not currently check that bindings are valid; improper use may yield nonsensical estimated distributions.
Estimate the result of applying the bound formula to distribution. Returns a new distribution. Options are passed to the underlying protocol. If bindings for :event are included in the formula, then estimate acts as 'syntatic sugar' for (measure (estimate distribution bindings) event). Note that estimate does not currently check that bindings are valid; improper use may yield nonsensical estimated distributions.
(event-query effect do given)
Returns a representation of a causal effect query with variable bindings. do and given should be maps. effect should be a map, and will be bound to the :event key of the resulting query.
Returns a representation of a causal effect query with variable bindings. do and given should be maps. effect should be a map, and will be bound to the :event key of the resulting query.
(extract-hedges form)
Walk the form and return the set of hedges inline.
Walk the form and return the set of hedges inline.
(fail? f)
Returns true iff f is an instance of Fail.
Returns true iff f is an instance of Fail.
(find-superset coll s)
Returns a superset of s or nil if no such superset exists. coll is a collection of sets.
Returns a superset of s or nil if no such superset exists. coll is a collection of sets.
(form->latex form)
Helper function to compile form to a valid LaTeX math string.
Helper function to compile form to a valid LaTeX math string.
(formula? f)
Returns true iff f is a Formula.
Returns true iff f is a Formula.
(free form)
Returns the set of free variables in a form.
Returns the set of free variables in a form.
(id y x p g)
Shpitser's ID algorithm. Call with p = {:p (vertices g)}. Returns a form, with any hedges inline.
Shpitser's ID algorithm. Call with p = {:p (vertices g)}. Returns a form, with any hedges inline.
(identifiable? model query)
(identifiable? model data query)
True iff q is identifiable in m from P(v)
True iff q is identifiable in m from P(v)
(identify model query)
(identify model data query)
Returns a formula that computes query q from data d in model m. Data defaults to P(v), i.e. joint distribution over all variables in m.
Note that formulas are not currently reduced to simpler, equivalent forms.
Returns a formula that computes query q from data d in model m. Data defaults to P(v), i.e. joint distribution over all variables in m. Note that formulas are not currently reduced to simpler, equivalent forms.
(infer model distribution query & {:as options})
Syntactic sugar for identify and estimate.
Syntactic sugar for identify and estimate.
(latent-projection m x)
Latent-project (set) x in m.
Latent-project (set) x in m.
(map->str m)
Convert a map of vars to vals to a LaTeX string.
Convert a map of vars to vals to a LaTeX string.
(measure distribution event & {:as options})
Returns the probability of the given event. Options are passed to the underlying protocol.
Returns the probability of the given event. Options are passed to the underlying protocol.
(model dag & confounding)
Returns a new causal diagram. model does not currently check that its arguments are valid.
Returns a new causal diagram. model does not currently check that its arguments are valid.
(node->str n)
Convert a node to a LaTeX string.
Convert a node to a LaTeX string.
(pairs-of coll)
Returns all pairs of elements of coll as a set of sets.
Returns all pairs of elements of coll as a set of sets.
(parents m x)
Returns Pa(x)_m i.e. the parents of the nodes in x for model m.
Returns Pa(x)_m i.e. the parents of the nodes in x for model m.
(predecessors ordering v)
Returns the set of items before v in ordering. Throws an exception if v is not in ordering.
Returns the set of items before v in ordering. Throws an exception if v is not in ordering.
(product coll)
Returns \prod_i p_i. coll is a collection of probability functions.
Returns \prod_i p_i. coll is a collection of probability functions.
(q effect & {:keys [do given] :or {do {} given {}}})
Query. Returns a representation of the causal effect query. Prefer calling this over the *-query constructors. q does not currently check that the bindings are consistent.
Query. Returns a representation of the causal effect query. Prefer calling this over the *-query constructors. q does not currently check that the bindings are consistent.
(query? f)
Returns true iff f is an instance of Query.
Returns true iff f is an instance of Query.
(set->str s)
Convert a set of nodes to a LaTeX string.
Convert a set of nodes to a LaTeX string.
(sources g)
Returns a set of all nodes in dag g which have zero in-degree. Assumes that g is of the form {nodes #{parents}}.
Returns a set of all nodes in dag g which have zero in-degree. Assumes that g is of the form {nodes #{parents}}.
(subgraph m x)
Returns G_{x} i.e. a model containing only the vertices in set x and edges between those vertices, including the bidirected edges.
Returns G_{x} i.e. a model containing only the vertices in set x and edges between those vertices, including the bidirected edges.
(topological-sort m)
Returns a topological sort of vertices in model m. Ties are broken by (sort ...); this ensures a unique sort.
Returns a topological sort of vertices in model m. Ties are broken by (sort ...); this ensures a unique sort.
(transpose g)
Alpha - subject to change. Returns the transpose of directed graph g. Graphs are assumed to be of the form {nodes #{nodes}}.
Alpha - subject to change. Returns the transpose of directed graph g. Graphs are assumed to be of the form {nodes #{nodes}}.
(unbound-query effect do given)
Returns a representation of a causal effect query without variable bindings. Formulas returned from (identify ...) will be unbound.
Returns a representation of a causal effect query without variable bindings. Formulas returned from (identify ...) will be unbound.
(val->str v)
Convert a value to a LaTeX string.
Convert a value to a LaTeX string.
(vertices m)
Returns ver(m), i.e. the vertices of model m.
Returns ver(m), i.e. the vertices of model m.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close