问题标签 [stochastic-process]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
261 浏览

simulation - 从 ODE Hill 动力学到随机质量作用

我在将具有 ODE 的模型转换为随机模型时遇到问题。

原始模型包含两个表达式:

1) k6f2*PKB_S473P^n6/(km6^n6+PKB_S473P^n6))*AS160

2) k9f1*S6K*mTORC1a^n9/(km9^n9+mTORC1a^n9)

用希尔动力学描述的。

我想知道如何将前两个表达式转换为质量作用定律,以便能够用随机模拟器模拟它们。

提前谢谢大家!

0 投票
0 回答
765 浏览

matlab - 伊藤随机过程的编码

我正在尝试在mathematica/matlab中实现一个随机过程的例程。此处编写的任何代码都是为mathematica 编写的,但如果有人可以帮助我在matlab 中对此进行编码(如果他们更熟悉的话),那也可以。但是,如果可能的话,mathematica 是优先考虑的。

我会先说明一下方程式后我想得到什么。

以下是我感兴趣的伊藤随机过程(其中z(t)=[x(t),y(t)]:

在此处输入图像描述

具有以下数量:

在此处输入图像描述

我们还有以下内容(从现在开始我将输入x(t),y(t) as x,y):

在此处输入图像描述

其中,在此处输入图像描述是第一次退出时间, GT(x)x(请参阅最后)的平滑函数

目标:我想得到Q0x在此处输入图像描述只有。

==================================================== ============================= 要找到第一个退出时间在此处输入图像描述,也许可以使用以下方法(由 b.gatessucks 提供)。请注意,以下是mathematica 代码。

退出时间的约束

在此处输入图像描述

退出时间找到:

输出{t, x[t], y[t], Boole[const[x[t], y[t]]]}

我需要能够使用上面的代码找到退出时间,然后在Q0. 上面查找退出时间的片段会为正确选择的在此处输入图像描述.

==================================================== ===============================

需要设置的数值任务 find Q0(x)

--> 我们从这个表达式中的积分项开始。首先 find在此处输入图像描述从域内部开始的许多初始条件(现在说 100 - 即 100 次退出时间)(可能使用本文中已经提到的代码段)。现在,可以将 100 个退出时间中的每一个的积分在此处输入图像描述计算为 和 的x函数在此处输入图像描述

--> 现在,积分的期望值Q0是之前评估的所有 100 个积分的样本平均值(根据大数定律)。因此,Q0可以找到并且它应该只是 和 的x函数在此处输入图像描述

==================================================== ===============================

我的问题:

  1. The code above for the exit time only seems to produce non-zero exit times for appropriately chosen initial conditions. 如果有人可以阐明如何选择合适的在此处输入图像描述,以便产生足够的退出时间,那将不胜感激。我真的很想保持上面在 中指定的约束const[x_, y_],但如果似乎没有希望找到易于处理的结果,那么我不介意放松它。

  2. 下面的代码GT(x)导致奇点——我从 DSolve 收到关于不确定表达式的错误消息.... b0[xc] 和 DrhoDy[xc] 都变得不确定,因此 DSolve 在使用初始条件 GT[xc] 时会出现问题它也变得不确定......解决这个问题的任何方式都会很高兴。

  3. 最后,我真的需要有人的帮助来有效地评估数学中的 100 个积分(因为这些项很大)对于之前找到的每个退出时间并采取预期。我不确定如何正确找到退出时间。

==================================================== ============================== 求GT(x):

颂:

在此处输入图像描述

满足初始条件:

在此处输入图像描述

在哪里,

在此处输入图像描述

在此处输入图像描述

0 投票
1 回答
15357 浏览

matlab - 生成并绘制经验联合 pdf 和 CDF

给定一对两个变量(X,Y),您如何在 vanilla MATLAB(无工具箱)中生成和绘制经验联合 PDF 和 CDF?

0 投票
2 回答
513 浏览

matlab - matlab中1和0等概率的所有组合的二进制矩阵

我想生成一个二进制矩阵,比如说(8,1)。等概率表示矩阵中有四个 1 和四个 0。通过这些元素的不同排列,总共有 70 种组合是可能的(例如 8C4)。我想要这些所有可能的组合一一。请帮忙。

0 投票
2 回答
207 浏览

algorithm - 如何在确定性泊松过程中求和间隔?

我正在制作一个需要生成确定性随机事件的应用程序。它们需要具有确定性,以便我可以计算应用程序关闭时发生的事件。我想找到一个函数 f(time1, time2) 告诉我在任意两个时间点之间发生了多少事件,而不生成完整的过程。也应该是 f(t1,t3) = f(t1,t2) + f(t2, t3)。

我从这个问题开始,但开始了这个新问题,所以我现在可以重写它,因为我对我正在寻找的东西有了更好的了解。

我在 Math Overflow 上提出了一个关于寻找 f 公式的问题,因为它似乎更像是一个数学问题而不是编码问题。

0 投票
1 回答
1089 浏览

r - 在 R 中模拟中餐厅流程

我正在尝试在 R 中模拟中餐厅流程,并想知道是否可以对这种粗略的实现进行任何效率改进。

特别是,我担心这条线:

这有效率吗?

0 投票
1 回答
3194 浏览

machine-learning - scikit多标签分类:ValueError:输入形状错误

我相信支持多标签分类,我不必使用 OneVsRestClassifier SGDClassifier()检查这个loss='log'

现在,我的数据集非常大,我正在使用HashingVectorizer并将结果作为输入传递给SGDClassifier. 我的目标有 42048 个特征。

当我运行它时,如下所示:

我得到:ValueError: bad input shape (300000, 42048)

我也使用类作为参数如下,但仍然是同样的问题。

在 SGDClassifier 的文档中,它说y : numpy array of shape [n_samples]

0 投票
2 回答
9043 浏览

matlab - 如何使用matlab生成高斯随机过程?

如何使用 Matlab 生成具有零均值和单位方差的高斯随机过程?

高斯随机变量可以通过

w=(1/sqrt(2*pi))*exp(-(t.^2)/2);

但是高斯随机过程呢?

0 投票
2 回答
165 浏览

algorithm - 如何以编程方式找到可以近似另一个黑盒函数的函数?

我有两个功能

f1() 和 f2() 都是黑盒。给定 w 和 s,我可以得到 m1 和 m2。

现在,我需要设计或找到一个函数 g,这样

此外,必须最小化 m2 和 m2' 之间的差异。

w 和 s 都是随机过程。

我怎样才能找到这样的功能g()?这属于什么知识领域?

0 投票
1 回答
1456 浏览

c++ - Dynamic (i.e. variable size) Fenwick Tree?

Questions: I have stumbled upon Fenwick trees (Binary index trees) that allow to calculate cumulative sums easily. However, I have only found implementations where the number of leeves (summands) is constant (but their value can change). Is there something like a generalised Fenwick tree that allows for the number of leeves (summands) to change, i.e. to have a variable size?

Background I am currently writing some stochastic simulation code (in C++): There are balls in an urn and each ball i has a certain probability p_i to be drawn. Upon a drawing event a ball is drawn (and removed) and replaced by two new balls with new probabilities (and all probabilities are rescaled accordingly; I do this "rescaling" efficiently already, so don't bother about it). At some point I start to remove balls such that the number of balls fluctuates around a constant value (that is known before). To do the drawing efficiently I want to use a binary tree. The standard Fenwick tree does exactly what I want except that it doesn't allow for the change in number of balls in the urn.

Typical numbers Start with 10 balls, add balls and start to remove balls once there are around 1000 such that there are then between 900 and 1100 balls in the urn (i.e. balls are added and removed such that the number stays around 1000).

Workaround so far Estimate the maximal number of balls needed (with some security margin, say 1200 balls) and make the constant-size Fenwick tree that large with most of the balls initially having probability 0 to be drawn and being successively updated.

Thank you very much for your help! Matthias