黒木玄 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 を見て下さい。
2020年12月23日(水)

@Atsushi_twi いや、本当に…
あんまりこういうプログラミング言語を真剣に触ったことがなかったので、一般論として窮屈そうとは思ってましたが、実感に変わりました笑
早くJuliaを仕事で使えるようにしたいですね。
タグ:
posted at 23:56:55

Pleased to see that GR runs natively under macOS 11 Big Sur on arm64 (Apple M1) using #SwiftLang. Now the only thing missing is a native #JuliaLang distribution. pic.twitter.com/7JXauz9riY
posted at 23:51:49

TypeProf でやらなきゃなー考えなきゃなー……と現時点で思っていることを書き出しておきました。
偉そうなことを書いておいてまだこんなこともできてないのか!とか言わず。
github.com/ruby/typeprof/...
タグ:
posted at 23:49:39

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

「そういう考えはあるよ。っていうか、y=1/xのグラフの上下だけじゃなくて、右左もつながってるんだ」と言われて、今ではコレが射影幾何学の考え方だと知っていますが、当時、突飛な考えが普通に受け入れられたことにすごく驚いたことをよく覚えています。当時の先生には今でも感謝しています。
タグ:
posted at 23:07:37

中1のとき、y=1/xのグラフで「xが正から0に近づくとyは∞になり、xが負から0に近づくとー∞になる」と教わった際、数直線のー∞と∞は繋がっているのでは(こんなこと話したらバカにされるかなぁ)と先生に話したら、[続く]
タグ:
posted at 23:05:39



OokuboTact 大久保中二病中年 @OokuboTact
算数教育の七不思議。
小学校教育は算数を教えるのが好きらしい
#超算数 pic.twitter.com/F4X8cwMWhn
タグ: 超算数
posted at 22:53:19

#統計
nbviewer.jupyter.org/gist/genkuroki...
止め方で結果が変わる?
で使った不完全ベータ函数の公式については添付画像を参照。
本質的に部分積分の易しい練習問題(高校生レベル)。
ベータ函数から不完全ベータ函数への一般化で超幾何ワールドに突入している。
dlmf.nist.gov/8.17 twitter.com/genkuroki/stat... pic.twitter.com/XtQhKOwVqn
タグ: 統計
posted at 22:50:13

#統計 ガンマ函数の対数の導函数達は統計学にもよく出て来る基本特殊函数達でコンピュータで効率的に計算できる。
例:ディガンマ函数は
ψ(s)=Γ'(s)/Γ(s)=(1/Γ(s))∫_0^∞ e⁻ˣ xˢ⁻¹ log x dx
でガンマ分布での log x の期待値という意味を持っています。
この辺は分配函数の対数の導函数と同じ。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 22:31:16


この人もそうだし、ハジキに代わる速さの指導法を出せばいい、と言う陰山英男もそうだけど、
そのように質問することで、掛け算の順序やハジキが指導法として優れていて批判派は対案を出せないでいる、という印象操作をしている。
「対案」はすでに出されているのに、彼らが無視しているだけ。 twitter.com/yamasati39/sta...
タグ:
posted at 22:17:33

教採のために、指導要領の出そうなところや、「ピアジェと言えば発達段階」という連想ゲームを暗記しようとして夜な夜な一人で頭をがんがんと打ち付けた人は大勢しそう。 twitter.com/y_bonten/statu...
タグ:
posted at 22:05:04

#統計 仕事で大学新入生向けの解析学の講義をしていて、ガウス積分、ガンマ函数、ベータ函数についても(実際に役に立つので)説明している人が結構いると思いますが、ガンマ函数とベータ函数の応用としてベルヌイ分布モデルのベイズ統計はちょうどいい感じの難易度で、教育用に結構使えると思います。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 21:57:08



バイデンが経済対策の93兆を「頭金」と言ったらしい。うちの政府もけちけちせずに50兆くらいを「頭金」と言って出してくれまいか。
今、とにかくみんな困っている。国は金を作れるのだから、どんどん配ってしまうべきでしょう。
世論を盛り上げましょう
タグ:
posted at 21:40:52

#統計 正規分布とその共役事前分布の場合の自由エネルギー、LOOCV、WBIC、WAICの公式は
nbviewer.jupyter.org/gist/genkuroki...
にあります。添付画像はWAICとLOOCVがモデル選択に失敗する様子のプロットになっている。真の予測誤差とそれらの逆相関(グラフの形が180度回転)が原因でモデル選択に失敗する。 pic.twitter.com/DW0z1k6Eh7
タグ: 統計
posted at 21:35:12

#統計 ベルヌイ分布モデルの場合に
自由エネルギー
LOOCV
WBIC
WAIC
の公式を作ると、ちょうどいい感じにベータ函数とガンマ函数の取り扱いの良い練習になります。ガンマ函数の導函数はディガンマ、トリガンマ函数で扱う。コンピュータでそれらの値を容易に計算できます。
nbviewer.jupyter.org/gist/genkuroki... pic.twitter.com/CJaF2CGpWs
タグ: 統計
posted at 21:28:56


仕事でScala書き始めてひと月くらい経つけど、やっぱりピンとこないや。
コード自体よりもビルドだの依存解決だの開発環境整備だのassemblyだので取られる時間の方が多くてモヤモヤする。あと静的型付け一般なのかもしれんけど、JSONとか扱う時型付けがアホくさくなる。
タグ:
posted at 21:26:04

#統計 #Julia言語
gist.github.com/genkuroki/f07f...
このノートブックには試行錯誤の途中の様子がほぼ残されている。
多項分布のサポート(有限集合になる)の配列を作る函数も自前で書いている。r項分布の場合に元の個数は binom(n+r-1, r-1) になる。r=2ならn+1でr=3なら(n+2)(n+1)/2になる。 pic.twitter.com/5e39oQBnhS
posted at 21:21:43

#統計 ベルヌイ分布モデルで、試行回数nを固定すると、二項分布モデルの話になるのですが、1つ前の後者のノートブックのその場合の結果の三項分布への拡張に関する粗雑なノートブック↓
gist.github.com/genkuroki/f07f...
Jeffreys事前分布を意味する0.5で最大期待汎化誤差が最小になっている。0が最尤法。 pic.twitter.com/oZwQvkqYof
タグ: 統計
posted at 21:16:49


#統計 さらにベルヌイ分布モデルの場合の実験の止め方の違いの取り扱いについてのノートブックが
nbviewer.jupyter.org/gist/genkuroki...
nbviewer.jupyter.org/gist/genkuroki...
にあります。ベイズ統計教育に興味を持っている人達のために作ったノートブックです。
タグ: 統計
posted at 21:02:48

#統計 正規分布モデルではなく、もっと易しいベルヌイ分布モデルの場合に、
* 汎化誤差、AIC、WAIC、LOOCV
* 自由エネルギー、BIC、WBIC
を比較したノートブックが
nbviewer.jupyter.org/gist/genkuroki...
にあります。仮説検定との関連もそれを見ればよく分かります。 twitter.com/hamada30137146...
タグ: 統計
posted at 21:02:46

Astghik Hovhannisyan @AstghikHovhann4
アルメニアで100年ぶりにマヌルネコが目撃されたそうです。かわいい pic.twitter.com/49n3tr6n2j
タグ:
posted at 20:43:55


訂正:NetaUtils.jl じゃなくて、MetaUtils.jl 😭
マジで目が弱っているのよね。
そう言えば「主義」が大事じゃないと困る奴らが、私の目が弱っていることについても何か不快な反応をしていたな。
まともな考え方をできていないことには、人格的な問題もあるのかもしれないと思いました。 twitter.com/genkuroki/stat... pic.twitter.com/HPGCWJzrxW
タグ:
posted at 20:29:51

この記事。今まで読んだB-Splineの説明で一番わかり易いかも。:BasicBSpline.jlを作ったので宣伝です! zenn.dev/hyrodium/artic...
タグ:
posted at 20:27:28



#Julia言語
計画行列Xとデータyに関する最小二乗法は
(:(=), :b, (:\, :X, :y)),
の行で実行されます。Juliaの通常の文法では
b = X\y
です。Juliaの線形代数の実装では最小二乗法はこの1行で行ける!最小二乗法はbに関する連立一次方程式
Xb = y
の理論のシンプルな一般化になっています。 pic.twitter.com/ddgm97WAt6
タグ: Julia言語
posted at 19:56:35

#Julia言語
using MetaUtils
x = 10
のもとで
(:call, :+, (:call, :*, 2, :x), 1) |> teval
と
Expr(:call, :+, Expr(:call, :*, 2, :x), 1) |> eval
と
2x + 1
は等価です。
添付画像のように sin(x)+ノイズ の多項式回帰も teval のスタイルで簡単に実行できます(笑) pic.twitter.com/kkPNaK39BU
タグ: Julia言語
posted at 19:52:44

#Julia言語
julia> ]
pkg> add MetaUtils
pkg> バックスペース
julia> using MetaUtils
で使用可能です。使い方の例↓
nbviewer.jupyter.org/github/genkuro...
Exprを略して楽に入力するために使える。
Juliaのパーサーを経由せずに、Exprで直接式を作って実行すると、メタプログラミングの入り口に立てます。
タグ: Julia言語
posted at 19:45:23

Well, I've crafted this PR to improve the situation a bit; with this PR type constraints from callee will propagate inter-procedurally when the callee only does such a simple check:
github.com/JuliaLang/juli...
タグ:
posted at 19:36:35

The limitation is described in this issue:
github.com/JuliaLang/juli...
It is, that currently Julia can't propagate constraints from `isa` or `===` inter-procedurally (i.e. across function calls)
The tweet above circumvents that by inlining a callee on surface AST level.
タグ:
posted at 19:36:35

Gabriele Corno @Gabriele_Corno
Flamenco Kids #Dance pic.twitter.com/2BPCWAIzcO
タグ: Dance
posted at 19:28:28

#統計 添付画像は
www.mext.go.jp/content/140707...
【数学編 理数編】高等学校学習指導要領 解説 (平成30年版)
より。「解説」は拘束力のない単なるいち著作物で、学習指導要領とは厳密に異なる文書なのですが、影響力があるので、みんなで監視してダメ出ししておくことは大事なことだと思います。 pic.twitter.com/ke2tMbjstD
タグ: 統計
posted at 19:25:23

#Julia言語 メタプログラミング、私はよく理解できなかったので、勉強用のパッケージを書いてしまいました。
JuliaのExpr型の対象の中身を見易く表示したり、表示した結果を逆にExpr型に変換して実行したりするための小さなパッケージです。
github.com/genkuroki/Meta...
NetaUtils.jl
タグ: Julia言語
posted at 19:05:08

#Julia言語 『1から始めるJuliaプログラミング』は正確に簡潔でエレガントに重要な情報をまとめることに成功している非常に良い本です。
メタプログラミングは真に難しいので、最初は、「2.8.6 標準ライブラリにあるマクロ」だけに目を通して、とばして読んで良いと思います。 twitter.com/iasadafa/statu...
タグ: Julia言語
posted at 19:01:04

@Salieri91381586 例えばこちらのレシートでは、
数量×単価
になっていますし、他にもそう言う例は枚挙にいとまがありません。 pic.twitter.com/rVy2lEwfJh
タグ:
posted at 18:59:57

@Salieri91381586 杜撰な算数教育の歴史は100年以上あります。
算数に関する杜撰な考え方を持っている人達を算数教育界の中で出世させる社会的仕組みも整備されています。
現在では「どこが根源か」という問いは無意味。
そして、デマに騙されてデマを発信する側に回る人まで出て来たわけです。 twitter.com/genkuroki/stat...
タグ:
posted at 18:49:29

これすごくない?このからくり好きに遊べて1泊4,500円だよ?2万3千で一棟貸切もできるよ。コスロケやオフ会に最高じゃない? pic.twitter.com/j3IQJp5A72
タグ:
posted at 18:34:03


#TodaiStat のタグを付けて、事前分布について【「美しくない」!「美しくない」!「美しくない」!— 大事な点なので三回繰り返しました】と質問に答えたのは、ベイズ統計の重要性について考えると明らかに非常にまずい。
完全にやらかしてしまっていると思います。
タグ: TodaiStat
posted at 17:38:52


この意味で、主観ベイズ主義の問題は、掛算順序問題よりも深刻な部分があると思っています。
主観確率のベイズ主義者と偏狭な考え方を共有しているせいで、批判している側がおかしなことを言っているとみなされる事例↓ twitter.com/genkuroki/stat...
タグ:
posted at 17:28:47

掛算順序問題では掛算順序固定強制を否定している人達は非常に合理的。
しかし、主観確率のベイズ主義を批判するときに、主観確率のベイズ主義者と偏狭な考え方を共有しているせいで、ベイズ統計の方法の数学的合理性を認識できずに、おかしなことを言っている人を見かけることがあります。
タグ:
posted at 17:28:46

この問題は本当に掛算順序問題に似ている。
* 特定の状況で掛算順序に何らかのルールを設けることは否定しない。しかし掛算順序固定の不合理な押し付けはやめてくれ。
* 主観確率の概念を利用すること自体は否定していない。しかし、それ抜きでベイズ統計を合理的に使用可能であることは認めてくれ。 twitter.com/genkuroki/stat...
タグ:
posted at 17:21:41










Here's a #julialang hack to circumvent one of current inference limitations and eliminate minor type-instabilities. pic.twitter.com/2qgOkXSniR
タグ: julialang
posted at 16:19:51








#Julia言語 次のスライドが面白いです。
www.slideshare.net/acidflask/desi...
Designing linear algebra into Julia
Jiahao Chen
2017
以下の仕様は普通に合理的です:
縦ベクトルと横ベクトルは相手の双対空間に属する
横ベクトル*縦ベクトルはスカラーになる
縦ベクトル ≠ n×1行列
横ベクトル ≠ 1×n行列 twitter.com/hyrodium/statu...
タグ: Julia言語
posted at 16:16:12



@4BH76N0r70Q1Slr こういう情報はどんどん出していくべきでしょうね。
今の学校の算数教育は信用できない。バツになっても気にしてはいけない。
という認識を広げることで、おかしな算数教育の被害を軽減できます。
この連ツイにも書きました
twitter.com/sekibunnteisuu...
タグ:
posted at 14:02:29

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

Ruby 3.0.0RC1が登場、型の記述や静的型推論ツールなど新機能。12月25日の正式リリースに向け - Publickey www.publickey1.jp/blog/20/ruby_3...
タグ:
posted at 13:40:43

これを見て、掛け算順序でバツを付けている小学校教師が「これはいくらなんでも酷い」とか言っていそう。
五十歩百歩ってやつだね。
私なんかこういうのを見ても、「ああ、またか」としか思わなくなってしまったw twitter.com/4BH76N0r70Q1Sl...
タグ:
posted at 13:20:47

Juliaについて色々愚痴ってたらめっちゃ丁寧なリプを頂いてしまった...
あんまりプラスの呟きしてなくてほんと申し訳ないです...
juliaで実際に何かをしてみて、良さを実感するまではまだまだこんな感じが続くと思いますが、とても参考になりました🙇♂️
タグ:
posted at 12:42:28

CをJuliaから呼び出す必要がなければ、JuliaとCのFFIに関する知識は必須ではないので読み飛ばして下さい。twitter.com/iasadafa/statu...
タグ:
posted at 12:29:48

多分include関数に関してでしょうか?もしOS毎に区切り文字が違うと、includeを使うたびにjoinpathを毎回使わなくてはならなくてちょっと面倒です。あとWindowsでもforward slashを問題なく使えることが多いでしょう。www.ibm.com/support/pages/... twitter.com/iasadafa/statu...
タグ:
posted at 12:29:48

1ファイルにネストしたモジュールを定義することは実際殆ど無いので、ファイル全体をインデントするのではなくモジュール内ではインデントしないとする慣習はある程度合理的だと思います。
twitter.com/iasadafa/statu...
タグ:
posted at 12:29:47

同じ型で同じサイズの配列が欲しいという状況はそこそこあるので、そういうときにちょくちょく使います。twitter.com/iasadafa/statu...
タグ:
posted at 12:29:47

ほりたみゅ (mastodonも見てね) @Hyrodium
2020/12/23のJulia AdventCalendarの記事です。どうぞ
zenn.dev/hyrodium/artic...
タグ:
posted at 12:29:16

これはあまりArray型のコンストラクタを直接呼出して配列を初期化してほしくないという気持ちのあらわれでしょう。要素の値が未定義なので、バグがあるとすごく見つけにくいです。普通はzeros/ones/fill/内包表記を使えば十分です。
twitter.com/iasadafa/statu...
タグ:
posted at 12:21:50

Juliaみたいな動的言語ではnothingを返すのは普通の慣習かと思います。例えばPythonのre.matchやRubyのString#matchも同様の挙動です。
twitter.com/iasadafa/statu...
タグ:
posted at 12:21:50

ちなみにこの本、ちょいちょい面白いコラムが入っていて、「制限用法の関係詞はthatかwhichか」という問題について、Madras-Slade(ランダムウォークの有名な教科書)で数えてみて、共著でも担当著者ごとに使用頻度が全然違う、とか調べている。 pic.twitter.com/uc9gLds6Xs
タグ:
posted at 12:15:06

昨日の英語に関するtweetは、服部久美子『数学のための英語教本』を読んでいてのものだったのですが、なんと著者本人からコメントとアドバイスを頂きました(ありがとうございます)>RT
タグ:
posted at 12:11:23


6割以上の人がJuliaに触れたことがあると答えているし、それ以外の人もぜひ使ってみたいと答えている。
twitter.com/bicycle1885/st...
タグ:
posted at 11:21:53

『算数数学教育において、「この人、まずそうだな」と感じられる発言者の多くが、
バツにしてよい理由を探し始める傾向が強い』
「バツにしてよい理由」どころか、「バツにするための理由」をあれこれデッチ上げ始めるのを沢山見てきた。
タグ:
posted at 09:52:45

#超算数 これtwitter.com/wakame01/statu...を見た。以前から言っているが現に子供に教えている教員が、どこか遠くの、教員免許さえ持っている保証のない人々に子供との向き合い方で判断を委ねているのが不思議でならない。
タグ: 超算数
posted at 09:24:23


#統計 「主観ベイズ主義」と「ベイズ統計=主観ベイズ主義という解釈(誤解!)でベイズ統計を批判する人達」の間のクズとクズの対決の歴史は【非生産的かつ不毛な議論】の歴史そのもの。
そういう印象で論文を査読する人はベイズ統計を使っているだけで疑いに目を向けるようになるんじゃないかな。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 08:02:20














#統計 妙なこだわりの押し付けは
* 掛算順序強制
* 主観ベイズ主義の強制
の他にも、
* 95%信頼区間の95%を確率ではなく割合と呼べ
* 分割表の独立性検定では不正確なχ²検定ではなく、正確なFisher検定を使え
の類もある。
これらは高等教育機関におけるチョー算数問題だと私は思っています。 twitter.com/genkuroki/stat...
タグ: 統計
posted at 07:27:16

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

Frames Catherine Whi @oxinabox_frames
Cthulu.jl is one of the most useful #JuliaLang developer tools.
github.com/JuliaDebug/Cth...
It lets you recursively look at different views of a function's src and of what it calls
I often use it, flipping between source-view and code_warntype view to hunt down a type instability etc
タグ: JuliaLang
posted at 06:53:49

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

算数数学教育において、「この人、まずそうだな」と感じられる発言者の多くが、
バツにしてよい理由を探し始める傾向が強い
という経験則が得られた。考え方の危なっかしさに応じてそうなり易さが決まる感じ。
教育に関する話題なのにどうしてバツにしてよい理由をいきなり探し始める?
タグ:
posted at 04:56:56

【何なら表面的には誤答でも「その考え方を突きつめると、例えばこういう正しい理論の一つになりえる」まで説明】←こういうの、非常に大事だと思う。 twitter.com/esumii/status/...
タグ:
posted at 04:51:13


Albert (2008) 打者の調子の波のモデル化 - ジョンとヨーコのイマジン日記 selfboast.hatenablog.jp/entry/2020/12/...
タグ:
posted at 01:08:36

FileIOとかRefとか、なんというかC言語のバックグラウンドある人がJulia使う時に当然のように使いこなしてそうな便利な道具のことをなんも知らない。
タグ:
posted at 00:40:25
