(2008/12/18-)
[0]前提, Precondition
Excelによる手作業で、業界内株価のべき乗傾向を探っていた作業を
Rにより自動化に近づける。
基本的に、Excelを使用しないで、処理を行う。
In the hand work by Excel, work to search for the Power Law tendency
to stock prices in the industry is brought close to the automation by R.
Basically, it processes it without using Excel.
~~~
[1]処理の流れ, Flow of processing
1)日単位の株価をネットから入手する。
Stock prices each every day are obtained from the net.
2)対象とする業界の銘柄のみを抜き出す。
:今回、終値を使用する。
Only the brand of the industry that targets it is pulled out.
:This time, the closing share price is used.
3)銘柄の時価総額を計算するために、発行済み株式総数を用意する。
To calculate the aggregate market value of the brand, the all issued stocks are prepared.
4)終値の時価総額を計算し、時価総額の大きい順番に並べ替える。
:後から順位の推移をチェックするために、ファイル出力する。
The aggregate market value of the closing share price is calculated, and
aggregate market value permutes it in large the order.
:To check the transition of the order later, the file output is done.
5)線形近似で、R^2の最大となる順位を求める。
The order that becomes the maximum of R^2 is requested by a linear approximation.
6)求めた順位での線形近似式から、べき乗傾向のA,B値を求める。
A and B value of the Power Law tendency are requested from the linear
approximation type in the requested order.
7)対象期間の日ごとに、上記の処理を繰り返す。
The above-mentioned processing is repeated day in and day out in the period covered.
~~~
[2]詳細処理内容, Content of detailed processing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-1]日単位の株価をネットから入手する。
Stock prices each every day are obtained from the net.
:以下のサイトから入手する。
It obtains it from the following sites.
STOCK:(6)Data in NET
http://humanbeing-etcman.blogspot.com/2008/12/stock6data-in-net.html
[株価データ倉庫]
http://www.geocities.co.jp/WallStreet-Stock/9256/data.html
日足株価データ
2008年株価データ
http://www.geocities.co.jp/WallStreet-Stock/9256/data2008.htm
:2008/12/12のデータは、ファイル:y081212.txt になる。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-2]対象とする業界の銘柄のみを抜き出す。
:今回、終値を使用する。
Only the brand of the industry that targets it is pulled out.
:This time, the closing share price is used.
:[2-1]のファイルから、grepを使用して抜き出す。
Grep is used and pulled out from the file of 2-1.
STOCK:(6)Data in NET
http://humanbeing-etcman.blogspot.com/2008/12/stock6data-in-net.html
[食品の場合, For Foods]
grep-foods-69.bat stock-price-file-targeted-date
Ex) grep-foods-69 y081212.txt
:ファイル:output-foods-y081212.txt.txt を出力する。
[電機の場合, For Electric Appliances]
grep-denki-161.bat stock-price-file-targeted-date
Ex) grep-denki-161 y081212.txt
:ファイル:output-denki-y081212.txt.txt を出力する。
---
[ファイル変換, File translation]
1)見出しを挿入する。Finding is inserted.
code,name,hajimene,takane,yasune,owarine,dekidaka
===
番外メモ)
銘柄コード,名称,始値,高値,安値,終値,出来高
===
2)区切り文字をタグからカンマに切り替える。
The delimiter is switched from tag to the comma.
[前, before]
2001 日本製粉 469 473 450 461 690
[後, after]
2001,日本製粉,469,473,450,461,690
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-3]銘柄の時価総額を計算するために、発行済み株式総数を用意する。
To calculate the aggregate market value of the brand, the all issued stocks are prepared.
---
:以下のデータを使用する。
The following data is used.
Power Law:(34)STOCK,Aggregate market value,時価総額
http://humanbeing-etcman.blogspot.com/2008/12/power-law34stockaggregate-market-value.html
:データを以下のファイルに保存するものとする。
Preserve data in the following files.
[発行済み株式数:食品の場合, Issued shares for Foods]
file:Issued_shares_for_foods-20081217.txt
===
code,name,issued_shares,unit
2001,日本製粉,174148,1000
2002,日清製粉,251535,500
2003,日東製粉,46924,1000
...
===
[発行済み株式数:電機の場合, Issued shares for Electric Appliances]
file:Issued_shares_for_denki-20081217.txt
===
code,name,issued_shares,unit
4062,イビデン,150852,100
...
===
---
「R,Tips]
発行済み株式総数をファイルから読み込み、テーブルで保持。テーブル内検索する。
例)食品、銘柄=2002の発行済み株式総数を得る。
> Issued_Shares = read.csv("Issued_shares_for_foods-20081217.txt")
> Issued_Shares$issued_shares[Issued_Shares$code == 2002]
[1] 251535
>
---
ネットから最新の発行済み株式総数をまとめて得る手段をチェック要!TODO)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-4]終値の時価総額を計算し、時価総額の大きい順番に並べ替える。
:後から順位の推移をチェックするために、ファイル出力する。
The aggregate market value of the closing share price is calculated, and
aggregate market value permutes it in large the order.
:To check the transition of the order later, the file output is done.
---
[2-4-1]時価総額の計算, Calculation of aggregate market value
Issued_Shares = read.csv("Issued_shares_for_foods-20081217.txt")
Stock = read.csv("output-foods-y081212.txt.txt")
jika = c()
for(i in 1:length(Stock$code)){
jika[i] = Stock$owarine[i] * as.numeric(Issued_Shares$issued_shares[Issued_Shares$code == Stock$code[i]])
}
jika
> jika
[1] 80282228 271154730 13467188 53472400 19787360 22241320
[7] 10503596 15895064 6181422 95420000 5183200 37394464
[13] 50150118 51209361 157298280 30060286 146308600 40063260
[19] 23130863 282843372 4468464 11007600 153616434 101773670
[25] 87622065 308194320 38371203 274590890 66302145 6326100
[31] 35517504 32670540 22942548 199743297 747623956 1065237656
[37] 106237600 14297748 24465087 27720000 45683268 20560880
[43] 215806692 58860000 39351375 114927120 34909056 7679542
[49] 3524100 81642669 108760698 56126570 205754574 659431086
[55] 184692420 175854094 148728181 14056000 44587431 122475294
[61] 293280245 419356560 32803389 39191040 15617404 3110000000
[67] 25953186 11012188 10306875
>
---
[2-4-2]時価総額の降順ソート, Descending order sorting of aggregate market value
:ソート前の配列位置を記憶。The position where it arranges before it sorts it is memorized.
:降順がないので、昇順にして反転した。
Because there was no descending order, it made in ascending order and it reversed.
jika_new = rev(sort(jika))
jika_old = rev(order(jika))
> jika_new
[1] 3110000000 1065237656 747623956 659431086 419356560 308194320
[7] 293280245 282843372 274590890 271154730 215806692 205754574
[13] 199743297 184692420 175854094 157298280 153616434 148728181
[19] 146308600 122475294 114927120 108760698 106237600 101773670
[25] 95420000 87622065 81642669 80282228 66302145 58860000
[31] 56126570 53472400 51209361 50150118 45683268 44587431
[37] 40063260 39351375 39191040 38371203 37394464 35517504
[43] 34909056 32803389 32670540 30060286 27720000 25953186
[49] 24465087 23130863 22942548 22241320 20560880 19787360
[55] 15895064 15617404 14297748 14056000 13467188 11012188
[61] 11007600 10503596 10306875 7679542 6326100 6181422
[67] 5183200 4468464 3524100
> jika_old
[1] 66 36 35 54 62 26 61 20 28 2 43 53 34 55 56 15 23 57 17 60 46 51 37
[24] 24 10 25 50 1 29 44 52 4 14 13 41 59 18 45 64 27 12 31 47 63 32 16
[47] 40 67 39 19 33 6 42 5 8 65 38 58 3 68 22 7 69 48 30 9 11 21 49
>
---
[2-4-3]以下のデータセットを作成。The following data sets are made.
:code,date,name,order,jika
:銘柄コード,日付,名称,時価総額の降順,時価総額
:"Brand code","date","name","Descending order of aggregate market value","Aggregate market value"
code_new = c()
name_new = c()
order_new = c()
# 銘柄の順位推移をチェックするために、日付を埋め込む。
# To check the order transition of the brand, the date is buried.
yyyymmdd = "20081212"
for(i in 1:length(jika_new)){
code_new[i] = Stock$code[jika_old[i]]
name_new[i] = as.character(Stock$name[jika_old[i]])
order_new[i] = i
}
Stock_new = data.frame(code=code_new, date=yyyymmdd, name=name_new, order=order_new, jika=jika_new)
Stock_new
> Stock_new
code date name order jika
1 2914 20081212 JT 1 3110000000
2 2503 20081212 キリン 2 1065237656
3 2502 20081212 アサヒ 3 747623956
4 2802 20081212 味の素 4 659431086
5 2897 20081212 日清食品 5 419356560
6 2267 20081212 ヤクルト 6 308194320
7 2875 20081212 東洋水産 7 293280245
8 2212 20081212 山崎製パン 8 282843372
9 2282 20081212 日本ハム 9 274590890
10 2002 20081212 日清製粉 10 271154730
11 2579 20081212 北九州コカ 11 215806692
12 2801 20081212 キッコマン 12 205754574
13 2501 20081212 サッポロ 13 199743297
14 2809 20081212 キユーピー 14 184692420
15 2810 20081212 ハウス食品 15 175854094
16 2202 20081212 明治製菓 16 157298280
17 2261 20081212 明治乳業 17 153616434
18 2811 20081212 カゴメ 18 148728181
19 2206 20081212 江崎グリコ 19 146308600
20 2871 20081212 ニチレイ 20 122475294
21 2593 20081212 伊藤園 21 114927120
22 2607 20081212 不二製油 22 108760698
23 2531 20081212 宝ホールディ 23 106237600
24 2262 20081212 雪印乳業 24 101773670
25 2059 20081212 ユニチャーム 25 95420000
26 2264 20081212 森永乳業 26 87622065
27 2602 20081212 日清オイリオ 27 81642669
28 2001 20081212 日本製粉 28 80282228
29 2284 20081212 伊藤ハム 29 66302145
30 2580 20081212 コカコーラセ 30 58860000
31 2613 20081212 J-オイルミ 31 56126570
32 2004 20081212 昭和産業 32 53472400
33 2201 20081212 森永製菓 33 51209361
34 2109 20081212 三井製糖 34 50150118
35 2572 20081212 三国コカ 35 45683268
36 2815 20081212 アリアケ 36 44587431
37 2207 20081212 名糖産業 37 40063260
38 2590 20081212 ダイドードリ 38 39351375
39 2908 20081212 フジッコ 39 39191040
40 2281 20081212 プリマハム 40 38371203
41 2108 20081212 日本甜菜糖 41 37394464
42 2288 20081212 丸大食品 42 35517504
43 2594 20081212 キーコーヒ 43 34909056
44 2899 20081212 永谷園 44 32803389
45 2290 20081212 米久 45 32670540
46 2204 20081212 中村屋 46 30060286
47 2540 20081212 養命酒製造 47 27720000
48 2918 20081212 わらべや日洋 48 25953186
49 2536 20081212 メルシャン 49 24465087
50 2211 20081212 不二家 50 23130863
51 2292 20081212 SFOODS 51 22942548
52 2051 20081212 日本農産工 52 22241320
53 2578 20081212 四国コカ 53 20560880
54 2009 20081212 鳥越製粉 54 19787360
55 2053 20081212 中部飼料 55 15895064
56 2910 20081212 ロックフィ 56 15617404
57 2533 20081212 オエノンホー 57 14297748
58 2812 20081212 焼津水産化学 58 14056000
59 2003 20081212 日東製粉 59 13467188
60 2922 20081212 なとり 60 11012188
61 2217 20081212 モロゾフ 61 11007600
62 2052 20081212 協同飼料 62 10503596
63 4404 20081212 ミヨシ油脂 63 10306875
64 2597 20081212 ユニカフェ 64 7679542
65 2286 20081212 林兼産業 65 6326100
66 2056 20081212 日配合飼料 66 6181422
67 2107 20081212 東洋精糖 67 5183200
68 2215 20081212 第一パン 68 4468464
69 2599 20081212 ジャパンフー 69 3524100
>
---
[2-4-4]ファイル出力, File output
:データセット:Stock_new をcsvファイルに出力する。
The data set: Stock_new is output to the csv file.
write.table(Stock_new, "stock_output.txt", quote=F, col.names=T, append=F, sep=",", row.names=FALSE)
file:stock_output.txt
===
code,date,name,order,jika
2914,20081212,JT,1,3.11e+09
2503,20081212,キリン,2,1065237656
2502,20081212,アサヒ,3,747623956
2802,20081212,味の素,4,659431086
2897,20081212,日清食品,5,419356560
2267,20081212,ヤクルト,6,308194320
...
===
---
[2-4-5][2-4]のスクリプトを整理する。The script of 2-4 is arranged.
# files
FILE_PATH_BASE = "C:/PowerLaw38"
FILE_Issued_Shares = paste(FILE_PATH_BASE, "Issued_shares_for_foods-20081217.txt", sep = "/")
FILE_Stock = paste(FILE_PATH_BASE, "output-foods-y081212.txt.txt", sep = "/")
FILE_Output = paste(FILE_PATH_BASE, "output-foods-jika-20081212.txt", sep = "/")
yyyymmdd = "20081212"
# Calculation of aggregate market value
Issued_Shares = read.csv(FILE_Issued_Shares)
Stock = read.csv(FILE_Stock)
jika = c()
for(i in 1:length(Stock$code)){
jika[i] = Stock$owarine[i] * as.numeric(Issued_Shares$issued_shares[Issued_Shares$code == Stock$code[i]])
}
# Descending order sorting of aggregate market value
jika_new = rev(sort(jika))
jika_old = rev(order(jika))
# data sets:Stock_new are made.
code_new = c()
name_new = c()
order_new = c()
for(i in 1:length(jika_new)){
code_new[i] = Stock$code[jika_old[i]]
name_new[i] = as.character(Stock$name[jika_old[i]])
order_new[i] = i
}
Stock_new = data.frame(code=code_new, date=yyyymmdd, name=name_new, order=order_new, jika=jika_new)
# File output
write.table(Stock_new, FILE_Output, quote=F, col.names=T, append=F, sep=",", row.names=FALSE)
---
[R,Tips]
1)型変換:as.numeric
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/25.html
2)sort
http://www.is.titech.ac.jp/~shimo/class/doc/r-tips.pdf
p.34)
rev() 要素を逆順
sort() 昇順整列
3)ファイル出力
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/45.html
> x <- read.csv("input.txt")
> x
name num date
1 aa1 100 20081225
2 aa2 200 20081226
> write.table(x, "output.txt", quote=F, col.names=F, append=T)
>
output.txt
===
1 aa1 100 20081225
2 aa2 200 20081226
===
> write.table(x, "output.txt", quote=F, col.names=T, append=F, sep=",")
output.txt
===
name,num,date
1,aa1,100,20081225
2,aa2,200,20081226
===
http://pbil.univ-lyon1.fr/library/base/html/write.table.html
> write.table(x, "output.txt", quote=F, col.names=T, append=F, sep=",", row.names=FALSE)
output.txt
===
name,num,date
aa1,100,20081225
aa2,200,20081226
===
4)文字列連結
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/17.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-5]線形近似で、R^2の最大となる順位を求める。
The order that becomes the maximum of R^2 is requested by a linear approximation.
:以下を参照。Refer to the following.
Power Law:(36)R,Linear approximation,線形近似(2)
http://humanbeing-etcman.blogspot.com/2008/12/power-law36rlinear-approximation2.html
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
for (i in 3:length(Stock_new$order)){
stock_log_order = log(Stock_new$order[1:i])
stock_log_jika = log(Stock_new$jika[1:i])
stock_loglog = data.frame(LN_order=stock_log_order, LN_jika=stock_log_jika)
result = summary(result <- lm(LN_jika ~ LN_order, data = stock_loglog))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
---
:R^2の最大値の取得は、以下を参照。
:Refer to the acquisition of the maximum value of R^2 as follows.
Power Law:(37)R,Linear approximation,線形近似(3)
http://humanbeing-etcman.blogspot.com/2008/12/power-law37rlinear-approximation3.html
base_order = 2
start_order = 3
end_order = length(kinji_ALL$KINJI_R2)
max_order = which.max(kinji_ALL$KINJI_R2[start_order:end_order]) + base_order
max_r2 = kinji_ALL$KINJI_R2[max_order]
max_order
max_r2
> max_order
[1] 28
> max_r2
[1] 0.984492
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-6]求めた順位での線形近似式から、べき乗傾向のA,B値を求める。
A and B value of the Power Law tendency are requested from the linear
approximation type in the requested order.
getAB = function(cnt){
ret_a = c()
ret_b = c()
x0 = 1
y0 = exp(kinji_ALL$KINJI_B[cnt])
x1 = cnt
y1 = exp(kinji_ALL$KINJI_A[cnt] * log(cnt) + kinji_ALL$KINJI_B[cnt])
B = y0 / y1
A = -log10(B) / log10(x1)
ret_a[1] = A
ret_b[1] = B
ret_val = data.frame(A=ret_a, B=ret_b)
return(ret_val)
}
> getAB(28)
A B
1 -0.9994923 27.95267
>
---
:検算してみる。Answer is checked.
> kinji_ALL
KINJI_A KINJI_B KINJI_R2
28 -0.9994923 21.60502 0.9844921
LN(y) = -0.9994923*LN(x) + 21.60502, R^2=0.9844921
LN
(x, y)=(1, exp(21.60502))(28, exp(-0.9994923*LN(28) + 21.60502))
=(1, 2415132529)(28, 86400779)
Relative value)
=(1, 2415132529/86400779)(28, 1)
=(1, 27.952670762378195687332865366874)(28, 1)
:OK! Aは1に近かった、、、:A was near one.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2-7]対象期間の日ごとに、上記の処理を繰り返す。
The above-mentioned processing is repeated day in and day out in the period covered.
---
[2-7-0]前提, Precondition
1)各ファイルは、ベースディレクトリから以下にあるものとする。
Each file assumed to be in the following from the base directory.
発行済み株式総数(input), All issued stocks
:is/Issued_shares_for_foods-20081217.txt
日別株価データ(input), Stock prices data according to day
:stock/stock-yyyymmdd.txt
日別時価総額データ(output), Aggregate market value data according to day
:jika/jika-yyyymmdd.txt
2)処理する日は、ベースディレクトリにある以下のファイルから読み込む。
The processed day is read from the following files that exist in the base directory.
yyyymmdd.txt
===
date,week
20081211,Thu
20081212,Fri
20081215,Mon
...
===
---
###########
# getAB()
###########
getAB = function(cnt, kinji_a, kinji_b){
x0 = 1
y0 = exp(kinji_b)
x1 = cnt
y1 = exp(kinji_a * log(cnt) + kinji_b)
B = y0 / y1
A = -log10(B) / log10(x1)
ret_val = data.frame(A=A, B=B)
return(ret_val)
}
###########
# getR2Max()
###########
getR2Max = function(Stock_Jika){
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
for (i in 3:length(Stock_Jika$order)){
stock_log_order = log(Stock_Jika$order[1:i])
stock_log_jika = log(Stock_Jika$jika[1:i])
stock_loglog = data.frame(LN_order=stock_log_order, LN_jika=stock_log_jika)
result = summary(result <- lm(LN_jika ~ LN_order, data = stock_loglog))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
###
base_order = 2
start_order = 3
end_order = length(kinji_ALL$KINJI_R2)
max_order = which.max(kinji_ALL$KINJI_R2[start_order:end_order]) + base_order
max_r2 = kinji_ALL$KINJI_R2[max_order]
###
ret_val = data.frame(order=max_order,
kinji_a=kinji_ALL$KINJI_A[max_order], kinji_b=kinji_ALL$KINJI_B[max_order], kinji_r2=max_r2 )
return(ret_val)
}
###########
# outputTable2CSVFile()
###########
outputTable2CSVFile = function(tablename, filename){
write.table(tablename, filename, quote=F, col.names=T, append=F, sep=",", row.names=FALSE)
}
###########
# getStock_Jika()
###########
getStock_Jika = function(Issued_Shares, Stock){
jika = c()
for(i in 1:length(Stock$code)){
jika[i] = Stock$owarine[i] * as.numeric(Issued_Shares$issued_shares[Issued_Shares$code == Stock$code[i]])
}
# Descending order sorting of aggregate market value
jika_new = rev(sort(jika))
jika_old = rev(order(jika))
# data sets:Stock_new are made.
code_new = c()
name_new = c()
order_new = c()
for(i in 1:length(jika_new)){
code_new[i] = Stock$code[jika_old[i]]
name_new[i] = as.character(Stock$name[jika_old[i]])
order_new[i] = i
}
Stock_new = data.frame(code=code_new, date=yyyymmdd, name=name_new, order=order_new, jika=jika_new)
return(Stock_new)
}
###########
# main()
###########
# files
FILE_PATH_BASE = "C:/PowerLaw38/"
FILE_Issued_Shares = paste(FILE_PATH_BASE, "is/", "Issued_shares_for_foods-20081217.txt", sep="")
FILE_YYYYMMDD = paste(FILE_PATH_BASE, "yyyymmdd.txt", sep="")
FILE_PowerLaw = paste(FILE_PATH_BASE, "powerlaw.txt", sep="")
###
powerlaw_a = c()
powerlaw_b = c()
powerlaw_date = c()
powerlaw_week = c()
powerlaw_order = c()
powerlaw_r2 = c()
###
YYYYMMDD = read.csv(FILE_YYYYMMDD)
for(i in 1:length(YYYYMMDD$date)){
yyyymmdd = YYYYMMDD$date[i]
FILE_Stock = paste(FILE_PATH_BASE, "stock/stock-", yyyymmdd, ".txt", sep = "")
FILE_Jika = paste(FILE_PATH_BASE, "jika/jika-", yyyymmdd, ".txt", sep = "")
Issued_Shares = read.csv(FILE_Issued_Shares)
Stock = read.csv(FILE_Stock)
Stock_Jika = getStock_Jika(Issued_Shares, Stock)
outputTable2CSVFile(Stock_Jika, FILE_Jika)
ret_getR2Max = getR2Max(Stock_Jika)
ret_getAB =getAB(ret_getR2Max$order[1], ret_getR2Max$kinji_a[1], ret_getR2Max$kinji_b[1])
###
powerlaw_a[i] = ret_getAB$A[1]
powerlaw_b[i] = ret_getAB$B[1]
powerlaw_date[i] = YYYYMMDD$date[i]
powerlaw_week[i] = as.character(YYYYMMDD$week[i])
powerlaw_order[i] = ret_getR2Max$order[1]
powerlaw_r2[i] = ret_getR2Max$kinji_r2[1]
}
PowerLaw = data.frame(a=powerlaw_a, b=powerlaw_b, date=powerlaw_date, week=powerlaw_week, order=powerlaw_order, r2=powerlaw_r2)
###
outputTable2CSVFile(PowerLaw, FILE_PowerLaw)
---
:出力ファイルの例は以下。The example of the output file is the following.
powerlaw.txt
===
a,b,date,week,order,r2
-0.999492282169319,27.9526690988954,20081212,Fri,28,0.98449209376968
===
~~~
end
2008年12月27日土曜日
2008年12月22日月曜日
Power Law:(37)R,Linear approximation,線形近似(3)
[0]前提, Precondition
Power Law:(36)の続き。Continuation of Power Law:(36).
http://humanbeing-etcman.blogspot.com/2008/12/power-law36rlinear-approximation2.html
R^2により、べき乗傾向の範囲の方針を決定したい。
I want to decide the policy within the range of the Power Law tendency by R^2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/21,06:45-)
[1]単純に、R^2の最大値を求める。Simply, the maximum value of R^2 is requested.
:Power Law:(36)のデータ:kinji_ALL を使う。The data of Power Law:(36): Kinji_ALL is used.
---
[1-1]先頭2件がNA値なので、3番から、最後(この場合、69)までを対象にする。
Because two heads are the NA values, everything from the 3rd to the end (69 in this case) is targeted.
===
参考)
http://www.is.titech.ac.jp/~shimo/class/doc/r-tips.pdf
:pdf内をキーワードで検索する。
:参考ページ)p.34, p.54, p.95, p.143
===
> max(kinji_ALL$KINJI_R2[3:69])
[1] 0.984492
>
---
[1-2]最大値は、配列の何番目か?Where of the array is the maximum value?
===
参考)
http://www.okada.jp.org/RWiki/?%B9%D4%CE%F3Tips%C2%E7%C1%B4#content_1_58
===
> which.max(kinji_ALL$KINJI_R2[3:69])
[1] 26
>
:先頭のNA値2件をスキップしているので、実際の順番は+2となる。
:The actual order becomes +2 because it skips the first two NA values.
> which.max(kinji_ALL$KINJI_R2[3:69]) + 2
[1] 28
>
---
[1-3]最大値を求める最終形は以下。The final type from which the maximum value is requested is the following.
> max_order = which.max(kinji_ALL$KINJI_R2[3:69]) + 2
> max_r2 = kinji_ALL$KINJI_R2[max_order]
> max_order
[1] 28
> max_r2
[1] 0.984492
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,14:44-)
[2]28位は、本:「業界地図」との絡みはあるか? Does 28th place have twining with the book "Industry map"?
「会社四季報」業界地図〈2009年版〉 東洋経済新報社 東経= (単行本 - 2008/8)
:20081212、東証一部の食品、終値の時価総額に関する順位
[2-1]上位3社, Top 3
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
---
[2-2]上位7位:約全体(69銘柄)の1割?、R^2の1つ目の山。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
---
[2-3]上位14位:とりあえず、7位の2倍ということで、、、:あまり意味はない。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
---
[2-4]上位28位:R^2の2つ目の山。R^2の最大値。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
2810,20081212,ハウス食品,1586,110879,175854094,15,2.708050201,18.9851652
2202,20081212,明治製菓,408,385535,157298280,16,2.772588722,18.87365443
2261,20081212,明治乳業,466,329649,153616434,17,2.833213344,18.84996937
2811,20081212,カゴメ,1493,99617,148728181,18,2.890371758,18.81763091
2206,20081212,江崎グリコ,1010,144860,146308600,19,2.944438979,18.80122865
2871,20081212,ニチレイ,394,310851,122475294,20,2.995732274,18.62341989
2593,20081212,伊藤園,1260,91212,114927120,21,3.044522438,18.55980875
2607,20081212,不二製油,1242,87569,108760698,22,3.091042453,18.5046606
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2262,20081212,雪印乳業,335,303802,101773670,24,3.17805383,18.43826198
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
2264,20081212,森永乳業,345,253977,87622065,26,3.258096538,18.28854341
2602,20081212,日清オイリオ,471,173339,81642669,27,3.295836866,18.21786259
2001,20081212,日本製粉,461,174148,80282228,28,3.33220451,18.20105883
:売上高か?
:本に載っていない企業もあります、、、:?以下。
===
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
===
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[3]R^2最大値までの近似線を引いてみる。The approximation line to R^2 maximum value is drawn.
[3-1]全体を散布図でプロットする。
foods = read.csv("20081212-foods.txt");
plot(LN_jika ~ LN_order, data = foods)
---
[3-2]TOPから28位までの近似線をひく。
# TOPから28位までのデータセットを作成。
foods_LN_order_28 = foods$LN_order[1:28]
foods_LN_jika_28 = foods$LN_jika[1:28]
foods_28 = data.frame(LN_order=foods_LN_order_28, LN_jika=foods_LN_jika_28)
# データセットを単回帰分析。
# 線形近似を求める。
result = lm(LN_jika ~ LN_order, data = foods_28)
# 近似線をひく。
abline(result)
# 28位に垂直線をひく。
abline(v = log(28), col="red")

---
[3-3]3位、7位の近似線も重ねてみる。
foods_LN_order_07 = foods$LN_order[1:7]
foods_LN_jika_07 = foods$LN_jika[1:7]
foods_07 = data.frame(LN_order=foods_LN_order_07, LN_jika=foods_LN_jika_07)
result_07 = lm(LN_jika ~ LN_order, data = foods_07)
abline(result_07)
abline(v = log(7), col="red")

foods_LN_order_03 = foods$LN_order[1:3]
foods_LN_jika_03 = foods$LN_jika[1:3]
foods_03 = data.frame(LN_order=foods_LN_order_03, LN_jika=foods_LN_jika_03)
result_03 = lm(LN_jika ~ LN_order, data = foods_03)
abline(result_03)
abline(v = log(3), col="red")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[4]試行)28位以降は、R^2の傾向はどうなっているか?
The trial) How does the tendency to R^2 become it since 28th place?
---
[4-1]29位からラストまでで、R^2の状態を見る。
foods = read.csv("20081212-foods.txt");
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
base_order = 29
###
search_order = base_order + 3
for (i in search_order:length(foods$LN_order)){
foods_LN_order_XX = foods$LN_order[base_order:i]
foods_LN_jika_XX = foods$LN_jika[base_order:i]
foods_XX = data.frame(LN_order=foods_LN_order_XX, LN_jika=foods_LN_jika_XX)
result = summary(result <- lm(LN_jika ~ LN_order, data = foods_XX))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
#
plot(kinji_ALL$KINJI_R2)

---
> kinji_ALL
KINJI_A KINJI_B KINJI_R2
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
7 NA NA NA
8 NA NA NA
9 NA NA NA
10 NA NA NA
11 NA NA NA
12 NA NA NA
13 NA NA NA
14 NA NA NA
15 NA NA NA
16 NA NA NA
17 NA NA NA
18 NA NA NA
19 NA NA NA
20 NA NA NA
21 NA NA NA
22 NA NA NA
23 NA NA NA
24 NA NA NA
25 NA NA NA
26 NA NA NA
27 NA NA NA
28 NA NA NA
29 NA NA NA
30 NA NA NA
31 NA NA NA
32 -2.117902 25.12154 0.9469793
33 -1.903733 24.39334 0.9530634
34 -1.681958 23.63695 0.9415084
35 -1.747786 23.86214 0.9618844
36 -1.711026 23.73602 0.9714386
37 -1.820286 24.11197 0.9727569
38 -1.824618 24.12692 0.9795561
39 -1.763410 23.91513 0.9791543
40 -1.697247 23.68557 0.9766580
41 -1.638252 23.48034 0.9745409
42 -1.611233 23.38610 0.9770650
43 -1.575727 23.26195 0.9775093
44 -1.570542 23.24377 0.9807556
45 -1.545937 23.15731 0.9815584
46 -1.557878 23.19937 0.9839262
47 -1.592808 23.32271 0.9834323
48 -1.635288 23.47307 0.9814780
49 -1.679389 23.62952 0.9793602
50 -1.722936 23.78435 0.9775434
51 -1.746983 23.87004 0.9788431
52 -1.765034 23.93450 0.9803990
53 -1.794668 24.04056 0.9803327
54 -1.820187 24.13209 0.9807158
55 -1.895708 24.40352 0.9680491
56 -1.953377 24.61122 0.9634660
57 -2.015220 24.83441 0.9584019
58 -2.062529 25.00548 0.9574780
59 -2.104095 25.15609 0.9576190
60 -2.175617 25.41573 0.9503957
61 -2.229160 25.61049 0.9488734
62 -2.277106 25.78521 0.9485560
63 -2.315086 25.92388 0.9497910
64 -2.393985 26.21248 0.9413408
65 -2.489239 26.56153 0.9290079
66 -2.569910 26.85768 0.9234153
67 -2.661975 27.19626 0.9155266
68 -2.759161 27.55431 0.9075625
69 -2.873103 27.97481 0.8960784
>
---
[4-2]29位からラストまでで、R^2の最大値を得る。
> max_order = which.max(kinji_ALL$KINJI_R2[32:69]) + 31
> max_r2 = kinji_ALL$KINJI_R2[max_order]
> max_order
[1] 46
> max_r2
[1] 0.9839262
>
---
[5]29位以降のデータに対して、46位の近似線を引く。
# 29位からラストまで、プロット。
foods = read.csv("20081212-foods.txt");
foods_LN_order_29toLast = foods$LN_order[29:length(foods$LN_order)]
foods_LN_jika_29toLast = foods$LN_jika[29:length(foods$LN_order)]
foods_29toLast = data.frame(LN_order=foods_LN_order_29toLast, LN_jika=foods_LN_jika_29toLast)
plot(LN_jika ~ LN_order, data = foods_29toLast)
# データセットを単回帰分析
result = lm(LN_jika ~ LN_order, data = foods_29toLast)
# 近似曲線をグラフに追加。
abline(result)
:この線は意味なし???

---
29位から46位の近似曲線では?
:17銘柄
start_order = 29
end_order = 46
foods_LN_order_start2end = foods$LN_order[start_order:end_order]
foods_LN_jika_start2end = foods$LN_jika[start_order:end_order]
foods_start2end = data.frame(LN_order=foods_LN_order_start2end, LN_jika=foods_LN_jika_start2end)
result = lm(LN_jika ~ LN_order, data = foods_start2end)
abline(result)
abline(v = log(end_order), col="red")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[5]出来高と順位の関係をチェックする。
The relation between the trading volume and the order is checked.
:出来高は何位までの集中しているか?
On how much order has the trading volume concentrated?
---
2008/12/12の出来高データ(dekidaka)は以下。:東証一部の食品。
===
code,name,owarine,stock_num,jika,order,dekidaka
2914,JT,311000,10000,3110000000,1,40.079
2503,キリン,1082,984508,1065237656,2,7134
2502,アサヒ,1546,483586,747623956,3,4101.6
2802,味の素,942,700033,659431086,4,7837
2897,日清食品,3290,127464,419356560,5,366.9
2267,ヤクルト,1752,175910,308194320,6,724.4
2875,東洋水産,2645,110881,293280245,7,1120
2212,山崎製パン,1284,220283,282843372,8,781
2282,日本ハム,1202,228445,274590890,9,3780
2002,日清製粉,1078,251535,271154730,10,3312.5
2579,北九州コカ,1942,111126,215806692,11,647.8
2801,キッコマン,978,210383,205754574,12,3356
2501,サッポロ,507,393971,199743297,13,3154
2809,キユーピー,1188,155465,184692420,14,585.9
2810,ハウス食品,1586,110879,175854094,15,390.4
2202,明治製菓,408,385535,157298280,16,3738
2261,明治乳業,466,329649,153616434,17,3183
2811,カゴメ,1493,99617,148728181,18,267.4
2206,江崎グリコ,1010,144860,146308600,19,202
2871,ニチレイ,394,310851,122475294,20,3574
2593,伊藤園,1260,91212,114927120,21,363.7
2607,不二製油,1242,87569,108760698,22,343.5
2531,宝ホールディ,488,217700,106237600,23,3097
2262,雪印乳業,335,303802,101773670,24,2405.5
2059,ユニチャーム,3250,29360,95420000,25,70.3
2264,森永乳業,345,253977,87622065,26,865
2602,日清オイリオ,471,173339,81642669,27,2389
2001,日本製粉,461,174148,80282228,28,690
2284,伊藤ハム,315,210483,66302145,29,863
2580,コカコーラセ,654000,90,58860000,30,0.142
2613,J-オイルミ,335,167542,56126570,31,1042
2004,昭和産業,296,180650,53472400,32,257
2201,森永製菓,189,270949,51209361,33,535
2109,三井製糖,354,141667,50150118,34,346
2572,三国コカ,853,53556,45683268,35,103.3
2815,アリアケ,1359,32809,44587431,36,102.8
2207,名糖産業,1884,21265,40063260,37,13.2
2590,ダイドードリ,2375,16569,39351375,38,49.3
2908,フジッコ,1120,34992,39191040,39,100
2281,プリマハム,171,224393,38371203,40,2761
2108,日本甜菜糖,244,153256,37394464,41,445
2288,丸大食品,268,132528,35517504,42,362
2594,キーコーヒ,1554,22464,34909056,43,30.8
2899,永谷園,857,38277,32803389,44,29
2290,米久,1134,28810,32670540,45,85
2204,中村屋,503,59762,30060286,46,107
2540,養命酒製造,840,33000,27720000,47,27
2918,わらべや日洋,1561,16626,25953186,48,51.4
2536,メルシャン,183,133689,24465087,49,220
2211,不二家,119,194377,23130863,50,259
2292,SFOODS,711,32268,22942548,51,19.5
2051,日本農産工,172,129310,22241320,52,143
2578,四国コカ,860,23908,20560880,53,25.8
2009,鳥越製粉,760,26036,19787360,54,38.4
2053,中部飼料,599,26536,15895064,55,65
2910,ロックフィ,1166,13394,15617404,56,23.9
2533,オエノンホー,218,65586,14297748,57,630
2812,焼津水産化学,1000,14056,14056000,58,19.6
2003,日東製粉,287,46924,13467188,59,24
2922,なとり,709,15532,11012188,60,21.4
2217,モロゾフ,300,36692,11007600,61,59
2052,協同飼料,101,103996,10503596,62,177
4404,ミヨシ油脂,125,82455,10306875,63,158
2597,ユニカフェ,1118,6869,7679542,64,10.5
2286,林兼産業,71,89100,6326100,65,316
2056,日配合飼料,86,71877,6181422,66,472
2107,東洋精糖,95,54560,5183200,67,417
2215,第一パン,93,48048,4468464,68,59
2599,ジャパンフー,691,5100,3524100,69,8.5
===
出来高全体:68996.521 単位:千株数
---
3位 :16% =(11275.679/68996.521)*100=16.34238776
7位 :30% =(21323.979/68996.521)*100=30.90587567
28位 :84% =(58519.979/68996.521)*100=84.81584021
46位 :95% =(65751.521/68996.521)*100=95.29686432
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[6]一時的なまとめ
トップからの順位でR^2の最大値は、今回のデータで28位。
トップから28位までの出来高が84%を占めることから、単純なR^2の最大値で近似しても、
マーケットの動きをカバーできるのではないか、、、
29位から46位までの銘柄は、1位から28位の動きに引きずられるようなものか???
---
当面のターゲットは、トップからのR^2で最大値までの範囲をべき乗傾向の範囲とする。
:これは、Excelでの手作業と結果的には同じになった。
~~~
番外)
筆記試験の準備のため。exit。遅い?
:(3日前)本屋の採用試験コーナーに行く。驚く!SPI...WEB:採用試験もインターネットの時代か、、、
~~~
end
Power Law:(36)の続き。Continuation of Power Law:(36).
http://humanbeing-etcman.blogspot.com/2008/12/power-law36rlinear-approximation2.html
R^2により、べき乗傾向の範囲の方針を決定したい。
I want to decide the policy within the range of the Power Law tendency by R^2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/21,06:45-)
[1]単純に、R^2の最大値を求める。Simply, the maximum value of R^2 is requested.
:Power Law:(36)のデータ:kinji_ALL を使う。The data of Power Law:(36): Kinji_ALL is used.
---
[1-1]先頭2件がNA値なので、3番から、最後(この場合、69)までを対象にする。
Because two heads are the NA values, everything from the 3rd to the end (69 in this case) is targeted.
===
参考)
http://www.is.titech.ac.jp/~shimo/class/doc/r-tips.pdf
:pdf内をキーワードで検索する。
:参考ページ)p.34, p.54, p.95, p.143
===
> max(kinji_ALL$KINJI_R2[3:69])
[1] 0.984492
>
---
[1-2]最大値は、配列の何番目か?Where of the array is the maximum value?
===
参考)
http://www.okada.jp.org/RWiki/?%B9%D4%CE%F3Tips%C2%E7%C1%B4#content_1_58
===
> which.max(kinji_ALL$KINJI_R2[3:69])
[1] 26
>
:先頭のNA値2件をスキップしているので、実際の順番は+2となる。
:The actual order becomes +2 because it skips the first two NA values.
> which.max(kinji_ALL$KINJI_R2[3:69]) + 2
[1] 28
>
---
[1-3]最大値を求める最終形は以下。The final type from which the maximum value is requested is the following.
> max_order = which.max(kinji_ALL$KINJI_R2[3:69]) + 2
> max_r2 = kinji_ALL$KINJI_R2[max_order]
> max_order
[1] 28
> max_r2
[1] 0.984492
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,14:44-)
[2]28位は、本:「業界地図」との絡みはあるか? Does 28th place have twining with the book "Industry map"?
「会社四季報」業界地図〈2009年版〉 東洋経済新報社 東経= (単行本 - 2008/8)
:20081212、東証一部の食品、終値の時価総額に関する順位
[2-1]上位3社, Top 3
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
---
[2-2]上位7位:約全体(69銘柄)の1割?、R^2の1つ目の山。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
---
[2-3]上位14位:とりあえず、7位の2倍ということで、、、:あまり意味はない。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
---
[2-4]上位28位:R^2の2つ目の山。R^2の最大値。
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
2810,20081212,ハウス食品,1586,110879,175854094,15,2.708050201,18.9851652
2202,20081212,明治製菓,408,385535,157298280,16,2.772588722,18.87365443
2261,20081212,明治乳業,466,329649,153616434,17,2.833213344,18.84996937
2811,20081212,カゴメ,1493,99617,148728181,18,2.890371758,18.81763091
2206,20081212,江崎グリコ,1010,144860,146308600,19,2.944438979,18.80122865
2871,20081212,ニチレイ,394,310851,122475294,20,2.995732274,18.62341989
2593,20081212,伊藤園,1260,91212,114927120,21,3.044522438,18.55980875
2607,20081212,不二製油,1242,87569,108760698,22,3.091042453,18.5046606
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2262,20081212,雪印乳業,335,303802,101773670,24,3.17805383,18.43826198
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
2264,20081212,森永乳業,345,253977,87622065,26,3.258096538,18.28854341
2602,20081212,日清オイリオ,471,173339,81642669,27,3.295836866,18.21786259
2001,20081212,日本製粉,461,174148,80282228,28,3.33220451,18.20105883
:売上高か?
:本に載っていない企業もあります、、、:?以下。
===
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
===
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[3]R^2最大値までの近似線を引いてみる。The approximation line to R^2 maximum value is drawn.
[3-1]全体を散布図でプロットする。
foods = read.csv("20081212-foods.txt");
plot(LN_jika ~ LN_order, data = foods)
---
[3-2]TOPから28位までの近似線をひく。
# TOPから28位までのデータセットを作成。
foods_LN_order_28 = foods$LN_order[1:28]
foods_LN_jika_28 = foods$LN_jika[1:28]
foods_28 = data.frame(LN_order=foods_LN_order_28, LN_jika=foods_LN_jika_28)
# データセットを単回帰分析。
# 線形近似を求める。
result = lm(LN_jika ~ LN_order, data = foods_28)
# 近似線をひく。
abline(result)
# 28位に垂直線をひく。
abline(v = log(28), col="red")
---
[3-3]3位、7位の近似線も重ねてみる。
foods_LN_order_07 = foods$LN_order[1:7]
foods_LN_jika_07 = foods$LN_jika[1:7]
foods_07 = data.frame(LN_order=foods_LN_order_07, LN_jika=foods_LN_jika_07)
result_07 = lm(LN_jika ~ LN_order, data = foods_07)
abline(result_07)
abline(v = log(7), col="red")
foods_LN_order_03 = foods$LN_order[1:3]
foods_LN_jika_03 = foods$LN_jika[1:3]
foods_03 = data.frame(LN_order=foods_LN_order_03, LN_jika=foods_LN_jika_03)
result_03 = lm(LN_jika ~ LN_order, data = foods_03)
abline(result_03)
abline(v = log(3), col="red")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[4]試行)28位以降は、R^2の傾向はどうなっているか?
The trial) How does the tendency to R^2 become it since 28th place?
---
[4-1]29位からラストまでで、R^2の状態を見る。
foods = read.csv("20081212-foods.txt");
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
base_order = 29
###
search_order = base_order + 3
for (i in search_order:length(foods$LN_order)){
foods_LN_order_XX = foods$LN_order[base_order:i]
foods_LN_jika_XX = foods$LN_jika[base_order:i]
foods_XX = data.frame(LN_order=foods_LN_order_XX, LN_jika=foods_LN_jika_XX)
result = summary(result <- lm(LN_jika ~ LN_order, data = foods_XX))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
#
plot(kinji_ALL$KINJI_R2)
---
> kinji_ALL
KINJI_A KINJI_B KINJI_R2
1 NA NA NA
2 NA NA NA
3 NA NA NA
4 NA NA NA
5 NA NA NA
6 NA NA NA
7 NA NA NA
8 NA NA NA
9 NA NA NA
10 NA NA NA
11 NA NA NA
12 NA NA NA
13 NA NA NA
14 NA NA NA
15 NA NA NA
16 NA NA NA
17 NA NA NA
18 NA NA NA
19 NA NA NA
20 NA NA NA
21 NA NA NA
22 NA NA NA
23 NA NA NA
24 NA NA NA
25 NA NA NA
26 NA NA NA
27 NA NA NA
28 NA NA NA
29 NA NA NA
30 NA NA NA
31 NA NA NA
32 -2.117902 25.12154 0.9469793
33 -1.903733 24.39334 0.9530634
34 -1.681958 23.63695 0.9415084
35 -1.747786 23.86214 0.9618844
36 -1.711026 23.73602 0.9714386
37 -1.820286 24.11197 0.9727569
38 -1.824618 24.12692 0.9795561
39 -1.763410 23.91513 0.9791543
40 -1.697247 23.68557 0.9766580
41 -1.638252 23.48034 0.9745409
42 -1.611233 23.38610 0.9770650
43 -1.575727 23.26195 0.9775093
44 -1.570542 23.24377 0.9807556
45 -1.545937 23.15731 0.9815584
46 -1.557878 23.19937 0.9839262
47 -1.592808 23.32271 0.9834323
48 -1.635288 23.47307 0.9814780
49 -1.679389 23.62952 0.9793602
50 -1.722936 23.78435 0.9775434
51 -1.746983 23.87004 0.9788431
52 -1.765034 23.93450 0.9803990
53 -1.794668 24.04056 0.9803327
54 -1.820187 24.13209 0.9807158
55 -1.895708 24.40352 0.9680491
56 -1.953377 24.61122 0.9634660
57 -2.015220 24.83441 0.9584019
58 -2.062529 25.00548 0.9574780
59 -2.104095 25.15609 0.9576190
60 -2.175617 25.41573 0.9503957
61 -2.229160 25.61049 0.9488734
62 -2.277106 25.78521 0.9485560
63 -2.315086 25.92388 0.9497910
64 -2.393985 26.21248 0.9413408
65 -2.489239 26.56153 0.9290079
66 -2.569910 26.85768 0.9234153
67 -2.661975 27.19626 0.9155266
68 -2.759161 27.55431 0.9075625
69 -2.873103 27.97481 0.8960784
>
---
[4-2]29位からラストまでで、R^2の最大値を得る。
> max_order = which.max(kinji_ALL$KINJI_R2[32:69]) + 31
> max_r2 = kinji_ALL$KINJI_R2[max_order]
> max_order
[1] 46
> max_r2
[1] 0.9839262
>
---
[5]29位以降のデータに対して、46位の近似線を引く。
# 29位からラストまで、プロット。
foods = read.csv("20081212-foods.txt");
foods_LN_order_29toLast = foods$LN_order[29:length(foods$LN_order)]
foods_LN_jika_29toLast = foods$LN_jika[29:length(foods$LN_order)]
foods_29toLast = data.frame(LN_order=foods_LN_order_29toLast, LN_jika=foods_LN_jika_29toLast)
plot(LN_jika ~ LN_order, data = foods_29toLast)
# データセットを単回帰分析
result = lm(LN_jika ~ LN_order, data = foods_29toLast)
# 近似曲線をグラフに追加。
abline(result)
:この線は意味なし???
---
29位から46位の近似曲線では?
:17銘柄
start_order = 29
end_order = 46
foods_LN_order_start2end = foods$LN_order[start_order:end_order]
foods_LN_jika_start2end = foods$LN_jika[start_order:end_order]
foods_start2end = data.frame(LN_order=foods_LN_order_start2end, LN_jika=foods_LN_jika_start2end)
result = lm(LN_jika ~ LN_order, data = foods_start2end)
abline(result)
abline(v = log(end_order), col="red")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2008/12/19,15:10-)
[5]出来高と順位の関係をチェックする。
The relation between the trading volume and the order is checked.
:出来高は何位までの集中しているか?
On how much order has the trading volume concentrated?
---
2008/12/12の出来高データ(dekidaka)は以下。:東証一部の食品。
===
code,name,owarine,stock_num,jika,order,dekidaka
2914,JT,311000,10000,3110000000,1,40.079
2503,キリン,1082,984508,1065237656,2,7134
2502,アサヒ,1546,483586,747623956,3,4101.6
2802,味の素,942,700033,659431086,4,7837
2897,日清食品,3290,127464,419356560,5,366.9
2267,ヤクルト,1752,175910,308194320,6,724.4
2875,東洋水産,2645,110881,293280245,7,1120
2212,山崎製パン,1284,220283,282843372,8,781
2282,日本ハム,1202,228445,274590890,9,3780
2002,日清製粉,1078,251535,271154730,10,3312.5
2579,北九州コカ,1942,111126,215806692,11,647.8
2801,キッコマン,978,210383,205754574,12,3356
2501,サッポロ,507,393971,199743297,13,3154
2809,キユーピー,1188,155465,184692420,14,585.9
2810,ハウス食品,1586,110879,175854094,15,390.4
2202,明治製菓,408,385535,157298280,16,3738
2261,明治乳業,466,329649,153616434,17,3183
2811,カゴメ,1493,99617,148728181,18,267.4
2206,江崎グリコ,1010,144860,146308600,19,202
2871,ニチレイ,394,310851,122475294,20,3574
2593,伊藤園,1260,91212,114927120,21,363.7
2607,不二製油,1242,87569,108760698,22,343.5
2531,宝ホールディ,488,217700,106237600,23,3097
2262,雪印乳業,335,303802,101773670,24,2405.5
2059,ユニチャーム,3250,29360,95420000,25,70.3
2264,森永乳業,345,253977,87622065,26,865
2602,日清オイリオ,471,173339,81642669,27,2389
2001,日本製粉,461,174148,80282228,28,690
2284,伊藤ハム,315,210483,66302145,29,863
2580,コカコーラセ,654000,90,58860000,30,0.142
2613,J-オイルミ,335,167542,56126570,31,1042
2004,昭和産業,296,180650,53472400,32,257
2201,森永製菓,189,270949,51209361,33,535
2109,三井製糖,354,141667,50150118,34,346
2572,三国コカ,853,53556,45683268,35,103.3
2815,アリアケ,1359,32809,44587431,36,102.8
2207,名糖産業,1884,21265,40063260,37,13.2
2590,ダイドードリ,2375,16569,39351375,38,49.3
2908,フジッコ,1120,34992,39191040,39,100
2281,プリマハム,171,224393,38371203,40,2761
2108,日本甜菜糖,244,153256,37394464,41,445
2288,丸大食品,268,132528,35517504,42,362
2594,キーコーヒ,1554,22464,34909056,43,30.8
2899,永谷園,857,38277,32803389,44,29
2290,米久,1134,28810,32670540,45,85
2204,中村屋,503,59762,30060286,46,107
2540,養命酒製造,840,33000,27720000,47,27
2918,わらべや日洋,1561,16626,25953186,48,51.4
2536,メルシャン,183,133689,24465087,49,220
2211,不二家,119,194377,23130863,50,259
2292,SFOODS,711,32268,22942548,51,19.5
2051,日本農産工,172,129310,22241320,52,143
2578,四国コカ,860,23908,20560880,53,25.8
2009,鳥越製粉,760,26036,19787360,54,38.4
2053,中部飼料,599,26536,15895064,55,65
2910,ロックフィ,1166,13394,15617404,56,23.9
2533,オエノンホー,218,65586,14297748,57,630
2812,焼津水産化学,1000,14056,14056000,58,19.6
2003,日東製粉,287,46924,13467188,59,24
2922,なとり,709,15532,11012188,60,21.4
2217,モロゾフ,300,36692,11007600,61,59
2052,協同飼料,101,103996,10503596,62,177
4404,ミヨシ油脂,125,82455,10306875,63,158
2597,ユニカフェ,1118,6869,7679542,64,10.5
2286,林兼産業,71,89100,6326100,65,316
2056,日配合飼料,86,71877,6181422,66,472
2107,東洋精糖,95,54560,5183200,67,417
2215,第一パン,93,48048,4468464,68,59
2599,ジャパンフー,691,5100,3524100,69,8.5
===
出来高全体:68996.521 単位:千株数
---
3位 :16% =(11275.679/68996.521)*100=16.34238776
7位 :30% =(21323.979/68996.521)*100=30.90587567
28位 :84% =(58519.979/68996.521)*100=84.81584021
46位 :95% =(65751.521/68996.521)*100=95.29686432
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[6]一時的なまとめ
トップからの順位でR^2の最大値は、今回のデータで28位。
トップから28位までの出来高が84%を占めることから、単純なR^2の最大値で近似しても、
マーケットの動きをカバーできるのではないか、、、
29位から46位までの銘柄は、1位から28位の動きに引きずられるようなものか???
---
当面のターゲットは、トップからのR^2で最大値までの範囲をべき乗傾向の範囲とする。
:これは、Excelでの手作業と結果的には同じになった。
~~~
番外)
筆記試験の準備のため。exit。遅い?
:(3日前)本屋の採用試験コーナーに行く。驚く!SPI...WEB:採用試験もインターネットの時代か、、、
~~~
end
2008年12月19日金曜日
Power Law:(36)R,Linear approximation,線形近似(2)
(2008/12/16-)
[0]前提
Rで、時価総額順位ごとに、トップから各順位に関して、R^2と線形近似式の切片と傾きを得る。
R^2, the cut of the linear approximation type, and the inclination of each
aggregate market value order are obtained from the top for each order by R.
~~~
[1]準備
[1-0]サンプルデータ,Example Data
http://humanbeing-etcman.blogspot.com/2008/12/power-law35rlinear-approximation1.html
Power Law:(35)のファイル:20081212-foods.txt を使用する。
The file of Power Law:(35): 20081212- foods.txt is used.
---
[1-1]トップから指定順位までのデータを用意する。
:方針)新たなデータセットを用意する。
Data from the top to a specified order is prepared.
:The policy) A new data set is prepared.
===
参考)
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/39.html
データフレームの考え方
===
[1-1-1]動作確認:データ範囲を指定する。
confirm the operation: The data range is specified.
> foods = read.csv("20081212-foods.txt");
> foods$LN_order
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
[8] 2.0794415 2.1972246 2.3025851 2.3978953 2.4849067 2.5649494 2.6390573
[15] 2.7080502 2.7725887 2.8332133 2.8903718 2.9444390 2.9957323 3.0445224
[22] 3.0910425 3.1354942 3.1780538 3.2188758 3.2580965 3.2958369 3.3322045
[29] 3.3672958 3.4011974 3.4339872 3.4657359 3.4965076 3.5263605 3.5553481
[36] 3.5835189 3.6109179 3.6375862 3.6635616 3.6888795 3.7135721 3.7376696
[43] 3.7612001 3.7841896 3.8066625 3.8286414 3.8501476 3.8712010 3.8918203
[50] 3.9120230 3.9318256 3.9512437 3.9702919 3.9889840 4.0073332 4.0253517
[57] 4.0430513 4.0604430 4.0775374 4.0943446 4.1108739 4.1271344 4.1431347
[64] 4.1588831 4.1743873 4.1896547 4.2046926 4.2195077 4.2341065
> foods$LN_order[1:10]
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
[8] 2.0794415 2.1972246 2.3025851
>
[1-1-2]LN_order, LN_jika で10位までの別のデータセットを作成する。
Another data set to 10th place is made with LN_order and LN_jika.
> foods_LN_order_10 = foods$LN_order[1:10]
> foods_LN_jika_10 = foods$LN_jika[1:10]
> foods_10 = data.frame(LN_order=foods_LN_order_10, LN_jika=foods_LN_jika_10)
> foods_10
LN_order LN_jika
1 0.0000000 21.85789
2 0.6931472 20.78646
3 1.0986123 20.43241
4 1.3862944 20.30689
5 1.6094379 19.85423
6 1.7917595 19.54624
7 1.9459101 19.49664
8 2.0794415 19.46040
9 2.1972246 19.43079
10 2.3025851 19.41820
>
~~~
[2]
データを3位から、ラストまで、1つの位ごとに、R^2、切片、傾きを求める。
:2位は、2点を結んだ直線なので、近似として意味がないから、3位から行う。
:結果は、別のデータセット(この場合、kinji_ALL)に格納した。
Data is requested and R^2, the cut, and the inclination are requested from 3th
place to last in each of the one place.
:It does from 3rd place because it is not significant because 2nd place is a
straight line that connects two points as the approximation.
:The result was stored in another data set (in this case, kinji_ALL).
> foods = read.csv("20081212-foods.txt");
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
for (i in 3:length(foods$LN_order)){
foods_LN_order_XX = foods$LN_order[1:i]
foods_LN_jika_XX = foods$LN_jika[1:i]
foods_XX = data.frame(LN_order=foods_LN_order_XX, LN_jika=foods_LN_jika_XX)
result = summary(result <- lm(LN_jika ~ LN_order, data = foods_XX))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
---
> kinji_ALL
KINJI_A KINJI_B KINJI_R2
1 NA NA NA
2 NA NA NA
3 -1.3242540 21.81650 0.9824892
4 -1.1462126 21.75659 0.9565357
5 -1.1694590 21.76733 0.9707778
6 -1.2092634 21.79003 0.9768168
7 -1.1938098 21.77974 0.9807814
8 -1.1583033 21.75306 0.9794489
9 -1.1165969 21.71849 0.9746122
10 -1.0722442 21.67858 0.9668070
11 -1.0602637 21.66701 0.9695117
12 -1.0459431 21.65231 0.9709022
13 -1.0290555 21.63402 0.9709299
14 -1.0165604 21.61981 0.9717328
15 -1.0048458 21.60591 0.9723224
16 -0.9999210 21.59983 0.9740801
17 -0.9928455 21.59077 0.9751474
18 -0.9851746 21.58063 0.9758356
19 -0.9761357 21.56830 0.9759397
20 -0.9775813 21.57033 0.9774987
21 -0.9798449 21.57359 0.9788664
22 -0.9823583 21.57730 0.9800693
23 -0.9833038 21.57873 0.9811715
24 -0.9841772 21.58008 0.9821641
25 -0.9862398 21.58333 0.9830372
26 -0.9904291 21.59007 0.9836339
27 -0.9957354 21.59876 0.9839738
28 -0.9994923 21.60502 0.9844921
29 -1.0098870 21.62264 0.9831402
30 -1.0228158 21.64491 0.9806215
31 -1.0349416 21.66612 0.9786022
32 -1.0464358 21.68652 0.9769389
33 -1.0572030 21.70590 0.9756323
34 -1.0665177 21.72290 0.9749226
35 -1.0772230 21.74268 0.9736195
36 -1.0867300 21.76047 0.9728248
37 -1.0980279 21.78187 0.9712340
38 -1.1079675 21.80092 0.9702756
39 -1.1162712 21.81701 0.9699321
40 -1.1236683 21.83151 0.9698507
41 -1.1304121 21.84486 0.9699205
42 -1.1373462 21.85872 0.9698911
43 -1.1434774 21.87111 0.9700475
44 -1.1501606 21.88473 0.9700077
45 -1.1557605 21.89626 0.9702260
46 -1.1625077 21.91027 0.9700864
47 -1.1702470 21.92648 0.9695829
48 -1.1785092 21.94394 0.9688642
49 -1.1870856 21.96221 0.9680108
50 -1.1958832 21.98110 0.9670627
51 -1.2037496 21.99812 0.9664935
52 -1.2113017 22.01460 0.9660299
53 -1.2196549 22.03295 0.9652395
54 -1.2278521 22.05109 0.9645104
55 -1.2398628 22.07787 0.9618342
56 -1.2510759 22.10304 0.9597209
57 -1.2630408 22.13008 0.9572346
58 -1.2742355 22.15555 0.9552742
59 -1.2852405 22.18075 0.9534707
60 -1.2992184 22.21296 0.9498893
61 -1.3120443 22.24270 0.9472154
62 -1.3246901 22.27220 0.9447482
63 -1.3366441 22.30025 0.9427655
64 -1.3530451 22.33896 0.9378681
65 -1.3717735 22.38343 0.9313413
66 -1.3896256 22.42605 0.9259591
67 -1.4093466 22.47339 0.9193602
68 -1.4303375 22.52405 0.9121090
69 -1.4540328 22.58154 0.9029087
>
---
結果をファイルに出力する。中断!
The result is output to the file. pending or TODO)
~~~
[3]
最大のR^2を求めるには、R^2をグラフ化する?
To obtain maximum R^2, R^2 is graphed?
> plot(kinji_ALL$KINJI_R2)
> abline(v = 3, col="red")
> abline(v = 7, col="red")
> abline(v = 28, col="red")
>

---
考察):最終結論は未決!
単純なグラフでないので、視覚化して判断するしかない?
最大値が1つではない、、、
:ある値以上で、最大順位を採用するか?
consideration): The final conclusion is undecided.
Because it is not a simple graph, it visualizes and it can do nothing but judge it?
The maximum value is not one...
:Is the maximum order adopted more than a certain value?
---
Excelの手作業では、10位ごとに飛び飛びに行って、ピークがありそうな部分に関しては
1つ1つ行った。これは、単純に頂点が1つしかないと判断してのこと。
In the hand work of Excel, it went in each 10th place here and there, and it
went for the part with the peak seemed one by one. This is judged for only one
the top to exist simply.
~~~
end
[0]前提
Rで、時価総額順位ごとに、トップから各順位に関して、R^2と線形近似式の切片と傾きを得る。
R^2, the cut of the linear approximation type, and the inclination of each
aggregate market value order are obtained from the top for each order by R.
~~~
[1]準備
[1-0]サンプルデータ,Example Data
http://humanbeing-etcman.blogspot.com/2008/12/power-law35rlinear-approximation1.html
Power Law:(35)のファイル:20081212-foods.txt を使用する。
The file of Power Law:(35): 20081212- foods.txt is used.
---
[1-1]トップから指定順位までのデータを用意する。
:方針)新たなデータセットを用意する。
Data from the top to a specified order is prepared.
:The policy) A new data set is prepared.
===
参考)
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/39.html
データフレームの考え方
===
[1-1-1]動作確認:データ範囲を指定する。
confirm the operation: The data range is specified.
> foods = read.csv("20081212-foods.txt");
> foods$LN_order
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
[8] 2.0794415 2.1972246 2.3025851 2.3978953 2.4849067 2.5649494 2.6390573
[15] 2.7080502 2.7725887 2.8332133 2.8903718 2.9444390 2.9957323 3.0445224
[22] 3.0910425 3.1354942 3.1780538 3.2188758 3.2580965 3.2958369 3.3322045
[29] 3.3672958 3.4011974 3.4339872 3.4657359 3.4965076 3.5263605 3.5553481
[36] 3.5835189 3.6109179 3.6375862 3.6635616 3.6888795 3.7135721 3.7376696
[43] 3.7612001 3.7841896 3.8066625 3.8286414 3.8501476 3.8712010 3.8918203
[50] 3.9120230 3.9318256 3.9512437 3.9702919 3.9889840 4.0073332 4.0253517
[57] 4.0430513 4.0604430 4.0775374 4.0943446 4.1108739 4.1271344 4.1431347
[64] 4.1588831 4.1743873 4.1896547 4.2046926 4.2195077 4.2341065
> foods$LN_order[1:10]
[1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
[8] 2.0794415 2.1972246 2.3025851
>
[1-1-2]LN_order, LN_jika で10位までの別のデータセットを作成する。
Another data set to 10th place is made with LN_order and LN_jika.
> foods_LN_order_10 = foods$LN_order[1:10]
> foods_LN_jika_10 = foods$LN_jika[1:10]
> foods_10 = data.frame(LN_order=foods_LN_order_10, LN_jika=foods_LN_jika_10)
> foods_10
LN_order LN_jika
1 0.0000000 21.85789
2 0.6931472 20.78646
3 1.0986123 20.43241
4 1.3862944 20.30689
5 1.6094379 19.85423
6 1.7917595 19.54624
7 1.9459101 19.49664
8 2.0794415 19.46040
9 2.1972246 19.43079
10 2.3025851 19.41820
>
~~~
[2]
データを3位から、ラストまで、1つの位ごとに、R^2、切片、傾きを求める。
:2位は、2点を結んだ直線なので、近似として意味がないから、3位から行う。
:結果は、別のデータセット(この場合、kinji_ALL)に格納した。
Data is requested and R^2, the cut, and the inclination are requested from 3th
place to last in each of the one place.
:It does from 3rd place because it is not significant because 2nd place is a
straight line that connects two points as the approximation.
:The result was stored in another data set (in this case, kinji_ALL).
> foods = read.csv("20081212-foods.txt");
kinji_r2 = c()
kinji_a = c()
kinji_b = c()
for (i in 3:length(foods$LN_order)){
foods_LN_order_XX = foods$LN_order[1:i]
foods_LN_jika_XX = foods$LN_jika[1:i]
foods_XX = data.frame(LN_order=foods_LN_order_XX, LN_jika=foods_LN_jika_XX)
result = summary(result <- lm(LN_jika ~ LN_order, data = foods_XX))
kinji_r2[i] = result$r.squared
kinji_b[i] = result$coefficients[1]
kinji_a[i] = result$coefficients[2]
}
kinji_ALL = data.frame(KINJI_A=kinji_a, KINJI_B=kinji_b, KINJI_R2=kinji_r2)
---
> kinji_ALL
KINJI_A KINJI_B KINJI_R2
1 NA NA NA
2 NA NA NA
3 -1.3242540 21.81650 0.9824892
4 -1.1462126 21.75659 0.9565357
5 -1.1694590 21.76733 0.9707778
6 -1.2092634 21.79003 0.9768168
7 -1.1938098 21.77974 0.9807814
8 -1.1583033 21.75306 0.9794489
9 -1.1165969 21.71849 0.9746122
10 -1.0722442 21.67858 0.9668070
11 -1.0602637 21.66701 0.9695117
12 -1.0459431 21.65231 0.9709022
13 -1.0290555 21.63402 0.9709299
14 -1.0165604 21.61981 0.9717328
15 -1.0048458 21.60591 0.9723224
16 -0.9999210 21.59983 0.9740801
17 -0.9928455 21.59077 0.9751474
18 -0.9851746 21.58063 0.9758356
19 -0.9761357 21.56830 0.9759397
20 -0.9775813 21.57033 0.9774987
21 -0.9798449 21.57359 0.9788664
22 -0.9823583 21.57730 0.9800693
23 -0.9833038 21.57873 0.9811715
24 -0.9841772 21.58008 0.9821641
25 -0.9862398 21.58333 0.9830372
26 -0.9904291 21.59007 0.9836339
27 -0.9957354 21.59876 0.9839738
28 -0.9994923 21.60502 0.9844921
29 -1.0098870 21.62264 0.9831402
30 -1.0228158 21.64491 0.9806215
31 -1.0349416 21.66612 0.9786022
32 -1.0464358 21.68652 0.9769389
33 -1.0572030 21.70590 0.9756323
34 -1.0665177 21.72290 0.9749226
35 -1.0772230 21.74268 0.9736195
36 -1.0867300 21.76047 0.9728248
37 -1.0980279 21.78187 0.9712340
38 -1.1079675 21.80092 0.9702756
39 -1.1162712 21.81701 0.9699321
40 -1.1236683 21.83151 0.9698507
41 -1.1304121 21.84486 0.9699205
42 -1.1373462 21.85872 0.9698911
43 -1.1434774 21.87111 0.9700475
44 -1.1501606 21.88473 0.9700077
45 -1.1557605 21.89626 0.9702260
46 -1.1625077 21.91027 0.9700864
47 -1.1702470 21.92648 0.9695829
48 -1.1785092 21.94394 0.9688642
49 -1.1870856 21.96221 0.9680108
50 -1.1958832 21.98110 0.9670627
51 -1.2037496 21.99812 0.9664935
52 -1.2113017 22.01460 0.9660299
53 -1.2196549 22.03295 0.9652395
54 -1.2278521 22.05109 0.9645104
55 -1.2398628 22.07787 0.9618342
56 -1.2510759 22.10304 0.9597209
57 -1.2630408 22.13008 0.9572346
58 -1.2742355 22.15555 0.9552742
59 -1.2852405 22.18075 0.9534707
60 -1.2992184 22.21296 0.9498893
61 -1.3120443 22.24270 0.9472154
62 -1.3246901 22.27220 0.9447482
63 -1.3366441 22.30025 0.9427655
64 -1.3530451 22.33896 0.9378681
65 -1.3717735 22.38343 0.9313413
66 -1.3896256 22.42605 0.9259591
67 -1.4093466 22.47339 0.9193602
68 -1.4303375 22.52405 0.9121090
69 -1.4540328 22.58154 0.9029087
>
---
結果をファイルに出力する。中断!
The result is output to the file. pending or TODO)
~~~
[3]
最大のR^2を求めるには、R^2をグラフ化する?
To obtain maximum R^2, R^2 is graphed?
> plot(kinji_ALL$KINJI_R2)
> abline(v = 3, col="red")
> abline(v = 7, col="red")
> abline(v = 28, col="red")
>
---
考察):最終結論は未決!
単純なグラフでないので、視覚化して判断するしかない?
最大値が1つではない、、、
:ある値以上で、最大順位を採用するか?
consideration): The final conclusion is undecided.
Because it is not a simple graph, it visualizes and it can do nothing but judge it?
The maximum value is not one...
:Is the maximum order adopted more than a certain value?
---
Excelの手作業では、10位ごとに飛び飛びに行って、ピークがありそうな部分に関しては
1つ1つ行った。これは、単純に頂点が1つしかないと判断してのこと。
In the hand work of Excel, it went in each 10th place here and there, and it
went for the part with the peak seemed one by one. This is judged for only one
the top to exist simply.
~~~
end
2008年12月18日木曜日
Power Law:(35)R,Linear approximation,線形近似(1)
(2008/12/16-)
~~~
[0]前提
各業種でその日の新聞から株価を転記して(たとえば、電機では約160銘柄)、
べき乗傾向の線形近似をExcelで求める作業は、約30分程度要していた。
Stock prices were posted from the newspaper of the day by each type of
business (For instance, they were about 160 brands in the Electric Appliances),
and work to request a linear approximation of the Power Law tendency
by Excel was required for about 30 minutes.
今後作業を継続する場合でも、今回の時価総額による作業をやり直す場合でも、
省力化のために、Rでの対応方法を確認する。
Even when work by this aggregate market value does over again even when work will
be continued in the future, the correspondence method in R is confirmed for the labor saving.
Excelの作業と同様に、Rで、相関図のグラフや近似式を得る方法を確認する。
The method of obtaining the graph and the approximation type of the correlation
diagram is confirmed by R as well as the work of Excel.
~~~
[1]探索
以下のように検索して行き着いた先は、、、
:探索履歴をメモりながら、進んでいきます。いつものパターン。
:キーワードの組み合わせを再考する場合には、記録してあると便利です。for myself.
---
google:R 最小二乗
google:R 線形近似
google:線形近似 プログラム
google:線形近似 最小二乗
===
http://szksrv.isc.chubu.ac.jp/lms/lms7.html
Excelをつかった最小二乗法
:先に進みます。
===
google:線形近似 最小二乗 R
google:Excel 線形近似 R プログラム
===
http://ssl.ohmsha.co.jp/cgi-bin/menu.cgi?ISBN=4-274-06556-1
Excelで学ぶ回帰分析入門、オーム社
--
第2章 散布図でデータの関係を調べよう
2.1 散布図とは
2.2 散布図のxとyの関係
2.3 単回帰式(関係式)を求めよう
2.3.1 直線(線形近似)の挿入
2.3.2 単回帰式とは
2.3.3 相関があるかどうかを調べる
2.3.4 最小自乗法
--
:線形は、単回帰でした。キーワード変更。
===
google:R 単回帰
===
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/70.html
単回帰分析
:たどり着きました。
~~~
[2]動作確認
[2-1]サンプルデータ
20081212付、東証一部、食品、終値の時価総額
:69銘柄、時価総額順に降順。
:owarine=終値, stock_num=発行済み株式数(単位:千株),jika=時価総額
:LN_order=LN(順番), LN_jika=LN(終値の時価総額)
file:20081212-foods.txt
===
code,date,name,owarine,stock_num,jika,order,LN_order,LN_jika
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
2810,20081212,ハウス食品,1586,110879,175854094,15,2.708050201,18.9851652
2202,20081212,明治製菓,408,385535,157298280,16,2.772588722,18.87365443
2261,20081212,明治乳業,466,329649,153616434,17,2.833213344,18.84996937
2811,20081212,カゴメ,1493,99617,148728181,18,2.890371758,18.81763091
2206,20081212,江崎グリコ,1010,144860,146308600,19,2.944438979,18.80122865
2871,20081212,ニチレイ,394,310851,122475294,20,2.995732274,18.62341989
2593,20081212,伊藤園,1260,91212,114927120,21,3.044522438,18.55980875
2607,20081212,不二製油,1242,87569,108760698,22,3.091042453,18.5046606
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2262,20081212,雪印乳業,335,303802,101773670,24,3.17805383,18.43826198
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
2264,20081212,森永乳業,345,253977,87622065,26,3.258096538,18.28854341
2602,20081212,日清オイリオ,471,173339,81642669,27,3.295836866,18.21786259
2001,20081212,日本製粉,461,174148,80282228,28,3.33220451,18.20105883
2284,20081212,伊藤ハム,315,210483,66302145,29,3.36729583,18.00973281
2580,20081212,コカコーラセ,654000,90,58860000,30,3.401197382,17.8906723
2613,20081212,J-オイルミ,335,167542,56126570,31,3.433987204,17.84311988
2004,20081212,昭和産業,296,180650,53472400,32,3.465735903,17.79467619
2201,20081212,森永製菓,189,270949,51209361,33,3.496507561,17.75143291
2109,20081212,三井製糖,354,141667,50150118,34,3.526360525,17.73053143
2572,20081212,三国コカ,853,53556,45683268,35,3.555348061,17.63724266
2815,20081212,アリアケ,1359,32809,44587431,36,3.583518938,17.61296256
2207,20081212,名糖産業,1884,21265,40063260,37,3.610917913,17.50597026
2590,20081212,ダイドードリ,2375,16569,39351375,38,3.63758616,17.48804148
2908,20081212,フジッコ,1120,34992,39191040,39,3.663561646,17.48395871
2281,20081212,プリマハム,171,224393,38371203,40,3.688879454,17.46281781
2108,20081212,日本甜菜糖,244,153256,37394464,41,3.713572067,17.43703323
2288,20081212,丸大食品,268,132528,35517504,42,3.737669618,17.3855362
2594,20081212,キーコーヒ,1554,22464,34909056,43,3.761200116,17.36825684
2899,20081212,永谷園,857,38277,32803389,44,3.784189634,17.30604239
2290,20081212,米久,1134,28810,32670540,45,3.80666249,17.30198431
2204,20081212,中村屋,503,59762,30060286,46,3.828641396,17.21871546
2540,20081212,養命酒製造,840,33000,27720000,47,3.850147602,17.13766473
2918,20081212,わらべや日洋,1561,16626,25953186,48,3.871201011,17.07180493
2536,20081212,メルシャン,183,133689,24465087,49,3.891820298,17.01275764
2211,20081212,不二家,119,194377,23130863,50,3.912023005,16.95667834
2292,20081212,SFOODS,711,32268,22942548,51,3.931825633,16.94850374
2051,20081212,日本農産工,172,129310,22241320,52,3.951243719,16.91746238
2578,20081212,四国コカ,860,23908,20560880,53,3.970291914,16.8389008
2009,20081212,鳥越製粉,760,26036,19787360,54,3.988984047,16.80055391
2053,20081212,中部飼料,599,26536,15895064,55,4.007333185,16.58151918
2910,20081212,ロックフィ,1166,13394,15617404,56,4.025351691,16.56389649
2533,20081212,オエノンホー,218,65586,14297748,57,4.043051268,16.4756126
2812,20081212,焼津水産化学,1000,14056,14056000,58,4.060443011,16.45855991
2003,20081212,日東製粉,287,46924,13467188,59,4.077537444,16.41576677
2922,20081212,なとり,709,15532,11012188,60,4.094344562,16.21451322
2217,20081212,モロゾフ,300,36692,11007600,61,4.110873864,16.2140965
2052,20081212,協同飼料,101,103996,10503596,62,4.127134385,16.16722823
4404,20081212,ミヨシ油脂,125,82455,10306875,63,4.143134726,16.14832171
2597,20081212,ユニカフェ,1118,6869,7679542,64,4.158883083,15.85407047
2286,20081212,林兼産業,71,89100,6326100,65,4.17438727,15.66019449
2056,20081212,日配合飼料,86,71877,6181422,66,4.189654742,15.6370589
2107,20081212,東洋精糖,95,54560,5183200,67,4.204692619,15.46093318
2215,20081212,第一パン,93,48048,4468464,68,4.219507705,15.31255528
2599,20081212,ジャパンフー,691,5100,3524100,69,4.234106505,15.07513564
===
---
[2-2]グラフ出力+線形近似
foods = read.csv("20081212-foods.txt");
plot(LN_jika ~ LN_order, data = foods)
# 線形近似を求める。
result = lm(LN_jika ~ LN_order, data = foods)
# 近似曲線をグラフに追加。
abline(result)

# 近似結果を出力
summary(result)
===
> summary(result)
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Residuals:
Min 1Q Median 3Q Max
-1.3499 -0.2369 0.1748 0.2605 0.5010
Coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 22.58154 0.19806 114.02 <2e-16 ***
LN_order -1.45403 0.05825 -24.96 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4366 on 67 degrees of freedom
Multiple R-squared: 0.9029, Adjusted R-squared: 0.9015
F-statistic: 623.1 on 1 and 67 DF, p-value: < 2.2e-16
>
> result
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Coefficients:
(Intercept) LN_order
22.582 -1.454
>
===
:これから、線形近似式は以下となる。
LN(y) = -1.45403*LN(x) + 22.58154 , R^2=0.9029
---
Excelで同様に求めた場合は以下。
LN(y) = -1.454*LN(x) + 22.582 , R^2=0.9029

---
[2-3]R の summary から結果を抜き出す。
:抜出の情報があまりない、、、
:結果を抜出、処理を自動化するのが目的です。
===
参考ページは以下。
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/71.html
:メモ整理中。names()もあったのを気づくが、この段階では使用していない。
===
試行錯誤で行き着いたのが、、、
> result = summary(result)
> result
Length Class Mode
call 3 -none- call
terms 3 terms call
residuals 69 -none- numeric
coefficients 8 -none- numeric
aliased 2 -none- logical
sigma 1 -none- numeric
df 3 -none- numeric
r.squared 1 -none- numeric
adj.r.squared 1 -none- numeric
fstatistic 3 -none- numeric
cov.unscaled 4 -none- numeric
>
:これらか変数名らしい。
:個々の変数には、JavaのMap,Listみたいな構造があるようだ、、、
:Pythonもリスト構造が好きだったなぁ、、、
--------------
単回帰分析結果の抜き出し方は以下。
> result = summary(result <- lm(LN_jika ~ LN_order, data = foods))
> result
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Residuals:
Min 1Q Median 3Q Max
-1.3499 -0.2369 0.1748 0.2605 0.5010
Coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 22.58154 0.19806 114.02 <2e-16 ***
LN_order -1.45403 0.05825 -24.96 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4366 on 67 degrees of freedom
Multiple R-squared: 0.9029, Adjusted R-squared: 0.9015
F-statistic: 623.1 on 1 and 67 DF, p-value: < 2.2e-16
>
---
> result$r.squared
[1] 0.9029087
> result$r.squared[1]
[1] 0.9029087
> result$coefficients
Estimate Std. Error t value Pr(>t)
(Intercept) 22.581540 0.19805779 114.01490 1.864877e-78
LN_order -1.454033 0.05825122 -24.96141 1.200399e-35
> result$coefficients[1]
[1] 22.58154
> result$coefficients[2]
[1] -1.454033
> result$coefficients[3]
[1] 0.1980578
> result$coefficients[4]
[1] 0.05825122
> result$coefficients[5]
[1] 114.0149
> result$coefficients[6]
[1] -24.96141
> result$coefficients[7]
[1] 1.864877e-78
> result$coefficients[8]
[1] 1.200399e-35
>
---
データから、線形近似の切片、傾きとR^2(決定係数=R-Squared)を割り出す最終形は以下。
foods = read.csv("20081212-foods.txt");
result = summary(result <- lm(LN_jika ~ LN_order, data = foods))
result$r.squared
result$coefficients[1]
result$coefficients[2]
結果は?
> result$r.squared
[1] 0.9029087
> result$coefficients[1]
[1] 22.58154
> result$coefficients[2]
[1] -1.454033
>
~~~
end
~~~
[0]前提
各業種でその日の新聞から株価を転記して(たとえば、電機では約160銘柄)、
べき乗傾向の線形近似をExcelで求める作業は、約30分程度要していた。
Stock prices were posted from the newspaper of the day by each type of
business (For instance, they were about 160 brands in the Electric Appliances),
and work to request a linear approximation of the Power Law tendency
by Excel was required for about 30 minutes.
今後作業を継続する場合でも、今回の時価総額による作業をやり直す場合でも、
省力化のために、Rでの対応方法を確認する。
Even when work by this aggregate market value does over again even when work will
be continued in the future, the correspondence method in R is confirmed for the labor saving.
Excelの作業と同様に、Rで、相関図のグラフや近似式を得る方法を確認する。
The method of obtaining the graph and the approximation type of the correlation
diagram is confirmed by R as well as the work of Excel.
~~~
[1]探索
以下のように検索して行き着いた先は、、、
:探索履歴をメモりながら、進んでいきます。いつものパターン。
:キーワードの組み合わせを再考する場合には、記録してあると便利です。for myself.
---
google:R 最小二乗
google:R 線形近似
google:線形近似 プログラム
google:線形近似 最小二乗
===
http://szksrv.isc.chubu.ac.jp/lms/lms7.html
Excelをつかった最小二乗法
:先に進みます。
===
google:線形近似 最小二乗 R
google:Excel 線形近似 R プログラム
===
http://ssl.ohmsha.co.jp/cgi-bin/menu.cgi?ISBN=4-274-06556-1
Excelで学ぶ回帰分析入門、オーム社
--
第2章 散布図でデータの関係を調べよう
2.1 散布図とは
2.2 散布図のxとyの関係
2.3 単回帰式(関係式)を求めよう
2.3.1 直線(線形近似)の挿入
2.3.2 単回帰式とは
2.3.3 相関があるかどうかを調べる
2.3.4 最小自乗法
--
:線形は、単回帰でした。キーワード変更。
===
google:R 単回帰
===
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/70.html
単回帰分析
:たどり着きました。
~~~
[2]動作確認
[2-1]サンプルデータ
20081212付、東証一部、食品、終値の時価総額
:69銘柄、時価総額順に降順。
:owarine=終値, stock_num=発行済み株式数(単位:千株),jika=時価総額
:LN_order=LN(順番), LN_jika=LN(終値の時価総額)
file:20081212-foods.txt
===
code,date,name,owarine,stock_num,jika,order,LN_order,LN_jika
2914,20081212,JT,311000,10000,3110000000,1,0,21.85788856
2503,20081212,キリン,1082,984508,1065237656,2,0.693147181,20.78646376
2502,20081212,アサヒ,1546,483586,747623956,3,1.098612289,20.43241068
2802,20081212,味の素,942,700033,659431086,4,1.386294361,20.30688803
2897,20081212,日清食品,3290,127464,419356560,5,1.609437912,19.85423209
2267,20081212,ヤクルト,1752,175910,308194320,6,1.791759469,19.54624105
2875,20081212,東洋水産,2645,110881,293280245,7,1.945910149,19.49663918
2212,20081212,山崎製パン,1284,220283,282843372,8,2.079441542,19.46040385
2282,20081212,日本ハム,1202,228445,274590890,9,2.197224577,19.43079288
2002,20081212,日清製粉,1078,251535,271154730,10,2.302585093,19.41820018
2579,20081212,北九州コカ,1942,111126,215806692,11,2.397895273,19.18989362
2801,20081212,キッコマン,978,210383,205754574,12,2.48490665,19.14219463
2501,20081212,サッポロ,507,393971,199743297,13,2.564949357,19.11254359
2809,20081212,キユーピー,1188,155465,184692420,14,2.63905733,19.0342024
2810,20081212,ハウス食品,1586,110879,175854094,15,2.708050201,18.9851652
2202,20081212,明治製菓,408,385535,157298280,16,2.772588722,18.87365443
2261,20081212,明治乳業,466,329649,153616434,17,2.833213344,18.84996937
2811,20081212,カゴメ,1493,99617,148728181,18,2.890371758,18.81763091
2206,20081212,江崎グリコ,1010,144860,146308600,19,2.944438979,18.80122865
2871,20081212,ニチレイ,394,310851,122475294,20,2.995732274,18.62341989
2593,20081212,伊藤園,1260,91212,114927120,21,3.044522438,18.55980875
2607,20081212,不二製油,1242,87569,108760698,22,3.091042453,18.5046606
2531,20081212,宝ホールディ,488,217700,106237600,23,3.135494216,18.48118865
2262,20081212,雪印乳業,335,303802,101773670,24,3.17805383,18.43826198
2059,20081212,ユニチャーム,3250,29360,95420000,25,3.218875825,18.37379876
2264,20081212,森永乳業,345,253977,87622065,26,3.258096538,18.28854341
2602,20081212,日清オイリオ,471,173339,81642669,27,3.295836866,18.21786259
2001,20081212,日本製粉,461,174148,80282228,28,3.33220451,18.20105883
2284,20081212,伊藤ハム,315,210483,66302145,29,3.36729583,18.00973281
2580,20081212,コカコーラセ,654000,90,58860000,30,3.401197382,17.8906723
2613,20081212,J-オイルミ,335,167542,56126570,31,3.433987204,17.84311988
2004,20081212,昭和産業,296,180650,53472400,32,3.465735903,17.79467619
2201,20081212,森永製菓,189,270949,51209361,33,3.496507561,17.75143291
2109,20081212,三井製糖,354,141667,50150118,34,3.526360525,17.73053143
2572,20081212,三国コカ,853,53556,45683268,35,3.555348061,17.63724266
2815,20081212,アリアケ,1359,32809,44587431,36,3.583518938,17.61296256
2207,20081212,名糖産業,1884,21265,40063260,37,3.610917913,17.50597026
2590,20081212,ダイドードリ,2375,16569,39351375,38,3.63758616,17.48804148
2908,20081212,フジッコ,1120,34992,39191040,39,3.663561646,17.48395871
2281,20081212,プリマハム,171,224393,38371203,40,3.688879454,17.46281781
2108,20081212,日本甜菜糖,244,153256,37394464,41,3.713572067,17.43703323
2288,20081212,丸大食品,268,132528,35517504,42,3.737669618,17.3855362
2594,20081212,キーコーヒ,1554,22464,34909056,43,3.761200116,17.36825684
2899,20081212,永谷園,857,38277,32803389,44,3.784189634,17.30604239
2290,20081212,米久,1134,28810,32670540,45,3.80666249,17.30198431
2204,20081212,中村屋,503,59762,30060286,46,3.828641396,17.21871546
2540,20081212,養命酒製造,840,33000,27720000,47,3.850147602,17.13766473
2918,20081212,わらべや日洋,1561,16626,25953186,48,3.871201011,17.07180493
2536,20081212,メルシャン,183,133689,24465087,49,3.891820298,17.01275764
2211,20081212,不二家,119,194377,23130863,50,3.912023005,16.95667834
2292,20081212,SFOODS,711,32268,22942548,51,3.931825633,16.94850374
2051,20081212,日本農産工,172,129310,22241320,52,3.951243719,16.91746238
2578,20081212,四国コカ,860,23908,20560880,53,3.970291914,16.8389008
2009,20081212,鳥越製粉,760,26036,19787360,54,3.988984047,16.80055391
2053,20081212,中部飼料,599,26536,15895064,55,4.007333185,16.58151918
2910,20081212,ロックフィ,1166,13394,15617404,56,4.025351691,16.56389649
2533,20081212,オエノンホー,218,65586,14297748,57,4.043051268,16.4756126
2812,20081212,焼津水産化学,1000,14056,14056000,58,4.060443011,16.45855991
2003,20081212,日東製粉,287,46924,13467188,59,4.077537444,16.41576677
2922,20081212,なとり,709,15532,11012188,60,4.094344562,16.21451322
2217,20081212,モロゾフ,300,36692,11007600,61,4.110873864,16.2140965
2052,20081212,協同飼料,101,103996,10503596,62,4.127134385,16.16722823
4404,20081212,ミヨシ油脂,125,82455,10306875,63,4.143134726,16.14832171
2597,20081212,ユニカフェ,1118,6869,7679542,64,4.158883083,15.85407047
2286,20081212,林兼産業,71,89100,6326100,65,4.17438727,15.66019449
2056,20081212,日配合飼料,86,71877,6181422,66,4.189654742,15.6370589
2107,20081212,東洋精糖,95,54560,5183200,67,4.204692619,15.46093318
2215,20081212,第一パン,93,48048,4468464,68,4.219507705,15.31255528
2599,20081212,ジャパンフー,691,5100,3524100,69,4.234106505,15.07513564
===
---
[2-2]グラフ出力+線形近似
foods = read.csv("20081212-foods.txt");
plot(LN_jika ~ LN_order, data = foods)
# 線形近似を求める。
result = lm(LN_jika ~ LN_order, data = foods)
# 近似曲線をグラフに追加。
abline(result)
# 近似結果を出力
summary(result)
===
> summary(result)
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Residuals:
Min 1Q Median 3Q Max
-1.3499 -0.2369 0.1748 0.2605 0.5010
Coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 22.58154 0.19806 114.02 <2e-16 ***
LN_order -1.45403 0.05825 -24.96 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4366 on 67 degrees of freedom
Multiple R-squared: 0.9029, Adjusted R-squared: 0.9015
F-statistic: 623.1 on 1 and 67 DF, p-value: < 2.2e-16
>
> result
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Coefficients:
(Intercept) LN_order
22.582 -1.454
>
===
:これから、線形近似式は以下となる。
LN(y) = -1.45403*LN(x) + 22.58154 , R^2=0.9029
---
Excelで同様に求めた場合は以下。
LN(y) = -1.454*LN(x) + 22.582 , R^2=0.9029

---
[2-3]R の summary から結果を抜き出す。
:抜出の情報があまりない、、、
:結果を抜出、処理を自動化するのが目的です。
===
参考ページは以下。
http://cse.naro.affrc.go.jp/takezawa/r-tips/r/71.html
:メモ整理中。names()もあったのを気づくが、この段階では使用していない。
===
試行錯誤で行き着いたのが、、、
> result = summary(result)
> result
Length Class Mode
call 3 -none- call
terms 3 terms call
residuals 69 -none- numeric
coefficients 8 -none- numeric
aliased 2 -none- logical
sigma 1 -none- numeric
df 3 -none- numeric
r.squared 1 -none- numeric
adj.r.squared 1 -none- numeric
fstatistic 3 -none- numeric
cov.unscaled 4 -none- numeric
>
:これらか変数名らしい。
:個々の変数には、JavaのMap,Listみたいな構造があるようだ、、、
:Pythonもリスト構造が好きだったなぁ、、、
--------------
単回帰分析結果の抜き出し方は以下。
> result = summary(result <- lm(LN_jika ~ LN_order, data = foods))
> result
Call:
lm(formula = LN_jika ~ LN_order, data = foods)
Residuals:
Min 1Q Median 3Q Max
-1.3499 -0.2369 0.1748 0.2605 0.5010
Coefficients:
Estimate Std. Error t value Pr(>t)
(Intercept) 22.58154 0.19806 114.02 <2e-16 ***
LN_order -1.45403 0.05825 -24.96 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4366 on 67 degrees of freedom
Multiple R-squared: 0.9029, Adjusted R-squared: 0.9015
F-statistic: 623.1 on 1 and 67 DF, p-value: < 2.2e-16
>
---
> result$r.squared
[1] 0.9029087
> result$r.squared[1]
[1] 0.9029087
> result$coefficients
Estimate Std. Error t value Pr(>t)
(Intercept) 22.581540 0.19805779 114.01490 1.864877e-78
LN_order -1.454033 0.05825122 -24.96141 1.200399e-35
> result$coefficients[1]
[1] 22.58154
> result$coefficients[2]
[1] -1.454033
> result$coefficients[3]
[1] 0.1980578
> result$coefficients[4]
[1] 0.05825122
> result$coefficients[5]
[1] 114.0149
> result$coefficients[6]
[1] -24.96141
> result$coefficients[7]
[1] 1.864877e-78
> result$coefficients[8]
[1] 1.200399e-35
>
---
データから、線形近似の切片、傾きとR^2(決定係数=R-Squared)を割り出す最終形は以下。
foods = read.csv("20081212-foods.txt");
result = summary(result <- lm(LN_jika ~ LN_order, data = foods))
result$r.squared
result$coefficients[1]
result$coefficients[2]
結果は?
> result$r.squared
[1] 0.9029087
> result$coefficients[1]
[1] 22.58154
> result$coefficients[2]
[1] -1.454033
>
~~~
end
2008年12月17日水曜日
Power Law:(34)STOCK,Aggregate market value,時価総額
[1]妄想:はじめに
株価のべき乗の扱いを再考。
The treatment of the Power Law of stock prices is reconsidered.
株価単独では、会社間の比較は妥当ではなかった。
In single stock prices, the comparison between companies was not appropriate.
株式の売買最小単位がべき乗の要因か?
単位:株価×1単元の株式数
Is the buying and selling minimum unit of the stocks a factor of the Power Law?
Unit:(Stock prices) * (Number of stocks of one unit)
株式分割もあるので、これもおかしい。
This is also amusing because there is a stock split.
ならば、要因は会社買収時の時価総額か?
Then, is the factor aggregate market value when the company is purchased?
~~~
[2]本,DO図書館
Excelで学ぶ株式投資―Excelで実... 藤本 壱 (単行本 - 2005/10)
--
(p.40)
時価総額 = 株価 * 発行済み株式数
--
(p.31)
PER(Price Earnings Ratio, 株価収益率)、単位=倍
PER = 株価 / (1株あたり当期純利益)
= 株価 / (当期純利益 / 発行済み株式数)
= (株価 * 発行済み株式数) / 当期純利益
= 時価総額 / 当期純利益
--
(p.38)
PBR(Price Book-value Ratio, 株価純資産倍率)、単位=倍
PBR = 株価 / (1株あたり純資産)
= 株価 / (純資産 / 発行済み株式数)
= (株価 * 発行済み株式数) / 純資産
= 時価総額 / 純資産
--
(p.32)
PERの目安):割高か否か?の判断の目安
・同業他社との比較
・市場全体の平均との比較
・過去のPERとの比較
--
:PBRも同様。
~~~
[3]方針
べき乗傾向は、絶対値をベースに考えた場合、上記の Ratio に潜む時価総額を
ターゲットにしてみる。
~~~
[4]「時価総額の発行済み株式数」を入手する。
[東証の株価検索]
http://quote.tse.or.jp/tse/quote.cgi?F=listing/cs00
「発行済み株式数」は、会社情報の「決算・投資指標情報」にあります。
:手で収集した。
---
[4-1]食品、2008/12/17時点
単位:発行株式数=千株,売買単位=株
===
コード,名称,発行株式数,売買単位
2001,日本製粉,174148,1000
2002,日清製粉,251535,500
2003,日東製粉,46924,1000
2004,昭和産業,180650,1000
2009,鳥越製粉,26036,100
2051,日本農産工,129310,1000
2052,協同飼料,103996,1000
2053,中部飼料,26536,1000
2056,日配合飼料,71877,1000
2059,ユニチャーム,29360,100
2107,東洋精糖,54560,1000
2108,日本甜菜糖,153256,1000
2109,三井製糖,141667,1000
2201,森永製菓,270949,1000
2202,明治製菓,385535,1000
2204,中村屋,59762,1000
2206,江崎グリコ,144860,1000
2207,名糖産業,21265,100
2211,不二家,194377,1000
2212,山崎製パン,220283,1000
2215,第一パン,48048,1000
2217,モロゾフ,36692,1000
2261,明治乳業,329649,1000
2262,雪印乳業,303802,500
2264,森永乳業,253977,1000
2267,ヤクルト,175910,100
2281,プリマハム,224393,1000
2282,日本ハム,228445,1000
2284,伊藤ハム,210483,1000
2286,林兼産業,89100,1000
2288,丸大食品,132528,1000
2290,米久,28810,500
2292,SFOODS,32268,500
2501,サッポロ,393971,1000
2502,アサヒ,483586,100
2503,キリン,984508,1000
2531,宝ホールディ,217700,1000
2533,オエノンホー,65586,1000
2536,メルシャン,133689,1000
2540,養命酒製造,33000,1000
2572,三国コカ,53556,100
2578,四国コカ,23908,100
2579,北九州コカ,111126,100
2580,コカコーラセ,90,1
2590,ダイドードリ,16569,100
2593,伊藤園,91212,100
2594,キーコーヒ,22464,100
2597,ユニカフェ,6869,100
2599,ジャパンフー,5100,100
2602,日清オイリオ,173339,1000
2607,不二製油,87569,100
2613,J-オイルミ,167542,1000
2801,キッコマン,210383,1000
2802,味の素,700033,1000
2809,キユーピー,155465,100
2810,ハウス食品,110879,100
2811,カゴメ,99617,100
2812,焼津水産化学,14056,100
2815,アリアケ,32809,100
2871,ニチレイ,310851,1000
2875,東洋水産,110881,1000
2897,日清食品,127464,100
2899,永谷園,38277,1000
2908,フジッコ,34992,1000
2910,ロックフィ,13394,100
2914,JT,10000,1
2918,わらべや日洋,16626,100
2922,なとり,15532,100
4404,ミヨシ油脂,82455,1000
===
---
[4-2]電機、2008/12/17時点
単位:発行株式数=千株,売買単位=株
===
コード,名称,発行株式数,売買単位
4062,イビデン,150852,100
4902,コニカミノル,531664,500
6448,ブラザー工,277536,100
6479,ミネベア,399168,1000
6501,日立製作所,3368126,1000
6502,東芝,3237602,1000
6503,三菱電機,2147202,1000
6504,富士電機,746485,1000
6505,東洋電機製,46575,1000
6506,安川電機,252332,1000
6507,神鋼電機,146407,1000
6508,明電舎,227638,1000
6513,オリジン電,33500,1000
6517,デンヨー,25360,100
6588,テック,288146,1000
6590,芝浦メカトロ,51926,1000
6592,マブチ,46476,100,
6594,日本電産,145075,100,
6621,高岳製作所,106135,1000,
6622,ダイヘン,135516,1000,
6632,JVCケンウ,,100,株式数なし?
6641,日新電機,107832,1000,
6644,大崎電気工,38551,1000,
6645,オムロン,239121,100,
6651,日東工業,44000,100,
6652,IDEC,38224,100,
6665,エルピーダメ,129814,100,
6674,ジーエスユア,367575,1000,
6675,サクサホール,62450,1000,
6676,メルコホール,23126,100,
6678,テクノメディ,29,1,
6701,NEC,2029733,1000,
6702,富士通,2070018,1000
6703,OKI,684257,1000
6704,岩崎通信機,100803,1000
6706,電気興業,70424,1000
6707,サンケン電,125490,1000
6708,エプソントヨ,187952,1000
6715,ナカヨ通信,23975,1000
6718,アイホン,20674,100
6723,NECエレク,123500,100
6724,セイコーエプ,196365,100
6727,ワコム,422,1
6728,アルバック,42906,100
6731,ピクセラ,11034,100
6737,ナナオ,22731,100
6741,日本信号,62448,100
6742,京三製作所,62844,1000
6744,能美防災,60833,1000
6745,ホーチキ,29172,1000
6749,マスプロ電,20348,100
6751,日本無線,137977,1000
6752,パナソニック,2453053,1000
6753,シャープ,1110700,1000
6754,アンリツ,128038,1000
6755,富士通ゼネ,109277,1000
6756,国際電気,105221,1000
6758,ソニー,1004535,100
6759,トーキン,113516,1000
6762,TDK,129591,100
6763,帝国通信工,50709,1000
6764,三洋電機,1872338,1000
6766,宮越商事,15542,100
6767,ミツミ電機,87498,100
6768,タムラ製作,75068,1000
6770,アルプス電,181560,100
6771,池上通信機,72857,1000
6773,パイオニア,210064,100
6779,日本電波工,20758,100
6788,日本トリム,4628,50
6789,ローランドデ,17800,100
6793,山水電気,1363000,1000
6794,フォスタ電,24106,100
6796,クラリオン,282744,1000
6798,SMK,79000,1000
6800,ヨコオ,20850,100
6801,東光,97541,1000
6803,ティアック,289317,1000
6804,ホシデン,72710,100
6806,ヒロセ電機,40021,100
6807,航空電子工,92303,1000
6809,TOA,35537,1000
6810,マクセル,99532,100
6815,ユニデン,63140,1000
6816,アルパイン,69785,100
6817,スミダコーポ,19944,100
6818,島田理化工,21538,100
6820,アイコム,14850,100
6839,船井電機,36104,100
6841,横河電機,268625,100
6844,新電元工業,87028,1000
6845,山武,75116,100
6849,日本光電,45765,100
6850,チノー,47801,1000
6853,共和電業,25759,1000
6855,日本電子材料,10605,100
6856,堀場製作所,42529,100
6857,アドテスト,199567,100
6858,小野測器,30250,1000
6859,エスペック,23781,100
6860,SUNX,35182,100
6861,キーエンス,50250,100
6866,HIOKI,14024,100
6869,シスメックス,51224,100
6875,メガチップス,24667,100
6877,OBARA,20869,100
6883,日本電産コパ,66452,100
6885,ミヤチテクノ,12031,100
6900,東京電波,8417,100
6901,澤藤電機,21610,1000
6905,コーセル,41184,100
6910,メディコ,39540,1000
6911,新日本無線,39131,1000
6914,オプテックス,16985,100
6915,千代田インテ,14129,100
6921,東光電気,29040,1000
6923,スタンレー,188240,100
6924,岩崎電気,78220,1000
6925,ウシオ電機,139629,100
6926,岡谷電機産,22922,100
6927,フェニックス,22807,100
6929,日本セラミ,26312,100
6934,新神戸電機,50936,1000
6935,日デジタル,33952,100
6937,古河電池,32800,1000
6938,双信電機,15600,100
6941,山一電機,20538,100
6947,図研,27904,100
6951,日本電子,79366,1000
6952,カシオ,279021,100
6954,ファナック,239508,100
6955,FDK,128076,1000
6958,日本CMK,63060,100
6961,エンプラス,20906,100
6963,ローム,118801,100
6965,浜松ホトニ,83712,100
6966,三井ハイテ,42467,100
6967,新光電気工,135172,100
6971,京セラ,191309,100
6974,日本インタ,31578,100
6976,太陽誘電,120481,1000
6981,村田製作所,225264,100
6985,ユーシン,31996,100
6986,双葉電子工,47387,100
6989,北陸電気工,92501,1000
6991,パナ電工,751075,1000
6996,ニチコン,78000,100
6997,日ケミコン,127159,1000
6999,KOA,43480,100
7244,市光工業,96037,1000
7276,小糸製作所,160789,1000
7280,ミツバ,45582,1000
7704,アロカ,28350,100
7718,スター精密,54533,100
7735,スクリーン,253974,1000
7739,キヤノン電,41472,100
7751,キヤノン,1333711,100
7752,リコー,744912,1000
7757,日本電産サン,191108,1000
7999,MUTOHホ,54818,1000
8035,東京エレク,180611,100
===
注)
:「6632,JVCケンウ」は、発行株式数のデータなし?
:売買単位=「1単元の株数」は、現時点であまり意味がなかった。参考までに。
---
[4-3]
発行株式数は変化するが、
べき乗傾向をチェックする期間:2008/11、2008/12はこのデータで行う。
~~~
[5]妄想:おわりに
会社規模の順位は、不祥事あるいは、M&Aによる合併等がなければ、
極端に変化しないという前提とする。
業界のべき乗傾向の推移を予測することで、
個々の企業の株価をある程度予測できるというシナリオである。
:時価総額のべき乗の推移で何が分かるか?
The order of the company scale is made assumption of not extremely changing if there are no amalgamation etc. done by the scandal or M&A.
In the forecast of the transition of the Power Law tendency to the
industry, It is a scenario that stock prices of an individual enterprise are
predictable to some degree.
:What do you understand from the transition of the Power Law of aggregate
market value?
~~~
end
株価のべき乗の扱いを再考。
The treatment of the Power Law of stock prices is reconsidered.
株価単独では、会社間の比較は妥当ではなかった。
In single stock prices, the comparison between companies was not appropriate.
株式の売買最小単位がべき乗の要因か?
単位:株価×1単元の株式数
Is the buying and selling minimum unit of the stocks a factor of the Power Law?
Unit:(Stock prices) * (Number of stocks of one unit)
株式分割もあるので、これもおかしい。
This is also amusing because there is a stock split.
ならば、要因は会社買収時の時価総額か?
Then, is the factor aggregate market value when the company is purchased?
~~~
[2]本,DO図書館
Excelで学ぶ株式投資―Excelで実... 藤本 壱 (単行本 - 2005/10)
--
(p.40)
時価総額 = 株価 * 発行済み株式数
--
(p.31)
PER(Price Earnings Ratio, 株価収益率)、単位=倍
PER = 株価 / (1株あたり当期純利益)
= 株価 / (当期純利益 / 発行済み株式数)
= (株価 * 発行済み株式数) / 当期純利益
= 時価総額 / 当期純利益
--
(p.38)
PBR(Price Book-value Ratio, 株価純資産倍率)、単位=倍
PBR = 株価 / (1株あたり純資産)
= 株価 / (純資産 / 発行済み株式数)
= (株価 * 発行済み株式数) / 純資産
= 時価総額 / 純資産
--
(p.32)
PERの目安):割高か否か?の判断の目安
・同業他社との比較
・市場全体の平均との比較
・過去のPERとの比較
--
:PBRも同様。
~~~
[3]方針
べき乗傾向は、絶対値をベースに考えた場合、上記の Ratio に潜む時価総額を
ターゲットにしてみる。
~~~
[4]「時価総額の発行済み株式数」を入手する。
[東証の株価検索]
http://quote.tse.or.jp/tse/quote.cgi?F=listing/cs00
「発行済み株式数」は、会社情報の「決算・投資指標情報」にあります。
:手で収集した。
---
[4-1]食品、2008/12/17時点
単位:発行株式数=千株,売買単位=株
===
コード,名称,発行株式数,売買単位
2001,日本製粉,174148,1000
2002,日清製粉,251535,500
2003,日東製粉,46924,1000
2004,昭和産業,180650,1000
2009,鳥越製粉,26036,100
2051,日本農産工,129310,1000
2052,協同飼料,103996,1000
2053,中部飼料,26536,1000
2056,日配合飼料,71877,1000
2059,ユニチャーム,29360,100
2107,東洋精糖,54560,1000
2108,日本甜菜糖,153256,1000
2109,三井製糖,141667,1000
2201,森永製菓,270949,1000
2202,明治製菓,385535,1000
2204,中村屋,59762,1000
2206,江崎グリコ,144860,1000
2207,名糖産業,21265,100
2211,不二家,194377,1000
2212,山崎製パン,220283,1000
2215,第一パン,48048,1000
2217,モロゾフ,36692,1000
2261,明治乳業,329649,1000
2262,雪印乳業,303802,500
2264,森永乳業,253977,1000
2267,ヤクルト,175910,100
2281,プリマハム,224393,1000
2282,日本ハム,228445,1000
2284,伊藤ハム,210483,1000
2286,林兼産業,89100,1000
2288,丸大食品,132528,1000
2290,米久,28810,500
2292,SFOODS,32268,500
2501,サッポロ,393971,1000
2502,アサヒ,483586,100
2503,キリン,984508,1000
2531,宝ホールディ,217700,1000
2533,オエノンホー,65586,1000
2536,メルシャン,133689,1000
2540,養命酒製造,33000,1000
2572,三国コカ,53556,100
2578,四国コカ,23908,100
2579,北九州コカ,111126,100
2580,コカコーラセ,90,1
2590,ダイドードリ,16569,100
2593,伊藤園,91212,100
2594,キーコーヒ,22464,100
2597,ユニカフェ,6869,100
2599,ジャパンフー,5100,100
2602,日清オイリオ,173339,1000
2607,不二製油,87569,100
2613,J-オイルミ,167542,1000
2801,キッコマン,210383,1000
2802,味の素,700033,1000
2809,キユーピー,155465,100
2810,ハウス食品,110879,100
2811,カゴメ,99617,100
2812,焼津水産化学,14056,100
2815,アリアケ,32809,100
2871,ニチレイ,310851,1000
2875,東洋水産,110881,1000
2897,日清食品,127464,100
2899,永谷園,38277,1000
2908,フジッコ,34992,1000
2910,ロックフィ,13394,100
2914,JT,10000,1
2918,わらべや日洋,16626,100
2922,なとり,15532,100
4404,ミヨシ油脂,82455,1000
===
---
[4-2]電機、2008/12/17時点
単位:発行株式数=千株,売買単位=株
===
コード,名称,発行株式数,売買単位
4062,イビデン,150852,100
4902,コニカミノル,531664,500
6448,ブラザー工,277536,100
6479,ミネベア,399168,1000
6501,日立製作所,3368126,1000
6502,東芝,3237602,1000
6503,三菱電機,2147202,1000
6504,富士電機,746485,1000
6505,東洋電機製,46575,1000
6506,安川電機,252332,1000
6507,神鋼電機,146407,1000
6508,明電舎,227638,1000
6513,オリジン電,33500,1000
6517,デンヨー,25360,100
6588,テック,288146,1000
6590,芝浦メカトロ,51926,1000
6592,マブチ,46476,100,
6594,日本電産,145075,100,
6621,高岳製作所,106135,1000,
6622,ダイヘン,135516,1000,
6632,JVCケンウ,,100,株式数なし?
6641,日新電機,107832,1000,
6644,大崎電気工,38551,1000,
6645,オムロン,239121,100,
6651,日東工業,44000,100,
6652,IDEC,38224,100,
6665,エルピーダメ,129814,100,
6674,ジーエスユア,367575,1000,
6675,サクサホール,62450,1000,
6676,メルコホール,23126,100,
6678,テクノメディ,29,1,
6701,NEC,2029733,1000,
6702,富士通,2070018,1000
6703,OKI,684257,1000
6704,岩崎通信機,100803,1000
6706,電気興業,70424,1000
6707,サンケン電,125490,1000
6708,エプソントヨ,187952,1000
6715,ナカヨ通信,23975,1000
6718,アイホン,20674,100
6723,NECエレク,123500,100
6724,セイコーエプ,196365,100
6727,ワコム,422,1
6728,アルバック,42906,100
6731,ピクセラ,11034,100
6737,ナナオ,22731,100
6741,日本信号,62448,100
6742,京三製作所,62844,1000
6744,能美防災,60833,1000
6745,ホーチキ,29172,1000
6749,マスプロ電,20348,100
6751,日本無線,137977,1000
6752,パナソニック,2453053,1000
6753,シャープ,1110700,1000
6754,アンリツ,128038,1000
6755,富士通ゼネ,109277,1000
6756,国際電気,105221,1000
6758,ソニー,1004535,100
6759,トーキン,113516,1000
6762,TDK,129591,100
6763,帝国通信工,50709,1000
6764,三洋電機,1872338,1000
6766,宮越商事,15542,100
6767,ミツミ電機,87498,100
6768,タムラ製作,75068,1000
6770,アルプス電,181560,100
6771,池上通信機,72857,1000
6773,パイオニア,210064,100
6779,日本電波工,20758,100
6788,日本トリム,4628,50
6789,ローランドデ,17800,100
6793,山水電気,1363000,1000
6794,フォスタ電,24106,100
6796,クラリオン,282744,1000
6798,SMK,79000,1000
6800,ヨコオ,20850,100
6801,東光,97541,1000
6803,ティアック,289317,1000
6804,ホシデン,72710,100
6806,ヒロセ電機,40021,100
6807,航空電子工,92303,1000
6809,TOA,35537,1000
6810,マクセル,99532,100
6815,ユニデン,63140,1000
6816,アルパイン,69785,100
6817,スミダコーポ,19944,100
6818,島田理化工,21538,100
6820,アイコム,14850,100
6839,船井電機,36104,100
6841,横河電機,268625,100
6844,新電元工業,87028,1000
6845,山武,75116,100
6849,日本光電,45765,100
6850,チノー,47801,1000
6853,共和電業,25759,1000
6855,日本電子材料,10605,100
6856,堀場製作所,42529,100
6857,アドテスト,199567,100
6858,小野測器,30250,1000
6859,エスペック,23781,100
6860,SUNX,35182,100
6861,キーエンス,50250,100
6866,HIOKI,14024,100
6869,シスメックス,51224,100
6875,メガチップス,24667,100
6877,OBARA,20869,100
6883,日本電産コパ,66452,100
6885,ミヤチテクノ,12031,100
6900,東京電波,8417,100
6901,澤藤電機,21610,1000
6905,コーセル,41184,100
6910,メディコ,39540,1000
6911,新日本無線,39131,1000
6914,オプテックス,16985,100
6915,千代田インテ,14129,100
6921,東光電気,29040,1000
6923,スタンレー,188240,100
6924,岩崎電気,78220,1000
6925,ウシオ電機,139629,100
6926,岡谷電機産,22922,100
6927,フェニックス,22807,100
6929,日本セラミ,26312,100
6934,新神戸電機,50936,1000
6935,日デジタル,33952,100
6937,古河電池,32800,1000
6938,双信電機,15600,100
6941,山一電機,20538,100
6947,図研,27904,100
6951,日本電子,79366,1000
6952,カシオ,279021,100
6954,ファナック,239508,100
6955,FDK,128076,1000
6958,日本CMK,63060,100
6961,エンプラス,20906,100
6963,ローム,118801,100
6965,浜松ホトニ,83712,100
6966,三井ハイテ,42467,100
6967,新光電気工,135172,100
6971,京セラ,191309,100
6974,日本インタ,31578,100
6976,太陽誘電,120481,1000
6981,村田製作所,225264,100
6985,ユーシン,31996,100
6986,双葉電子工,47387,100
6989,北陸電気工,92501,1000
6991,パナ電工,751075,1000
6996,ニチコン,78000,100
6997,日ケミコン,127159,1000
6999,KOA,43480,100
7244,市光工業,96037,1000
7276,小糸製作所,160789,1000
7280,ミツバ,45582,1000
7704,アロカ,28350,100
7718,スター精密,54533,100
7735,スクリーン,253974,1000
7739,キヤノン電,41472,100
7751,キヤノン,1333711,100
7752,リコー,744912,1000
7757,日本電産サン,191108,1000
7999,MUTOHホ,54818,1000
8035,東京エレク,180611,100
===
注)
:「6632,JVCケンウ」は、発行株式数のデータなし?
:売買単位=「1単元の株数」は、現時点であまり意味がなかった。参考までに。
---
[4-3]
発行株式数は変化するが、
べき乗傾向をチェックする期間:2008/11、2008/12はこのデータで行う。
~~~
[5]妄想:おわりに
会社規模の順位は、不祥事あるいは、M&Aによる合併等がなければ、
極端に変化しないという前提とする。
業界のべき乗傾向の推移を予測することで、
個々の企業の株価をある程度予測できるというシナリオである。
:時価総額のべき乗の推移で何が分かるか?
The order of the company scale is made assumption of not extremely changing if there are no amalgamation etc. done by the scandal or M&A.
In the forecast of the transition of the Power Law tendency to the
industry, It is a scenario that stock prices of an individual enterprise are
predictable to some degree.
:What do you understand from the transition of the Power Law of aggregate
market value?
~~~
end
STOCK:(6)Data in NET
(2008/12/15)
[0]目的
※現段階としては、[0-2]が主目的。
[0-1]
新聞廃棄で欠落した株価をネットから入手する。
Stock prices missed by the newspaper abandonment are obtained from the net.
:20081110,20081201付、東証一部、食品、電機
[0-2]
新聞から転記するのも大変なので、ネットから株価データを入手する。
Because posting it from the newspaper is also serious, the stock prices data is acquired from the net.
~~~
[1]探索
:現時点の株価をチェックできるサイトは結構ありました。
[東証の株価検索]
http://quote.tse.or.jp/tse/quote.cgi?F=listing/cs00
[asahi.com/ニュース/ビジネス/株価検索/東証業種一覧]
http://stock.asahi.com/search/qsearch.exe?F=asahicom/stock
[ADVFN]:会員登録が必要。無料?内容:未チェック。TODO)
http://jp.advfn.com/p.php?pid=front
:銘柄指定の時系列データもありました。
[株価データ ダウンロード]
http://k-db.com/site/default.aspx
[PanRolling 相場日足場帳]
http://www.panrolling.com/data/
[株価データ倉庫]:2000年からデータがある。
http://www.geocities.co.jp/WallStreet-Stock/9256/data.html
:データはPanRolling 相場日足場帳(東証・大証1・2部の株価データのみ)と同じ形式。
---
現時点で、選択したものは、以下です。
[株価データ倉庫]
http://www.geocities.co.jp/WallStreet-Stock/9256/data.html
日足株価データ
2008年株価データ
http://www.geocities.co.jp/WallStreet-Stock/9256/data2008.htm
:日別にファイルが分かれている。
(2008/12/17, 13:20時点)
y081212.zip
y081211.zip
y081210.zip
y081209.zip
y081208.zip
y081205.zip
y081204.zip
y081203.zip
y081202.zip
y081201.zip
...
:データ更新は、1週間単位か?:未確認。TODO)
---
データ形式は、東証・大証1・2部全銘柄の四本値・出来高。
例)
20081212
1001 日経225 8599 8610 8087 8235 303.249
...
~~~
[2]加工
:ただし、業種単位での抜き出す方法は如何に?
However, how does the pulling out method in each type of business?
:全銘柄の株価データファイルから、各業種ごとの銘柄をgrepして集める。
:Brands of each type of business are done in grep and collected from the stock prices data file of all brands.
grep
http://humanbeing-etcman.blogspot.com/2008/12/win32grep.html
食品の銘柄一覧
STOCK:(2)TSE,ISIN,Foods
http://humanbeing-etcman.blogspot.com/2008/12/stock2tseisinfoods.html
電機の銘柄一覧
STOCK:(3)TSE,ISIN,Electric Appliances
http://humanbeing-etcman.blogspot.com/2008/12/stock3tseisinelectric-appliances.html
---
2008/12/12の株価データファイルを y081212.txt とする。
---
[2-1]食品の銘柄を抜き出す方法
データファイルと同じディレクトリにファイル:grep-foods-69.bat をおき、以下のように実行。
grep-foods-69 y081212.txt
抜出結果が以下のファイルに格納。※入力ファイル名によりファイル名が異なる。
output-foods-y081212.txt.txt
grep-foods-69.bat
===
grep "^2001" %1 >> output-foods-%1.txt
grep "^2002" %1 >> output-foods-%1.txt
grep "^2003" %1 >> output-foods-%1.txt
grep "^2004" %1 >> output-foods-%1.txt
grep "^2009" %1 >> output-foods-%1.txt
grep "^2051" %1 >> output-foods-%1.txt
grep "^2052" %1 >> output-foods-%1.txt
grep "^2053" %1 >> output-foods-%1.txt
grep "^2056" %1 >> output-foods-%1.txt
grep "^2059" %1 >> output-foods-%1.txt
grep "^2107" %1 >> output-foods-%1.txt
grep "^2108" %1 >> output-foods-%1.txt
grep "^2109" %1 >> output-foods-%1.txt
grep "^2201" %1 >> output-foods-%1.txt
grep "^2202" %1 >> output-foods-%1.txt
grep "^2204" %1 >> output-foods-%1.txt
grep "^2206" %1 >> output-foods-%1.txt
grep "^2207" %1 >> output-foods-%1.txt
grep "^2211" %1 >> output-foods-%1.txt
grep "^2212" %1 >> output-foods-%1.txt
grep "^2215" %1 >> output-foods-%1.txt
grep "^2217" %1 >> output-foods-%1.txt
grep "^2261" %1 >> output-foods-%1.txt
grep "^2262" %1 >> output-foods-%1.txt
grep "^2264" %1 >> output-foods-%1.txt
grep "^2267" %1 >> output-foods-%1.txt
grep "^2281" %1 >> output-foods-%1.txt
grep "^2282" %1 >> output-foods-%1.txt
grep "^2284" %1 >> output-foods-%1.txt
grep "^2286" %1 >> output-foods-%1.txt
grep "^2288" %1 >> output-foods-%1.txt
grep "^2290" %1 >> output-foods-%1.txt
grep "^2292" %1 >> output-foods-%1.txt
grep "^2501" %1 >> output-foods-%1.txt
grep "^2502" %1 >> output-foods-%1.txt
grep "^2503" %1 >> output-foods-%1.txt
grep "^2531" %1 >> output-foods-%1.txt
grep "^2533" %1 >> output-foods-%1.txt
grep "^2536" %1 >> output-foods-%1.txt
grep "^2540" %1 >> output-foods-%1.txt
grep "^2572" %1 >> output-foods-%1.txt
grep "^2578" %1 >> output-foods-%1.txt
grep "^2579" %1 >> output-foods-%1.txt
grep "^2580" %1 >> output-foods-%1.txt
grep "^2590" %1 >> output-foods-%1.txt
grep "^2593" %1 >> output-foods-%1.txt
grep "^2594" %1 >> output-foods-%1.txt
grep "^2597" %1 >> output-foods-%1.txt
grep "^2599" %1 >> output-foods-%1.txt
grep "^2602" %1 >> output-foods-%1.txt
grep "^2607" %1 >> output-foods-%1.txt
grep "^2613" %1 >> output-foods-%1.txt
grep "^2801" %1 >> output-foods-%1.txt
grep "^2802" %1 >> output-foods-%1.txt
grep "^2809" %1 >> output-foods-%1.txt
grep "^2810" %1 >> output-foods-%1.txt
grep "^2811" %1 >> output-foods-%1.txt
grep "^2812" %1 >> output-foods-%1.txt
grep "^2815" %1 >> output-foods-%1.txt
grep "^2871" %1 >> output-foods-%1.txt
grep "^2875" %1 >> output-foods-%1.txt
grep "^2897" %1 >> output-foods-%1.txt
grep "^2899" %1 >> output-foods-%1.txt
grep "^2908" %1 >> output-foods-%1.txt
grep "^2910" %1 >> output-foods-%1.txt
grep "^2914" %1 >> output-foods-%1.txt
grep "^2918" %1 >> output-foods-%1.txt
grep "^2922" %1 >> output-foods-%1.txt
grep "^4404" %1 >> output-foods-%1.txt
===
---
[2-2]電機の銘柄を抜き出す方法
データファイルと同じディレクトリにファイル:grep-denki-161.bat をおき、以下のように実行。
grep-denki-161 y081212.txt
抜出結果が以下のファイルに格納。※入力ファイル名によりファイル名が異なる。
output-denki-y081212.txt.txt
grep-denki-161.bat
===
grep "^4062" %1 >> output-denki-%1.txt
grep "^4902" %1 >> output-denki-%1.txt
grep "^6448" %1 >> output-denki-%1.txt
grep "^6479" %1 >> output-denki-%1.txt
grep "^6501" %1 >> output-denki-%1.txt
grep "^6502" %1 >> output-denki-%1.txt
grep "^6503" %1 >> output-denki-%1.txt
grep "^6504" %1 >> output-denki-%1.txt
grep "^6505" %1 >> output-denki-%1.txt
grep "^6506" %1 >> output-denki-%1.txt
grep "^6507" %1 >> output-denki-%1.txt
grep "^6508" %1 >> output-denki-%1.txt
grep "^6513" %1 >> output-denki-%1.txt
grep "^6517" %1 >> output-denki-%1.txt
grep "^6588" %1 >> output-denki-%1.txt
grep "^6590" %1 >> output-denki-%1.txt
grep "^6592" %1 >> output-denki-%1.txt
grep "^6594" %1 >> output-denki-%1.txt
grep "^6621" %1 >> output-denki-%1.txt
grep "^6622" %1 >> output-denki-%1.txt
grep "^6632" %1 >> output-denki-%1.txt
grep "^6641" %1 >> output-denki-%1.txt
grep "^6644" %1 >> output-denki-%1.txt
grep "^6645" %1 >> output-denki-%1.txt
grep "^6651" %1 >> output-denki-%1.txt
grep "^6652" %1 >> output-denki-%1.txt
grep "^6665" %1 >> output-denki-%1.txt
grep "^6674" %1 >> output-denki-%1.txt
grep "^6675" %1 >> output-denki-%1.txt
grep "^6676" %1 >> output-denki-%1.txt
grep "^6678" %1 >> output-denki-%1.txt
grep "^6701" %1 >> output-denki-%1.txt
grep "^6702" %1 >> output-denki-%1.txt
grep "^6703" %1 >> output-denki-%1.txt
grep "^6704" %1 >> output-denki-%1.txt
grep "^6706" %1 >> output-denki-%1.txt
grep "^6707" %1 >> output-denki-%1.txt
grep "^6708" %1 >> output-denki-%1.txt
grep "^6715" %1 >> output-denki-%1.txt
grep "^6718" %1 >> output-denki-%1.txt
grep "^6723" %1 >> output-denki-%1.txt
grep "^6724" %1 >> output-denki-%1.txt
grep "^6727" %1 >> output-denki-%1.txt
grep "^6728" %1 >> output-denki-%1.txt
grep "^6731" %1 >> output-denki-%1.txt
grep "^6737" %1 >> output-denki-%1.txt
grep "^6741" %1 >> output-denki-%1.txt
grep "^6742" %1 >> output-denki-%1.txt
grep "^6744" %1 >> output-denki-%1.txt
grep "^6745" %1 >> output-denki-%1.txt
grep "^6749" %1 >> output-denki-%1.txt
grep "^6751" %1 >> output-denki-%1.txt
grep "^6752" %1 >> output-denki-%1.txt
grep "^6753" %1 >> output-denki-%1.txt
grep "^6754" %1 >> output-denki-%1.txt
grep "^6755" %1 >> output-denki-%1.txt
grep "^6756" %1 >> output-denki-%1.txt
grep "^6758" %1 >> output-denki-%1.txt
grep "^6759" %1 >> output-denki-%1.txt
grep "^6762" %1 >> output-denki-%1.txt
grep "^6763" %1 >> output-denki-%1.txt
grep "^6764" %1 >> output-denki-%1.txt
grep "^6766" %1 >> output-denki-%1.txt
grep "^6767" %1 >> output-denki-%1.txt
grep "^6768" %1 >> output-denki-%1.txt
grep "^6770" %1 >> output-denki-%1.txt
grep "^6771" %1 >> output-denki-%1.txt
grep "^6773" %1 >> output-denki-%1.txt
grep "^6779" %1 >> output-denki-%1.txt
grep "^6788" %1 >> output-denki-%1.txt
grep "^6789" %1 >> output-denki-%1.txt
grep "^6793" %1 >> output-denki-%1.txt
grep "^6794" %1 >> output-denki-%1.txt
grep "^6796" %1 >> output-denki-%1.txt
grep "^6798" %1 >> output-denki-%1.txt
grep "^6800" %1 >> output-denki-%1.txt
grep "^6801" %1 >> output-denki-%1.txt
grep "^6803" %1 >> output-denki-%1.txt
grep "^6804" %1 >> output-denki-%1.txt
grep "^6806" %1 >> output-denki-%1.txt
grep "^6807" %1 >> output-denki-%1.txt
grep "^6809" %1 >> output-denki-%1.txt
grep "^6810" %1 >> output-denki-%1.txt
grep "^6815" %1 >> output-denki-%1.txt
grep "^6816" %1 >> output-denki-%1.txt
grep "^6817" %1 >> output-denki-%1.txt
grep "^6818" %1 >> output-denki-%1.txt
grep "^6820" %1 >> output-denki-%1.txt
grep "^6839" %1 >> output-denki-%1.txt
grep "^6841" %1 >> output-denki-%1.txt
grep "^6844" %1 >> output-denki-%1.txt
grep "^6845" %1 >> output-denki-%1.txt
grep "^6849" %1 >> output-denki-%1.txt
grep "^6850" %1 >> output-denki-%1.txt
grep "^6853" %1 >> output-denki-%1.txt
grep "^6855" %1 >> output-denki-%1.txt
grep "^6856" %1 >> output-denki-%1.txt
grep "^6857" %1 >> output-denki-%1.txt
grep "^6858" %1 >> output-denki-%1.txt
grep "^6859" %1 >> output-denki-%1.txt
grep "^6860" %1 >> output-denki-%1.txt
grep "^6861" %1 >> output-denki-%1.txt
grep "^6866" %1 >> output-denki-%1.txt
grep "^6869" %1 >> output-denki-%1.txt
grep "^6875" %1 >> output-denki-%1.txt
grep "^6877" %1 >> output-denki-%1.txt
grep "^6883" %1 >> output-denki-%1.txt
grep "^6885" %1 >> output-denki-%1.txt
grep "^6900" %1 >> output-denki-%1.txt
grep "^6901" %1 >> output-denki-%1.txt
grep "^6905" %1 >> output-denki-%1.txt
grep "^6910" %1 >> output-denki-%1.txt
grep "^6911" %1 >> output-denki-%1.txt
grep "^6914" %1 >> output-denki-%1.txt
grep "^6915" %1 >> output-denki-%1.txt
grep "^6921" %1 >> output-denki-%1.txt
grep "^6923" %1 >> output-denki-%1.txt
grep "^6924" %1 >> output-denki-%1.txt
grep "^6925" %1 >> output-denki-%1.txt
grep "^6926" %1 >> output-denki-%1.txt
grep "^6927" %1 >> output-denki-%1.txt
grep "^6929" %1 >> output-denki-%1.txt
grep "^6934" %1 >> output-denki-%1.txt
grep "^6935" %1 >> output-denki-%1.txt
grep "^6937" %1 >> output-denki-%1.txt
grep "^6938" %1 >> output-denki-%1.txt
grep "^6941" %1 >> output-denki-%1.txt
grep "^6947" %1 >> output-denki-%1.txt
grep "^6951" %1 >> output-denki-%1.txt
grep "^6952" %1 >> output-denki-%1.txt
grep "^6954" %1 >> output-denki-%1.txt
grep "^6955" %1 >> output-denki-%1.txt
grep "^6958" %1 >> output-denki-%1.txt
grep "^6961" %1 >> output-denki-%1.txt
grep "^6963" %1 >> output-denki-%1.txt
grep "^6965" %1 >> output-denki-%1.txt
grep "^6966" %1 >> output-denki-%1.txt
grep "^6967" %1 >> output-denki-%1.txt
grep "^6971" %1 >> output-denki-%1.txt
grep "^6974" %1 >> output-denki-%1.txt
grep "^6976" %1 >> output-denki-%1.txt
grep "^6981" %1 >> output-denki-%1.txt
grep "^6985" %1 >> output-denki-%1.txt
grep "^6986" %1 >> output-denki-%1.txt
grep "^6989" %1 >> output-denki-%1.txt
grep "^6991" %1 >> output-denki-%1.txt
grep "^6996" %1 >> output-denki-%1.txt
grep "^6997" %1 >> output-denki-%1.txt
grep "^6999" %1 >> output-denki-%1.txt
grep "^7244" %1 >> output-denki-%1.txt
grep "^7276" %1 >> output-denki-%1.txt
grep "^7280" %1 >> output-denki-%1.txt
grep "^7704" %1 >> output-denki-%1.txt
grep "^7718" %1 >> output-denki-%1.txt
grep "^7735" %1 >> output-denki-%1.txt
grep "^7739" %1 >> output-denki-%1.txt
grep "^7751" %1 >> output-denki-%1.txt
grep "^7752" %1 >> output-denki-%1.txt
grep "^7757" %1 >> output-denki-%1.txt
grep "^7999" %1 >> output-denki-%1.txt
grep "^8035" %1 >> output-denki-%1.txt
===
~~~
[3]出力ファイルの検証
新聞から転記したデータとの比較を行った。
日付:20081212
---
[3-1]食品
差異は以下。
===
新聞)
銘柄数:70
以下の2銘柄、終値の転記ミス。my fault
2580,コカコーラセ
2914,JT
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
===
株価データ倉庫)
銘柄数:69:1件少ない。
:「25935 伊藤園 第1種 優先」は入っていない。
---
[3-2]電機
差異は以下。
===
新聞)
銘柄数:161:一致
以下の2銘柄、終値の転記ミス。my fault
6678,テクノメディ
6727,ワコム
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
===
株価データ倉庫)
銘柄数:161:一致
新聞との終値差異は以下。
6927 フェニックス :-1円
6929 日本セラミ :-2円
6645 オムロン :-17円
6839 船井電機 :-19円
6594 日本電産 :-20円
6804 ホシデン :-20円
6963 ローム :-30円
6981 村田製作所 :-90円
---
結論)
:若干差異はあるが、誤差?
:「株価データ倉庫」でいきます。
~~~
end
[0]目的
※現段階としては、[0-2]が主目的。
[0-1]
新聞廃棄で欠落した株価をネットから入手する。
Stock prices missed by the newspaper abandonment are obtained from the net.
:20081110,20081201付、東証一部、食品、電機
[0-2]
新聞から転記するのも大変なので、ネットから株価データを入手する。
Because posting it from the newspaper is also serious, the stock prices data is acquired from the net.
~~~
[1]探索
:現時点の株価をチェックできるサイトは結構ありました。
[東証の株価検索]
http://quote.tse.or.jp/tse/quote.cgi?F=listing/cs00
[asahi.com/ニュース/ビジネス/株価検索/東証業種一覧]
http://stock.asahi.com/search/qsearch.exe?F=asahicom/stock
[ADVFN]:会員登録が必要。無料?内容:未チェック。TODO)
http://jp.advfn.com/p.php?pid=front
:銘柄指定の時系列データもありました。
[株価データ ダウンロード]
http://k-db.com/site/default.aspx
[PanRolling 相場日足場帳]
http://www.panrolling.com/data/
[株価データ倉庫]:2000年からデータがある。
http://www.geocities.co.jp/WallStreet-Stock/9256/data.html
:データはPanRolling 相場日足場帳(東証・大証1・2部の株価データのみ)と同じ形式。
---
現時点で、選択したものは、以下です。
[株価データ倉庫]
http://www.geocities.co.jp/WallStreet-Stock/9256/data.html
日足株価データ
2008年株価データ
http://www.geocities.co.jp/WallStreet-Stock/9256/data2008.htm
:日別にファイルが分かれている。
(2008/12/17, 13:20時点)
y081212.zip
y081211.zip
y081210.zip
y081209.zip
y081208.zip
y081205.zip
y081204.zip
y081203.zip
y081202.zip
y081201.zip
...
:データ更新は、1週間単位か?:未確認。TODO)
---
データ形式は、東証・大証1・2部全銘柄の四本値・出来高。
例)
20081212
1001 日経225 8599 8610 8087 8235 303.249
...
~~~
[2]加工
:ただし、業種単位での抜き出す方法は如何に?
However, how does the pulling out method in each type of business?
:全銘柄の株価データファイルから、各業種ごとの銘柄をgrepして集める。
:Brands of each type of business are done in grep and collected from the stock prices data file of all brands.
grep
http://humanbeing-etcman.blogspot.com/2008/12/win32grep.html
食品の銘柄一覧
STOCK:(2)TSE,ISIN,Foods
http://humanbeing-etcman.blogspot.com/2008/12/stock2tseisinfoods.html
電機の銘柄一覧
STOCK:(3)TSE,ISIN,Electric Appliances
http://humanbeing-etcman.blogspot.com/2008/12/stock3tseisinelectric-appliances.html
---
2008/12/12の株価データファイルを y081212.txt とする。
---
[2-1]食品の銘柄を抜き出す方法
データファイルと同じディレクトリにファイル:grep-foods-69.bat をおき、以下のように実行。
grep-foods-69 y081212.txt
抜出結果が以下のファイルに格納。※入力ファイル名によりファイル名が異なる。
output-foods-y081212.txt.txt
grep-foods-69.bat
===
grep "^2001" %1 >> output-foods-%1.txt
grep "^2002" %1 >> output-foods-%1.txt
grep "^2003" %1 >> output-foods-%1.txt
grep "^2004" %1 >> output-foods-%1.txt
grep "^2009" %1 >> output-foods-%1.txt
grep "^2051" %1 >> output-foods-%1.txt
grep "^2052" %1 >> output-foods-%1.txt
grep "^2053" %1 >> output-foods-%1.txt
grep "^2056" %1 >> output-foods-%1.txt
grep "^2059" %1 >> output-foods-%1.txt
grep "^2107" %1 >> output-foods-%1.txt
grep "^2108" %1 >> output-foods-%1.txt
grep "^2109" %1 >> output-foods-%1.txt
grep "^2201" %1 >> output-foods-%1.txt
grep "^2202" %1 >> output-foods-%1.txt
grep "^2204" %1 >> output-foods-%1.txt
grep "^2206" %1 >> output-foods-%1.txt
grep "^2207" %1 >> output-foods-%1.txt
grep "^2211" %1 >> output-foods-%1.txt
grep "^2212" %1 >> output-foods-%1.txt
grep "^2215" %1 >> output-foods-%1.txt
grep "^2217" %1 >> output-foods-%1.txt
grep "^2261" %1 >> output-foods-%1.txt
grep "^2262" %1 >> output-foods-%1.txt
grep "^2264" %1 >> output-foods-%1.txt
grep "^2267" %1 >> output-foods-%1.txt
grep "^2281" %1 >> output-foods-%1.txt
grep "^2282" %1 >> output-foods-%1.txt
grep "^2284" %1 >> output-foods-%1.txt
grep "^2286" %1 >> output-foods-%1.txt
grep "^2288" %1 >> output-foods-%1.txt
grep "^2290" %1 >> output-foods-%1.txt
grep "^2292" %1 >> output-foods-%1.txt
grep "^2501" %1 >> output-foods-%1.txt
grep "^2502" %1 >> output-foods-%1.txt
grep "^2503" %1 >> output-foods-%1.txt
grep "^2531" %1 >> output-foods-%1.txt
grep "^2533" %1 >> output-foods-%1.txt
grep "^2536" %1 >> output-foods-%1.txt
grep "^2540" %1 >> output-foods-%1.txt
grep "^2572" %1 >> output-foods-%1.txt
grep "^2578" %1 >> output-foods-%1.txt
grep "^2579" %1 >> output-foods-%1.txt
grep "^2580" %1 >> output-foods-%1.txt
grep "^2590" %1 >> output-foods-%1.txt
grep "^2593" %1 >> output-foods-%1.txt
grep "^2594" %1 >> output-foods-%1.txt
grep "^2597" %1 >> output-foods-%1.txt
grep "^2599" %1 >> output-foods-%1.txt
grep "^2602" %1 >> output-foods-%1.txt
grep "^2607" %1 >> output-foods-%1.txt
grep "^2613" %1 >> output-foods-%1.txt
grep "^2801" %1 >> output-foods-%1.txt
grep "^2802" %1 >> output-foods-%1.txt
grep "^2809" %1 >> output-foods-%1.txt
grep "^2810" %1 >> output-foods-%1.txt
grep "^2811" %1 >> output-foods-%1.txt
grep "^2812" %1 >> output-foods-%1.txt
grep "^2815" %1 >> output-foods-%1.txt
grep "^2871" %1 >> output-foods-%1.txt
grep "^2875" %1 >> output-foods-%1.txt
grep "^2897" %1 >> output-foods-%1.txt
grep "^2899" %1 >> output-foods-%1.txt
grep "^2908" %1 >> output-foods-%1.txt
grep "^2910" %1 >> output-foods-%1.txt
grep "^2914" %1 >> output-foods-%1.txt
grep "^2918" %1 >> output-foods-%1.txt
grep "^2922" %1 >> output-foods-%1.txt
grep "^4404" %1 >> output-foods-%1.txt
===
---
[2-2]電機の銘柄を抜き出す方法
データファイルと同じディレクトリにファイル:grep-denki-161.bat をおき、以下のように実行。
grep-denki-161 y081212.txt
抜出結果が以下のファイルに格納。※入力ファイル名によりファイル名が異なる。
output-denki-y081212.txt.txt
grep-denki-161.bat
===
grep "^4062" %1 >> output-denki-%1.txt
grep "^4902" %1 >> output-denki-%1.txt
grep "^6448" %1 >> output-denki-%1.txt
grep "^6479" %1 >> output-denki-%1.txt
grep "^6501" %1 >> output-denki-%1.txt
grep "^6502" %1 >> output-denki-%1.txt
grep "^6503" %1 >> output-denki-%1.txt
grep "^6504" %1 >> output-denki-%1.txt
grep "^6505" %1 >> output-denki-%1.txt
grep "^6506" %1 >> output-denki-%1.txt
grep "^6507" %1 >> output-denki-%1.txt
grep "^6508" %1 >> output-denki-%1.txt
grep "^6513" %1 >> output-denki-%1.txt
grep "^6517" %1 >> output-denki-%1.txt
grep "^6588" %1 >> output-denki-%1.txt
grep "^6590" %1 >> output-denki-%1.txt
grep "^6592" %1 >> output-denki-%1.txt
grep "^6594" %1 >> output-denki-%1.txt
grep "^6621" %1 >> output-denki-%1.txt
grep "^6622" %1 >> output-denki-%1.txt
grep "^6632" %1 >> output-denki-%1.txt
grep "^6641" %1 >> output-denki-%1.txt
grep "^6644" %1 >> output-denki-%1.txt
grep "^6645" %1 >> output-denki-%1.txt
grep "^6651" %1 >> output-denki-%1.txt
grep "^6652" %1 >> output-denki-%1.txt
grep "^6665" %1 >> output-denki-%1.txt
grep "^6674" %1 >> output-denki-%1.txt
grep "^6675" %1 >> output-denki-%1.txt
grep "^6676" %1 >> output-denki-%1.txt
grep "^6678" %1 >> output-denki-%1.txt
grep "^6701" %1 >> output-denki-%1.txt
grep "^6702" %1 >> output-denki-%1.txt
grep "^6703" %1 >> output-denki-%1.txt
grep "^6704" %1 >> output-denki-%1.txt
grep "^6706" %1 >> output-denki-%1.txt
grep "^6707" %1 >> output-denki-%1.txt
grep "^6708" %1 >> output-denki-%1.txt
grep "^6715" %1 >> output-denki-%1.txt
grep "^6718" %1 >> output-denki-%1.txt
grep "^6723" %1 >> output-denki-%1.txt
grep "^6724" %1 >> output-denki-%1.txt
grep "^6727" %1 >> output-denki-%1.txt
grep "^6728" %1 >> output-denki-%1.txt
grep "^6731" %1 >> output-denki-%1.txt
grep "^6737" %1 >> output-denki-%1.txt
grep "^6741" %1 >> output-denki-%1.txt
grep "^6742" %1 >> output-denki-%1.txt
grep "^6744" %1 >> output-denki-%1.txt
grep "^6745" %1 >> output-denki-%1.txt
grep "^6749" %1 >> output-denki-%1.txt
grep "^6751" %1 >> output-denki-%1.txt
grep "^6752" %1 >> output-denki-%1.txt
grep "^6753" %1 >> output-denki-%1.txt
grep "^6754" %1 >> output-denki-%1.txt
grep "^6755" %1 >> output-denki-%1.txt
grep "^6756" %1 >> output-denki-%1.txt
grep "^6758" %1 >> output-denki-%1.txt
grep "^6759" %1 >> output-denki-%1.txt
grep "^6762" %1 >> output-denki-%1.txt
grep "^6763" %1 >> output-denki-%1.txt
grep "^6764" %1 >> output-denki-%1.txt
grep "^6766" %1 >> output-denki-%1.txt
grep "^6767" %1 >> output-denki-%1.txt
grep "^6768" %1 >> output-denki-%1.txt
grep "^6770" %1 >> output-denki-%1.txt
grep "^6771" %1 >> output-denki-%1.txt
grep "^6773" %1 >> output-denki-%1.txt
grep "^6779" %1 >> output-denki-%1.txt
grep "^6788" %1 >> output-denki-%1.txt
grep "^6789" %1 >> output-denki-%1.txt
grep "^6793" %1 >> output-denki-%1.txt
grep "^6794" %1 >> output-denki-%1.txt
grep "^6796" %1 >> output-denki-%1.txt
grep "^6798" %1 >> output-denki-%1.txt
grep "^6800" %1 >> output-denki-%1.txt
grep "^6801" %1 >> output-denki-%1.txt
grep "^6803" %1 >> output-denki-%1.txt
grep "^6804" %1 >> output-denki-%1.txt
grep "^6806" %1 >> output-denki-%1.txt
grep "^6807" %1 >> output-denki-%1.txt
grep "^6809" %1 >> output-denki-%1.txt
grep "^6810" %1 >> output-denki-%1.txt
grep "^6815" %1 >> output-denki-%1.txt
grep "^6816" %1 >> output-denki-%1.txt
grep "^6817" %1 >> output-denki-%1.txt
grep "^6818" %1 >> output-denki-%1.txt
grep "^6820" %1 >> output-denki-%1.txt
grep "^6839" %1 >> output-denki-%1.txt
grep "^6841" %1 >> output-denki-%1.txt
grep "^6844" %1 >> output-denki-%1.txt
grep "^6845" %1 >> output-denki-%1.txt
grep "^6849" %1 >> output-denki-%1.txt
grep "^6850" %1 >> output-denki-%1.txt
grep "^6853" %1 >> output-denki-%1.txt
grep "^6855" %1 >> output-denki-%1.txt
grep "^6856" %1 >> output-denki-%1.txt
grep "^6857" %1 >> output-denki-%1.txt
grep "^6858" %1 >> output-denki-%1.txt
grep "^6859" %1 >> output-denki-%1.txt
grep "^6860" %1 >> output-denki-%1.txt
grep "^6861" %1 >> output-denki-%1.txt
grep "^6866" %1 >> output-denki-%1.txt
grep "^6869" %1 >> output-denki-%1.txt
grep "^6875" %1 >> output-denki-%1.txt
grep "^6877" %1 >> output-denki-%1.txt
grep "^6883" %1 >> output-denki-%1.txt
grep "^6885" %1 >> output-denki-%1.txt
grep "^6900" %1 >> output-denki-%1.txt
grep "^6901" %1 >> output-denki-%1.txt
grep "^6905" %1 >> output-denki-%1.txt
grep "^6910" %1 >> output-denki-%1.txt
grep "^6911" %1 >> output-denki-%1.txt
grep "^6914" %1 >> output-denki-%1.txt
grep "^6915" %1 >> output-denki-%1.txt
grep "^6921" %1 >> output-denki-%1.txt
grep "^6923" %1 >> output-denki-%1.txt
grep "^6924" %1 >> output-denki-%1.txt
grep "^6925" %1 >> output-denki-%1.txt
grep "^6926" %1 >> output-denki-%1.txt
grep "^6927" %1 >> output-denki-%1.txt
grep "^6929" %1 >> output-denki-%1.txt
grep "^6934" %1 >> output-denki-%1.txt
grep "^6935" %1 >> output-denki-%1.txt
grep "^6937" %1 >> output-denki-%1.txt
grep "^6938" %1 >> output-denki-%1.txt
grep "^6941" %1 >> output-denki-%1.txt
grep "^6947" %1 >> output-denki-%1.txt
grep "^6951" %1 >> output-denki-%1.txt
grep "^6952" %1 >> output-denki-%1.txt
grep "^6954" %1 >> output-denki-%1.txt
grep "^6955" %1 >> output-denki-%1.txt
grep "^6958" %1 >> output-denki-%1.txt
grep "^6961" %1 >> output-denki-%1.txt
grep "^6963" %1 >> output-denki-%1.txt
grep "^6965" %1 >> output-denki-%1.txt
grep "^6966" %1 >> output-denki-%1.txt
grep "^6967" %1 >> output-denki-%1.txt
grep "^6971" %1 >> output-denki-%1.txt
grep "^6974" %1 >> output-denki-%1.txt
grep "^6976" %1 >> output-denki-%1.txt
grep "^6981" %1 >> output-denki-%1.txt
grep "^6985" %1 >> output-denki-%1.txt
grep "^6986" %1 >> output-denki-%1.txt
grep "^6989" %1 >> output-denki-%1.txt
grep "^6991" %1 >> output-denki-%1.txt
grep "^6996" %1 >> output-denki-%1.txt
grep "^6997" %1 >> output-denki-%1.txt
grep "^6999" %1 >> output-denki-%1.txt
grep "^7244" %1 >> output-denki-%1.txt
grep "^7276" %1 >> output-denki-%1.txt
grep "^7280" %1 >> output-denki-%1.txt
grep "^7704" %1 >> output-denki-%1.txt
grep "^7718" %1 >> output-denki-%1.txt
grep "^7735" %1 >> output-denki-%1.txt
grep "^7739" %1 >> output-denki-%1.txt
grep "^7751" %1 >> output-denki-%1.txt
grep "^7752" %1 >> output-denki-%1.txt
grep "^7757" %1 >> output-denki-%1.txt
grep "^7999" %1 >> output-denki-%1.txt
grep "^8035" %1 >> output-denki-%1.txt
===
~~~
[3]出力ファイルの検証
新聞から転記したデータとの比較を行った。
日付:20081212
---
[3-1]食品
差異は以下。
===
新聞)
銘柄数:70
以下の2銘柄、終値の転記ミス。my fault
2580,コカコーラセ
2914,JT
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
===
株価データ倉庫)
銘柄数:69:1件少ない。
:「25935 伊藤園 第1種 優先」は入っていない。
---
[3-2]電機
差異は以下。
===
新聞)
銘柄数:161:一致
以下の2銘柄、終値の転記ミス。my fault
6678,テクノメディ
6727,ワコム
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
===
株価データ倉庫)
銘柄数:161:一致
新聞との終値差異は以下。
6927 フェニックス :-1円
6929 日本セラミ :-2円
6645 オムロン :-17円
6839 船井電機 :-19円
6594 日本電産 :-20円
6804 ホシデン :-20円
6963 ローム :-30円
6981 村田製作所 :-90円
---
結論)
:若干差異はあるが、誤差?
:「株価データ倉庫」でいきます。
~~~
end
Win32,grep
[1]前提
win32 でコマンドとして grep を使用したい。
テキストファイル(複数指定可)から特定文字で一致する行を抜き出すもの。
UNIXではおなじみです。
---
エディタ:秀丸のgrepは大変お世話になっています。
cygwinも以前使用したが、インストが大変なので、
単独の grep.exe を探す。
~~~
[2]探索
秀丸のgrepはいずこ?
:C:\Program Files\Hidemaru に単独*.exeはなかった???
---
google 検索:grep win32
http://gnuwin32.sourceforge.net/packages/grep.htm
grep-2.5.3-bin.zip
実行時に*.dllがなかったので、すなおに?setupを選択。
grep-2.5.3-setup.exe
環境変数のPATHに以下を追加。
C:\Program Files\GnuWin32\bin
~~~
[3]動作確認
以下のファイルがあります。
ファイル:y081212.txt ※「株価データ倉庫」を使用。後述予定。
===
20081212
1001 日経225 8599 8610 8087 8235 303.249
1002 東証指数 839 843 799 813 303.249
1003 NY円相場 9024 9024 9024 9024 0
1007 東京円相場 9024 9024 9024 9024 0
1008 円ユーロ 12066 12066 12066 12066 0
...
===
[3-1]「2001」で検索。
grep 2001 y081212.txt
2001 日本製粉 469 473 450 461 690
2423 ジェイエムテ 20010 20010 19500 19500 0.009
2477 比較.com 20000 20010 20000 20010 0.004
6790 野田スクリー 19910 20010 19160 19910 0.15
[3-2]「2001」を先頭の銘柄コードでのみ検索したい。
grep "^2001" y081212.txt
2001 日本製粉 469 473 450 461 690
:これでいきます。
~~~
end
win32 でコマンドとして grep を使用したい。
テキストファイル(複数指定可)から特定文字で一致する行を抜き出すもの。
UNIXではおなじみです。
---
エディタ:秀丸のgrepは大変お世話になっています。
cygwinも以前使用したが、インストが大変なので、
単独の grep.exe を探す。
~~~
[2]探索
秀丸のgrepはいずこ?
:C:\Program Files\Hidemaru に単独*.exeはなかった???
---
google 検索:grep win32
http://gnuwin32.sourceforge.net/packages/grep.htm
grep-2.5.3-bin.zip
実行時に*.dllがなかったので、すなおに?setupを選択。
grep-2.5.3-setup.exe
環境変数のPATHに以下を追加。
C:\Program Files\GnuWin32\bin
~~~
[3]動作確認
以下のファイルがあります。
ファイル:y081212.txt ※「株価データ倉庫」を使用。後述予定。
===
20081212
1001 日経225 8599 8610 8087 8235 303.249
1002 東証指数 839 843 799 813 303.249
1003 NY円相場 9024 9024 9024 9024 0
1007 東京円相場 9024 9024 9024 9024 0
1008 円ユーロ 12066 12066 12066 12066 0
...
===
[3-1]「2001」で検索。
grep 2001 y081212.txt
2001 日本製粉 469 473 450 461 690
2423 ジェイエムテ 20010 20010 19500 19500 0.009
2477 比較.com 20000 20010 20000 20010 0.004
6790 野田スクリー 19910 20010 19160 19910 0.15
[3-2]「2001」を先頭の銘柄コードでのみ検索したい。
grep "^2001" y081212.txt
2001 日本製粉 469 473 450 461 690
:これでいきます。
~~~
end
2008年12月15日月曜日
Power Law:(33)STOCK,Last Price Incorrect...
ネットから欠落した日の株価を探している段階で発見した。
It discovered it at the stage in which it looked for stock prices on the day
missed from the net.
東証一部、食品、電機の終値を新聞から転記した際、以下の銘柄で誤り発見!
今までの「べき乗則」のパターンが破綻した。
When the closing share price of first section of the Tokyo Stock Exchange, Food,
and the Electric Appliances is posted from the newspaper, it mistakes because of the
following brands and it discovers it.
The pattern of the current "Power Law" failed.
記事には、B,Y銘柄は100円単位と明記していた。
B and Y brand were described clearly in the article every 100 yen.
~~~
[1]食品,20081212時点,Foods at 2008/12/12.
前,before)
2580,コカコーラセ,6540
2914,JT,3110
後,after)
2580,コカコーラセ,654000
2914,JT,311000
~~~
[2]電機,20081212時点,Electric Appliances at 2008/12/12.
前,before)
6678,テクノメディ,2050
6727,ワコム,890
後,after)
6678,テクノメディ,205000
6727,ワコム,89000
~~~
これからどうするか?
How will you do in the future?
[次なるプラン,The next plan]
失敗は成功の元?
順番の上位と下位で二極化している模様。
ならば、今回誤った上位の株価を削除した場合、後半部分の傾向として、今まで検討したパターンが生きないか?
The failure is an origin of the success.
It seems to polarize by the high rank and the subordinate position of order.
Then, when you delete stock prices of the title after it mistakes it
this time, Is not the pattern that has been examined up to now effective as the
tendency in the latter half part?
~~~
end
It discovered it at the stage in which it looked for stock prices on the day
missed from the net.
東証一部、食品、電機の終値を新聞から転記した際、以下の銘柄で誤り発見!
今までの「べき乗則」のパターンが破綻した。
When the closing share price of first section of the Tokyo Stock Exchange, Food,
and the Electric Appliances is posted from the newspaper, it mistakes because of the
following brands and it discovers it.
The pattern of the current "Power Law" failed.
記事には、B,Y銘柄は100円単位と明記していた。
B and Y brand were described clearly in the article every 100 yen.
~~~
[1]食品,20081212時点,Foods at 2008/12/12.
前,before)
2580,コカコーラセ,6540
2914,JT,3110
後,after)
2580,コカコーラセ,654000
2914,JT,311000
~~~
[2]電機,20081212時点,Electric Appliances at 2008/12/12.
前,before)
6678,テクノメディ,2050
6727,ワコム,890
後,after)
6678,テクノメディ,205000
6727,ワコム,89000
~~~
これからどうするか?
How will you do in the future?
[次なるプラン,The next plan]
失敗は成功の元?
順番の上位と下位で二極化している模様。
ならば、今回誤った上位の株価を削除した場合、後半部分の傾向として、今まで検討したパターンが生きないか?
The failure is an origin of the success.
It seems to polarize by the high rank and the subordinate position of order.
Then, when you delete stock prices of the title after it mistakes it
this time, Is not the pattern that has been examined up to now effective as the
tendency in the latter half part?
~~~
end
2008年12月14日日曜日
Power Law:(32)STOCK,B-5A-Fn,(2)
(2008/12/15)
終値に誤り発見!Power Law:(33)を参照。再トライ,TODO)
Mistakes to the closing share price!Refer to Power Law:(33). Re-trial and TODO)
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
(2008/12/07-)
東証の食品、電機の株価の日別べき乗傾向を引き続き探る。
It continuously searches for the Power Law tendency to stock prices of the
Food and Electric Appliances of Tokyo Stock Exchange according to the day.
~~~
[1]
A-Bの散布図の傾き5をゼロにしたA値の日別推移を見る。
The transition of A value in which inclination 5 of the scatter chart of A-B is
adjusted to 0 according to the day is seen.

~~~
[2]
これで、A値の推移は、フィボナッチ数の基準線からの変位としてみることになる。
In this, the transition of A value will be seen as displacement from the base point
lines of the number of Fibonacci.

:この変位が、タイトルのB-5A-Fnである。
:This displacement is B-5A-Fn of the title.
~~~
[3]
基準線からの前後のフィボナッチ数との関係をみるために、その変位は以下となる。
To see the relation to the number of Fibonacci before and behind the base point line,
the displacement becomes the following.

~~~
[4]
変位を相対値としてみた場合、以下の係数を省略する。
When displacement is seen as a relative value, the following coefficients are omitted.
=SIN((90 - ATAN(5)*180/PI())*PI()/180)
=0.196116135

~~~
[5]
食品のAの変位は以下。
The displacement of A of Food is the following.

:20081110、20081201は手持ちデータが欠落した。
:1つはリサイクルで廃棄。もう1つはレジ袋の代用で廃棄。いずれも、ネットでデータ収集が必要。TODO)
:欠落したデータのプロットは想定内ではある。
:Data reserves was missed to 20081110 and 20081201.
:One is abandoned by recycling. Another one is abandoned by substituting the plastic bag.
Both data collections are necessary in the net.
:The plot of the missed data is in assumption.
---
[図の考察,Consideration of figure]
2つの波が見える。1つは全体に大きく増加して減少するもの。もう1つは3つのうねりで反対方向に引っ張る力が働いている。
Two waves are seen. It increases greatly and one decreases in the whole. Power to pull another one in the counter direction by three undulations works.
~~~
[6]
電機のAの変位は以下。
The displacement of A of Electric Appliances is the following.
[6-1]

:20081113にR^2の最高値が順位の前と後に分かれた。前半を採用した。いずれが正しいか?
:The highest value of R^2 divided into 20081113 ahead of the order and after. The
first half was adopted. Which is correct?
---
[6-2]

:20081113にR^2の最高値が順位の前と後に分かれた。後半を採用した。いずれが正しいか?
:The highest value of R^2 divided into 20081113 ahead of the order and after. The
latter half was adopted. Which is correct?
---
[図の考察,Consideration of figure]
アメリカ大統領選挙近辺のインパクトから減衰して、ある値に収束しているようにみえる。
It attenuates from the impact in the vicinity of an American presidential
election, and it seems to settle to a certain value.
20081215のマーケットの動きで、いずれの方向に振れるか?別の新たなるインパクトになるか?
In which direction do you swing in the movement of the market of 20081215?Do it
become another new impact?
~~~
[7]
20081214付の道新で、来週の動きが出ていた。
Next week's movement had gone out by the Hokkaido newspaper of 20081214 applying.

:...日米で重要な経済指標の発表が予定されており、内容によっては8000円も割り込みそうだ...
:...The announcement of an important economic indicator is scheduled in Japan-U.S...
~~~
end
終値に誤り発見!Power Law:(33)を参照。再トライ,TODO)
Mistakes to the closing share price!Refer to Power Law:(33). Re-trial and TODO)
http://humanbeing-etcman.blogspot.com/2008/12/power-law33stocklast-price-incorrect.html
(2008/12/07-)
東証の食品、電機の株価の日別べき乗傾向を引き続き探る。
It continuously searches for the Power Law tendency to stock prices of the
Food and Electric Appliances of Tokyo Stock Exchange according to the day.
~~~
[1]
A-Bの散布図の傾き5をゼロにしたA値の日別推移を見る。
The transition of A value in which inclination 5 of the scatter chart of A-B is
adjusted to 0 according to the day is seen.
~~~
[2]
これで、A値の推移は、フィボナッチ数の基準線からの変位としてみることになる。
In this, the transition of A value will be seen as displacement from the base point
lines of the number of Fibonacci.
:この変位が、タイトルのB-5A-Fnである。
:This displacement is B-5A-Fn of the title.
~~~
[3]
基準線からの前後のフィボナッチ数との関係をみるために、その変位は以下となる。
To see the relation to the number of Fibonacci before and behind the base point line,
the displacement becomes the following.
~~~
[4]
変位を相対値としてみた場合、以下の係数を省略する。
When displacement is seen as a relative value, the following coefficients are omitted.
=SIN((90 - ATAN(5)*180/PI())*PI()/180)
=0.196116135
~~~
[5]
食品のAの変位は以下。
The displacement of A of Food is the following.

:20081110、20081201は手持ちデータが欠落した。
:1つはリサイクルで廃棄。もう1つはレジ袋の代用で廃棄。いずれも、ネットでデータ収集が必要。TODO)
:欠落したデータのプロットは想定内ではある。
:Data reserves was missed to 20081110 and 20081201.
:One is abandoned by recycling. Another one is abandoned by substituting the plastic bag.
Both data collections are necessary in the net.
:The plot of the missed data is in assumption.
---
[図の考察,Consideration of figure]
2つの波が見える。1つは全体に大きく増加して減少するもの。もう1つは3つのうねりで反対方向に引っ張る力が働いている。
Two waves are seen. It increases greatly and one decreases in the whole. Power to pull another one in the counter direction by three undulations works.
~~~
[6]
電機のAの変位は以下。
The displacement of A of Electric Appliances is the following.
[6-1]

:20081113にR^2の最高値が順位の前と後に分かれた。前半を採用した。いずれが正しいか?
:The highest value of R^2 divided into 20081113 ahead of the order and after. The
first half was adopted. Which is correct?
---
[6-2]

:20081113にR^2の最高値が順位の前と後に分かれた。後半を採用した。いずれが正しいか?
:The highest value of R^2 divided into 20081113 ahead of the order and after. The
latter half was adopted. Which is correct?
---
[図の考察,Consideration of figure]
アメリカ大統領選挙近辺のインパクトから減衰して、ある値に収束しているようにみえる。
It attenuates from the impact in the vicinity of an American presidential
election, and it seems to settle to a certain value.
20081215のマーケットの動きで、いずれの方向に振れるか?別の新たなるインパクトになるか?
In which direction do you swing in the movement of the market of 20081215?Do it
become another new impact?
~~~
[7]
20081214付の道新で、来週の動きが出ていた。
Next week's movement had gone out by the Hokkaido newspaper of 20081214 applying.
:...日米で重要な経済指標の発表が予定されており、内容によっては8000円も割り込みそうだ...
:...The announcement of an important economic indicator is scheduled in Japan-U.S...
~~~
end
登録:
投稿 (Atom)