about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m')
-rw-r--r--sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m b/sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m
new file mode 100644
index 00000000..b5bd041e
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/potentials/@mpot/pot_to_marginal.m
@@ -0,0 +1,13 @@
+function m = pot_to_marginal(pot)
+% POT_TO_MARGINAL Convert a mpot to a marginal structure.
+% m = pot_to_marginal(pot)
+
+m.domain = pot.domain;
+m.T = exp(pot.logp);
+m.mu = pot.mu;
+m.Sigma = pot.Sigma;
+
+if isvectorBNT(m.T)
+  m.T = m.T(:)';
+end
+