Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍
https://github.com/madlabunimib/PyCTBN
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
251 lines
11 KiB
251 lines
11 KiB
4 years ago
|
|
||
|
|
||
|
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||
|
<html xml:lang="" lang="" version="-//W3C//DTD XHTML 1.1//EN" xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
||
|
|
||
|
<title>set_of_cims module — PyCTBN documentation</title>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'/>
|
||
|
<link rel="stylesheet" href="../_static/css/pdj.css" type="text/css" />
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<link rel="index" title="Index"
|
||
|
href="../genindex.html"/>
|
||
|
<link rel="search" title="Search" href="../search.html"/>
|
||
|
<link rel="top" title="PyCTBN documentation" href="../index.html"/>
|
||
|
|
||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||
|
<meta http-equiv="cache-control" content="public" />
|
||
|
<meta name="robots" content="follow, all" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
<!-- Add jQuery library -->
|
||
|
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body class="wy-body-for-nav" role="document">
|
||
|
|
||
|
<div class="wy-grid-for-nav">
|
||
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
|
<div class="wy-side-nav-search">
|
||
|
<a href="../index.html" class="fa fa-home"> PyCTBN </a>
|
||
|
<div role="search">
|
||
|
<form id ="rtd-search-form" class="wy-form"
|
||
|
action="../search.html" method="get">
|
||
|
<input type="text" name="q" placeholder="Search docs" />
|
||
|
<input type="hidden" name="check_keywords" value="yes" />
|
||
|
<input type="hidden" name="area" value="default" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||
|
|
||
|
|
||
|
|
||
|
<!-- Local TOC -->
|
||
|
<div class="local-toc"><ul>
|
||
|
<li><a class="reference internal" href="#">set_of_cims module</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</nav>
|
||
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||
|
|
||
|
<nav class="wy-nav-top" id="barra-mobile" role="navigation" aria-label="top navigation">
|
||
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
|
<a href="#">Porão do Juca</a>
|
||
|
</nav>
|
||
|
|
||
|
<div class="wy-nav-content">
|
||
|
<div class="fundo-claro">
|
||
|
</div>
|
||
|
<div class="fundo-escuro">
|
||
|
</div>
|
||
|
|
||
|
<div class="rst-content">
|
||
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
||
|
|
||
|
<!-- <ul class="wy-breadcrumbs"> -->
|
||
|
<!-- <li><a href="#">Docs</a> »</li> -->
|
||
|
|
||
|
<!-- <li>Features</li> -->
|
||
|
<!-- <li class="wy-breadcrumbs-aside"> -->
|
||
|
|
||
|
<!-- <a href="_sources/index.txt" rel="nofollow"> View page source</a> -->
|
||
|
|
||
|
<!-- </li> -->
|
||
|
<!-- </ul> -->
|
||
|
<!-- <hr/> -->
|
||
|
</div>
|
||
|
|
||
|
<div role="main" class="">
|
||
|
|
||
|
<div id="content" class="hfeed entry-container hentry">
|
||
|
<div class="section" id="module-set_of_cims">
|
||
|
<span id="set-of-cims-module"></span><h1>set_of_cims module<a class="headerlink" href="#module-set_of_cims" title="Permalink to this headline">¶</a></h1>
|
||
|
<dl class="py class">
|
||
|
<dt id="set_of_cims.SetOfCims">
|
||
|
<em class="property">class </em><code class="sig-prename descclassname">set_of_cims.</code><code class="sig-name descname">SetOfCims</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node_id</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">parents_states_number</span><span class="p">:</span> <span class="n">List</span></em>, <em class="sig-param"><span class="n">node_states_number</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">p_combs</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span><a class="headerlink" href="#set_of_cims.SetOfCims" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
|
<p>Aggregates all the CIMS of the node identified by the label _node_id.</p>
|
||
|
<dl class="field-list simple">
|
||
|
<dt class="field-odd">Parameters</dt>
|
||
|
<dd class="field-odd"><ul class="simple">
|
||
|
<li><p><strong>node_id</strong> – the node label</p></li>
|
||
|
<li><p><strong>parents_states_number</strong> (<em>List</em>) – the cardinalities of the parents</p></li>
|
||
|
<li><p><strong>node_states_number</strong> (<em>int</em>) – the caridinality of the node</p></li>
|
||
|
<li><p><strong>p_combs</strong> (<em>numpy.ndArray</em>) – the p_comb structure bound to this node</p></li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dt class="field-even">_state_residence_time</dt>
|
||
|
<dd class="field-even"><p>matrix containing all the state residence time vectors for the node</p>
|
||
|
</dd>
|
||
|
<dt class="field-odd">_transition_matrices</dt>
|
||
|
<dd class="field-odd"><p>matrix containing all the transition matrices for the node</p>
|
||
|
</dd>
|
||
|
<dt class="field-even">_actual_cims</dt>
|
||
|
<dd class="field-even"><p>the cims of the node</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.actual_cims">
|
||
|
<em class="property">property </em><code class="sig-name descname">actual_cims</code><a class="headerlink" href="#set_of_cims.SetOfCims.actual_cims" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd></dd></dl>
|
||
|
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.build_cims">
|
||
|
<code class="sig-name descname">build_cims</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">state_res_times</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">transition_matrices</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em><span class="sig-paren">)</span> → None<a class="headerlink" href="#set_of_cims.SetOfCims.build_cims" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd><p>Build the <code class="docutils literal notranslate"><span class="pre">ConditionalIntensityMatrix</span></code> objects given the state residence times and transitions matrices.
|
||
|
Compute the cim coefficients.The class member <code class="docutils literal notranslate"><span class="pre">_actual_cims</span></code> will contain the computed cims.</p>
|
||
|
<dl class="field-list simple">
|
||
|
<dt class="field-odd">Parameters</dt>
|
||
|
<dd class="field-odd"><ul class="simple">
|
||
|
<li><p><strong>state_res_times</strong> (<em>numpy.ndArray</em>) – the state residence times matrix</p></li>
|
||
|
<li><p><strong>transition_matrices</strong> (<em>numpy.ndArray</em>) – the transition matrices</p></li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd></dl>
|
||
|
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.build_times_and_transitions_structures">
|
||
|
<code class="sig-name descname">build_times_and_transitions_structures</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="headerlink" href="#set_of_cims.SetOfCims.build_times_and_transitions_structures" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd><p>Initializes at the correct dimensions the state residence times matrix and the state transition matrices.</p>
|
||
|
</dd></dl>
|
||
|
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.filter_cims_with_mask">
|
||
|
<code class="sig-name descname">filter_cims_with_mask</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mask_arr</span><span class="p">:</span> <span class="n">numpy.ndarray</span></em>, <em class="sig-param"><span class="n">comb</span><span class="p">:</span> <span class="n">List</span></em><span class="sig-paren">)</span> → numpy.ndarray<a class="headerlink" href="#set_of_cims.SetOfCims.filter_cims_with_mask" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd><p>Filter the cims contained in the array <code class="docutils literal notranslate"><span class="pre">_actual_cims</span></code> given the boolean mask <code class="docutils literal notranslate"><span class="pre">mask_arr</span></code> and the index
|
||
|
<code class="docutils literal notranslate"><span class="pre">comb</span></code>.</p>
|
||
|
<dl class="field-list simple">
|
||
|
<dt class="field-odd">Parameters</dt>
|
||
|
<dd class="field-odd"><ul class="simple">
|
||
|
<li><p><strong>mask_arr</strong> (<em>numpy.array</em>) – the boolean mask that indicates which parent to consider</p></li>
|
||
|
<li><p><strong>comb</strong> (<em>numpy.array</em>) – the state/s of the filtered parents</p></li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dt class="field-even">Returns</dt>
|
||
|
<dd class="field-even"><p>Array of <code class="docutils literal notranslate"><span class="pre">ConditionalIntensityMatrix</span></code> objects</p>
|
||
|
</dd>
|
||
|
<dt class="field-odd">Return type</dt>
|
||
|
<dd class="field-odd"><p>numpy.array</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</dd></dl>
|
||
|
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.get_cims_number">
|
||
|
<code class="sig-name descname">get_cims_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#set_of_cims.SetOfCims.get_cims_number" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd></dd></dl>
|
||
|
|
||
|
<dl class="py method">
|
||
|
<dt id="set_of_cims.SetOfCims.p_combs">
|
||
|
<em class="property">property </em><code class="sig-name descname">p_combs</code><a class="headerlink" href="#set_of_cims.SetOfCims.p_combs" title="Permalink to this definition">¶</a></dt>
|
||
|
<dd></dd></dl>
|
||
|
|
||
|
</dd></dl>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<footer>
|
||
|
|
||
|
|
||
|
<hr/>
|
||
|
|
||
|
<div role="contentinfo">
|
||
|
<p>
|
||
|
© Copyright 2020, Filippo Martini.
|
||
|
</p>
|
||
|
</div>
|
||
|
|
||
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/jucacrispim/sphinx_pdj_theme">theme</a> provided by <a href="http://poraodojuca.net">Porão do Juca</a>.
|
||
|
|
||
|
</footer>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
var DOCUMENTATION_OPTIONS = {
|
||
|
URL_ROOT:'../',
|
||
|
VERSION:'',
|
||
|
COLLAPSE_INDEX:false,
|
||
|
FILE_SUFFIX:'.html',
|
||
|
HAS_SOURCE: true
|
||
|
};
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../_static/jquery.js">
|
||
|
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../_static/underscore.js">
|
||
|
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../_static/doctools.js">
|
||
|
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../_static/language_data.js">
|
||
|
|
||
|
</script>
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript"
|
||
|
src="../_static/js/theme.js"></script>
|
||
|
|
||
|
<script type="text/javascript"
|
||
|
src="../_static/js/pdj.js"></script>
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
jQuery(function () {
|
||
|
SphinxRtdTheme.StickyNav.enable();
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|