楼主: tulipsliu
2211 43

[学科前沿] 金融学前沿研究R代码实现 [推广有奖]

31
tulipsliu 在职认证  发表于 2020-12-9 14:39:08
$$
\star\beta
$$

32
tulipsliu 在职认证  发表于 2020-12-9 14:39:33
$$
\beta^\star
$$

33
tulipsliu 在职认证  发表于 2020-12-9 14:41:34
$$
\beta\top\sigma^\star
$$

34
tulipsliu 在职认证  发表于 2020-12-9 14:42:06
$$
\beta^\top\sigma^\star
$$

35
tulipsliu 在职认证  发表于 2020-12-14 22:04:37
Click the Refresh button to see progress of the chains
starting worker pid=5360 on localhost:11587 at 22:04:15.786
starting worker pid=1032 on localhost:11587 at 22:04:15.964
starting worker pid=16968 on localhost:11587 at 22:04:16.142
starting worker pid=16676 on localhost:11587 at 22:04:16.325
starting worker pid=17588 on localhost:11587 at 22:04:16.499
starting worker pid=12300 on localhost:11587 at 22:04:16.676

SAMPLING FOR MODEL 'macro.reg' NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.001 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 10 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
Chain 1: Iteration:    1 / 1200 [  0%]  (Warmup)

SAMPLING FOR MODEL 'macro.reg' NOW (CHAIN 3).
Chain 3:
Chain 3: Gradient evaluation took 0.001 seconds
Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 10 seconds.
Chain 3: Adjust your expectations accordingly!
Chain 3:
Chain 3:
Chain 3: Iteration:    1 / 1200 [  0%]  (Warmup)

SAMPLING FOR MODEL 'macro.reg' NOW (CHAIN 4).
Chain 4:
Chain 4: Gradient evaluation took 0.001 seconds
Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 10 seconds.
Chain 4: Adjust your expectations accordingly!
Chain 4:
Chain 4:
Chain 4: Iteration:    1 / 1200 [  0%]  (Warmup)

SAMPLING FOR MODEL 'macro.reg' NOW (CHAIN 5).
Chain 5:
Chain 5: Gradient evaluation took 0 seconds
Chain 5: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
Chain 5: Adjust your expectations accordingly!
Chain 5:
Chain 5:
Chain 5: Iteration:    1 / 1200 [  0%]  (Warmup)

SAMPLING FOR MODEL 'macro.reg' NOW (CHAIN 6).
Chain 6:

36
tulipsliu 在职认证  发表于 2020-12-14 22:07:28
a_Regs_Times_Real_Equip_Investment_per_Firm",
+                                     "mean_beta_Regs_Times_Real_IP_Investment_per_Firm","hetero_beta_Regs_Times_Real_IP_Investment_per_Firm",
+                                     "mean_beta_Regs_Times_Real_Structs_Investment_per_Firm","hetero_beta_Regs_Times_Real_Structs_Investment_per_Firm",
+                                     "mean_beta_Regs_Times_Real_Fixed_Investment_per_Firm","hetero_beta_Regs_Times_Real_Fixed_Investment_per_Firm",
+                                     "mean_beta_Regs_Times_Real_Interest_Rate_Times_Real_GDP_per_Firm","hetero_beta_Regs_Times_Real_Interest_Rate_Times_Real_GDP_per_Firm",
+                                     "mean_beta_Lagged_Regs","hetero_beta_Lagged_Regs",
+                                     "mean_beta_Lagged_Regs_Times_Dynamic_Variable","hetero_beta_Lagged_Regs_Times_Dynamic_Variable",
+                                     "mean_beta_Lagged_Regs_Times_Real_Equip_Investment_per_Firm","hetero_beta_Lagged_Regs_Times_Real_Equip_Investment_per_Firm",
+                                     "mean_beta_Lagged_Regs_Times_Real_IP_Investment_per_Firm","hetero_beta_Lagged_Regs_Times_Real_IP_Investment_per_Firm",
+                                     "mean_beta_Lagged_Regs_Times_Real_Structs_Investment_per_Firm","hetero_beta_Lagged_Regs_Times_Real_Structs_Investment_per_Firm",
+                                     "mean_beta_Lagged_Regs_Times_Real_Fixed_Investment_per_Firm","hetero_beta_Lagged_Regs_Times_Real_Fixed_Investment_per_Firm",
+                                     "mean_beta_Lagged_Regs_Times_Real_Interest_Rate_Times_Real_GDP_per_Firm","hetero_beta_Lagged_Regs_Times_Real_Interest_Rate_Times_Real_GDP_per_Firm")
>
> # specify the number of Posterior Draws required
> Draws.Required <- 1000
>
>
> ##########################################################################################
> # Regress Real.Equip.Investment.per.Firm on Real.Interest.Rate and Real.GDP.per.Firm
> ##########################################################################################
>
> # Specify which investment variable is the outcome variable
> Investment.Data[["Real_Investment_per_Firm"]] <- Real_Equip_Investment_per_Firm
>
> # run model
> Equip.Investment.Results <- Estimate.Model.Investment.Equation(Investment.Data,Industry.Data.Without.NA,
+                                                                Investment.Variable.Name="Real.Equip.Investment.per.Firm",
+                                                                Draws.Required,Base.Year+1,Terminal.Year-1)
DIAGNOSTIC(S) FROM PARSER:
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.
Info: assignment operator <- deprecated in the Stan language; use = instead.

When you compile models, you are also contributing to development of the NEXT
Stan compiler. In this version of rstan, we compile your model as usual, but
also test our new compiler on your syntactically correct model. In this case,
the new compiler did not work like we hoped. By filing an issue at
https://github.com/stan-dev/stanc3/issues with your model
or a minimal example that shows this warning you will be contributing
valuable information to Stan and ensuring your models continue working. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages()
or by first calling rstan_options(javascript = FALSE).
Error in context_eval(join(src), private$context, serialize) :
  0,248,Failure,-3,

37
tulipsliu 在职认证  发表于 2020-12-27 18:02:31
Let $log$ denote the logarithm to the base 2, then informational gain is measured in bits.
Shannon entropy [@S48] states that for a discrete random variable $J$ with probability distribution $p(j)$, where $j$ stands for the different outcomes the random variable $J$ can take, the average number of bits required to optimally encode independent draws from the distribution of $J$ can be calculated as
  
$$
  H_J = - \sum_j p(j) \cdot log \left(p(j)\right).
$$

38
tulipsliu 在职认证  发表于 2020-12-27 18:02:49
Strictly speaking, Shannon's formula  is a measure for uncertainty, which increases with the number of bits needed to optimally encode a sequence of realizations of $J$.
In order to measure the information flow between two processes, Shannon entropy is combined with the concept of the Kullback-Leibler distance [@KL51] and by assuming that the underlying processes evolve over time according to a Markov process [@schreiber2000].
Let $I$ and $J$ denote two discrete random variables with marginal probability distributions $p(i)$ and $p(j)$ and joint probability distribution $p(i,j)$, whose dynamical structures correspond to stationary Markov processes of order $k$ (process $I$) and $l$ (process $J$).
The Markov property implies that the probability to observe $I$ at time $t+1$ in state $i$ conditional on the $k$ previous observations is $p(i_{t+1}|i_t,...,i_{t-k+1})=p(i_{t+1}|i_t,...,i_{t-k})$.
The average number of bits needed to encode the observation in $t+1$ if the previous $k$ values are known is given by
  
$$
  h_I(k)=- \sum_i p\left(i_{t+1}, i_t^{(k)}\right) \cdot log \left(p\left(i_{t+1}|i_t^{(k)}\right)\right),
$$

39
tulipsliu 在职认证  发表于 2021-1-27 21:40:31
$$
\begin{array}{l}
{x_{1,t}} = {x_{1,t - 1}} + \sigma_1{u_{1,t}}\\
{x_{2,t}} = \phi {x_{2,t - 1}} + \sigma_2{u_{2,t}}\\
{y_t} = {x_{1,t}} + {x_{2,t}}
\end{array}
$$

40
tulipsliu 在职认证  发表于 2021-1-27 21:40:57
$$
\begin{array}{l}
{\phi_{z,t}} = {\phi_{z,t - 1}}\\
{x_{2,z,t}} = {x_{2,z,t - 1}} \phi_{z,t}  + 0.8{u_{2,t}}\\
\end{array}
$$

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-30 09:23