A while back I posted an example outlining how to use petersburg to simulate the St. Petersburg Paradox. In this post, I’d like to dig a little deeper into what petersbug is and what it does.

前一段时间,我发布了一个示例,概述了如何使用彼得斯堡来模拟圣彼得堡悖论。 在本文中,我想更深入地研究petersbug是什么以及它的作用。

Petersburg is a minimal python library for representing complex decisions (as in decision theory decisions) as probabilistic graphs.  With a game or decision represented, it can be simulated with some context (like finite bankrolls, ruin, or risk aversion).  So let’s dive in to the inner workings:

Petersburg是一个最小的python库,用于将复杂的决策(如决策理论决策中的)表示为概率图。 通过表示游戏或决策,可以在一定环境下(例如有限资金,破产或规避风险)对其进行模拟。 因此,让我们深入了解内部工作原理:

A graph is a set of nodes connected by edges.  Nodes represent some object or state, and they are connected by edges that may or may not have direction.  Both edges and nodes can have attributes tied to them, such as weights, labels or other data.  If it is possible to start at a node, and progress along edges and get back to the same node, that is called a cycle, making a directed graph without cycles “acyclic”.  These directed acyclic graphs (DAGs) are what we use to represent decisions in petersburg.

图是由边连接的一组节点。 节点表示某种对象或状态,它们通过可能具有方向或没有方向的边连接。 边缘和节点都可以绑定属性,例如权重,标签或其他数据。 如果有可能从一个节点开始,然后沿着边缘前进并返回到同一节点,则称为循环,使没有循环的有向图成为“非循环的”。 这些有向无环图(DAG)是我们用来表示圣彼得堡决策的依据。

Nodes in petersburg have one attribute: payoff.  This is some numeric value accumulated when the node is reached.  There is one special case for nodes, and that is the starting node, where the process begins.  Other than that, all decisions are made up of these simple one-attribute nodes connected by directed edges.  The edges have two attributes: cost and weight.  The cost is, just like the payoff attribute of the nodes, accumulated on arrival to the edge.  Weights are positive numeric values that are used to represent the likelihood of taking one edge versus another when more than one path out of a node is available.

彼得斯堡的节点具有一个属性:收益。 这是到达节点时累积的一些数值。 节点有一种特殊情况,那就是过程开始的起始节点。 除此之外,所有决策都由这些有向边连接的简单一属性节点组成。 边缘具有两个属性:成本和重量。 就像节点的收益属性一样,成本是在到达边缘时累积的。 权重是正数值,用于表示当一条路径中有多个路径可用时,一条边缘相对于另一边缘的可能性。

With these two objects, a graph object, which is simply a reference to the starting node of a DAG can be built very simply to represent very complex scenarios.  To revisit the St. Petersburg case in a more classical case (with finite bankroll), the dictionary representing the game for just one flip would be:

使用这两个对象,可以非常简单地构建一个图形对象,该对象只是对DAG起始节点的引用,可以表示非常复杂的场景。 为了在更经典的情况下(具有有限的资金)重温圣彼得堡的情况,仅需翻转一下即可表示游戏的字典为:

{"1": {"after": [],"payoff": 0},"2": {"after": [{"cost": 10,"node_id": 1}],"payoff": 0},"3": {"after": [{"weight": 1,"cost": 0,"node_id": 2}],"payoff": 2},"4": {"after": [{"weight": 1,"cost": 0,"node_id": 2}],"payoff": 0}
}

In this graph, there are 4 nodes:

在此图中,有4个节点:

  1. Start
  2. Entrance Fee
  3. Flip #1: Heads
  4. Flip #2: Tails (fail)
  1. 开始
  2. 入场费
  3. 翻转#1:元首
  4. 翻转#2:尾巴(失败)

The (3) and (4) node pattern can be repeated indefinitely to represent the St. Petersburg game.

可以无限重复重复(3)和(4)节点模式,以表示圣彼得堡游戏。

While these classical decision theoretic problems are interesting, and I have two more to post in the coming weeks, the real intention here is to study more interesting relationships in complex decision structures.  So in the case where the weights in one part of graph aren’t known, but the structure and costs are, how can you use simulation to understand the influence of those weights to make informed (and safe from ruin) decisions?  How can likelihood, criticality, and ability to affect change be estimated and consolidated in complex decision scenarios?

尽管这些经典决策理论问题很有趣,并且在接下来的几周内我还要发表两个问题,但这里的真正目的是研究复杂决策结构中更有趣的关系。 因此,在未知图的一部分权重但结构和成本未知的情况下,您如何使用模拟来理解这些权重的影响来做出明智的(并且可以避免崩溃)决策? 在复杂的决策场景中,如何估计,合并影响变更的可能性,关键性和能力?

Petersburg will be able to help understand these kinds of questions better by providing structure into how the problems are presented, and by providing that structure in such a way that subsets of the decision which may be simpler can be examined in isolation.

通过为问题的处理方式提供结构,并以一种可以使可能更简单的决策子集被单独检查的方式提供结构,Petersburg将能够帮助更好地理解这类问题。

So check out petersburg on github, it’s still very raw, but there are a bunch of examples that I’ll continue developing as the library itself fleshes out:

因此,请在github上查看petersburg,它仍然很原始,但是随着库本身的完善,我将继续开发许多示例:

翻译自: https://www.pybloggers.com/2016/01/thinking-like-a-graph-to-make-decisions-petersburg/

像图形一样思考以做出决策:彼得斯堡相关推荐

  1. 决策者根据什么曲线做出决策_如何做出产品设计决策

    决策者根据什么曲线做出决策 by Tanner Christensen 由Tanner Christensen 如何做出产品设计决策 (How Product Design Decisions are ...

  2. 决策者根据什么曲线做出决策_如何在开放社区中做出品牌决策

    决策者根据什么曲线做出决策 4月18日,Docker创始人所罗门·海克斯(Solomon Hykes)在主要Docker仓库中通过拉取请求发表了一个重要声明 :" Docker会将其所有开源 ...

  3. 【数据分析】什么是数据分析? 分析和管理数据以做出决策

    数据分析是一门专注于从数据中提取洞察力的学科,包括数据的分析.收集.组织和存储,以及用于执行此操作的工具和技术 数据分析定义 数据分析是一门专注于从数据中提取洞察力的学科.它包括数据分析和管理的过程. ...

  4. 决策者根据什么曲线做出决策_大规模做出公开决策

    决策者根据什么曲线做出决策 在初创企业中,预测决策将如何影响与您一起工作的人相对容易. 如果您不知道,只需询问他们,然后相应地进行调整即可. 在大多数启动环境中,此类公开对话都是一种直观且预期的做法. ...

  5. 游戏开发中的人工智能(十三):不确定状态下的决策:贝叶斯技术

    接上文 游戏开发中的人工智能(十二):概率概论 本文内容:贝叶斯技术是概率技术,本章解释如何运用,以便在游戏中做决策并适应游戏. 不确定状态下的决策:贝叶斯技术 本章要介绍贝叶斯推论和贝叶斯网络,教你 ...

  6. 神经网络到底是如何做出决策的?

    (A,B)---m*n*2---(1,0)(0,1) 神经网络的衰变假设:被概率密度表达的粒子A和B彼此互为粒子和环境,在相互作用中被彼此微扰产生衰变,衰变产物是B化A和A化B,网络的分类准确率是两个 ...

  7. 五 我们经常会忘记,要学会 走路 才能 奔跑,Python基础教程

    目录 1 前言,啰嗦几句但很重要的 2 Python 交互器是个学习利器 3 "=" 这可不是等于的意思 4 基本数据类型的使用 5 数字(Number) 6 字符串(String ...

  8. 关机时无人照管更新正在运行_无法抗拒的未来:无人叉车在内部物流中已成为现实...

    自动化和半自动化的叉车不再是新奇的东西,在人力短缺的仓库中取得了进展.他们最终会成为规范吗? 目前尚不知道全世界有多少辆无人驾驶叉车(也称为自动叉车.机器人叉车或者AGV)售出.但是叉车生产商都显示出 ...

  9. 产品经理最重要的3个能力

    导读:小O北大毕业后接到了一份心仪的某知名互联网公司产品助理的录用信.他很幸运,因为带他的导师是一位资深的.产品素养很好的产品经理老K. 小O深知自己在产品这条路上还有很长一段路要走,就在琢磨一个问题 ...

最新文章

  1. Flutter实战之(Clubhouse App)
  2. printf linux 头文件,Linux C 格式化输出时要注意的问题
  3. java压缩----使用ANT JDK压缩---只压缩选中目录的指定文件夹
  4. Python实现ORM
  5. ILP32和LP64数据模型
  6. 浏览器专属 CSS Hack:区分 Firefox / Opera / Safari / Internet Explorer
  7. C语言,realloc
  8. 计算机制图总结,计算机制图总结.doc
  9. mysql redo,MySQL 8.0 redo log的深入解析
  10. Vector CANoe Option Car2X利用Car2X场景编辑器创建车联网交通场景与应用示例剖析
  11. c语言 如何选择 大小端,c语言大小端的问题
  12. vdat文件怎么转成mp4文件
  13. 最小公共子串——力扣
  14. Python日期推算实操案例
  15. Three物体剪切clipping实例
  16. eclipse的使用简介
  17. 新年了,5G手机芯片,到底买谁?
  18. vscode latex 字数统计
  19. 产品经理,你真的理解俞军的产品价值公式吗?
  20. 3CDB:基于3C技术的染色质互作信息数据库

热门文章

  1. 10系统更新后计算机不见,你好!我的电脑一不小心升级到win10以后桌面上的资料都不见了?? 爱问知识人...
  2. DC-DC电压基准芯片和REF芯片
  3. linux下.txt文件名乱码,Linux下打开txt文件乱码问题解决方案
  4. 数据库安全性和完整性考虑_您是否考虑过云安全性?
  5. 自动巡检机器人故障检测系统
  6. 2014-2015年开发的机器人仿真测试平台
  7. 数据结构 | 合并两个长度分别为m和n的有序表,最坏情况下需要比较m+n-1次
  8. 也谈SAP系统优缺点
  9. 初识powerpoint的计算机教案,《初识PowerPoint》教学设计
  10. centos添加硬盘