Menu

2019年5月1日現在(確定値)*人口単位:千人、 Source 総務省
年齢階級 総人口:男女計 総人口:男 総人口:女 日本人人口:男女計 日本人人口:男 日本人人口:女
総数 126,181 61,404 64,777 123,900 60,287 63,613
0~4歳 4,795 2,457 2,339 4,719 2,418 2,302
5~9 5,128 2,626 2,502 5,063 2,592 2,471
10~14 5,368 2,748 2,620 5,313 2,720 2,593
15~19 5,876 3,015 2,861 5,756 2,954 2,802
20~24 6,379 3,292 3,087 5,980 3,072 2,908
25~29 6,193 3,185 3,007 5,855 2,994 2,861
30~34 6,826 3,480 3,347 6,578 3,351 3,227
35~39 7,598 3,850 3,748 7,392 3,756 3,636
40~44 8,863 4,491 4,372 8,697 4,420 4,276
45~49 9,713 4,910 4,804 9,558 4,848 4,710
50~54 8,478 4,262 4,217 8,347 4,210 4,137
55~59 7,636 3,814 3,823 7,538 3,773 3,764
60~64 7,552 3,727 3,826 7,482 3,697 3,785
65~69 8,965 4,339 4,626 8,911 4,314 4,597
70~74 8,464 3,987 4,477 8,424 3,968 4,456
75~79 7,149 3,198 3,950 7,120 3,186 3,934
80~84 5,329 2,195 3,134 5,311 2,188 3,124
85~89 3,580 1,259 2,321 3,571 1,256 2,315
90~94 1,742 476 1,266 1,739 475 1,264
95~99 474 85 389 473 85 388
100歳以上 72 9 63 72 9 63
15歳未満 15,292 7,831 7,461 15,095 7,730 7,365
15~64 75,114 38,024 37,090 73,183 37,076 36,107
65歳以上 35,775 15,549 20,226 35,622 15,482 20,140
うち75歳以上 18,346 7,223 11,123 18,287 7,199 11,088
うち85歳以上 5,868 1,830 4,039 5,856 1,826 4,030
15歳未満(%) 12.1 12.8 11.5 12.2 12.8 11.6
15~64(%) 59.5 61.9 57.3 59.1 61.5 56.8
65歳以上(%) 28.4 25.3 31.2 28.8 25.7 31.7
うち75歳以上(%) 14.5 11.8 17.2 14.8 11.9 17.4
うち85歳以上(%) 4.7 3 6.2 4.7 3 6.3

外国為替公示相場(Source:みずほ銀行)

日経平均(Source:日本経済新聞社)

VIX and SKEW(Source:Cboe Global Markets, Inc.)

暗号資産(Source:Coinbase,FRED)

米掘削リグ稼働数(Source:Baker Hughes, a GE Company)

ドルストレート前営業日比の平均値

ドルストレートは外国為替公示相場(Source:みずほ銀行)より算出

Economic Policy Uncertainty

Source:https://www.policyuncertainty.com

トランプ大統領の就任前後における日経平均前営業日比ボラティリティの比較

  • 休日、祝日の補間はとっていない。
  • helpより
    • 『garchOrder The ARCH (q) and GARCH (p) orders.』
    • 『external.regressors A matrix object containing the external regressors to include in the variance equation with as many rows as will be included in the data (which is passed in the fit function).』
  • 参照引用Webページ
head(nikkei)
            Date Nikkei_ChangeRate trump
14882 2009-01-20         -2.313958     0
14883 2009-01-21         -2.035139     0
14884 2009-01-22          1.899606     0
14885 2009-01-23         -3.806506     0
14886 2009-01-26         -0.814822     0
14887 2009-01-27          4.932610     0
tail(nikkei)
            Date Nikkei_ChangeRate trump
17524 2019-11-05         1.7558270     1
17525 2019-11-06         0.2229057     1
17526 2019-11-07         0.1137153     1
17527 2019-11-08         0.2638198     1
17528 2019-11-11        -0.2566276     1
17529 2019-11-12         0.8064945     1
head(nikkei[as.Date("2017-1-17") <= nikkei$Date, ])
            Date Nikkei_ChangeRate trump
16839 2017-01-17        -1.4752891     0
16840 2017-01-18         0.4296908     0
16841 2017-01-19         0.9414445     0
16842 2017-01-20         0.3442698     1
16843 2017-01-23        -1.2900050     1
16844 2017-01-24        -0.5454441     1

datavalue <- nikkei[, 2]
trump <- as.matrix(nikkei$trump)
  • Dummyなし

\[ r_t = \mu + \sqrt{h_t}\epsilon_t,\quad \epsilon_t\sim i.i.d. \textrm{N} (0,1),\quad h_t=\omega+\beta_{1}h_{t-1} + \alpha_{1} r^2_{t-1}\\r_tはt時点の日経平均前営業日比 \]

summary(tseries::garch(x = datavalue, order = c(1, 1)))

 ***** ESTIMATION WITH ANALYTICAL GRADIENT ***** 

     I     INITIAL X(I)        D(I)

     1     1.636820e+00     1.000e+00
     2     5.000000e-02     1.000e+00
     3     5.000000e-02     1.000e+00

    IT   NF      F         RELDF    PRELDF    RELDX   STPPAR   D*STEP   NPRELDF
     0    1  2.066e+03
     1    3  2.047e+03  9.04e-03  2.32e-02  3.0e-02  4.8e+03  1.0e-01  5.54e+01
     2    5  2.046e+03  5.51e-04  5.92e-04  2.4e-03  3.5e+02  1.0e-02  3.81e+00
     3    7  2.045e+03  8.81e-04  8.85e-04  5.1e-03  2.0e+00  2.0e-02  1.15e+00
     4    9  2.042e+03  1.21e-03  1.23e-03  1.2e-02  2.1e+00  4.0e-02  1.15e+00
     5   11  2.028e+03  7.12e-03  8.13e-03  9.3e-02  3.7e+00  3.2e-01  1.23e+00
     6   14  1.955e+03  3.56e-02  4.17e-02  8.4e-01  1.9e+00  1.3e+00  3.04e+00
     7   18  1.934e+03  1.09e-02  2.63e-02  2.7e-02  1.0e+01  4.7e-02  1.43e-01
     8   19  1.927e+03  3.86e-03  5.35e-03  2.8e-02  2.0e+00  4.7e-02  3.06e-01
     9   20  1.917e+03  4.87e-03  1.01e-02  6.5e-02  1.7e+00  9.5e-02  4.73e-02
    10   22  1.886e+03  1.62e-02  2.16e-02  1.6e-01  1.0e+00  3.7e-01  5.49e-02
    11   26  1.886e+03  1.64e-04  3.42e-04  7.9e-04  1.1e+01  2.0e-03  5.21e-03
    12   27  1.886e+03  5.04e-05  5.28e-05  1.1e-03  2.0e+00  2.0e-03  3.16e-03
    13   28  1.885e+03  1.48e-04  1.61e-04  1.6e-03  1.9e+00  3.9e-03  2.86e-03
    14   29  1.885e+03  2.03e-04  2.49e-04  3.7e-03  1.7e+00  7.9e-03  1.41e-03
    15   30  1.885e+03  1.09e-04  4.16e-04  7.8e-03  8.5e-01  1.6e-02  6.98e-04
    16   31  1.884e+03  2.86e-04  3.93e-04  6.4e-03  9.2e-01  1.6e-02  7.39e-04
    17   32  1.884e+03  4.33e-05  3.79e-05  2.4e-03  0.0e+00  4.8e-03  3.79e-05
    18   33  1.884e+03  1.69e-06  2.13e-06  6.9e-04  0.0e+00  1.4e-03  2.13e-06
    19   42  1.884e+03  8.83e-14  3.40e-11  4.0e-08  8.8e+01  7.8e-08  1.54e-08
    20   49  1.884e+03  2.78e-15  2.56e-13  3.1e-10  1.5e+04  5.9e-10  1.57e-08
    21   57  1.884e+03 -3.74e-15  1.35e-17  1.6e-14  2.8e+08  3.1e-14  1.57e-08

 ***** FALSE CONVERGENCE *****

 FUNCTION     1.884234e+03   RELDX        1.615e-14
 FUNC. EVALS      57         GRAD. EVALS      21
 PRELDF       1.350e-17      NPRELDF      1.572e-08

     I      FINAL X(I)        D(I)          G(I)

     1    6.872101e-02     1.000e+00    -7.185e-01
     2    1.286346e-01     1.000e+00    -2.466e-01
     3    8.371551e-01     1.000e+00    -3.143e-01


Call:
tseries::garch(x = datavalue, order = c(1, 1))

Model:
GARCH(1,1)

Residuals:
     Min       1Q   Median       3Q      Max 
-5.24308 -0.51920  0.06073  0.63840  4.16471 

Coefficient(s):
    Estimate  Std. Error  t value             Pr(>|t|)    
a0   0.06872     0.01067    6.442       0.000000000118 ***
a1   0.12863     0.01009   12.743 < 0.0000000000000002 ***
b1   0.83716     0.01301   64.352 < 0.0000000000000002 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Diagnostic Tests:
    Jarque Bera Test

data:  Residuals
X-squared = 353.9, df = 2, p-value < 0.00000000000000022


    Box-Ljung test

data:  Squared.Residuals
X-squared = 2.7556, df = 1, p-value = 0.09691
garchresult <- fGarch::garchFit(formula = ~garch(1, 1), data = datavalue, trace = F)
summary(garchresult)

Title:
 GARCH Modelling 

Call:
 fGarch::garchFit(formula = ~garch(1, 1), data = datavalue, trace = F) 

Mean and Variance Equation:
 data ~ garch(1, 1)
<environment: 0x000000006c236c58>
 [data = datavalue]

Conditional Distribution:
 norm 

Coefficient(s):
      mu     omega    alpha1     beta1  
0.078498  0.069501  0.133201  0.832811  

Std. Errors:
 based on Hessian 

Error Analysis:
        Estimate  Std. Error  t value             Pr(>|t|)    
mu       0.07850     0.02155    3.643              0.00027 ***
omega    0.06950     0.01503    4.625           0.00000375 ***
alpha1   0.13320     0.01595    8.351 < 0.0000000000000002 ***
beta1    0.83281     0.01963   42.423 < 0.0000000000000002 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log Likelihood:
 -4312.76    normalized:  -1.628686 

Description:
 Wed Nov 13 07:40:34 2019 by user: 20141203 


Standardised Residuals Tests:
                                Statistic p-Value  
 Jarque-Bera Test   R    Chi^2  341.0583  0        
 Shapiro-Wilk Test  R    W      0.9839492 0        
 Ljung-Box Test     R    Q(10)  3.64339   0.9620039
 Ljung-Box Test     R    Q(15)  7.985499  0.9243627
 Ljung-Box Test     R    Q(20)  14.51157  0.8036408
 Ljung-Box Test     R^2  Q(10)  8.368049  0.5929342
 Ljung-Box Test     R^2  Q(15)  12.94569  0.606493 
 Ljung-Box Test     R^2  Q(20)  17.76081  0.6031616
 LM Arch Test       R    TR^2   12.36123  0.4171221

Information Criterion Statistics:
     AIC      BIC      SIC     HQIC 
3.260393 3.269278 3.260389 3.263609 
garchresult@fit$par
        mu      omega     alpha1      beta1 
0.07849765 0.06950126 0.13320075 0.83281054 
  • Dummyあり

\[ r_t = \mu + \sqrt{h_t}\epsilon_t,\quad \epsilon_t\sim i.i.d. \textrm{N} (0,1),\quad h_t=\omega+\beta_{1}h_{t-1} + \alpha_{1} r^2_{t-1} + \delta_{\textrm{dummy}}\\r_tはt時点の日経平均前営業日比 \]

garch_sim <- function(data, v_model, garchorder, armaorder, external_regressors) {
    garch_model <- ugarchspec(variance.model = list(model = v_model, garchOrder = garchorder, external.regressors = external_regressors), mean.model = list(armaOrder = armaorder, include.mean = T))
    garch_result <- ugarchfit(spec = garch_model, data = data)
    return(garch_result)
}
garch_sim(data = datavalue, v_model = "sGARCH", garchorder = c(1, 1), armaorder = c(0, 0), external_regressors = trump)

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics   
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model  : ARFIMA(0,0,0)
Distribution    : norm 

Optimal Parameters
------------------------------------
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.078488    0.021553   3.6417 0.000271
omega   0.069521    0.015331   4.5347 0.000006
alpha1  0.133084    0.017693   7.5219 0.000000
beta1   0.832837    0.020711  40.2130 0.000000
vxreg1  0.000000    0.012813   0.0000 1.000000

Robust Standard Errors:
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.078488    0.023092   3.3989 0.000677
omega   0.069521    0.024581   2.8282 0.004681
alpha1  0.133084    0.033785   3.9392 0.000082
beta1   0.832837    0.041886  19.8833 0.000000
vxreg1  0.000000    0.019077   0.0000 1.000000

LogLikelihood : -4312.772 

Information Criteria
------------------------------------
                   
Akaike       3.2612
Bayes        3.2723
Shibata      3.2611
Hannan-Quinn 3.2652

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                        statistic p-value
Lag[1]                     0.1127  0.7371
Lag[2*(p+q)+(p+q)-1][2]    0.5395  0.6754
Lag[4*(p+q)+(p+q)-1][5]    1.1054  0.8354
d.o.f=0
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic p-value
Lag[1]                      1.617  0.2035
Lag[2*(p+q)+(p+q)-1][5]     3.558  0.3146
Lag[4*(p+q)+(p+q)-1][9]     5.176  0.4040
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]    0.2444 0.500 2.000  0.6211
ARCH Lag[5]    2.1507 1.440 1.667  0.4389
ARCH Lag[7]    2.9846 2.315 1.543  0.5165

Nyblom stability test
------------------------------------
Joint Statistic:  2.1993
Individual Statistics:              
mu     0.02339
omega  0.40085
alpha1 0.27628
beta1  0.37110
vxreg1 0.54536

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:         1.28 1.47 1.88
Individual Statistic:    0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value     prob sig
Sign Bias           0.5895 0.555549    
Negative Sign Bias  1.7555 0.079293   *
Positive Sign Bias  2.6095 0.009120 ***
Joint Effect       15.4704 0.001456 ***


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic   p-value(g-1)
1    20     75.76 0.000000009885
2    30     96.86 0.000000003087
3    40    106.74 0.000000032521
4    50    123.15 0.000000025795


Elapsed time : 0.460026 
garch_sim(data = datavalue, v_model = "eGARCH", garchorder = c(1, 1), armaorder = c(0, 0), external_regressors = trump)

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics   
-----------------------------------
GARCH Model : eGARCH(1,1)
Mean Model  : ARFIMA(0,0,0)
Distribution    : norm 

Optimal Parameters
------------------------------------
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.040200    0.019692   2.0414 0.041211
omega   0.049256    0.008955   5.5004 0.000000
alpha1 -0.131221    0.014791  -8.8716 0.000000
beta1   0.925783    0.011539  80.2331 0.000000
gamma1  0.209337    0.021671   9.6600 0.000000
vxreg1 -0.052351    0.013267  -3.9460 0.000079

Robust Standard Errors:
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.040200    0.020399   1.9706 0.048765
omega   0.049256    0.014000   3.5183 0.000434
alpha1 -0.131221    0.032234  -4.0708 0.000047
beta1   0.925783    0.019363  47.8120 0.000000
gamma1  0.209337    0.028870   7.2511 0.000000
vxreg1 -0.052351    0.018966  -2.7602 0.005777

LogLikelihood : -4257.736 

Information Criteria
------------------------------------
                   
Akaike       3.2203
Bayes        3.2337
Shibata      3.2203
Hannan-Quinn 3.2252

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                        statistic p-value
Lag[1]                     0.1271  0.7215
Lag[2*(p+q)+(p+q)-1][2]    0.5817  0.6565
Lag[4*(p+q)+(p+q)-1][5]    0.9724  0.8659
d.o.f=0
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic p-value
Lag[1]                   0.005185  0.9426
Lag[2*(p+q)+(p+q)-1][5]  0.566473  0.9470
Lag[4*(p+q)+(p+q)-1][9]  1.511598  0.9546
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]  0.002496 0.500 2.000  0.9602
ARCH Lag[5]  1.132248 1.440 1.667  0.6941
ARCH Lag[7]  1.308261 2.315 1.543  0.8589

Nyblom stability test
------------------------------------
Joint Statistic:  0.9164
Individual Statistics:              
mu     0.09824
omega  0.07408
alpha1 0.23984
beta1  0.12196
gamma1 0.30847
vxreg1 0.02154

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:         1.49 1.68 2.12
Individual Statistic:    0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value   prob sig
Sign Bias           0.5893 0.5557    
Negative Sign Bias  0.1619 0.8714    
Positive Sign Bias  1.5516 0.1209    
Joint Effect        2.6109 0.4556    


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic p-value(g-1)
1    20     56.92  0.000011739
2    30     73.50  0.000009909
3    40     77.92  0.000212237
4    50     99.32  0.000028463


Elapsed time : 0.69504 

Gold,Silver,Platinum,Palladium(Source:OANDA)

Analysis

Weekly update

Science and Engineering Cafe on the Net