跳转到内容

This page is also in English.

Read it in English

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

affine_sde_moments 函数

从 x0 出发的 dX = (a + b X) dt + sigma dW 在时刻 t 的均值和方差。

怎么写

affine_sde_moments(a, b, sigma, x0, time)

给出 {mean: ..., variance: ...},b = 0 的情形单独处理;有一条说明注明它何时成立。

a
漂移的常数部分。接受一个表达式。
b
速率:漂移为 a + b X。接受一个表达式。
sigma
噪声强度。接受一个表达式。
x0
起始值,不随时间变化。接受一个表达式。
time
时间,一个变量。接受一个变量或变量列表。

affine_sde_moments(a, b, sigma, x0, time)

对最多六个状态同理;结果包含均值和协方差。

a
各状态漂移的常数部分,放在方括号中。接受一个列表。
b
漂移矩阵,每个状态一行。接受一个矩阵,写作行组成的列表。
sigma
噪声:每个状态一行,每个驱动一列。接受一个矩阵,写作行组成的列表。
x0
各状态的起始值。接受一个列表。
time
时间,一个变量。接受一个变量或变量列表。

示例

  • (E[Xt],Var⁡(Xt)) 其中 dXt=(a+bXt) dt+σ dWt, X0=x0⇒E[Xt]={x0ebt+a(ebt−1)b当 b≠0 时x0+at其他Var⁡(Xt)={σ2(e2bt−1)2b当 b≠0 时σ2t其他\displaystyle (E[X_{t}], \operatorname{Var}(X_{t})) \text{ 其中 } \mathrm{d}X_{t} = (a+b X_{t})\,\mathrm{d}t+\sigma\,\mathrm{d}W_{t},\ X_{0} = x_{0} \Rightarrow \begin{aligned} E[X_{t}] &= \begin{cases} x_{0} e^{b t}+\frac{a (e^{b t}-1)}{b} & \text{当 } b \neq 0 \text{ 时} \\ x_{0}+a t & \text{其他} \end{cases} \\ \operatorname{Var}(X_{t}) &= \begin{cases} \frac{\sigma^{2} (e^{2 b t}-1)}{2 b} & \text{当 } b \neq 0 \text{ 时} \\ \sigma^{2} t & \text{其他} \end{cases} \end{aligned}
    affine_sde_moments(a, b, sigma, x0, t)

    在求解器中,affine_sde_moments(a, b, sigma, x0, t) 的结果是 {mean: piecewise(x0*e^(b*t) + a*(e^(b*t) - 1)/b if b != 0, x0 + a*t otherwise), variance: piecewise((1/2)sigma^2*(e^(2b*t) - 1)/b if b != 0, sigma^2*t otherwise)}。

    在求解器中打开
  • (E[Xt],Var⁡(Xt)) 其中 dXt=(1+2Xt) dt+3 dWt, X0=0⇒E[Xt]=e2t−12Var⁡(Xt)=9(e4t−1)4\displaystyle (E[X_{t}], \operatorname{Var}(X_{t})) \text{ 其中 } \mathrm{d}X_{t} = (1+2 X_{t})\,\mathrm{d}t+3\,\mathrm{d}W_{t},\ X_{0} = 0 \Rightarrow \begin{aligned} E[X_{t}] &= \frac{e^{2 t}-1}{2} \\ \operatorname{Var}(X_{t}) &= \frac{9 (e^{4 t}-1)}{4} \end{aligned}
    affine_sde_moments(1, 2, 3, 0, t)

    在求解器中,affine_sde_moments(1, 2, 3, 0, t) 的结果是 {mean: (e^(2t) - 1)/2, variance: 9(e^(4t) - 1)/4}。

    在求解器中打开
  • affine_sde_moments⁡([0,0],(−120−3),(1001),[x0,y0],t)=[mean→[x0et+y0(e−t−1e3t),y0e3t],covariance→(−1e2t+12e4t−16e6t+23−14e4t+16e6t+112−14e4t+16e6t+11216−16e6t)]\displaystyle \operatorname{affine\_sde\_moments}\left(\left[ 0, 0 \right], \begin{pmatrix} -1 & 2 \\ 0 & -3 \end{pmatrix}, \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \left[ x_{0}, y_{0} \right], t\right) = \left[ \text{mean} \to \left[ \frac{x_{0}}{e^{t}}+y_{0} \left(e^{-t}-\frac{1}{e^{3 t}}\right), \frac{y_{0}}{e^{3 t}} \right], \text{covariance} \to \begin{pmatrix} -\frac{1}{e^{2 t}}+\frac{1}{2 e^{4 t}}-\frac{1}{6 e^{6 t}}+\frac{2}{3} & -\frac{1}{4 e^{4 t}}+\frac{1}{6 e^{6 t}}+\frac{1}{12} \\ -\frac{1}{4 e^{4 t}}+\frac{1}{6 e^{6 t}}+\frac{1}{12} & \frac{1}{6}-\frac{1}{6 e^{6 t}} \end{pmatrix} \right]
    affine_sde_moments([0, 0], [[-1, 2], [0, -3]], [[1, 0], [0, 1]], [x0, y0], t)

    在求解器中,affine_sde_moments([0, 0], [[-1, 2], [0, -3]], [[1, 0], [0, 1]], [x0, y0], t) 的结果是 {mean: [x0*e^-t + y0*(e^-t - e^(-3t)), y0*e^(-3t)], covariance: [[-e^(-2t) + e^(-4t)/2 - e^(-6t)/6 + 2/3, -e^(-4t)/4 + e^(-6t)/6 + 1/12], [-e^(-4t)/4 + e^(-6t)/6 + 1/12, 1/6 - e^(-6t)/6]]}。

    在求解器中打开
  • geometric_sde_path

    dX = mu X dt + sigma X dW 的路径,表示为维纳过程在时刻 t 的取值 w 的函数。

  • binomial_distribution

    n 次独立试验中成功的次数,每次试验成功的概率为 p。

  • wiener_process

    带漂移 mu 和噪声 sigma、从 0 开始的布朗运动。

  • cdf

    服从某个分布的变量取值至多为某个值的概率。

  • weibull_distribution

    一个单元存活到时间 x 的概率为 e^(-(x/scale)^shape) 时的寿命。

  • correlation

    两个等长列表的相关系数。