楼主: tulipsliu
8502 294

[学科前沿] [QuantEcon]MATLAB混编FORTRAN语言 [推广有奖]

81
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:18:58
The first moment of the distribution is $\mu$. The second and third
central moment are, respectively,
$$
\begin{align*}
  \mu_2 &= \sigma^2 = \mu + \phi\mu^3 \\
  \mu_3 &= \mu + 3 \phi \mu^2 \sigma^2.
\end{align*}
$$
For the limiting case $\mu = \infty$, the underlying inverse Gaussian
has an inverse chi-squared distribution. The latter has no finite
strictly positive, integer moments and, consequently, neither does the
Poisson-inverse Gaussian. See \autoref{sec:app:discrete:pig} for the
formulas in this case.

82
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:20:03
$$
\Gamma(\alpha; x) = \frac{1}{\Gamma(\alpha)}
  \int_0^x t^{\alpha - 1} e^{-t}\, dt, \quad \alpha > 0, x > 0,
$$

with

$$
\beta(a, b)
  = \int_0^1 t^{a - 1} (1 - t)^{b - 1}\, dt
  = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a + b)}.
$$

83
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:21:03
$$
G(\alpha; x) = -\frac{x^\alpha e^{-x}}{\alpha}
  + \frac{1}{\alpha} G(\alpha + 1; x).
$$
This process can be repeated until $\alpha + k$ is a positive number,
in which case the right hand side can be evaluated with
\eqref{eq:gammainc:apos}. If $\alpha = 0, -1, -2, \dots$, this
calculation requires the value of

84
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:21:20
$$
F(a, b; c; z) = \frac{\Gamma(c)}{\Gamma(a) \Gamma(b)}
  \sum_{k = 0}^\infty
  \frac{\Gamma(a + k) \Gamma(b + k)}{\Gamma(c + k)} \frac{z^k}{k!}
$$

85
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:22:04
$$
\begin{align*}
  f(x)
  &= \frac{\gamma u^\tau (1 - u)^\alpha}{%
    (x - \mu) \beta (\alpha, \tau )},
    \quad u = \frac{v}{1 + v},
    \quad v = \left(\frac{x - \mu}{\theta} \right)^\gamma,
    \quad x > \mu \\
  F(x)
  &= \beta(\tau, \alpha; u) \\ \displaybreak[0]
  \E{X^k}
  &= \sum_{j = 0}^k \binom{k}{j} \mu^{k - j} \theta^j\,
    \frac{\Gamma(\tau+j/\gamma) \Gamma(\alpha-j/\gamma)}{%
    \Gamma(\alpha) \Gamma(\tau)},
    \quad \text{integer } 0 \leq k < \alpha\gamma \\
  \E{(X \wedge x)^k}
  &= \sum_{j = 0}^k \binom{k}{j} \mu^{k - j} \theta^j\,
    \frac{B(\tau+j/\gamma, \alpha-j/\gamma; u)}{%
    \Gamma(\alpha) \Gamma(\tau)} \\
  &\phantom{=} + x^k [1 - \beta(\tau, \alpha; u)],
    \quad \text{integer } k \geq 0,
    \quad \alpha - j/\gamma \neq -1, -2, \dots
\end{align*}
$$

86
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:22:41
$$
\begin{align}
  f(x)
  &= \frac{\alpha \gamma u^\alpha (1 - u)}{(x - \mu)},
    \quad u = \frac{1}{1 + v},
    \quad v = \left(\frac{x - \mu}{\theta} \right)^\gamma,
    \quad x > \mu \\
  F(x)
  &= 1 - u^\alpha \\ \displaybreak[0]
  \E{X^k}
  &= \sum_{j = 0}^k \binom{k}{j} \mu^{k - j} \theta^j\,
    \frac{\Gamma(1+j/\gamma) \Gamma(\alpha-j/\gamma)}{%
    \Gamma(\alpha)},
    \quad \text{integer } 0 \leq k < \alpha\gamma \\
  \E{(X \wedge x)^k}
  &= \sum_{j = 0}^k \binom{k}{j} \mu^{k - j} \theta^j\,
    \frac{B(1+j/\gamma, \alpha-j/\gamma; 1-u)}{%
    \Gamma(\alpha)} \\
  &\phantom{=} + x^k u^\alpha,
    \quad \text{integer } k \geq 0
    \quad \alpha - j/\gamma \neq -1, -2, \dots
\end{align}
$$

87
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:24:59
$$
f_{\tilde{Y}^P}(y)   \begin{cases}
  &=
     0,
      & 0 \leq y \leq \alpha d \\
    \left( \mathbb{D}\frac{1}{\alpha (1 + r)} \right)
    \mathbb{D}\frac{f_X \left( \frac{y}{\alpha(1 + r)} \right)}{%
      1 - F_X \left( \frac{d}{1 + r} \right)},
      & \alpha d < y < \alpha u \\
    \mathbb{D}\frac{1 - F_X \Big( \frac{u}{1 + r} \Big)}{%
      1 - F_X \left( \frac{d}{1 + r} \right)},
      & y = \alpha u
    \end{cases}
  $$

88
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:26:27
\subsection{Form}
$$\textbf{y}_t \sim \mathcal{N}(\mu_t, \sigma^2_t), \quad t=1,\dots,T$$
$$\mu_t = \alpha + \sum^P_{p=1} \phi_p \textbf{y}_{t-p}, \quad t=1,\dots,T$$
$$\epsilon_t = \textbf{y}_t - \mu_t$$
$$\alpha \sim \mathcal{N}(0, 1000)$$
$$\phi_p \sim \mathcal{N}(0, 1000), \quad p=1,\dots,P$$
$$\sigma^2_t = \omega + \sum^Q_{q=1} \theta_q \epsilon^2_{t-q}, \quad t=2,\dots,T$$
$$\omega \sim \mathcal{HC}(25)$$
$$\theta_q \sim \mathcal{U}(0, 1), \quad q=1,\dots,Q$$
\subsection{Data}
\code{data(demonfx) \\
y <- as.vector(diff(log(as.matrix(demonfx[1:261,1])))) \\
T <- length(y) \\
L.P <- c(1,5,20) \#Autoregressive lags \\
L.Q <- c(1,2) \#Volatility lags \\
P <- length(L.P) \#Autoregressive order \\
Q <- length(L.Q) \#Volatility order \\
mon.names <- "LP" \\
parm.names <- as.parm.names(list(alpha=0, phi=rep(0,P), omega=0, \\
\hspace*{0.27 in} theta=rep(0,Q))) \\
pos.alpha <- grep("alpha", parm.names) \\
pos.phi <- grep("phi", parm.names) \\
pos.omega <- grep("omega", parm.names) \\
pos.theta <- grep("theta", parm.names) \\
PGF <- function(Data) \{ \\
\hspace*{0.27 in} alpha <- rnorm(1) \\
\hspace*{0.27 in} phi <- runif(Data$P,-1,1) \\
\hspace*{0.27 in} omega <- rhalfcauchy(1,5) \\
\hspace*{0.27 in} theta <- runif(Data$Q, 1e-10, 1-1e-5) \\
\hspace*{0.27 in} return(c(alpha, phi, omega, theta)) \\
\hspace*{0.27 in} \} \\
MyData <- list(L.P=L.P, L.Q=L.Q, PGF=PGF, P=P, Q=Q, T=T, mon.names=mon.names, \\
\hspace*{0.27 in} parm.names=parm.names, pos.alpha=pos.alpha, pos.phi=pos.phi, \\
\hspace*{0.27 in} pos.omega=pos.omega, pos.theta=pos.theta, y=y) \\
}

89
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:27:13
$$\textbf{y}_t \sim \mathcal{N}(\mu_t, \sigma^2_t), \quad t=1,\dots,T$$
$$\mu_t = \alpha + \sum^P_{p=1} \phi_p \textbf{y}_{t-p} + \delta \sigma^2_{t-1}, \quad t=1,\dots,T$$
$$\epsilon_t = \textbf{y}_t - \mu_t$$
$$\alpha \sim \mathcal{N}(0, 1000)$$
$$\phi_p \sim \mathcal{N}(0, 1000), \quad p=1,\dots,P$$
$$\delta \sim \mathcal{N}(0, 1000)$$
$$\sigma^2_t = \omega + \sum^Q_{q=1} \theta_q \epsilon^2_{t-q}, \quad t=2,\dots,T$$
$$\omega \sim \mathcal{HC}(25)$$
$$\theta_q \sim \mathcal{U}(0, 1), \quad q=1,\dots,Q$$
\subsection{Data}
$$\textbf{y}_t \sim \mathcal{N}(\mu_t, \sigma^2_t), \quad t=1,\dots,T$$
$$\mu_t = \alpha + \sum^P_{p=1} \phi_p \textbf{y}_{t-p}, \quad t=1,\dots,T$$
$$\epsilon_t = \textbf{y}_t - \mu_t$$
$$\alpha \sim \mathcal{N}(0, 1000)$$
$$\phi_p \sim \mathcal{N}(0, 1000), \quad p=1,\dots,P$$
$$\sigma^2_t = \theta_1 + \theta_2 \epsilon^2_{t-1} + \theta_3 \sigma^2_{t-1}$$
$$\omega \sim \mathcal{HC}(25)$$
$$\theta_k = \frac{1}{1 + \exp(-\theta_k)}, \quad k=1,\dots,3$$
$$\theta_k \sim \mathcal{N}(0, 1000) \in [-10,10], \quad k=1,\dots,3$$

90
tulipsliu(未真实交易用户) 在职认证  发表于 2020-12-16 19:27:49
$$\textbf{y}_t \sim \mathcal{N}(\mu_t, \sigma^2_t), \quad t=1,\dots,T$$
$$\mu_t = \alpha + \sum^P_{p=1} \phi_p \textbf{y}_{t-p} + \delta \sigma^2_{t-1}, \quad t=1,\dots,(T+1)$$
$$\epsilon_t = \textbf{y}_t - \mu_t$$
$$\alpha \sim \mathcal{N}(0, 1000)$$
$$\phi_p \sim \mathcal{N}(0, 1000), \quad p=1,\dots,P$$
$$\sigma^2_t = \omega + \theta_1 \epsilon^2_{t-1} + \theta_2 \sigma^2_{t-1}$$
$$\omega \sim \mathcal{HC}(25)$$
$$\theta_k \sim \mathcal{U}(0, 1), \quad k=1,\dots,2$$

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-23 23:55