<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ソフトウェア | Carlos Mendez</title><link>https://carlos-mendez.org/ja/software/</link><atom:link href="https://carlos-mendez.org/ja/software/index.xml" rel="self" type="application/rss+xml"/><description>ソフトウェア</description><generator>Wowchemy (https://wowchemy.com)</generator><language>ja-jp</language><copyright>© 2018–2026 Carlos Mendez. 無断転載を禁じます。</copyright><image><url>https://carlos-mendez.org/media/icon_huedfae549300b4ca5d201a9bd09a3ecd5_79625_512x512_fill_lanczos_center_3.png</url><title>ソフトウェア</title><link>https://carlos-mendez.org/ja/software/</link></image><item><title>scspill</title><link>https://carlos-mendez.org/ja/software/scspill/</link><pubDate>Tue, 28 Jul 2026 00:00:00 +0000</pubDate><guid>https://carlos-mendez.org/ja/software/scspill/</guid><description>&lt;p>&lt;strong>処理が漏れ出すときの合成コントロール — 処理群への効果と、各ドナーが受け取るスピルオーバーを。&lt;/strong>&lt;/p>
&lt;p>&lt;code>scspill&lt;/code> は、ドナープールに対するSUTVAを外した合成コントロールモデルのPythonパッケージです。処理がコントロール群に及ぶことを許し、いずれのモデルも2つの推定対象を報告します。すなわち、汚染を取り除いた処理群への効果と、各ドナーが受け取るスピルオーバー効果です。後者は従来の合成コントロールでは表現すること自体ができません。現在利用できるモデル &lt;code>sar&lt;/code> は、ユーザーが指定した空間重みを通じてスピルオーバーを伝え、その大きさを単一の強度パラメータ ρ で調整します。この ρ は&lt;strong>仮定するのではなく推定されます&lt;/strong>。合成ウェイトは制約を課さないホースシュー（horseshoe）縮小推定で求めるため、ドナーは除外されることも、負の値をとることも、外挿することもできます。そして2つの推定対象いずれについても完全なベイズ的不確実性を返します。ρ = 0 のとき、モデルはベイズ的ホースシュー合成コントロールに厳密に一致します。推定器のアーキテクチャは &lt;a href="https://github.com/jgreathouse9/mlsynth" target="_blank" rel="noopener">mlsynth&lt;/a>（pydanticの設定を入力とし、標準化された結果オブジェクトを出力する）に従い、&lt;code>method&lt;/code> の名称は同ライブラリの &lt;code>SPILLSYNTH&lt;/code> ディスパッチャと一致するため、両者は自然に組み合わせられます。&lt;/p>
&lt;h3 id="-はじめにhttpsquarcs-labgithubioscspillget-startedhtml">🚀 &lt;a href="https://quarcs-lab.github.io/scspill/get-started.html" target="_blank" rel="noopener">はじめに&lt;/a>&lt;/h3>
&lt;p>カリフォルニア州の提案99（Proposition 99）を対象に、およそ10行でモデルを推定します。&lt;strong>95%信用区間付きのATT&lt;/strong>、スピルオーバー強度 ρ、各ドナーが年ごとに受け取るスピルオーバー、MCMC診断、反事実プロットが得られます。&lt;/p>
&lt;p>&lt;a href="https://colab.research.google.com/github/quarcs-lab/scspill/blob/main/notebooks/california.ipynb" target="_blank" rel="noopener">▶ Colab で開く&lt;/a>&lt;/p>
&lt;h3 id="-モデルhttpsquarcs-labgithubioscspillmodels">🧬 &lt;a href="https://quarcs-lab.github.io/scspill/models/" target="_blank" rel="noopener">モデル&lt;/a>&lt;/h3>
&lt;p>現在提供されているモデルは1つ、&lt;a href="https://quarcs-lab.github.io/scspill/models/sar.html" target="_blank" rel="noopener">&lt;code>sar&lt;/code>&lt;/a> です。&lt;a href="https://doi.org/10.1093/ectj/utag006" target="_blank" rel="noopener">Sakaguchi・Tagawa (2026)&lt;/a> による、空間自己回帰型スピルオーバーを備えたベイズ合成コントロールです。さらに3つのスピルオーバー対応モデルが&lt;a href="https://quarcs-lab.github.io/scspill/models/#planned" target="_blank" rel="noopener">ロードマップ&lt;/a>にあります。Cao・Dowd のモデル、Di Stefano・Mellace の包括的合成コントロール、Grossi ほかによる部分干渉SCGです。これらは&lt;strong>未実装&lt;/strong>であり、&lt;code>SCSPILLConfig&lt;/code> はこれらの名称を黙って別のモデルで代替せず、明示的に拒否します。&lt;/p>
&lt;h3 id="-検証httpsquarcs-labgithubioscspillarticlesvalidationhtml">🧪 &lt;a href="https://quarcs-lab.github.io/scspill/articles/validation.html" target="_blank" rel="noopener">検証&lt;/a>&lt;/h3>
&lt;p>&lt;code>sar&lt;/code> のサンプラーが正しいことを示す証拠です。&lt;strong>Geweke (2004) の同時分布検定&lt;/strong>、事前分布の感度グリッド、事前予測チェック、そして著者らのR実装による固定済み信用区間との交差検証。&lt;/p>
&lt;h2 id="機能の概要">機能の概要&lt;/h2>
&lt;p>&lt;strong>&lt;code>scspill&lt;/code>&lt;/strong> — モデル層。&lt;code>SCSPILL(config).fit()&lt;/code> は、ATTとその信用区間、反事実の経路、ρ の事後分布、時点×ドナーのスピルオーバーパネル、MCMC診断を返します。&lt;/p>
&lt;p>&lt;strong>&lt;code>scspill.validation&lt;/code>&lt;/strong> — &lt;code>sar&lt;/code> のサンプラー検証。Gewekeの同時分布検定、事前分布の感度グリッド、事前予測チェック。&lt;/p>
&lt;p>&lt;strong>&lt;code>scspill.simulate&lt;/code>&lt;/strong> — &lt;code>sar&lt;/code> の&lt;a href="https://quarcs-lab.github.io/scspill/articles/simulation-study.html" target="_blank" rel="noopener">モンテカルロエンジン&lt;/a>。ルーク型格子によるSARデータ生成過程と、論文の表1・表2の基礎となる SCM / BSCM / SCSPILL の比較です。&lt;/p>
&lt;p>&lt;strong>&lt;code>scspill.data&lt;/code>&lt;/strong> — 以下のスピルオーバーパネル。モデルに依存しない形式のため、今後追加されるモデルでもそのまま利用できます。&lt;/p>
&lt;p>&lt;strong>&lt;code>sar&lt;/code> は実装されているだけでなく検証されています&lt;/strong> — 著者らのRレプリケーションパッケージと交差検証されています。カリフォルニアとスーダンの事後分布は固定済みのR信用区間と、モンテカルロのグリッドは論文の固定済みの表と、事前予測統計量は小数第3位まで照合されています。既定の設定は&lt;em>論文に忠実&lt;/em>で、参照実装に残る複数の既知の不具合が修正されており、それぞれに従来挙動へ戻す手段か差分を定量化したベンチマークが用意されています。詳しくは &lt;a href="https://quarcs-lab.github.io/scspill/models/sar.html" target="_blank" rel="noopener">&lt;code>sar&lt;/code> モデルのページ&lt;/a>をご覧ください。&lt;/p>
&lt;h2 id="付属のケーススタディ">付属のケーススタディ&lt;/h2>
&lt;p>&lt;code>scspill.data&lt;/code> には、すぐに推定できる2つの&lt;a href="https://quarcs-lab.github.io/scspill/articles/datasets.html" target="_blank" rel="noopener">データセット&lt;/a>が含まれています。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>カリフォルニア&lt;/strong> — 提案99、39州（1970–2000年）。一人当たり紙巻たばこ販売量とルーク型隣接重み。&lt;code>scspill.data.load_california()&lt;/code> で読み込みます。&lt;/li>
&lt;li>&lt;strong>スーダン&lt;/strong> — 2011年の分離独立、アフリカ34か国（2000–2015年）。一人当たりGDPと貿易ネットワーク重み。&lt;code>scspill.data.load_sudan()&lt;/code> で読み込みます。&lt;a href="https://quarcs-lab.github.io/scspill/sudan.html" target="_blank" rel="noopener">スーダンのケーススタディ&lt;/a>で詳しく扱っています。&lt;/li>
&lt;/ul>
&lt;h2 id="インストール">インストール&lt;/h2>
&lt;p>最新リリースはPyPIから入手できます（基本のインストールはNumPy/SciPyのみ。&lt;code>numba&lt;/code> エクストラでJITコンパイル済みサンプラーが追加されます）。&lt;/p>
&lt;pre>&lt;code class="language-bash">pip install scspill # NumPy/SciPy sampler backend
pip install &amp;quot;scspill[numba]&amp;quot; # + JIT-compiled samplers (~10x faster)
pip install &amp;quot;scspill @ git+https://github.com/quarcs-lab/scspill.git&amp;quot; # latest
&lt;/code>&lt;/pre>
&lt;p>Python 3.10 以上が必要です。&lt;/p>
&lt;h2 id="ひと目で">ひと目で&lt;/h2>
&lt;p>付属のケーススタディを読み込み、サンプラーを実行して、2つの推定対象を確認します。&lt;/p>
&lt;pre>&lt;code class="language-python">from scspill import SCSPILL
from scspill.data import load_california
panel = load_california() # Prop 99 panel + rook-contiguity weights
result = SCSPILL(
{**panel.config_kwargs(), &amp;quot;m_iter&amp;quot;: 20_000, &amp;quot;burn&amp;quot;: 10_000, &amp;quot;seed&amp;quot;: 42}
).fit()
result.att, result.att_ci # treatment effect on California + 95% CrI
result.rho_hat, result.rho_ci # spillover intensity posterior
result.spillover_panel[&amp;quot;Nevada&amp;quot;] # the effect received by Nevada, per year
result.diagnostics() # ESS / R-hat / MCSE per chain
result.plot(kind=&amp;quot;panel&amp;quot;) # counterfactual | effect | top spillovers
&lt;/code>&lt;/pre>
&lt;p>推定器の動きは、&lt;a href="https://quarcs-lab.github.io/scspill/get-started.html" target="_blank" rel="noopener">はじめに&lt;/a>、&lt;a href="https://quarcs-lab.github.io/scspill/models/" target="_blank" rel="noopener">モデル&lt;/a>、&lt;a href="https://quarcs-lab.github.io/scspill/articles/validation.html" target="_blank" rel="noopener">検証&lt;/a>でご覧いただけます。&lt;/p>
&lt;h2 id="基盤">基盤&lt;/h2>
&lt;p>&lt;code>scspill&lt;/code> は依存関係を意図的に軽く保っています。現代的なPythonの科学計算スタックのみで構成されています。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://numpy.org" target="_blank" rel="noopener">NumPy&lt;/a>&lt;/strong> と &lt;strong>&lt;a href="https://scipy.org" target="_blank" rel="noopener">SciPy&lt;/a>&lt;/strong> — サンプラーの計算基盤&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://pandas.pydata.org" target="_blank" rel="noopener">pandas&lt;/a>&lt;/strong> — パネルとスピルオーバーの表&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://docs.pydantic.dev" target="_blank" rel="noopener">pydantic&lt;/a>&lt;/strong> — 検証付きの推定器設定&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://matplotlib.org" target="_blank" rel="noopener">matplotlib&lt;/a>&lt;/strong> — 診断図と反事実の図&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://numba.pydata.org" target="_blank" rel="noopener">numba&lt;/a>&lt;/strong> — オプションのJITコンパイル済みサンプラー&lt;/li>
&lt;/ul>
&lt;h2 id="謝辞">謝辞&lt;/h2>
&lt;p>&lt;code>scspill&lt;/code> の著者は Carlos Mendez、Shosei Sakaguchi、Hayato Tagawa の3名です。本Pythonパッケージは Carlos Mendez が執筆し、保守しています。&lt;code>sar&lt;/code> モデルとそのオリジナルのR/C++実装は Shosei Sakaguchi 氏と Hayato Tagawa 氏によるものです。両氏の&lt;a href="https://doi.org/10.5281/zenodo.19066186" target="_blank" rel="noopener">レプリケーションパッケージ&lt;/a>はMITライセンスで公開されており、その著作権表示は本ライブラリの &lt;code>LICENSE&lt;/code> に保持されています。また &lt;code>scspill&lt;/code> の各リリースは、その固定済みの結果と交差検証されています。推定器のアーキテクチャは Jared Greathouse 氏の &lt;a href="https://github.com/jgreathouse9/mlsynth" target="_blank" rel="noopener">mlsynth&lt;/a> に、ドキュメント基盤は QuaRCS Lab の &lt;a href="https://github.com/quarcs-lab/geometrics" target="_blank" rel="noopener">geometrics&lt;/a> パッケージに倣っています。&lt;/p>
&lt;p>&lt;code>scspill&lt;/code> をご利用の際は、本ソフトウェアを引用してください（機械可読なメタデータは &lt;a href="https://github.com/quarcs-lab/scspill/blob/main/CITATION.cff" target="_blank" rel="noopener">&lt;code>CITATION.cff&lt;/code>&lt;/a> にあります）。&lt;/p>
&lt;blockquote>
&lt;p>Mendez, C., Sakaguchi, S., &amp;amp; Tagawa, H. (2026). &lt;em>Synthetic Control Models with Spillovers in Python&lt;/em> (version 0.2.1). &lt;a href="https://github.com/quarcs-lab/scspill" target="_blank" rel="noopener">https://github.com/quarcs-lab/scspill&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;p>MITライセンスで公開されています。&lt;/p></description></item><item><title>geometrics</title><link>https://carlos-mendez.org/ja/software/geometrics/</link><pubDate>Thu, 02 Jul 2026 00:00:00 +0000</pubDate><guid>https://carlos-mendez.org/ja/software/geometrics/</guid><description>&lt;p>&lt;strong>地域の成長・収束・格差 — 空間的に、Pythonで。&lt;/strong>&lt;/p>
&lt;p>&lt;code>geometrics&lt;/code> は &lt;a href="https://pysal.org/" target="_blank" rel="noopener">PySAL&lt;/a> ファミリーを基盤とし、地域収束の文献における標準的な分析を、インタラクティブな &lt;a href="https://plotly.com/python/" target="_blank" rel="noopener">Plotly&lt;/a> の図、出版品質の &lt;a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">Great Tables&lt;/a>、整然とした（tidy）DataFrame を返す適用しやすい関数にまとめています。&lt;strong>探索／分析／学習&lt;/strong>のワークフローに、すべての結果を解釈・説明する組み込みの&lt;strong>学習レイヤー&lt;/strong>と&lt;strong>3つのノーコードアプリ&lt;/strong>を組み合わせています。学生、教員、応用研究者のいずれにも役立つように作られています。&lt;/p>
&lt;h3 id="-探索httpsquarcs-labgithubiogeometricsexplorehtml">🗺️ &lt;a href="https://quarcs-lab.github.io/geometrics/explore.html" target="_blank" rel="noopener">探索&lt;/a>&lt;/h3>
&lt;p>地域を地図化し記述します。分類・アニメーション化されたコロプレス図、空間重みの接続性、&lt;strong>モランの散布図と LISA クラスターマップ&lt;/strong>、時空間ビュー。&lt;/p>
&lt;p>&lt;a href="https://geometrics-explore.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/quarcs-lab/geometrics/blob/main/notebooks/explore.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h3 id="-分析httpsquarcs-labgithubiogeometricsanalyzehtml">🧮 &lt;a href="https://quarcs-lab.github.io/geometrics/analyze.html" target="_blank" rel="noopener">分析&lt;/a>&lt;/h3>
&lt;p>モデルを推定します。&lt;strong>β・σ・クラブ収束&lt;/strong>、インパクトを伴う空間計量経済モデル、マルコフおよび空間マルコフのダイナミクス、空間分解を伴う&lt;strong>ジニ／タイルの格差&lt;/strong>、GWR／マルチスケール GWR。&lt;/p>
&lt;p>&lt;a href="https://geometrics-analyze.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/quarcs-lab/geometrics/blob/main/notebooks/analyze.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h3 id="-学習httpsquarcs-labgithubiogeometricslearnhtml">📚 &lt;a href="https://quarcs-lab.github.io/geometrics/learn.html" target="_blank" rel="noopener">学習&lt;/a>&lt;/h3>
&lt;p>手法の背後にある考え方を確かめます。既知の真実を自分で調整できる&lt;strong>11個の実行可能な概念サンドボックス&lt;/strong>、&lt;strong>30トピック&lt;/strong>の解説インデックス、そしてすべての結果に対する平易な言葉での解説。&lt;/p>
&lt;p>&lt;a href="https://geometrics-learn.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/quarcs-lab/geometrics/blob/main/notebooks/learn.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h2 id="ブラウザでアプリを試す">ブラウザでアプリを試す&lt;/h2>
&lt;p>インストールもコードも不要 — 3つの &lt;code>geometrics&lt;/code> アプリが、ワークフロー全体をブラウザ上で実行します。ポイント＆クリックの地図とモデル、ソート可能な表、再現可能なエクスポート。それぞれがドキュメントのケーススタディに対応するノーコード版です。&lt;/p>
&lt;p>&lt;a href="https://geometrics-explore.streamlit.app/" target="_blank" rel="noopener">🗺️ 探索アプリ&lt;/a> · &lt;a href="https://geometrics-analyze.streamlit.app/" target="_blank" rel="noopener">🧮 分析アプリ&lt;/a> · &lt;a href="https://geometrics-learn.streamlit.app/" target="_blank" rel="noopener">📚 学習アプリ&lt;/a>&lt;/p>
&lt;h2 id="機能の概要">機能の概要&lt;/h2>
&lt;p>&lt;strong>地図と ESDA&lt;/strong> — 分類／アニメーション化されたコロプレス図、空間重みの接続性、モランの散布図、LISA クラスターマップ、時系列でのモランの I。&lt;/p>
&lt;p>&lt;strong>時空間ダイナミクス&lt;/strong> — 横断面分布の推移とエンティティ×時間のヒートマップ。&lt;/p>
&lt;p>&lt;strong>収束&lt;/strong> — OLS または空間推定量による β 収束、σ 収束、そしてクラブマップ付きの Phillips–Sul 収束クラブ。&lt;/p>
&lt;p>&lt;strong>空間計量経済学&lt;/strong> — &lt;code>spreg&lt;/code> スイート、モデル推奨付きの LM 診断、代替的な重みによる頑健性。&lt;/p>
&lt;p>&lt;strong>分布ダイナミクス&lt;/strong> — マルコフおよび空間マルコフの遷移分析。&lt;/p>
&lt;p>&lt;strong>格差&lt;/strong> — 空間分解を伴うジニ／タイルのトレンド、タイルの級間／級内分解。&lt;/p>
&lt;p>&lt;strong>局所モデル&lt;/strong> — 局所係数を地図化した GWR とマルチスケール GWR。&lt;/p>
&lt;p>&lt;strong>概念サンドボックス&lt;/strong> — 既知のデータ生成過程からデータをシミュレートする11個の教育用関数。&lt;/p>
&lt;h2 id="付属のケーススタディ">付属のケーススタディ&lt;/h2>
&lt;p>&lt;code>geometrics.data&lt;/code> には、すぐに分析できる2つのケーススタディが付属しています。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>インド&lt;/strong> — 520の地区、衛星による夜間光（1996〜2010年）：&lt;code>gm.data.load_india()&lt;/code>、&lt;code>load_india_states()&lt;/code>。&lt;/li>
&lt;li>&lt;strong>ボリビア&lt;/strong> — PWT に基づく地域 GDP（2021年購買力平価の米ドル、2012〜2022年）を3つの地理的スケールで：&lt;code>gm.data.load_bolivia()&lt;/code>（112の郡）、&lt;code>load_bolivia_departments()&lt;/code>（9の県）、&lt;code>load_bolivia_grid()&lt;/code>（1,603のグリッドセル）。&lt;/li>
&lt;/ul>
&lt;h2 id="インストール">インストール&lt;/h2>
&lt;p>最新リリースを PyPI からインストールします（基本インストールでほとんどのワークフローに対応します。エクストラでマルコフのダイナミクス、ノーコードアプリ、PNG エクスポートを追加できます）。&lt;/p>
&lt;pre>&lt;code class="language-bash">pip install geometrics # core
pip install &amp;quot;geometrics[dynamics]&amp;quot; # + Markov / spatial Markov (giddy)
pip install &amp;quot;geometrics[streamlit]&amp;quot; # + the three no-code apps
pip install &amp;quot;geometrics[all]&amp;quot; # everything, incl. PNG export
&lt;/code>&lt;/pre>
&lt;p>Python 3.11 以上が必要です。&lt;/p>
&lt;h2 id="ひと目で">ひと目で&lt;/h2>
&lt;p>付属のケーススタディを読み込み、変数ラベルを付与して地図化します — すべての図はインタラクティブな Plotly オブジェクトです。&lt;/p>
&lt;pre>&lt;code class="language-python">import geometrics as gm
# India — 520 districts, satellite nighttime lights (1996–2010)
gdf, df, df_dict = gm.data.load_india()
df = gm.set_labels(df, df_dict, set_panel=True)
# A classified choropleth of nighttime lights in 2010
gm.explore_choropleth_map(df, &amp;quot;ntl_total&amp;quot;, gdf=gdf, period=2010).fig
&lt;/code>&lt;/pre>
&lt;p>&lt;strong>収束を推定し、それ自身に説明させる&lt;/strong> — β 収束と σ 収束、それぞれに平易な言葉での解説を添えて。&lt;/p>
&lt;pre>&lt;code class="language-python">beta = gm.analyze_beta_convergence(df, &amp;quot;ntl_total&amp;quot;, model=&amp;quot;ols&amp;quot;)
print(beta.interpret()) # plain-language, associational reading
sigma = gm.analyze_sigma_convergence(df, &amp;quot;ntl_total&amp;quot;)
&lt;/code>&lt;/pre>
&lt;p>&lt;strong>学びながら進む&lt;/strong> — 概念サンドボックスと解説。&lt;/p>
&lt;pre>&lt;code class="language-python">gm.learn_beta_convergence(convergence_rate=0.02) # a runnable concept sandbox
print(gm.explain(&amp;quot;spatial_autocorrelation&amp;quot;)) # a concept explainer; gm.list_topics() lists all 30
&lt;/code>&lt;/pre>
&lt;p>&lt;a href="https://quarcs-lab.github.io/geometrics/explore.html" target="_blank" rel="noopener">探索&lt;/a>、&lt;a href="https://quarcs-lab.github.io/geometrics/analyze.html" target="_blank" rel="noopener">分析&lt;/a>、&lt;a href="https://quarcs-lab.github.io/geometrics/learn.html" target="_blank" rel="noopener">学習&lt;/a> で各関数の動作をご覧ください。&lt;/p>
&lt;h2 id="基盤">基盤&lt;/h2>
&lt;p>&lt;code>geometrics&lt;/code> は、空間分析エコシステム &lt;a href="https://pysal.org/" target="_blank" rel="noopener">PySAL&lt;/a> とモダンな Python のデータスタックの上に成り立っています。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://pysal.org/" target="_blank" rel="noopener">PySAL&lt;/a>&lt;/strong> — &lt;code>libpysal&lt;/code>（重み）、&lt;code>esda&lt;/code>（モランの I／LISA）、&lt;code>giddy&lt;/code>（分布ダイナミクス）、&lt;code>inequality&lt;/code>（ジニ／タイル）、&lt;code>mapclassify&lt;/code>（コロプレス図の分類）、&lt;code>spreg&lt;/code>（空間回帰）、&lt;code>mgwr&lt;/code>（マルチスケール GWR）&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://geopandas.org/" target="_blank" rel="noopener">geopandas&lt;/a>&lt;/strong> — 地理空間データフレーム&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://plotly.com/python/" target="_blank" rel="noopener">Plotly&lt;/a>&lt;/strong> — インタラクティブな図&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">Great Tables&lt;/a>&lt;/strong> — 出版品質の表&lt;/li>
&lt;/ul>
&lt;h2 id="謝辞">謝辞&lt;/h2>
&lt;p>&lt;code>geometrics&lt;/code> は &lt;a href="https://quarcs-lab.org" target="_blank" rel="noopener">QuaRCS Lab&lt;/a>（定量地域・計算科学）で開発されており、&lt;a href="https://pysal.org/" target="_blank" rel="noopener">PySAL&lt;/a> プロジェクト、geopandas、Plotly、Great Tables の上に成り立っています。研究で &lt;code>geometrics&lt;/code> を使用する際は、リポジトリ（&lt;a href="https://github.com/quarcs-lab/geometrics/blob/main/CITATION.cff" target="_blank" rel="noopener">&lt;code>CITATION.cff&lt;/code>&lt;/a> を参照）および基盤となる PySAL パッケージを引用してください。&lt;/p></description></item><item><title>expdpy</title><link>https://carlos-mendez.org/ja/software/expdpy/</link><pubDate>Thu, 18 Jun 2026 00:00:00 +0000</pubDate><guid>https://carlos-mendez.org/ja/software/expdpy/</guid><description>&lt;p>&lt;strong>パネルデータをインタラクティブに探索・分析・学習 — Pythonで。&lt;/strong>&lt;/p>
&lt;p>&lt;code>expdpy&lt;/code> は、インタラクティブな &lt;a href="https://plotly.com/python/" target="_blank" rel="noopener">Plotly&lt;/a> の図と出版品質の &lt;a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">Great Tables&lt;/a> を返す組み合わせ可能な関数に、&lt;strong>fixest スタイルの計量経済学&lt;/strong>、すべての結果を解釈・説明する組み込みの&lt;strong>学習レイヤー&lt;/strong>、そして&lt;strong>3つのノーコードアプリ&lt;/strong>を組み合わせています。学生、教員、応用研究者のいずれにも役立つように作られています。&lt;/p>
&lt;h3 id="-探索httpscmg777githubioexpdpyexplorehtml">🔍 &lt;a href="https://cmg777.github.io/expdpy/explore.html" target="_blank" rel="noopener">探索&lt;/a>&lt;/h3>
&lt;p>パネルを記述・可視化します。表、分布、欠損値マップ、時系列トレンド、グループ比較、散布図、&lt;strong>級内／級間（within／between）変動&lt;/strong>、&lt;strong>パネルダイナミクス&lt;/strong>。&lt;/p>
&lt;p>&lt;a href="https://expdpy-explore.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/cmg777/expdpy/blob/main/notebooks/explore.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h3 id="-分析httpscmg777githubioexpdpyanalyzehtml">🧮 &lt;a href="https://cmg777.github.io/expdpy/analyze.html" target="_blank" rel="noopener">分析&lt;/a>&lt;/h3>
&lt;p>モデルを推定します。固定効果／変量効果／&lt;strong>相関変量効果&lt;/strong>、FWL、ハウスマン検定、頑健な推測、&lt;strong>イベントスタディ／DiD&lt;/strong>、&lt;strong>β／σ／クラブ収束&lt;/strong>、&lt;strong>クズネッツ波形&lt;/strong>曲線。&lt;/p>
&lt;p>&lt;a href="https://expdpy-analyze.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/cmg777/expdpy/blob/main/notebooks/analyze.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h3 id="-学習httpscmg777githubioexpdpylearnhtml">📚 &lt;a href="https://cmg777.github.io/expdpy/learn.html" target="_blank" rel="noopener">学習&lt;/a>&lt;/h3>
&lt;p>手法の背後にある考え方を確かめます。既知の真実を自分で調整できる&lt;strong>9つの実行可能な概念サンドボックス&lt;/strong>、&lt;strong>27トピック&lt;/strong>の解説インデックス、そしてすべての結果に対する平易な言葉での解説。&lt;/p>
&lt;p>&lt;a href="https://expdpy-learn.streamlit.app/" target="_blank" rel="noopener">🚀 アプリを開く&lt;/a> · &lt;a href="https://colab.research.google.com/github/cmg777/expdpy/blob/main/notebooks/learn.ipynb" target="_blank" rel="noopener">▶ Colabで開く&lt;/a>&lt;/p>
&lt;h2 id="ブラウザでアプリを試す">ブラウザでアプリを試す&lt;/h2>
&lt;p>インストールもコードも不要 — 3つの &lt;code>ExPdPy&lt;/code> アプリが、ワークフロー全体をブラウザ上で実行します。サンプルパイプライン、ポイント＆クリックの分析、ソート可能な表、再現可能なノートブックのエクスポート。それぞれがドキュメントのケーススタディに対応するノーコード版です。&lt;/p>
&lt;p>&lt;a href="https://expdpy-explore.streamlit.app/" target="_blank" rel="noopener">🔍 探索アプリ&lt;/a> · &lt;a href="https://expdpy-analyze.streamlit.app/" target="_blank" rel="noopener">🧮 分析アプリ&lt;/a> · &lt;a href="https://expdpy-learn.streamlit.app/" target="_blank" rel="noopener">📚 学習アプリ&lt;/a>&lt;/p>
&lt;h2 id="機能の概要">機能の概要&lt;/h2>
&lt;p>&lt;strong>探索&lt;/strong> — 記述・相関・極値の表、ヒストグラムと棒グラフ、時系列・分位点トレンド、グループ別の棒／バイオリン／トレンドビュー、欠損値ヒートマップ、LOESS 平滑化（任意）付きの散布図、級内／級間（&lt;code>xtsum&lt;/code>）分解、ユニット別の軌跡、パネル構造の診断、分布・遷移ダイナミクス、&lt;code>treat_outliers&lt;/code>。&lt;/p>
&lt;p>&lt;strong>分析&lt;/strong> — &lt;a href="https://github.com/py-econometrics/pyfixest" target="_blank" rel="noopener">pyfixest&lt;/a> による&lt;strong>多元固定効果&lt;/strong>と&lt;strong>クラスター頑健標準誤差&lt;/strong>付きの OLS、より充実した &lt;code>analyze_estimation&lt;/code>（ステップワイズ／複数アウトカム、Newey–West・Driscoll–Kraay 標準誤差）、&lt;strong>プールド（pooled）／級間（between）／固定効果／変量効果&lt;/strong>と&lt;strong>相関変量効果（Mundlak）&lt;strong>推定量、&lt;strong>ハウスマン検定&lt;/strong>、推定後ツール（固定効果プロット、予測、Wald 同時検定）、&lt;strong>頑健な推測&lt;/strong>（ランダム化推測、ワイルドクラスターブートストラップ）、&lt;strong>Frisch–Waugh–Lovell&lt;/strong> プロットと&lt;/strong>係数&lt;/strong>プロット、最新の&lt;strong>イベントスタディ／時差のある差分の差分法&lt;/strong>（&lt;code>did2s&lt;/code>、Sun–Abraham、LP-DiD、動的 TWFE）、&lt;strong>β・σ・クラブ収束&lt;/strong>、そしてプールド／級間／級内推定量による&lt;strong>クズネッツ波形&lt;/strong>曲線。&lt;/p>
&lt;p>&lt;strong>学習&lt;/strong> — すべての結果が平易な言葉で語ります。&lt;code>.interpret()&lt;/code> は&lt;strong>連関的（associational）&lt;strong>な解説を返し（デザインが裏付けない限り因果的な主張はしません）、&lt;code>.explain()&lt;/code> ／ &lt;code>explain(topic)&lt;/code> ／ &lt;code>list_topics()&lt;/code> で&lt;/strong>27&lt;/strong>の概念解説を閲覧できます。&lt;strong>9つの概念サンドボックス&lt;/strong>がデータをシミュレートし、既知の真実を&lt;em>見て&lt;/em>調整できます — 一階差分 ≈ 平均除去 ≈ ダミー変数の恒等関係、固定効果、クラスタリング、欠落変数バイアス、β／σ／クラブ収束、クズネッツ波。&lt;/p>
&lt;p>&lt;strong>付属データセット&lt;/strong> — &lt;code>expdpy.data&lt;/code> には、すぐに探索できるパネルが付属しています。&lt;strong>&lt;code>kuznets&lt;/code>&lt;/strong>（N字型クズネッツ曲線の代表的なデモ）、&lt;code>gapminder&lt;/code>、&lt;strong>&lt;code>staggered_did&lt;/code>&lt;/strong>（イベントスタディ／DiD）、&lt;strong>&lt;code>productivity&lt;/code>&lt;/strong>、&lt;strong>&lt;code>bolivia112_gdppc&lt;/code>&lt;/strong>（収束）。データ辞書については &lt;a href="https://cmg777.github.io/expdpy/explanation/kuznets-dataset.html" target="_blank" rel="noopener">kuznets データセット&lt;/a> のページをご覧ください。&lt;/p>
&lt;h2 id="インストール">インストール&lt;/h2>
&lt;p>最新リリースを PyPI からインストールします（変量効果、CRE、ハウスマン検定はそのまま利用できます。アプリには &lt;code>streamlit&lt;/code> エクストラが必要です）。&lt;/p>
&lt;pre>&lt;code class="language-bash">pip install expdpy
pip install &amp;quot;expdpy[streamlit]&amp;quot; # the no-code ExPdPy apps (Streamlit)
&lt;/code>&lt;/pre>
&lt;p>&lt;a href="https://docs.astral.sh/uv/" target="_blank" rel="noopener">uv&lt;/a> を使う場合：&lt;/p>
&lt;pre>&lt;code class="language-bash">uv pip install expdpy
uv pip install &amp;quot;expdpy[streamlit]&amp;quot;
&lt;/code>&lt;/pre>
&lt;p>最新の未公開バージョンは、&lt;code>main&lt;/code> ブランチから直接インストールできます。&lt;/p>
&lt;pre>&lt;code class="language-bash">pip install &amp;quot;git+https://github.com/cmg777/expdpy.git&amp;quot;
&lt;/code>&lt;/pre>
&lt;p>Python 3.10 以上が必要です。&lt;/p>
&lt;h2 id="ひと目で">ひと目で&lt;/h2>
&lt;p>このドキュメント全体を通じた主要な例は、付属の &lt;code>kuznets&lt;/code> パネル（80か国 × 2015〜2025年）です。地域間の格差が所得に対して &lt;strong>N字型のクズネッツ曲線&lt;/strong>を描く合成データセットで、上昇し、下降し、非常に高い所得で再び上昇します。&lt;/p>
&lt;pre>&lt;code class="language-python">import expdpy as ex
from expdpy.data import load_kuznets
df = load_kuznets()
# The N-shaped regional Kuznets curve: regional inequality vs (log) GDP per capita
ex.explore_scatter_plot(
df, x=&amp;quot;log_gdp_pc&amp;quot;, y=&amp;quot;gini_regional&amp;quot;, color=&amp;quot;continent&amp;quot;, size=&amp;quot;population&amp;quot;, loess=1
).fig
&lt;/code>&lt;/pre>
&lt;p>&lt;strong>回帰を実行し、それ自身に説明させる&lt;/strong> — 二元固定効果、クラスター頑健標準誤差、平易な言葉での解説、係数プロット。&lt;/p>
&lt;pre>&lt;code class="language-python">res = ex.analyze_regression_table(
df,
dvs=&amp;quot;gini_regional&amp;quot;,
idvs=[&amp;quot;log_gdp_pc&amp;quot;, &amp;quot;log_gdp_pc_sq&amp;quot;, &amp;quot;log_gdp_pc_cu&amp;quot;],
feffects=[&amp;quot;country&amp;quot;, &amp;quot;year&amp;quot;],
clusters=[&amp;quot;country&amp;quot;],
)
print(res.interpret()) # plain-language, associational reading
ex.analyze_coefficient_plot(res) # themed coefficient plot with confidence intervals
&lt;/code>&lt;/pre>
&lt;p>&lt;strong>学びながら進む&lt;/strong> — 概念サンドボックスと解説。&lt;/p>
&lt;pre>&lt;code class="language-python">ex.learn_first_differences() # first differences ≈ demeaning ≈ dummy variables
print(ex.explain(&amp;quot;fixed_effects&amp;quot;)) # a concept explainer; ex.list_topics() lists all 27
&lt;/code>&lt;/pre>
&lt;p>&lt;a href="https://cmg777.github.io/expdpy/explore.html" target="_blank" rel="noopener">探索&lt;/a>、&lt;a href="https://cmg777.github.io/expdpy/analyze.html" target="_blank" rel="noopener">分析&lt;/a>、&lt;a href="https://cmg777.github.io/expdpy/learn.html" target="_blank" rel="noopener">学習&lt;/a> で各関数の動作を確認するか、&lt;a href="https://cmg777.github.io/expdpy/explanation/kuznets-dataset.html" target="_blank" rel="noopener">kuznets データセット&lt;/a> のページでデータ辞書をご覧ください。&lt;/p>
&lt;h2 id="基盤">基盤&lt;/h2>
&lt;p>&lt;code>expdpy&lt;/code> は、モダンな Python のデータ・計量経済学スタックの上に成り立っています。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://plotly.com/python/" target="_blank" rel="noopener">Plotly&lt;/a>&lt;/strong> — インタラクティブな図&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/py-econometrics/pyfixest" target="_blank" rel="noopener">pyfixest&lt;/a>&lt;/strong> — 固定効果および差分の差分法の推定量&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://posit-dev.github.io/great-tables/" target="_blank" rel="noopener">Great Tables&lt;/a>&lt;/strong> — 出版品質の表&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://bashtage.github.io/linearmodels/" target="_blank" rel="noopener">linearmodels&lt;/a>&lt;/strong> — 変量効果／級間／相関変量効果とハウスマン検定&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://streamlit.io/" target="_blank" rel="noopener">Streamlit&lt;/a>&lt;/strong> — ノーコードの &lt;code>ExPdPy&lt;/code> アプリ&lt;/li>
&lt;/ul>
&lt;h2 id="謝辞">謝辞&lt;/h2>
&lt;p>expdpy は、&lt;strong>Joachim Gassen&lt;/strong> 氏と &lt;strong>TRR 266 Accounting for Transparency&lt;/strong> プロジェクトによる優れた R パッケージ &lt;a href="https://github.com/trr266/ExPanDaR" target="_blank" rel="noopener">ExPanDaR&lt;/a> の Python 移植版として始まり、その基盤は今もその成果に深く着想を得ています。時を経て、expdpy は元のパッケージをはるかに超えて成長しました — fixest スタイルの推定量、イベントスタディ／差分の差分法のツール、変量効果・相関変量効果のパネルモデル、収束分析、結果を解釈・説明する組み込みの学習レイヤー — そして今後も進化を続けます。&lt;/p>
&lt;p>ExPanDaR の作者の皆様に感謝します。研究で &lt;code>expdpy&lt;/code> を使用する際は、原典を引用してください（&lt;a href="https://github.com/cmg777/expdpy/blob/main/CITATION.cff" target="_blank" rel="noopener">&lt;code>CITATION.cff&lt;/code>&lt;/a> を参照）。&lt;/p></description></item></channel></rss>