pymc.model.core.BaseModel#

class pymc.model.core.BaseModel(*args, **kwargs)[source]#

Functionality shared by mutable and frozen models.

Abstract: instantiate Model (mutable), or create a FrozenModel with pymc.model.transform.optimization.freeze_model().

Methods

BaseModel.__init__([name, coords, ...])

BaseModel.check_start_vals(start, **kwargs)

Check that the logp is defined and finite at the starting point.

BaseModel.compile_d2logp([vars, jacobian, ...])

Compiled log probability density hessian function.

BaseModel.compile_dlogp([vars, jacobian])

Compiled log probability density gradient function.

BaseModel.compile_fn(outs, *[, inputs, ...])

Compiles a PyTensor function.

BaseModel.compile_logp([vars, jacobian, sum])

Compiled log probability density function.

BaseModel.copy()

Clone the model.

BaseModel.d2logp([vars, jacobian, negate_output])

Hessian of the models log-probability w.r.t.

BaseModel.debug([point, fn, verbose])

Debug model function at point.

BaseModel.dlogp([vars, jacobian])

Gradient of the models log-probability w.r.t.

BaseModel.eval_rv_shapes()

Evaluate shapes of untransformed AND transformed free variables.

BaseModel.get_context([error_if_none, ...])

BaseModel.initial_point([random_seed])

Compute the initial point of the model.

BaseModel.logp([vars, jacobian, sum])

Elemwise log-probability of the model.

BaseModel.logp_dlogp_function([grad_vars, ...])

Compile a PyTensor function that computes logp and gradient.

BaseModel.name_for(name)

Check if name has prefix and adds if needed.

BaseModel.name_of(name)

Check if name has prefix and deletes if needed.

BaseModel.point_logps([point, round_vals])

Compute the log probability of point for all random variables in the model.

BaseModel.profile(outs, *[, n, point, ...])

Compile and profile a PyTensor function which returns outs and takes values of model vars as a dict as an argument.

BaseModel.replace_rvs_by_values(graphs, **kwargs)

Clone and replace random variables in graphs with their value variables.

BaseModel.set_data(name, values[, coords])

Change the values of a data variable in the model.

BaseModel.set_dim(name, new_length[, ...])

Update a mutable dimension.

BaseModel.shape_from_dims(dims)

BaseModel.table(*[, split_groups, ...])

Create a rich table summarizing the model's variables and their expressions.

BaseModel.to_graphviz(*[, var_names, ...])

Produce a graphviz Digraph from a PyMC model.

Attributes

basic_RVs

List of random variables the model is defined in terms of.

continuous_value_vars

All the continuous value variables in the model.

coords

Coordinate values for model dimensions.

datalogp

PyTensor scalar of log-probability of the observed variables and potential terms.

dim_lengths

The symbolic lengths of dimensions in the model.

discrete_value_vars

All the discrete value variables in the model.

isroot

observedlogp

PyTensor scalar of log-probability of the observed variables.

parent

potentiallogp

PyTensor scalar of log-probability of the Potential terms.

prefix

root

unobserved_RVs

List of all random variables, including deterministic ones.

unobserved_value_vars

List of all random variables (including untransformed projections), as well as deterministics used as inputs and outputs of the model's log-likelihood graph.

value_vars

List of unobserved random variables used as inputs to the model's log-likelihood (which excludes deterministics).

varlogp

PyTensor scalar of log-probability of the unobserved random variables (excluding deterministic).

varlogp_nojac

PyTensor scalar of log-probability of the unobserved random variables (excluding deterministic) without jacobian term.