2008年5月18日日曜日

ありま、ARIMA hack(0)

Nth prime の残差を時系列解析する流れで、時系列解析の[にわか仕立て解法]を別立てにする。
まずはモチベーションを高めるために、プロジェクト名を決める。名前は大事。
分類名を何にするかを決めかねていた。
~~~
とりあえず、ARIMAを使いたい。
ARIMA:ありま、アリマ、ありーま、、、、関係ないけど、有馬とか、、、音の響きがここちよい?

案)
[1]ARIMAの一夜づけ
 ※まだ、Nth primeの残差が線形であるとは断定していない、、、
[2]ARIMAの一夜干し

~~~
たまたま、
Google Maps Hacks -地図検索サービス徹底活用テクニック- (単行本(ソフトカバー)) Rich Gibson (著), Schuyler Erle (著), 武舎 広幸 (翻訳), 福地 太郎 (翻訳), 武舎 るみ (翻訳)
の
[はじめに]で、hackが、”ある問題に対する[にわか仕立ての]解決法や、、、”から、

~~~
本件は、
[arima hack] に決定する。

~~~
本件の仕込みデータは、以下。
=>現段階までにチェックした本を列記。

<DO図書館> :2008/04/xx
[1]考える技術としての統計学―生活・ビジネス・投資に生かす (NHKブックス 1101) (単行本) 飯田 泰之 (著)
一言コメント:初めて、ARIMAを知りました。本当の初心者にわかりやすい。
***
<以下、SA図書館> :2008/05/xx:now
[2]Excelでやさしく学ぶ時系列―明日を支配する時系列 (単行本) 石村 貞夫 (著), ステファニー リヒャルト (著)
一言コメント:最後は、SPSSの流れになる。Excelで入り口から中をのぞいた感じ。

[3]時系列解析入門 (単行本) 北川 源四郎 (著)
一言コメント:数式がメイン。現時点では、スキップ。あとから、挑戦したい。

[4]SGCライブラリ 19臨時別冊・数理科学2002年12月「時系列解析入門」~ 線形システムから非線形システムへ ~宮野尚哉(弘前大学准教授) 著
一言コメント:なにか流れがつかめたような、、、

~~~
当面、やることは、

[1]分析ツールの用意

[2]テストデータの用意 ※ベンチマークデータに使用。
=>白色ノイズ
=>擬似AR(n)データ:???
=>カオスデータ (ローレンツ?等)

[3]テストデータによる分析ツールの特徴を把握

[4]Nth prime残差を分析ツールに適用
 =>AR,MA,ARMA,ARIMAが有効か?
 =>カオスか?
 を見極めたい、、、
~~~
(以下、英語に変換: by excite) :modified a little...
~~~
The rest error of Nth prime is made and the rapid tailoring method of the time series analysis is made another to set up by the flow that analyzes the time series. To improve motivation first of all, the project name is decided. The name is important. Whether the distinguished name was made what was not able to be decided.
~~~
I want to use ARIMA for the time being.
ARIMA: It is, and is it and is the sound of Arima or the sound ..reeling.. .., alima.. ..rolling.. comfortable though it is ..,.. unrelated?

Idea)
[1]Cram of ARIMA- It is not concluded that the rest error of Nth prime is linear still.
[2]It dries it at night of ARIMA.
~~~
By chance ) Google Maps Hacks
Takeshi Hiroyuki (translation), Taro Fukuchi (translation), and Takeshi ..Rich Gibson (.. ..writing.. ..Schuyler Erle (.. ..writing..
seeing (translation)Introduction and hack :
from "Solution of a rapid tailoring to the problem of it is".
~~~
This case
It decides it to arima hack.
~~~
The training data of this case : as follows.
The book checked until the present stage is enumerated

@@@ here. @@@

~~~
Now, doing :.
[1]Preparation for analytical tool
[2]It uses it for preparation * bench mark data of the test data.
=>White noise
=>PseudoAR(n) data?
=>Chaos data(Lorenz?)
[3]The feature of the analytical tool by the test data is understood.
[4]The Nth prime rest error is applied to the analytical tool.
=> AR, MA, ARMA, and ARIMA effective?
=Is it > chaos?I want to ascertain.

end

2008年5月12日月曜日

n,fitVal,diffでdiffをみる、その後

Nth prime from 10^1 to 10^18
で、
diff のパターンを探る。
~~~
n, fitVal, diff, diff2=LN(diff(n)/diff(n=1))
1, 0.016697271, 7.10543E-15
2, 0.118285099, 1.13687E-13, 2.772588722 = LN(1.13687E-13/7.10543E-15)
3, 0.133713395, 9.09495E-13, 4.852030264
4, 0.133937284, 1.45519E-11, 7.624618986
5, 0.134500591, 4.65661E-10, 11.09035489
6, 0.135418895, 3.72529E-09, 13.16979643
7, 0.136435938, 5.96046E-08, 15.94238515
8, 0.137127055, 2.38419E-07, 17.32867951
9, 0.137635663, 7.62939E-06, 20.79441542
10, 0.137960709, 3.05176E-05, 22.18070978
11, 0.138136724, 0.000488281, 24.9532985
12, 0.138191928, 0.00390625, 27.03274004
13, 0.138152185, 0.0625, 29.80532876
14, 0.138038091, 1, 32.57791749
15, 0.137866058, 8, 34.65735903
16, 0.137649034, 64, 36.73680057
17, 0.137397218, 512, 38.81624211
18, 0.137118652, 8192, 41.58883083 =LN(8192/7.10543E-15)

~~~
diff2 をグラフ化すると、線形になった。

Excelの近似を使用。


~~~
prime3, Clawson's Pn も線形であるが、パラメータは若干異なる。

y = ax + b

[prime] Nth prime from 10^1 to 10^18

a = 2.4107
b = -1.6411

[prime3] Nth prime from 10^1 to 10^25

a = 2.3992
b = -1.5729

[Clawson's Pn] Nth prime from 10^1 to 10^100

a = 2.3311
b = 0.3961

~~~
[in prime]

MIN = 7.11e-15
a = 2.4107
b = -1.6411

diffAdj = MIN * exp(a * LOG(n) + b)

~~~
Nth prime from 1 to 1000,

diff and diffx(= diff - diffAdj) のグラフは以下。

(sosuu-fitVal-out-level-20-withsin-withdiff-so-from-2-.txt)

※前までは、level-9 までで、今回2~、level-20で行った。fitValの探索桁数が9->20にしたという話。

[diff] Nth prime from 6th to 1000th.

[diffx] Nth prime from 6th to 1000th.
~~~
n=5th で diff=特異点??? これは何か?

(sosuu-fitVal-out-level-20-withsin-withdiff-so-from-2-.txt)
n=1th to 5th まで、fitVal<0で、n=5thで突然、diffがピークをむかえる、、、何か?

~~~

久々に、fitValのグラフを見る。 これらは、昨年からのものを、いまだ整理していない、、、

時系列?で表現できないかなぁ・・・



end

2008年5月7日水曜日

Calvin C. Clawson's Pn、fitValをグラフにすると

(memo:sosuu-fitVal-out-level-20-withsin-withdiff-so-20080505-2116-Clawson-p208.xls)


Clawson's Pn のグラフ
~~~
[1]fitValの傾向(x=10^n,y=fitVal) ,range=ALL(from n=1 to n=100)

[2]fitValの傾向(x=10^n,y=fitVal) ,range=(from n=2 to n=100)

[3]fitValの傾向(x=10^n,y=fitVal) ,range=(from n=4 to n=100)
end

Calvin C. Clawson's Pnで、1e100までのfitValを求める

今週は、DO図書館から、
「数学の不思議―数の意味と美しさ 」2005/05/25
カルヴィン・C. クロースン (著), Calvin C. Clawson (原著), 好田 順治 (翻訳)
を借りている。
~~~
Mathematical Mysteries: The Beauty and Magic of Numbers
by Calvin C. Clawson (Author)
~~~
これは、素数の本だ。

全部読みきれていないが、
日本語版、p.208に、
n番目の素数計算式があった。

1e100までのfitValの傾向を探る目安を得てみる。

Pn~n*ln(n) + n(ln(ln(n)) - 1)

~~~
(memo:sosuu-fitVal-out-level-20-withsin-withdiff-so-20080505-2116-Clawson-p208.txt)

n, Pn, fitVal, diff
10, 2.13661753824200000000E01, 0.6768087999184148, 3.552713678800501E-15
100, 5.13234981179599000000E02, 0.1794684563433643, 1.1368683772161603E-13
1000, 7.84040001289820000000E03, 0.14290452716961893, 9.094947017729282E-13
10000, 1.04306671783440000000E05, 0.13719061625914533, 1.4551915228366852E-11
100000, 1.29563958226523000000E06, 0.13680719083338835, 2.3283064365386963E-10
1000000, 1.54413024724403000000E07, 0.1374023802269421, 1.862645149230957E-9
10000000, 1.78980382452616000000E08, 0.13805663577906238, 2.9802322387695312E-8
100000000, 2.03341547308802000000E09, 0.1385617016935984, 4.76837158203125E-7
1000000000, 2.27545228595306000000E10, 0.13889080815918026, 3.814697265625E-6
10000000000, 2.51624684681825000000E11, 0.1390638633185092, 6.103515625E-5
1E11, 2.75603637409808000000E12, 0.1391095612478985, 9.765625E-4
1E12, 2.99499602109645000000E13, 0.13905464469761267, 0.0078125
1E13, 3.23325880116321000000E14, 0.1389213966174301, 0.0625
1E14, 3.47092810767799000000E15, 0.13872763601437535, 1.0
1E15, 3.70808590412608000000E16, 0.13848738587885942, 8.0
1E16, 3.94479826553925000000E17, 0.13821162351736357, 128.0
1E17, 4.18111923702030000000E18, 0.13790893907273943, 512.0
1E18, 4.41709358770369000000E19, 0.13758606781877572, 16384.0
1E19, 4.65275881913013000000E20, 0.13724830614579822, 131072.0
1E20, 4.88814665786829000000E21, 0.13689983215457574, 2097152.0
1E21, 5.12328418358463000000E22, 0.1365439516230145, 8388608.0
1E22, 5.35819469444753000000E23, 0.1361832867838571, 6.7108864E7
1E23, 5.59289838000402000000E24, 0.13581992163815942, 1.073741824E9
1E24, 5.82741285074530000000E25, 0.13545551429782482, 1.7179869184E10
1E25, 6.06175355949673000000E26, 0.13509138427704895, 2.06158430208E11
1E26, 6.29593414011146000000E27, 0.13472858068230514, 2.199023255552E12
1E27, 6.52996668220915000000E28, 0.13436793576971182, 8.796093022208E12
1E28, 6.76386195592564000000E29, 0.1340101072345526, 2.81474976710656E14
1E29, 6.99762959720617000000E30, 0.13365561177635493, 2.251799813685248E15
1E30, 7.23127826167315000000E31, 0.13330485187130453, 9.007199254740992E15
1E31, 7.46481575325485000000E32, 0.1329581372269248, 2.8823037615171174E17
1E32, 7.69824913238572000000E33, 0.13261570205131595, 2.305843009213694E18
1E33, 7.93158480755179000000E34, 0.13227771901104485, 1.8446744073709552E19
1E34, 8.16482861316617000000E35, 0.1319443105561157, 2.9514790517935283E20
1E35, 8.39798587615290000000E36, 0.1316155581415034, 1.1805916207174113E21
1E36, 8.63106147314897000000E37, 0.13129150976056142, 1.888946593147858E22
1E37, 8.86405987986719000000E38, 0.1309721861178092, 1.5111572745182865E23
1E38, 9.09698521387481000000E39, 0.13065758570055366, 1.2089258196146292E24
1E39, 9.32984127181454000000E40, 0.13034768895589027, 3.8685626227668134E25
1E40, 9.56263156191237000000E41, 0.13004246173824066, 1.5474250491067253E26
1E41, 9.79535933247081000000E42, 0.12974185816005143, 1.2379400392853803E27
1E42, 1.00280275969281000000E44, 0.12944582295260273, 1.9807040628566084E28
1E43, 1.02606391559685000000E45, 0.12915429342348902, 3.1691265005705735E29
1E44, 1.04931966170904000000E46, 0.12886720108112265, 3.802951800684688E30
1E45, 1.07257024119750000000E47, 0.12858447298361947, 4.056481920730334E31
1E46, 1.09581588119463000000E48, 0.12830603285897152, 3.2451855365842673E32
1E47, 1.11905679417678000000E49, 0.12803180203505973, 2.5961484292674138E33
1E48, 1.14229317919870000000E50, 0.12776170021118266, 4.153837486827862E34
1E49, 1.16552522300067000000E51, 0.12749564609731093, 1.6615349947311448E35
1E50, 1.18875310100378000000E52, 0.12723355794272745, 3.9876839873547476E36
1E51, 1.21197697820669000000E53, 0.12697535397203802, 2.1267647932558654E37
1E52, 1.23519700999520000000E54, 0.1267209527435739, 1.7014118346046923E38
1E53, 1.25841334287484000000E55, 0.12647027344258335, 2.7222589353675077E39
1E54, 1.28162611513491000000E56, 0.12622323611972644, 2.1778071482940062E40
1E55, 1.30483545745153000000E57, 0.1259797618835978, 5.226737155905615E41
1E56, 1.32804149343650000000E58, 0.12573977305454692, 5.575186299632656E42
1E57, 1.35124434013743000000E59, 0.12550319328605, 2.2300745198530623E43
1E58, 1.37444410849449000000E60, 0.1252699476587417, 1.7840596158824499E44
1E59, 1.39764090375802000000E61, 0.1250399627515378, 8.563486156235759E45
1E60, 1.42083482587113000000E62, 0.12481316669349113, 4.5671926166590716E46
1E61, 1.44402596982058000000E63, 0.12458948919954721, 5.480631139990886E47
1E62, 1.46721442595924000000E64, 0.12436886159278668, 2.9230032746618058E48
1E63, 1.49040028030264000000E65, 0.12415121681544669, 4.6768052394588893E49
1E64, 1.51358361480227000000E66, 0.12393648943055521, 3.7414441915671115E50
1E65, 1.53676450759757000000E67, 0.12372461561584797, 5.9863107065073784E51
1E66, 1.55994303324881000000E68, 0.12351553315125846, 4.7890485652059027E52
1E67, 1.58311926295240000000E69, 0.12330918140118967, 1.915619426082361E53
1E68, 1.60629326474019000000E70, 0.12310550129254343, 3.0649910817317777E54
1E69, 1.62946510366434000000E71, 0.12290443528929489, 7.355978596156267E55
1E70, 1.65263484196881000000E72, 0.12270592736436607, 1.9615942923083377E56
1E71, 1.67580253924867000000E73, 0.12250992296937806, 6.277101735386681E57
1E72, 1.69896825259835000000E74, 0.12231636900276649, 5.0216813883093446E58
1E73, 1.72213203674962000000E75, 0.12212521377671287, 8.034690221294951E59
1E74, 1.74529394420012000000E76, 0.12193640698325996, 3.2138760885179806E60
1E75, 1.76845402533338000000E77, 0.12174989965986842, 7.713302612443153E61
1E76, 1.79161232853082000000E78, 0.12156564415471754, 2.0568806966515076E62
1E77, 1.81476890027643000000E79, 0.12138359409193938, 6.582018229284824E63
1E78, 1.83792378525473000000E80, 0.12120370433696487, 5.2656145834278593E64
1E79, 1.86107702644245000000E81, 0.12102593096213625, 4.2124916667422875E65
1E80, 1.88422866519445000000E82, 0.12085023121270294, 6.73998666678766E66
1E81, 1.90737874132438000000E83, 0.12067656347328344, 5.391989333430128E67
1E82, 1.93052729318024000000E84, 0.12050488723491987, 4.3135914667441024E68
1E83, 1.95367435771550000000E85, 0.12033516306272823, 3.450873173395282E69
1E84, 1.97681997055591000000E86, 0.12016735256423776, 2.7606985387162255E70
1E85, 1.99996416606232000000E87, 0.12000141835844996, 8.834235323891922E71
1E86, 2.02310697738989000000E88, 0.11983732404562834, 7.067388259113537E72
1E87, 2.04624843654385000000E89, 0.11967503417785778, 2.826955303645415E73
1E88, 2.06938857443202000000E90, 0.11951451423038856, 4.523128485832664E74
1E89, 2.09252742091450000000E91, 0.11935573057374042, 7.237005577332262E75
1E90, 2.11566500485042000000E92, 0.11919865044662085, 2.894802230932905E76
1E91, 2.13880135414223000000E93, 0.11904324192960444, 9.263367138985296E77
1E92, 2.16193649577749000000E94, 0.11888947391960521, 3.7053468555941183E78
1E93, 2.18507045586847000000E95, 0.11873731610510381, 2.9642774844752946E79
1E94, 2.20820325968958000000E96, 0.11858673894214515, 4.7428439751604714E80
1E95, 2.23133493171283000000E97, 0.11843771363107584, 7.588550360256754E81
1E96, 2.25446549564144000000E98, 0.11829021209401473, 3.0354201441027017E82
1E97, 2.27759497444174000000E99, 0.11814420695303025, 4.8566722305643227E83
1E98, 2.30072339037335000000E100, 0.11799967150903307, 7.770675568902916E84
1E99, 2.32385076501793000000E101, 0.11785657972133085, 6.216540455122333E85
1E100, 2.34697711930641000000E102, 0.11771490618786012, 9.946464728195733E86


end

2008年5月6日火曜日

10^18 と Cino's prime3での10^25で、fitValを求める(4)

グラフの元ネタデータの
n,fitVal,diff
で、diffをチェックする。

[in case of prime]

~~~
8の倍数になっている? バグ?
***

(グラフはあとで)

~~~
最終的に、式:soに組み込みたい、、、?

10^18 と Cino's prime3での10^25で、fitValを求める(3)

prime3のグラフ
~~~
[1]fitValの傾向(x=n,y=fitVal) ,range=ALL(from n=1 to n=25)
[2]fitValの傾向(x=n,y=fitVal) ,range=(from n=3 to n=25)
[3]fitValの傾向(x=n,y=fitVal) ,range=(from n=5 to n=25)
end

2008年5月5日月曜日

10^18 と Cino's prime3での10^25で、fitValを求める(2)

primeのグラフ
~~~
[1]fitValの傾向(x=n,y=fitVal) ,range=ALL(from n=1 to n=18)[2]fitValの傾向(x=n,y=fitVal) ,range=(from n=3 to n=18)[3]fitValの傾向(x=n,y=fitVal) ,range=(from n=8 to n=18)

end