2020年7月28日火曜日

R 無限ループ



library(reshape2)
library(ggplot2)
library(audio)
for(i in seq(1,36,1)){
  source("../../Dropbox/R-script/covid/tokyo_effective_repro.r")
  # source("../../Dropbox/R-script/covid/em_region.r")
  # source("../../Dropbox/R-script/covid/tokyo_age_split.r")
  source("../../Dropbox/R-script/covid/plot_effective_repro.r")
  # source("../../Dropbox/R-script/covid/tokyo_vs_others.r")
  # source("../../Dropbox/R-script/covid/em_region.r")

  print(Sys.time())
{if(sum(mdf[(length(rownames(mdf))-6):length(rownames(mdf)),i])>1){cat(colnames(mdf)[i]);cat(" ");cat(sum(mdf[(length(rownames(mdf))-6):length(rownames(mdf)),i]));t <- t+sum(mdf[(length(rownames(mdf))-6):length(rownames(mdf)),i]) ;cat("\n")}};cat(paste("total ",t,"\n",sep=''))

  wait(3600)
}

2020年7月20日月曜日

EPS 2020JUL20

> eps_year_xts["2020::"]
             [,1]
2020-01-01 116.43
2020-04-01 101.44
2020-07-01  94.97
2020-10-01  92.06
2021-01-01 113.24
2021-04-01 127.39
2021-07-01 137.85
2021-10-01 145.28


delete 2 lines in the middle of eps.txt which include 'ACTUAL' and 'price'.


~$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 116.33
eps_year_xts["2019::"][6] <- 100.29
eps_year_xts["2019::"][7] <- 94.83
eps_year_xts["2019::"][8] <- 92.54
eps_year_xts["2019::"][9] <- 112.31
eps_year_xts["2019::"][10] <- 128.51
eps_year_xts["2019::"][11] <- 138.90
eps_year_xts["2019::"][12] <- 146.96

2020年7月14日火曜日

年齢別グラフ g <- ggplot(NULL)



  • 東京の感染者数ヒストリカルデータから日次の年齢別ヒストグラムを作る
  • その上に重症化可能性指数を線グラフで重ねる。
  • g <- ggplot(NULL)を使用してベースオブジェクトを生成し、それに対しgeom_bar(),geom_line()を行ってグラフをオーバーレイ表示する。
  • 重症化可能性指数は大体最終の死亡者の10倍になるように若い人は人数に0.02
    50代は 0.04 60代は 0.15, 70代は 0.56 それ以上は1 の係数をかけて加算
  • 事前に最新のCSV をダウンロードしておくこと。
    • curl <- "https://stopcovid19.metro.tokyo.lg.jp/data/130001_tokyo_covid19_patients.csv"
    • cdestfile <- "~/R/R2/covid/tokyo.csv"
    • download.file(curl,cdestfile)


func <- function(x1,x2,x3,x4,x5,x6,x7,x8){
  return(x1*0.02+x2*0.02+x3*0.02+x4*0.02+x5*0.04+x6*0.15+x7*0.56+x8*1)
}

length_graph <- length(seq(as.Date("2020-03-20"),Sys.Date(),by='days'))
w <- read.csv("~/R/R2/covid/tokyo.csv")
y <- as.xts(as.numeric(substr(w[,9],1,2)),as.Date(w[,5]))
# apply.daily(as.xts(rep(1,length(y[y[,1] == 10])),as.Date(index(y[y[,1] == 10]))),sum)

# v <- c()
# seq(as.Date(w[1,5]),Sys.Date(),by='days')
v <- as.xts(rep(1,length( seq(as.Date(w[1,5]),Sys.Date(),by='days') )), seq(as.Date(w[1,5]),Sys.Date(),by='days'))
for(i in seq(10,80,10)){
  if(i < 80){
    v<- merge(v,  apply.daily(as.xts(rep(1,length(y[y[,1] == i])),as.Date(index(y[y[,1] == i]))),sum))
  }else{  # for the case the sample is more than 80 yrs old.
    v<- merge(v,  apply.daily(as.xts(rep(1,length(y[y[,1] >= i])),as.Date(index(y[y[,1] >= i]))),sum))
  }
}
# v<- merge(v,  apply.daily(as.xts(rep(1,length(y[y[,1] > 80 ])),as.Date(index(y[y[,1] >80]))),sum))
v <- v[,-1]
for(i in seq(1,8,1)){
  colnames(v)[i] <- as.character(i*10)
}

# replace NA with ZERO.
for( i in seq(1,length(colnames(v)),1)) {
  for(j in seq(1,length(index(v)),1)) {
      if(is.na(v[j,i])){  v[j,i] <- 0}
  }
  # print(v[,i])
}

# for( i in length(colnames(v))){
#  replace(v[,i], which(is.na(v[,i])), 0)
# }

# apply(v[,c(6,7,8)],1,sum)
w <- merge(as.xts(apply(v[,c(1,2,3,4,5)],1,sum) ,index(v)),as.vector(apply(v[,c(6,7,8)],1,sum) ))

colnames(w)[1] <- "lessthan60"
colnames(w)[2] <- "over60"

df <- data.frame(t=last(index(w),length_graph),
                 # o=last(diff(all[,1]-all[,3],t=all[,3]),length_graph),
                 o=last(w[,1],length_graph),
                 k=last(w[,2],length_graph)
                 # or=last(all[,2],length_graph)*multi,
                 # kr=last(all[,2],length_graph)*multi
               )
# df.melt <- melt(data=df, id.vars="t", measure.vars=c("lessthan60", "over60"))


df.melt <- melt(data=df, id.vars="t", measure.vars=c(colnames(w)[1],colnames(w)[2]))
# head(df.melt)
df <- df.melt
               # g <- ggplot(x, aes(x = t, y = value, fill = variable))
               # # g <- ggplot(x, aes(x = t, y = d))
               # g <- g + geom_bar(stat = "identity")
               # # g <- g + scale_fill_nejm()
g <- ggplot(df, aes(x = t, y = value, fill = variable))
g <- g + geom_bar(stat = "identity")
# plot(g)

df <- data.frame(t=last(index(v),length_graph),
                 # o=last(diff(all[,1]-all[,3],t=all[,3]),length_graph),
                 a=last(v[,1],length_graph),
                 b=last(v[,2],length_graph),
                 c=last(v[,3],length_graph),
                 d=last(v[,4],length_graph),
                 e=last(v[,5],length_graph),
                 f=last(v[,6],length_graph),
                 g=last(v[,7],length_graph),
                 h=last(v[,8],length_graph)
                 # or=last(all[,2],length_graph)*multi,
                 # kr=last(all[,2],length_graph)*multi
               )

for(i in seq(1,8,1)){
                 colnames(df)[i+1] <- as.character(i*10)
}

# df.melt <- melt(data=df, id.vars="t", measure.vars=c("X10", "X20", "X30", "X40", "X50", "X60", "X70", "X80"))
df.melt <- melt(data=df, id.vars="t", measure.vars=c("10", "20", "30", "40", "50", "60", "70", "80"))
# head(df.melt)
df <- df.melt
# in order to overlayer graph use ggplot(NULL) to create base object.
g <- ggplot(NULL)
# g <- ggplot(df, aes(x = t, y = value, fill = variable))
g <- g + scale_fill_brewer(palette="Spectral",na.value = "black",name = "age group", direction=-1,labels = c("=<19",">=20",">=30",">=40",">=50",">=60",">=70",">=80"))
g <- g + geom_bar(data=df,aes(x = t, y = value, fill = variable),stat = "identity")

# prepare the second layer.
df <- data.frame(t=last(index(v),length_graph),
              value=last(mapply(func,v[,1],v[,2],v[,3],v[,4],v[,5],v[,6],v[,7],v[,8]),length_graph)
)
df <- df[-length(df[,1]),]  # cut off the last entry.
# g <- ggplot(df, aes(x = t, y = value))
g <- g+geom_line(data=df, aes(x = t, y = value))

# plot(g)
png("~/Dropbox/R-script/covid/05tokyo_age.png", width = 1200, height = 800)
plot(g)
dev.off()


2020年6月13日土曜日

EPS 2020JUN13



eps_year_xts["2020::"]
             [,1]
2020-01-01 116.42
2020-04-01 100.84
2020-07-01  93.89
2020-10-01  90.33
2021-01-01 110.84
2021-04-01 125.10
2021-07-01 135.49
2021-10-01 142.90

~$ tac eps.txt 
3/31/2019 2834.40 $37.99 $35.02 18.52 21.09 $153.05 $134.39
6/30/2019 2941.76 $40.14 $34.93 19.04 21.75 $154.54 $135.27
9/30/2019  2976.74 $39.81 $33.99 19.46 22.40 $152.97 $132.90
12/31/2019 3230.78 $39.18 $35.53 20.56 23.16 $157.12 $139.47
3/31/2020 (97.5%) 2584.59 $19.70 $11.98 22.42 26.73 $138.83 $116.43
6/30/2020 $23.08 $19.94 25.56 30.68 $121.77 $101.44
9/30/2020 $31.04 $27.52 27.54 32.77 $113.00 $94.97
12/31/2020 $35.89 $32.62 28.37 33.81 $109.71 $92.06
3/31/2021 $37.02 $33.16 24.50 27.49 $127.03 $113.24
6/30/2021 $38.14 $34.09 21.90 24.43 $142.09 $127.39
9/30/2021 $42.05 $37.98 20.33 22.58 $153.10 $137.85
12/31/2021 $44.59 $40.05 19.24 21.42 $161.80 $145.28

~$   tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'

eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 116.43
eps_year_xts["2019::"][6] <- 101.44
eps_year_xts["2019::"][7] <- 94.97
eps_year_xts["2019::"][8] <- 92.06
eps_year_xts["2019::"][9] <- 113.24
eps_year_xts["2019::"][10] <- 127.39
eps_year_xts["2019::"][11] <- 137.85
eps_year_xts["2019::"][12] <- 145.28

Personal Income and GDP PI



Recalculate based upon the past 20 years except 2020.


summary(lm(last(yearlyReturn(PI),20)[-20] ~ last(yearlyReturn(G),20)[-20]))

Call:
lm(formula = last(yearlyReturn(PI), 20)[-20] ~ last(yearlyReturn(G), 
    20)[-20])

Residuals:
      Min        1Q    Median        3Q       Max 
-0.063473 -0.008838  0.000614  0.013313  0.045431 

Coefficients:
                               Estimate Std. Error t value Pr(>|t|)   
(Intercept)                    0.006467   0.012627   0.512  0.61514   
last(yearlyReturn(G), 20)[-20] 0.878119   0.290504   3.023  0.00767 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.02297 on 17 degrees of freedom
Multiple R-squared:  0.3496, Adjusted R-squared:  0.3113 
F-statistic: 9.137 on 1 and 17 DF,  p-value: 0.007673

  • calculate PI according to the formula above on the assumption that 2020 GDPC1 year return is -5% and CPI is 2%.
0.006467 0.878119 *G["2019-10-01"]*0.97
                GDP
2019-10-01 18508.34


  • when 2020 GDP growth is forecasted as -0.05, to calculate PI growth rate do this.


0.006467 + 0.878119 *(expected GDP growth rate)


  • then 2020 PI forecast is as below


(1 + 0.006467 + 0.878119 *-0.05)*PI["2019-10-01"]
                 PI
2019-10-01 18061.11

plot.default(last(yearlyReturn(G),20)[-20],last(yearlyReturn(PI),20)[-20])
abline(lm(last(yearlyReturn(PI),20)[-20] ~ last(yearlyReturn(G),20)[-20]))
abline(v=0)



Recalculate based upon the past 50 years except 2020.


summary(lm(last(yearlyReturn(PI),50)[-50] ~ last(yearlyReturn(G),50)[-50]))

Call:
lm(formula = last(yearlyReturn(PI), 50)[-50] ~ last(yearlyReturn(G), 
    50)[-50])

Residuals:
      Min        1Q    Median        3Q       Max 
-0.065914 -0.005273  0.000005  0.006657  0.043099 

Coefficients:
                               Estimate Std. Error t value Pr(>|t|)    
(Intercept)                    0.008346   0.005670   1.472    0.148    
last(yearlyReturn(G), 50)[-50] 0.890811   0.080517  11.064 1.11e-14 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.01723 on 47 degrees of freedom
Multiple R-squared:  0.7226, Adjusted R-squared:  0.7167 
F-statistic: 122.4 on 1 and 47 DF,  p-value: 1.11e-14

0.008346+0.890811 *G["2019-10-01"]*0.97
                GDP
2019-10-01 18775.85

0.008346+0.890811 *(expected GDP growth rate)
  • when 2020 is -0.05
0.008346+0.890811 *-0.05
[1] -0.03619455

(1+ 0.008346+0.890811 *-0.05)*PI["2019-12-01"]

      PI
2019-12-01 18222.28

2020年6月2日火曜日

.Last function 終了 終了処理



save image files with timestamp file name like "yyyy-mm-dd-hh-mm-ss-00" and .Rdata.

.Last <- function() {
  # save.image(file=paste(getwd(),Sys.time(),sep="/"))
  #
  # save working image in the parent directory. expected the length of the directory name is fixed.
  # adjust value "len" to fit the length of the result "getwd()".
  #
  op <- options(digits.secs = 2)
  start_pos <- 1
  # len <- 23
  # change to decide based upon strings length.
  last_pos <- nchar(as.character(getwd())) -2
  save.image(file=gsub("[ :.]","-",paste(substr(getwd(),start_pos,last_pos),Sys.time(),sep="/")))
   cat("time stamp file done...\n")
  save.image(file=paste(getwd(),".Rdata",sep="/"))
   cat("RData done...\n")
  #
  # OR store working image at the working directory
  #
  # save.image(file=gsub(" ","-",paste(getwd(),Sys.time(),sep="/")))
  #
  cat("bye bye...\n")
}

2020年6月1日月曜日

EPS 2020JUN01



the entries below are wrong.

> eps_year_xts["2020::"]
             [,1]
2020-01-01 102.44
2020-04-01  96.80
2020-07-01  95.16
2020-10-01 115.77
2021-01-01 130.19
2021-04-01 140.44
2021-07-01 147.68
2021-10-01 150.31

~$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 116.42
eps_year_xts["2019::"][6] <- 100.84
eps_year_xts["2019::"][7] <- 93.89
eps_year_xts["2019::"][8] <- 90.33
eps_year_xts["2019::"][9] <- 110.84
eps_year_xts["2019::"][10] <- 125.10
eps_year_xts["2019::"][11] <- 135.49
eps_year_xts["2019::"][12] <- 142.90

2020年5月29日金曜日

Global PMI manufacturing



> pmi_global <- as.xts(c(50.3,50.1,50.4, 47.1,47.3,39.8),seq(as.Date("2019-11-01"),as.Date("2020-04-01"),by='months'))
> pmi_global
           [,1]
2019-11-01 50.3
2019-12-01 50.1
2020-01-01 50.4
2020-02-01 47.1
2020-03-01 47.3
2020-04-01 39.8


> pmi_global <- append(pmi_global,as.xts(c(47.9,50.3,51.8,52.3),seq(as.Date("2020-06-01"),as.Date("2020-09-01"),by='months')))

> pmi_global
           [,1]
2019-11-01 50.3
2019-12-01 50.1
2020-01-01 50.4
2020-02-01 47.1
2020-03-01 47.3
2020-04-01 39.6
2020-05-01 42.4
2020-06-01 47.9
2020-07-01 50.3
2020-08-01 51.8
2020-09-01 52.3

2020年5月23日土曜日

Tokyo Newly Infection and R + 7 days moving average


  • データはhttps://catalog.data.metro.tokyo.lg.jp/dataset/t000010d0000000068/resource/c2d997db-1450-43fa-8037-ebb11ec28d4c から取得した「リソース」ボタンを押すこと。
  • データは公表年月日データが記録されれているだけなので、これをapply.daily()を使用して日毎に集計する必要がある。結果は日々差分データとなる。
  • nod は平滑化のための期間パラメータ(日数)である。ここでは 7 とする。
  • Kは、(十進LOG(過去nod日間の新規感染確認者数計)ー 十進LOG(さらにその前のnod日間の新規感染確認者数計))/ nod
  • L = 平均潜伏期間 = 4.76 (7 in china) 出典= https://www.fukuishimbun.co.jp/articles/-/1071227
  • 福井県内で新型コロナウイルスの感染が確認された人のうち、ほかの感染者と接触し発症するまでの潜伏期間が推定できるケースの平均値は「4.76日」だった。
  • D = 平均潜伏感染期間 = 9 あるいはL+2。2は中国での実測値。
  • R = K^2*(L*D)+K*(L+D)+1

l <- 4.76
d <- l+2
nod <- 7


w <- c()
# w <- read.csv("~/R/R2/covid/summary.csv")
# https://stopcovid19.metro.tokyo.lg.jp/data/130001_tokyo_covid19_patients.csv
curl <- "https://stopcovid19.metro.tokyo.lg.jp/data/130001_tokyo_covid19_patients.csv"
cdestfile <- "~/R/R2/covid/tokyo.csv"
download.file(curl,cdestfile)
w <- read.csv("~/R/R2/covid/tokyo.csv")

w <- apply.daily(as.xts(rep(1,length(w[,1])),as.Date(w[,5])),sum)
last(w)


len <- length(w[,1])
k <- c()
for(i in seq(2*nod+1,len,1)) {
 k <- append(k,((log10(sum(w[,1][(i-nod+1):i]))) - log10(sum(w[,1][(i-2*nod+1):(i-nod)])))/nod)
}
r <- round(k**2*(l*d) + k*(l+d) +1,2)
w <- merge(w,as.xts(r,last(index(w),length(r))))
w


colnames(w)[2] <- "effective_repro"
last(w,len-11)
# plot(last(w[,2],60))

# R と新規感染者数を混在させるためスケール調整のために係数を計算する。
multi <- (max(na.omit(last(w[,1],length_graph))) / max(na.omit(last(w[,2],length_graph))))
length_graph <- 60 # グラフは過去45日間が対象
# merge(w,)

# as.xts(as.vector(round(last((na.omit(filter(w[,1],rep(1,7))/7)),length_graph),2)),as.Date(last(index(w),length_graph)))
w <- merge(w,as.xts(as.vector(round(last((na.omit(filter(w[,1],rep(1,7))/7)),length_graph),2)),as.Date(last(index(w),length_graph))))
w[,2] <- w[,2]*multi
positive <- as.vector(last(w[,1],length_graph))
repro <- as.vector(round(last(w[,2],length_graph),2))
moving_a <- as.vector(last(w[,3],length_graph))
date <- as.Date(last(index(w),length_graph))


df <- data.frame(
                p=positive,
                r=repro,
                m=moving_a,
                # s=seq(1,45,1))
                t=date)


p <- ggplot(df,aes(x=t))

p <- p + geom_bar(aes(y=p),stat="identity", colour="limegreen",fill="limegreen")
# p <- p + scale_x_date(date_breaks = "1 month", date_labels = "%M")
p <- p + geom_path(aes(y=r),colour='red')
p <- p + geom_path(aes(y=m),colour='blue')
# p <- p + scale_x_date(date_breaks = "1 month", date_labels = "%M")


p <- p + theme(axis.title.x=element_blank(),axis.title.y=element_blank())
p <- p+annotate("text",label=as.character("1.0"),x=as.Date(df$t[length_graph]), y=5+1*multi,colour='black')
p <- p + geom_hline(yintercept = 1*multi,size=0.5,linetype=2,colour="red",alpha=1)
p <- p+annotate("text",label=as.character("2.0"),x=as.Date(df$t[length_graph]), y=5+2*multi,,colour='black')
p <- p + geom_hline(yintercept = 2*multi,size=0.5,linetype=2,colour="red",alpha=1)
png("03tokyo.png", width = 800, height = 600)
plot(p)
dev.off()



2020年5月21日木曜日

All Region Daily New Infection stack histgram curl(),matrix(), cbind(),transform(),png(),melt()




  • データは"https://raw.githubusercontent.com/kazogiwara/covid19/master/data/prefectures.csv"から取得
  • データは各県のデータが日付と県名をキーにシーケンシャルに格納されている。必要なデータだけを抽出、ソートの上使用する。 
  • nod は平滑化のための期間パラメータ(日数)である。ここでは 7 とする。
  • Kは、(十進LOG(過去nod日間の新規感染確認者数計)ー 十進LOG(さらにその前のnod日間の新規感染確認者数計))/ nod
  • L = 平均潜伏期間 = 4.76 (7 in china)
  • from https://www.fukuishimbun.co.jp/articles/-/1071227
  • 福井県内で新型コロナウイルスの感染が確認された人のうち、ほかの感染者と接触し発症するまでの潜伏期間が推定できるケースの平均値は「4.76日」だった。
  • D = 平均潜伏感染期間 = 9 あるいはL+2。2は中国での実測値。
  • R = K^2*(L*D)+K*(L+D)+1
  • library(reshape2) を事前に実行しておくこと。melt()に必要。

library(reshape2)
length_graph <- 60 # グラフは過去length_graph日間が対象
l <- 4.76
d <- l+2
nod <- 7

w <- c()
curl <- "https://raw.githubusercontent.com/kaz-ogiwara/covid19/master/data/prefectures.csv"
# curl <- "https://github.com/kaz-ogiwara/covid19/blob/master/data/summary.csv"
cdestfile <- "~/R/R2/covid/pref.csv"
download.file(curl,cdestfile)
w <- read.csv("~/R/R2/covid/pref.csv")
# w <- as.xts(w[,c(5,6)],as.Date(paste(w[,1],w[,2],w[,3],sep='-')))
# とりあえずdata.frameを作って必要なデータを抜きす。
df <- c()
df <- data.frame(t=as.Date(paste(w[,1],w[,2],w[,3],sep='-')),
                r=w[,5],
                p=w[,6])

# データフレームから県名を抜き出し、unique(w[,5])で県名一覧を作る。
# 行列を作成し、各県のデータを抜き出し、順次行列にbindしていく。
i <- 1
mtx <- matrix(diff(df$p[df$r == unique(w[,5])[i]]))
for( i in seq(2,length(unique(w[,5])),1)){
  mtx <- cbind(mtx,diff(df$p[df$r == unique(w[,5])[i]]))
}
# 行列をデータフレームに変換し、そののち日付データを先のデータフレームから抜き出し付加する。
mdf <-as.data.frame(mtx)
mdf <-transform(mdf,t=unique(df$t)[-1])
# データフレームの列名を県名一覧で変更する。
colnames(mdf)[1:length(unique(w[,5]))] <- as.character(unique(w[,5]))

df.melt <- melt(data=mdf, id.vars="t", measure.vars=as.character(unique(w[,5])))
head(df.melt)
df <- df.melt
g <- ggplot(df, aes(x = t, y = value, fill = variable))
g <- g + geom_bar(stat = "identity")


png("04em.png", width = 1400, height = 600)
plot(g)
dev.off()


2020年5月19日火曜日

EPS 2020MAY19


EPS2020MAY13 has a serious problem. where data length should be 12, it has only 11 entries.


~$ tac eps.txt 
3/31/2019 2834.40 $37.99 $35.02 18.52 21.09 $153.05 $134.39
6/30/2019 2941.76 $40.14 $34.93 19.04 21.75 $154.54 $135.27
9/30/2019  2976.74 $39.81 $33.99 19.46 22.40 $152.97 $132.90
12/31/2019 3230.78 $39.18 $35.53 20.56 23.16 $157.12 $139.47
3/31/2020 (90.3%) 2584.59 $20.00 $12.56 20.50 24.38 $139.13 $117.01
6/30/2020 $23.66 $21.18 23.26 27.62 $122.65 $103.26
9/30/2020 $31.60 $28.27 24.93 29.24 $114.44 $97.55
12/31/2020 $36.41 $33.57 25.54 29.84 $111.67 $95.59
3/31/2021 $37.29 $33.26 22.12 24.53 $128.96 $116.28
6/30/2021 $38.53 $34.73 19.83 21.97 $143.83 $129.84
9/30/2021 $42.52 $38.61 18.43 20.35 $154.75 $140.17
12/31/2021 $44.80 $40.82 17.49 19.35 $163.14 $147.42

~$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 117.01
eps_year_xts["2019::"][6] <- 103.26
eps_year_xts["2019::"][7] <- 97.55
eps_year_xts["2019::"][8] <- 95.59
eps_year_xts["2019::"][9] <- 116.28
eps_year_xts["2019::"][10] <- 129.84
eps_year_xts["2019::"][11] <- 140.17
eps_year_xts["2019::"][12] <- 147.42

2020年5月18日月曜日

Is Jigger & Pony in Singapore

Asia’s Best Bar for 2020 Is Jigger & Pony in Singapore



  1. Jigger & Pony (Singapore)
  2. The Old Man (Hong Kong)
  3. Coa (Hong Kong)
  4. Indulge Experimental Bistro (Taipei)
  5. Atlas (Singapore)
  6. Native (Singapore)
  7. The Bamboo Bar at Mandarin Oriental (Bangkok)
  8. Manhattan (Singapore)
  9. The SG Club (Tokyo)
  10. Aha Saloon (Taipei)
  11. Vesper (Bangkok)
  12. Sober Company (Shanghai)
  13. Bar Mood (Taipei)
  14. Bar Trigona (Kuala Lumpur)
  15. Ben Benfiddich (Tokyo)
  16. Quinary (Hong Kong)
  17. Tippling Club (Singapore)
  18. The Wise King (Hong Kong)
  19. Speak Low (Shanghai)
  20. High Five (Tokyo)
  21. Bee’s Knees (Kyoto)
  22. The Old Man (Singapore)
  23. D.Bespoke (Singapore)
  24. Tropic City (Bangkok)
  25. Gibson (Singapore)
  26. Draft Land (Taipei)
  27. Room by Le Kief (Taipei)
  28. 8 ½ Otto e Mezzo Bombano (Hong Kong)
  29. Charles H (Seoul)
  30. 28 HongKong Street (Singapore)
  31. Rabbit Hole (Bangkok)
  32. Nutmeg & Clove (Singapore)
  33. Backstage Cocktail Bar (Bangkok)
  34. Caprice Bar (Hong Kong)
  35. The Pontiac (Hong Kong)
  36. Hope & Sesame (Guangzhou)
  37. Junglebird (Kuala Lumpur)
  38. The Odd Couple (Shanghai)
  39. Bar Trench (Tokyo)
  40. Sidecar (New Delhi)
  41. Bar Orchard Ginza (Tokyo)
  42. The Curator (Manila)
  43. Union Brasserie, Bakery & Bar (Jakarta)
  44. Lobster Bar & Grill  (Hong Kong)
  45. The Back Room (Manila)
  46. MO Bar (Singapore)
  47. Alice (Seoul)
  48. Coley (Kuala Lumpur)
  49. Le Chamber (Seoul)
  50. Bar Cham (Seoul)



2020年5月13日水曜日

EPS 2020MAY13


> eps_year_xts["2020::"]
             [,1]
2020-01-01 125.55
2020-04-01 112.16
2020-07-01 107.75
2020-10-01 106.97
2021-01-01 119.15
2021-04-01 133.29
2021-07-01 143.24
2021-10-01 150.31

~$ cat eps.txt 
12/31/2021 $45.05 $41.12 17.84 19.84 $164.19 $147.68
9/30/2021 $42.79 $38.61 18.79 20.86 $155.89 $140.44
6/30/2021 $38.88 $34.70 20.21 22.50 $144.98 $130.19
3/31/2021 $37.47 $33.25 22.52 25.31 $130.07 $115.77
12/31/2020 $36.75 $33.89 25.92 30.79 $113.03 $95.16
9/30/2020 $31.88 $28.35 25.38 30.27 $115.46 $96.80
6/30/2020 $23.97 $20.28 23.74 28.60 $123.39 $102.44
3/31/2020 (88.1%) 2584.59 $20.43 $12.64 20.99 25.02 $139.56 $117.09
12/31/2019 3230.78 $39.18 $35.53 20.56 23.16 $157.12 $139.47
9/30/2019  2976.74 $39.81 $33.99 19.46 22.40 $152.97 $132.90
6/30/2019 2941.76 $40.14 $34.93 19.04 21.75 $154.54 $135.27

~$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 135.27
eps_year_xts["2019::"][2] <- 132.90
eps_year_xts["2019::"][3] <- 139.47
eps_year_xts["2019::"][4] <- 117.09
eps_year_xts["2019::"][5] <- 102.44
eps_year_xts["2019::"][6] <- 96.80
eps_year_xts["2019::"][7] <- 95.16
eps_year_xts["2019::"][8] <- 115.77
eps_year_xts["2019::"][9] <- 130.19
eps_year_xts["2019::"][10] <- 140.44
eps_year_xts["2019::"][11] <- 147.68

2020年5月9日土曜日

EPS 2020MAY09



> eps_year_xts["2020::"]
             [,1]
2020-01-01 129.39
2020-04-01 117.62
2020-07-01 113.96
2020-10-01 113.05
2021-01-01 121.56
2021-04-01 133.87
2021-07-01 142.67
2021-10-01 149.17

~$ tac eps.txt 
3/31/2019 2834.40 $37.99 $35.02 18.52 21.09 $153.05 $134.39
6/30/2019 2941.76 $40.14 $34.93 19.04 21.75 $154.54 $135.27
9/30/2019  2976.74 $39.81 $33.99 19.46 22.40 $152.97 $132.90
12/31/2019 3230.78 $39.18 $35.53 20.56 23.16 $157.12 $139.47
3/31/2020 (71.8%) 2584.59 $27.89 $21.10 19.25 22.55 $147.02 $125.55
6/30/2020 $24.57 $21.54 21.53 25.24 $131.45 $112.16
9/30/2020 $32.39 $29.58 22.82 26.27 $124.03 $107.75
12/31/2020 $37.09 $34.75 23.21 26.46 $121.94 $106.97
3/31/2021 $37.61 $33.28 21.50 23.76 $131.66 $119.15
6/30/2021 $39.19 $35.68 19.35 21.24 $146.28 $133.29
9/30/2021 $43.07 $39.53 18.03 19.76 $156.96 $143.24
12/31/2021 $45.25 $41.82 17.14 18.83 $165.12 $150.31
~$ tac eps.txt | awk '{gsub("\\$","",$NF);print "eps_year_xts[\"2019::\"]["NR"] <- "$NF}'
eps_year_xts["2019::"][1] <- 134.39
eps_year_xts["2019::"][2] <- 135.27
eps_year_xts["2019::"][3] <- 132.90
eps_year_xts["2019::"][4] <- 139.47
eps_year_xts["2019::"][5] <- 125.55
eps_year_xts["2019::"][6] <- 112.16
eps_year_xts["2019::"][7] <- 107.75
eps_year_xts["2019::"][8] <- 106.97
eps_year_xts["2019::"][9] <- 119.15
eps_year_xts["2019::"][10] <- 133.29
eps_year_xts["2019::"][11] <- 143.24
eps_year_xts["2019::"][12] <- 150.31