黒木玄 Gen Kuroki
- いいね数 389,756/311,170
- フォロー 995 フォロワー 14,556 ツイート 293,980
- 現在地 (^-^)/
- Web https://genkuroki.github.io/documents/
- 自己紹介 私については https://twilog.org/genkuroki と https://genkuroki.github.io と https://github.com/genkuroki と https://github.com/genkuroki/public を見て下さい。
2021年01月11日(月)

非公開
タグ:
posted at xx:xx:xx

授業のため、地震波形の立ち上がり=P波到達の瞬間を読み取るためのページを作った。 Plotly.js のおかげで比較的簡単 pic.twitter.com/nBn7QO4v9B
タグ:
posted at 02:59:52


#統計
amazon.co.jp/dp/4130413007
竹内啓・竹村彰通編
数理統計学の理論と応用
1994
第5章 竹内啓 統計的推測理論の諸問題
に最尤法が漸近的に全然最良でないシンプルな例が載っていたので(添付画像)、#Julia言語 で数値的に確認してみた↓
nbviewer.jupyter.org/gist/genkuroki...
ベイズ統計に繋がる話題。続く pic.twitter.com/HQKUFaUBJr
posted at 04:22:16


#統計 データを生成する真の分布は添付画像の密度函数を持つtruncated normal distributionです。標準正規分布を |x|>1 なら確率密度が0になるように改変したもの。
モデルはこの分布を並行移動したものです。パラメータは平均μのみ。
分布の台がパラメータμごとに違うモデルになっている。 pic.twitter.com/91XiSCPZkr
タグ: 統計
posted at 04:26:15

#統計 その場合に、
* 最尤法(max.lik.estim.)
* サンプル中の値の最大値と最小値の平均を推定値として採用(mean extrema)
の2つを比較すると、添付画像のように、後者を使った方が真の値の0に近い値が得られる確率が高くなります。
n=10だと違いは小さいにですが、n=100だと違いは明瞭。 pic.twitter.com/qWqRWInj20
タグ: 統計
posted at 04:41:54

#統計 #Julia言語 せっかく計算したので n=1000, 10000の場合も。
最尤法(max. lik. estim.)は、最大値と最小値の平均を推定値として採用するシンプルな推定法に惨敗しています。
分散固定のtruncated normal distribution modelでこのようなことが起こるわけです。 pic.twitter.com/1roMhWoOMk
posted at 04:45:38

#統計 #Julia言語
nbviewer.jupyter.org/gist/genkuroki...
添付画像はランダムに生成したサンプルの尤度函数のグラフです。
n=10, 100, 1000とサンプルサイズnを大きくして行くと、尤度函数が区間上ほぼ一定値の形に近付いて行く様子が見えます。微小な傾きが原因で最尤推定値は区間の両端に偏りがちになる。 pic.twitter.com/wM2nH3s7aZ
posted at 04:50:00





#統計 以下のリンク先のスレッドを見ても、ベイズ統計のような尤度函数全体の情報をうまく利用しようとする方法は、「主観確率」だの「ベイズ主義」だの「尤度原理」だのそういうくだらない話と無関係に、「誤差が小さい」という良い性質があるがゆえに使う価値がある場合があることが分かります。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 05:11:35






#統計 nは大と仮定し、p(1|0)=p(-1|0)=C>0とおき、p(x|0)の分散をσ²と書き、サンプルはp(x|0)のサンプルだとする。
このとき、-(B-1)とA+1は期待値1/(nC)の指数分布に近似的に従い、X̅は平均0標準偏差σ/√nの正規分布に近似的に従い、|X̅|≤const./(nC)となる確率は0に近付く。 pic.twitter.com/B7uqth26cd
タグ: 統計
posted at 07:46:11






#統計 数学的に定義された尤度は「もっともらしさ」ではないのに、likelihoodと呼ぶことになったせいで、論理的に考えることよりも、言葉の意味で考えてしまう傾向の強い人達が、尤度について不毛な哲学を20世紀に展開した疑いがある。
誰かそういう黒歴史についてきちんと研究するべきだと思います。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 08:05:37

@miguelraz_ I have no idea, but some fundamental packages are downloaded thousands times everyday (see: discourse.julialang.org/t/pkg-ecosyste...), which seems to exclude automation tools like CI.
タグ:
posted at 08:08:10

#統計 #Julia言語 区間[-1,1]の外側を切断した標準正規分布のサンプルの最大値Mについて、1-Mが従う分布が指数分布で近似されることの数値的に確認。
ヒストグラムはモンテカルロ法でのMの分布。
青線はMの正確な分布。
赤の破線は指数分布による近似。
nbviewer.jupyter.org/gist/genkuroki... pic.twitter.com/Dayv9qXd4R
posted at 08:17:28





ほりたみゅ (mastodonも見てね) @Hyrodium
昨日悩んでたJuliaのべき乗問題、Juliaのslackで聞いて解決しました。^(a,b)がBase.literal_pow(^,a,Base.Val{b}())のような形に変換されてるらしいです。
当時の関連issue:
github.com/JuliaLang/juli...
タグ:
posted at 08:56:52

ほりたみゅ (mastodonも見てね) @Hyrodium
>Experimental feature: x^n for integer literals n (e.g. x^3 or x^-3) is now lowered to Base.literal_pow(^, x, Val{n}), to enable compile-time specialization for literal integer exponents (#20530, #20889).
らしいです
github.com/JuliaLang/juli...
タグ:
posted at 09:02:24

ほりたみゅ (mastodonも見てね) @Hyrodium
julia-syntax.scmでこの操作が定義されてる様子
github.com/JuliaLang/juli...
タグ:
posted at 09:07:16

ほりたみゅ (mastodonも見てね) @Hyrodium
literal_powだけが特殊っぽいし、自前で定義した関数にこのような正負判定の分岐を入れるのは難しそう
タグ:
posted at 09:09:51

@tsatie 把握することができていれば、自力で解決可能なので、把握できていないのは仕方がないです。
しかし、把握できていなくても、再度同じ失敗を繰り返しながら記録を取って、失敗の様子のスクショや、OS、Juliaのバージョン、などなど考えられる限りすべての必要そうな情報を出すことはできます。 twitter.com/tsatie/status/...
タグ:
posted at 09:11:20

Frames Catherine Whi @oxinabox_frames
Tim Holy wrote a blog post explaining precompilation.
I have for ages wondered how it actually worked and what the precompile function actually did, and if it was actually related to what happens during ]precompile. And this answers all that. #JuliaLang
julialang.org/blog/2021/01/p...
タグ: JuliaLang
posted at 09:16:26


こがわなぎさ@はやぶさ725号 @Nagisa_Kogawa
@sakigake ※記事にも書いてますが、ヨンパチ豪雪は観測開始前なので記録に含まれません。
タグ:
posted at 10:09:11

[文] -> 字句解析と構文解析(julia-parser.scm) -> [AST] -> マクロ展開 -> 構文解析?(julia-syntax.scm)(syntaxエラーはここ)
タグ:
posted at 10:16:40




@tsatie #Julia言語 SymPy.jl を使えているなら、ドキュメントを読むだけで多くの問題が解決します。
行列の対角化なら↓
juliahub.com/docs/SymPy/Kze... twitter.com/tsatie/status/... pic.twitter.com/Sv3xPZy2PD
タグ: Julia言語
posted at 11:39:14

@tsatie #Julia言語
SymPy で行列の対角化
gist.github.com/genkuroki/7bf5... pic.twitter.com/HXeiRwkVpy
タグ: Julia言語
posted at 11:42:08





pythonでいうところの,glob操作がこれでjuliaでもできるようになるのかな.インストール中.
github.com/vtjnash/Glob.jl
タグ:
posted at 13:26:37

@minibusgo ほんと、8割おじさんのインタビュー本にも、そうではないことがわかります。
理論疫学者・西浦博の挑戦-新型コロナからいのちを守れ! (単行本) 西浦 博 www.amazon.co.jp/dp/4120053598/...
タグ:
posted at 14:20:04

OokuboTact 大久保中二病中年 @OokuboTact
@IshidaTsuyoshi > 教科書には「.0 は消す」とは書いてなかったが、おそらく指導書には書いてあるのだろうね。
参考 東京書籍のサイトから
www.tokyo-shoseki.co.jp/question/e/san... pic.twitter.com/cL4GqXJyYm
タグ:
posted at 14:41:47



@ppp3141592ppp @physics303 #Julia言語
str 中の 'I' と等しい文字の個数を数える
↓直訳
count(==('I'), str)
タグ: Julia言語
posted at 17:08:59


斉藤ひでみ・現職教師(西村祐二) @kimamanigo0815
自身の小中高時代よりも、規則も指導のレベルも、キツく、厳しくなってるんじゃないかという実感があった。
実際に校内暴力が収まったにも関わらず、校則はこの20年厳しくなり続けた。
そして部活も教員勤務も、質量ともに確実に厳しくなった。
その解は、【20年前よりも学校に求めるものが増えた】。
タグ:
posted at 17:12:06

juliaさん,appendで配列に文字を入れようとする文字がバラバラになる.pushを使うと回避できる. pic.twitter.com/Vvh86Vnwg0
タグ:
posted at 18:51:24

非公開
タグ:
posted at xx:xx:xx

非公開
タグ:
posted at xx:xx:xx

素敵やなぁ♬ PythonなSymPyの威力なのかJuliaなのか渾然一体としてよう分からんけど。 twitter.com/genkuroki/stat... pic.twitter.com/bhbRZYouZT
タグ:
posted at 20:08:54

ごまふあざらし(GomahuAzaras @MathSorcerer
OhMyREPL 楽しい.
#Julia言語 pic.twitter.com/J1ydNV41Uk
タグ: Julia言語
posted at 20:30:29


ほりたみゅ (mastodonも見てね) @Hyrodium
Luxor.jlにバグあったのでissueとPR投げた
github.com/JuliaGraphics/...
タグ:
posted at 21:52:33

Cでは右シフトのシフト幅がビット幅を超えるときは未定義なんだけど、Juliaでは(余計な?)気を回してうまいこと定義されているので、いくぶん長いコードが生成されるんやで。0x3fとかでマスクすれば回避できる。ってかこれ前もハマった気がする。
タグ:
posted at 21:54:41

ほりたみゅ (mastodonも見てね) @Hyrodium
昔書いた「n+1点を通るn-1次元球面」(pdf)が役に立ちました
hyrodium.github.io/pdf/#n1%E7%82%... pic.twitter.com/Xht31QEnSz
タグ:
posted at 22:08:04


Hiromitsu Takagi @HiromitsuTakagi
こりゃまた稚拙なことを。あのね「人間中心のデジタル社会」(とか人間中心のAI社会)てそんな瑣末なことじゃないんだよ?人間の尊厳が尊重されるとかそういうこと。何を問題視して「人間中心の——」と言われてるのかまるでわかってない。
twitter.com/ledgeai/status...
「デジタルなデータこそが「元本」」 pic.twitter.com/gcRS7LVm37
タグ:
posted at 23:18:40

Hiromitsu Takagi @HiromitsuTakagi
「AI特化型メディア」を標榜するメディアが、こんなしょうもない話してる場合かね?
ledge.ai/amazon-academy...
「「デジタル中心の人間社会」とは、どういう意味か。たとえば、現代社会においては、デジタルなデータを印刷し、印鑑を押したものを「元本」と呼ぶことが多い。しかし、その用紙は…」
タグ:
posted at 23:23:17

脱原発は新技術開発と同時進行の長期的展望ですよ。代替エネルギーの目処もつかないうちにできるはずがありません。この10年で分かったことは、太陽光も風力も今のままではあてにならないってことでしょう?メガソーラーなんかただの環境破壊だったわけですやん
タグ:
posted at 23:38:27