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

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

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

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

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

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

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