Skip to main content

Posts

ドル円アノマリー追記:データが暴く「公務員の給料」も刈り取られる日

ドル円アノマリー追記:データが暴く「公務員の給料」も刈り取られる日 前回の記事では、「毎月25日の給料日」を起点としたシステム的な円売り・ドル買いアノマリーについて解説しました。今回はさらに解像度を上げ、「毎月1日〜31日の日付別」でドル円の平均変化率(リターン)を可視化してみました。 使用したPythonコードは以下の通りです。 ‘’’Python import yfinance as yf import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # 分析期間の設定 dateStart = "2015-01-01" dateEnd   = "2026-05-23" ticker = "JPY=X"   # ドル円 df = yf.download(     ticker,     start=dateStart,     end=dateEnd,     auto_adjust=False,     progress=False ) if isinstance(df.columns, pd.MultiIndex):     close = df["Close"][ticker].dropna() else:     close = df["Close"].dropna() daily_return = close.pct_change() * 100 analysis_df = pd.DataFrame({"Return": daily_return}) analysis_df.index = pd.to_datetime(analysis_df.index) analysis_df["Day_of_Month"] = analysis_df.index.day analysis_df = analysis_df[analysis_df.index.dayofweek < 5] pivot_table = analysis_df.groupby("Day_of_Month")["Return...

Visualizing Japan's Capital Flight: The "Payday Anomaly" in USD/JPY

Visualizing Japan's Capital Flight: The "Payday Anomaly" in USD/JPY The Japanese Yen has been experiencing historic weakness. While many attribute this solely to interest rate differentials or government interventions, I suspected a more mechanical, structural force at play: the automated capital flight by Japanese retail investors. The Hypothesis: The Payday Effect In Japan, the 25th of the month is the standard payday for most corporate workers. Recently, due to inflation and the new tax-free investment program (NISA), a massive number of people have set up automated monthly purchases of foreign equity index funds (such as the S&P 500 or All-Country World Index). I hypothesized that this creates an automatic, system-wide "Sell JPY / Buy USD" order triggered every single month around payday. The Code To verify this, I wrote a Python script using yfinance and seaborn to map the average daily return of USD/JPY by the week and day of the month, covering data...

Unveiling Hidden Intents: Using the Python Library "emotionics" as a Negotiation Radar

Unveiling Hidden Intents: Using the Python Library "emotionics" as a Negotiation Radar Introduction Negotiations are often clouded by bluffs, excuses, and hidden agendas. What if you could objectively peek behind the curtain? Today, I will introduce how to leverage the Python library "emotionics" not just as an analytical model, but as a powerful, objective radar for negotiations. By using the gyo (estimation) module, we can strip away superficial emotions and uncover the true physical state of the negotiation table. https://pypi.org/project/emotionics/ Code Here is a practical example. Imagine a scenario where a business partner uses a macro-environmental excuse to cut down your orders. ‘’’Python import os import json import emotionics from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() # 1. Activation # * Example using Gemini emotionics.activate(     llm="gemini",     api_key=os.getenv("MY_API_KEY"),     mo...