I found the trend by this code. This trend is from Japanese Workers' Pay Day(Every 25th day in a month). '''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" # ドル円 # yfinanceから取得(仕様変更の警告回避のため auto_adjust を明示) df = yf . download ( ticker , start = dateStart , end = dateEnd , auto_adjust = False , progress = False ) # yfinanceの仕様変更(MultiIndex化)に対応して終値を安全に抽出 if isinstance ( df . columns , pd . MultiIndex ): close = df [ "Close" ][ ticker ].dropna() else : close = df [ "Close" ]. dropna () # 前日比の変化率(%)を計算 # ドル円の場合、プラス = ドル買い/円売り、マイナス = ドル売り/円買い daily_return = close . pct_change () * 100 # 分析用のDataFrameを作成 analysis_df = pd . DataFrame ({ "Return" : daily_return }) analysis_df . index = pd . to_datetime ( analysis_df . index ...
Learning Methods and Result Curves
I sometimes think about learning methods, Stuck(S) and Que(Q).
S tends to learn as y = 1.3X
Q tends to learn as y = X**1.3
This difference shows short term winning for S, but if Q survives, Q wins for long term.
import numpy as np
import matplotlib.pyplot as plt
# データ生成
x = np.linspace(0, 5, 100)
y1 = 1.3 * x
y2 = x ** 1.3
# グラフ描画
plt.figure(figsize=(8, 6))
plt.plot(x, y1, label=r"$y = 1.3x$")
plt.plot(x, y2, label=r"$y = x^{1.3}$")
plt.xlabel("x")
plt.ylabel("y")
plt.title("Comparison")
plt.legend()
plt.grid(True)
plt.show()

Comments
Post a Comment