Liking cljdoc? Tell your friends :D

whittemore.core


all-valsclj

(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.
sourceraw docstring

ancestorsclj

(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.
sourceraw docstring

bindclj

(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.
sourceraw docstring

bound-queryclj

(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 ...)
sourceraw docstring

c-componentsclj

(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.
sourceraw docstring

categoricalclj

(categorical dataset & {:as options})

Estimate a categorical distribution, where dataset is one of:

  • a clojure.core.matrix dataset
  • a seq of maps of random variables to values
Estimate a categorical distribution, where dataset is one of:
- a clojure.core.matrix dataset
- a seq of maps of random variables to values
sourceraw docstring

cut-incomingclj

(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.
sourceraw docstring

dataclj

(data v)

Returns a representation of the known joint probability function.

Returns a representation of the known joint probability function.
sourceraw docstring

data?clj

(data? f)

Returns true iff f is an instance of Fail.

Returns true iff f is an instance of Fail.
sourceraw docstring

definecljmacro

(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.
sourceraw docstring

defmodelcljmacro

(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.
sourceraw docstring

estimateclj

(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.
sourceraw docstring

event-queryclj

(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.
sourceraw docstring

extract-hedgesclj

(extract-hedges form)

Walk the form and return the set of hedges inline.

Walk the form and return the set of hedges inline.
sourceraw docstring

fail?clj

(fail? f)

Returns true iff f is an instance of Fail.

Returns true iff f is an instance of Fail.
sourceraw docstring

find-supersetclj

(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.
sourceraw docstring

form->latexclj

(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.
sourceraw docstring

formula->latexclj

(formula->latex formula)
source

formula?clj

(formula? f)

Returns true iff f is a Formula.

Returns true iff f is a Formula.
sourceraw docstring

freeclj

(free form)

Returns the set of free variables in a form.

Returns the set of free variables in a form.
sourceraw docstring

hedgeclj

(hedge g s)
source

idclj

(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.
sourceraw docstring

identifiable?clj

(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)
sourceraw docstring

identifyclj

(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.
sourceraw docstring

inferclj

(infer model distribution query & {:as options})

Syntactic sugar for identify and estimate.

Syntactic sugar for identify and estimate.
sourceraw docstring

latent-projectionclj

(latent-projection m x)

Latent-project (set) x in m.

Latent-project (set) x in m.
sourceraw docstring

map->strclj

(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.
sourceraw docstring

measureclj

(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.
sourceraw docstring

modelclj

(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.
sourceraw docstring

node->strclj

(node->str n)

Convert a node to a LaTeX string.

Convert a node to a LaTeX string.
sourceraw docstring

pairs-ofclj

(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.
sourceraw docstring

parentsclj

(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.
sourceraw docstring

predecessorsclj

(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.
sourceraw docstring

productclj

(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.
sourceraw docstring

qclj

(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.
sourceraw docstring

query?clj

(query? f)

Returns true iff f is an instance of Query.

Returns true iff f is an instance of Query.
sourceraw docstring

set->strclj

(set->str s)

Convert a set of nodes to a LaTeX string.

Convert a set of nodes to a LaTeX string.
sourceraw docstring

sourcesclj

(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}}.
sourceraw docstring

subgraphclj

(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.
sourceraw docstring

sumclj

(sum sub p)

Returns \sum_{sub} p

Returns \sum_{sub} p
sourceraw docstring

topological-sortclj

(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.
sourceraw docstring

transposeclj

(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}}.
sourceraw docstring

unbound-queryclj

(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.
sourceraw docstring

val->strclj

(val->str v)

Convert a value to a LaTeX string.

Convert a value to a LaTeX string.
sourceraw docstring

verticesclj

(vertices m)

Returns ver(m), i.e. the vertices of model m.

Returns ver(m), i.e. the vertices of model m.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close