{"id":2545,"date":"2024-09-26T07:46:23","date_gmt":"2024-09-25T22:46:23","guid":{"rendered":"https:\/\/secondlife.lol\/?p=2545"},"modified":"2024-09-27T21:23:01","modified_gmt":"2024-09-27T12:23:01","slug":"stock-data-time-series-analysis-trend-forecasting","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/ja\/stock-data-time-series-analysis-trend-forecasting\/","title":{"rendered":"Python\u30c7\u30fc\u30bf\u5206\u6790\u306e\u4f8b\uff1aS&amp;P 500\u306e\u682a\u5f0f\u30c7\u30fc\u30bf\u306e\u6642\u7cfb\u5217\u5206\u6790\u3068\u5c06\u6765\u306e\u4fa1\u683c\u4e88\u6e2c\u3092\u884c\u3046"},"content":{"rendered":"<p>\u682a\u5f0f\u5e02\u5834\u3067\u30c7\u30fc\u30bf\u5206\u6790\u306f\u975e\u5e38\u306b\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002\u6295\u8cc7\u5bb6\u306f\u3001\u682a\u4fa1\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u628a\u63e1\u3057\u3001\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3057\u3001\u610f\u601d\u6c7a\u5b9a\u3092\u884c\u3046\u305f\u3081\u306b\u30c7\u30fc\u30bf\u5206\u6790\u3092\u6d3b\u7528\u3057\u307e\u3059\u3002\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f <strong>\u30c7\u30fc\u30bf\u5206\u6790\u306e\u4f8b\u3068\u3057\u3066\u3001S&amp;P500\u306e\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u6642\u7cfb\u5217\u5206\u6790\u6280\u6cd5\u3092\u5b66\u3073\u3001\u682a\u4fa1\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u628a\u63e1\u3057\u3001\u305d\u308c\u3092\u3082\u3068\u306b\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3059\u308b\u65b9\u6cd5\u3002<\/strong>\u6700\u5f8c\u307e\u3067\u8aad\u3081\u3070\u3001\u682a\u5f0f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u91cd\u8981\u306a\u6982\u5ff5\u3068\u5206\u6790\u624b\u6cd5\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{color:var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{color:var(--global-palette2, #2B6CB0);font-size:28px;font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);line-height:2em;font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list .kb-table-of-contents__entry:hover{color:var(--global-palette6, #718096);}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}<\/style>\n\n\n<h2 class=\"wp-block-heading\">\u682a\u5f0f\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u5206\u6790\u306e\u91cd\u8981\u6027<\/h2>\n\n\n\n<p>\u682a\u4fa1\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306f\u3001\u682a\u4fa1\u304c\u6642\u9593\u306e\u7d4c\u904e\u3068\u3068\u3082\u306b\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u304b\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\u3068\u3001\u682a\u4fa1\u306e\u30d1\u30bf\u30fc\u30f3\u3068\u30c8\u30ec\u30f3\u30c9\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u3055\u3089\u306b\u3001\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3059\u308b\u30e2\u30c7\u30eb\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4eca\u56de\u306ePython\u306e\u30c7\u30fc\u30bf\u5206\u6790\u4f8b\u3067\u306f\u3001\u682a\u4fa1\u306e\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6d3b\u7528\u3057\u3066\u30c8\u30ec\u30f3\u30c9\u3092\u5206\u6790\u3057 <strong>ARIMA\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3059\u308b\u65b9\u6cd5<\/strong>\u3092\u5b66\u3093\u3067\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u306e\u30ed\u30fc\u30c9\u3068\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3<\/h2>\n\n\n\n<p>\u307e\u305a\u3001Python\u306e <strong>yfinance<\/strong> \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066S&amp;P 500\u306e\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u63a2\u7d22\u3057\u3066\u307f\u307e\u3059\u3002 yfinance\u306fYahoo Finance\u304b\u3089\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u53d6\u308a\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Python\u3067\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>yfinance\u3092yf\u3068\u3057\u3066\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\n\n# S&amp;P500\u6307\u6570\u30c7\u30fc\u30bf\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\nsp500 = yf.download('^GSPC', start='2010-01-01', end='2023-01-01')\n\n# \u30c7\u30fc\u30bf\u95b2\u89a7\nprint(sp500.head())\nprint(sp500.describe())<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001S&amp;P 500\u6307\u6570\u30c7\u30fc\u30bf\u3092Yahoo Finance\u304b\u3089\u53d6\u5f97\u3057\u3066\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u5f62\u5f0f\u3067\u4fdd\u5b58\u3057\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u306f\u65e5\u4ed8\u5225\u306b\u682a\u4fa1\u6307\u6570\u306e <strong>\u7d42\u5024<\/strong>, <strong>\u8449\u5dfb<\/strong>, <strong>\u9ad8\u4fa1\u5024<\/strong>, <strong>\u4f4e\u4fa1\u683c<\/strong>\u305d\u3057\u3066 <strong>\u53d6\u5f15\u91cf<\/strong>\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u8aac\u660e<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\u65e5\u4ed8<\/code>\u65e5\u4ed8\uff1a\u65e5\u4ed8<\/li>\n\n\n\n<li><code>\u30aa\u30fc\u30d7\u30f3<\/code>\u8a69\u6b4c : \u8a69\u6b4c<\/li>\n\n\n\n<li><code>\u9ad8<\/code>\u4fa1\u683c : \u9ad8\u4fa1<\/li>\n\n\n\n<li><code>\u4f4e<\/code>\u4fa1\u683c : \u4f4e\u4fa1\u683c<\/li>\n\n\n\n<li><code>\u9589\u3058\u308b<\/code>\u7d42\u5024 : \u7d42\u5024<\/li>\n\n\n\n<li><code>Adj Close<\/code>\u4fee\u6b63\u7d42\u5024(\u914d\u5f53\u3068\u682a\u5f0f\u5206\u5272\u3092\u53cd\u6620\u3057\u305f\u4fa1\u683c)<\/li>\n\n\n\n<li><code>\u30dc\u30ea\u30e5\u30fc\u30e0<\/code>\u53d6\u5f15\u91cf : \u53d6\u5f15\u91cf<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u30c7\u30fc\u30bf\u306b\u306f\u3001\u682a\u5f0f\u6642\u7cfb\u5217\u5206\u6790\u306b\u5fc5\u8981\u306a\u60c5\u5831\u304c\u3059\u3079\u3066\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u7279\u306b <strong>\u7d42\u5024<\/strong>\u306f\u3001\u682a\u4fa1\u5206\u6790\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316<\/h2>\n\n\n\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\u969b\u306b\u306f\u3001\u307e\u305a\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3059\u308b\u3053\u3068\u306b\u3088\u308a <strong>\u30c8\u30ec\u30f3\u30c9\u3068\u30d1\u30bf\u30fc\u30f3\u3092\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u91cd\u8981<\/strong>\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u682a\u4fa1\u304c\u9577\u671f\u7684\u306b\u4e0a\u6607\u307e\u305f\u306f\u4e0b\u843d\u3059\u308b\u304b\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u793a\u3059\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u682a\u4fa1\u306e\u53ef\u8996\u5316<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>matplotlib.pyplot as plt \u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\n\n# \u7d42\u5024\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316\nplt.figure(figsize=(10, 6))\nplt.plot(sp500['Close'], label='S&amp;P 500\u7d42\u5024', color='blue')\nplt.title('S&amp;P 500\u6307\u6570\u7d42\u5024\u6642\u7cfb\u5217')\nplt.xlabel('\u65e5\u4ed8')\nplt.ylabel('\u7d42\u5024 (USD)')\nplt.legend()\nplt.show()<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067S&amp;P 500\u6307\u6570\u306e\u7d42\u5024\u30c7\u30fc\u30bf\u3092\u8996\u899a\u5316\u3059\u308b\u3068\u3001\u6642\u9593\u306e\u7d4c\u904e\u3068\u3068\u3082\u306b\u682a\u4fa1\u304c\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3057\u305f\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4e00\u822c\u7684\u306b\u3001S&amp;P 500\u6307\u6570\u306f\u9577\u671f\u7684\u306b\u4e0a\u6607\u3059\u308b\u50be\u5411\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<style>.kb-image2545_d34f3d-2d .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2545_d34f3d-2d img.kb-img, .kb-image2545_d34f3d-2d .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2545_d34f3d-2d\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"600\" height=\"382\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-16-600x382.jpg\" alt=\"\ud30c\uc774\uc36c \ub370\uc774\ud130\ubd84\uc11d \uc608\uc81c \uadf8\ub9bc S&amp;P 500 \uc8fc\uc2dd \ub370\uc774\ud130\" class=\"kb-img wp-image-2551\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-16-600x382.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-16-300x191.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-16-768x489.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-16.jpg 859w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u4e0d\u601d\u8b70\u306a\u3053\u3068\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u306d\u3002 \u306a\u305c\u3053\u3093\u306a\u3053\u3068\u304c\u8d77\u3053\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f <a href=\"https:\/\/secondlife.lol\/ja\/%ed%8c%8c%ec%9d%b4%ec%8d%ac-%ed%95%9c%ea%b8%80-%ea%b9%a8%ec%a7%90-%ed%95%b4%ea%b2%b0-%ec%8b%9c%ea%b0%81%ed%99%94%ec%97%90%ec%84%9c-%ed%95%9c%ea%b8%80-%ed%85%8d%ec%8a%a4%ed%8a%b8-%eb%ac%b8%ec%a0%9c\/\" data-type=\"post\" data-id=\"2575\">Python\u306e\u30cf\u30f3\u30b0\u30eb\u6587\u5b57\u5316\u3051\u3092\u89e3\u6c7a\uff1a\u8996\u899a\u5316\u3067\u30cf\u30f3\u30b0\u30eb\u30c6\u30ad\u30b9\u30c8\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b<\/a>  \u3053\u306e\u8a18\u4e8b\u3067\u78ba\u8a8d\u3057\u3066\u3001\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u79fb\u52d5\u5e73\u5747\u306b\u3088\u308b\u30c8\u30ec\u30f3\u30c9\u5206\u6790<\/h2>\n\n\n\n<p><strong>\u79fb\u52d5\u5e73\u5747(Moving Average)<\/strong>\u306f\u3001\u682a\u4fa1\u306e\u77ed\u671f\u7684\u306a\u5909\u52d5\u3092\u53d6\u308a\u9664\u304d\u3001\u5168\u4f53\u7684\u306a\u30c8\u30ec\u30f3\u30c9\u3092\u628a\u63e1\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u624b\u6cd5\u3067\u3059\u3002\u4e00\u822c\u7684\u306b <strong>\u77ed\u671f\u79fb\u52d5\u5e73\u5747<\/strong>\u305d\u3057\u3066 <strong>\u9577\u671f\u79fb\u52d5\u5e73\u5747<\/strong>\u3092\u4f75\u7528\u3057\u3066\u50be\u5411\u3092\u5206\u6790\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u77ed\u671f\u30fb\u9577\u671f\u79fb\u52d5\u5e73\u5747\u306e\u53ef\u8996\u5316<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u77ed\u671f\u79fb\u52d5\u5e73\u5747(50\u65e5)\u3068\u9577\u671f\u79fb\u52d5\u5e73\u5747(200\u65e5)\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\nsp500['MA50'] = sp500['Close'].rolling(window=50).mean()\nsp500['MA200'] = sp500['Close'].rolling(window=200).mean()\n\n#\u79fb\u52d5\u5e73\u5747\u306e\u53ef\u8996\u5316\nplt.figure(figsize=(10, 6))\nplt.plot(sp500['Close'], label='\u7d42\u5024', color='blue')\nplt.plot(sp500['MA50'], label='50 \u65e5\u79fb\u52d5\u5e73\u5747', color='red')\nplt.plot(sp500['MA200'], label='200 \u65e5\u79fb\u52d5\u5e73\u5747', color='green')\nplt.title('S&amp;P 500\u6307\u6570\u3068\u79fb\u52d5\u5e73\u5747')\nplt.xlabel('\u65e5\u4ed8')\nplt.ylabel('\u4fa1\u683c (USD)')\nplt.legend()\nplt.show()<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f50\u65e5\u3068200\u65e5 <strong>\u79fb\u52d5\u5e73\u5747<\/strong>\u3092\u53ef\u8996\u5316\u3057\u3001\u682a\u4fa1\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u5206\u6790\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u77ed\u671f\u79fb\u52d5\u5e73\u5747\u304c\u9577\u671f\u79fb\u52d5\u5e73\u5747\u3088\u308a\u4e0a\u306b\u3042\u308b\u3068\u304d\u306f\u4e0a\u6607\u30c8\u30ec\u30f3\u30c9\u3001\u9006\u306b\u4e0b\u306b\u3042\u308b\u3068\u304d\u306f\u4e0b\u843d\u30c8\u30ec\u30f3\u30c9\u3068\u89e3\u91c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<style>.kb-image2545_16f4b0-71 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2545_16f4b0-71 img.kb-img, .kb-image2545_16f4b0-71 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2545_16f4b0-71\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"600\" height=\"382\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-17-600x382.jpg\" alt=\"\ud30c\uc774\uc36c \ub370\uc774\ud130\ubd84\uc11d \uc608\uc81c \uadf8\ub9bc S&amp;P 500 \uc8fc\uc2dd \ub370\uc774\ud130\" class=\"kb-img wp-image-2552\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-17-600x382.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-17-300x191.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-17-768x489.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-17.jpg 859w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">ARIMA\u30e2\u30c7\u30eb\u3092\u7528\u3044\u305f\u5c06\u6765\u306e\u4fa1\u683c\u4e88\u6e2c<\/h2>\n\n\n\n<p>\u682a\u4fa1\u30c7\u30fc\u30bf\u3092\u3082\u3068\u306b <strong>ARIMA(\u81ea\u5df1\u56de\u5e30\u7d71\u5408\u79fb\u52d5\u5e73\u5747)<\/strong> \u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u5c06\u6765\u306e\u682a\u4fa1\u3092\u4e88\u6e2c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002ARIMA\u30e2\u30c7\u30eb\u306f\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3057\u3001\u5c06\u6765\u306e\u5024\u3092\u4e88\u6e2c\u3059\u308b\u305f\u3081\u306b\u3088\u304f\u4f7f\u308f\u308c\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ARIMA\u30e2\u30c7\u30eb\u306e\u69cb\u7bc9\u3068\u4e88\u6e2c<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>statsmodels.tsa.arima.model from statsmodels.tsa.arima.model import ARIMA\n\n# \u7d42\u5024\u30c7\u30fc\u30bf\u306e\u307f\u9078\u629e\nsp500_close = sp500['Close'].dropna()\n\n# ARIMA\u30e2\u30c7\u30eb\u5b66\u7fd2 (p=5, d=1, q=0)\nmodel = ARIMA(sp500_close, order=(5, 1, 0))\nmodel_fit = model.fit()\n\n# 30\u65e5\u5f8c\u306e\u4e88\u6e2c\nforecast = model_fit.forecast(steps=30)\nprint(forecast)\n\n# \u4e88\u6e2c\u7d50\u679c\u306e\u53ef\u8996\u5316\nplt.figure(figsize=(10, 6))\nplt.plot(sp500_close, label='\u5b9f\u969b\u306e\u7d42\u5024')\nplt.plot(forecast.index, forecast, label='\u4e88\u6e2c\u7d42\u5024', color='red')\nplt.title('S&amp;P 500\u7d42\u5024\u4e88\u6e2c\uff08ARIMA\u30e2\u30c7\u30eb\uff09')\nplt.xlabel('\u65e5\u4ed8')\nplt.ylabel('\u4fa1\u683c (USD)')\nplt.legend()\nplt.show()<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f <strong>ARIMA\u30e2\u30c7\u30eb<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u682a\u5f0f\u306e\u7d42\u5024\u3092\u4e88\u6e2c\u3057\u300130\u65e5\u9593\u306e\u5c06\u6765\u306e\u4fa1\u683c\u3092\u63a8\u5b9a\u3057\u307e\u3059\u3002\u4e88\u6e2c\u3055\u308c\u305f\u4fa1\u683c\u3068\u5b9f\u969b\u306e\u682a\u4fa1\u3092\u6bd4\u8f03\u3059\u308b\u3053\u3068\u3067\u3001\u30e2\u30c7\u30eb\u304c\u3069\u306e\u7a0b\u5ea6\u306e\u7cbe\u5ea6\u3067\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3059\u308b\u304b\u3092\u8a55\u4fa1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<style>.kb-image2545_73b0a3-32 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2545_73b0a3-32 img.kb-img, .kb-image2545_73b0a3-32 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2545_73b0a3-32\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"600\" height=\"376\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-18-600x376.jpg\" alt=\"\ud30c\uc774\uc36c \ub370\uc774\ud130\ubd84\uc11d \uc608\uc81c \uadf8\ub9bc S&amp;P 500 \uc8fc\uc2dd \ub370\uc774\ud130\" class=\"kb-img wp-image-2553\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-18-600x376.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-18-300x188.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-18-768x481.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-18.jpg 873w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30e2\u30c7\u30eb\u8a55\u4fa1<\/h2>\n\n\n\n<p>ARIMA\u30e2\u30c7\u30eb\u3092\u8a55\u4fa1\u3059\u308b\u305f\u3081\u306b <strong><a href=\"https:\/\/ailib.secondlife.lol\/mean-squared-error-mse\/\">\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee(MSE)<\/a><\/strong>\u79c1 <strong>AIC(\u30a2\u30ab\u30a4\u30b1\u60c5\u5831\u57fa\u6e96)<\/strong> \u306a\u3069\u306e\u6307\u6a19\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u6307\u6a19\u306f\u3001\u30e2\u30c7\u30eb\u306e\u4e88\u6e2c\u6027\u80fd\u3092\u5b9a\u91cf\u7684\u306b\u8a55\u4fa1\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30c7\u30eb\u8a55\u4fa1\u6307\u6a19<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># \u30e2\u30c7\u30eb\u8a55\u4fa1\nmse = ((sp500_close[-30:] - forecast)**2).mean()\nprint(f'\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee(MSE)\uff1a{mse}')\n\n# AIC\u5024\u3092\u51fa\u529b\nprint(f'AIC: {model_fit.aic}')<\/code><\/pre>\n\n\n\n<p>MSE\u306f\u4e88\u6e2c\u5024\u3068\u5b9f\u969b\u306e\u5024\u3068\u306e\u5dee\u3092\u6e2c\u5b9a\u3057\u3001\u5024\u304c\u5c0f\u3055\u3044\u307b\u3069\u30e2\u30c7\u30eb\u306e\u4e88\u6e2c\u304c\u6b63\u78ba\u3067\u3042\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002 \u307e\u305f\u3001AIC\u306f\u30e2\u30c7\u30eb\u306e\u8907\u96d1\u3055\u3068\u6027\u80fd\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u6e2c\u5b9a\u3059\u308b\u6307\u6a19\u3067\u3042\u308a\u3001\u5024\u304c\u4f4e\u3044\u307b\u3069\u826f\u3044\u30e2\u30c7\u30eb\u3068\u898b\u306a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7d50\u679c\u5024\n\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee(MSE): nan\nAIC: 31515.1006909070282<\/code><\/pre>\n\n\n\n<p>AIC\u306f\u5024\u304c\u51fa\u308b\u306e\u306b\u3001\u306a\u305cMSE\u306f\u5024\u304c\u3046\u307e\u304f\u51fa\u306a\u304b\u3063\u305f\u306e\u3067\u3057\u3087\u3046\u304b\uff1f \u305d\u3057\u3066\u3001nan\u306f\u4f55\u3092\u610f\u5473\u3059\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f <a href=\"https:\/\/secondlife.lol\/ja\/fixing-nan-in-python-arima-predictions\/\" data-type=\"post\" data-id=\"2561\">Python\u306enan\u9664\u53bb: ARIMA\u30e2\u30c7\u30eb\u4e88\u6e2c\u306b\u304a\u3051\u308bnan\u554f\u984c\u306e\u89e3\u6c7a<\/a> \u3053\u306e\u8a18\u4e8b\u3067\u78ba\u8a8d\u3057\u3066\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u5206\u6790\u3067\u3088\u304f\u3042\u308b\u30df\u30b9\u3068\u89e3\u6c7a\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u4eca\u56de\u306fPython\u30c7\u30fc\u30bf\u5206\u6790\u306e\u4f8b\u984c\u3067\u3088\u304f\u767a\u751f\u3059\u308b\u30df\u30b9\u3068\u305d\u306e\u89e3\u6c7a\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/ailib.secondlife.lol\/overfitting-solutions-ai-models\/\">\u30e2\u30c7\u30eb\u30aa\u30fc\u30d0\u30fc\u30d5\u30a3\u30c3\u30c8<\/a><\/strong>\uff1a\u30c7\u30fc\u30bf\u3092\u904e\u5ea6\u306b\u7d30\u304b\u304f\u5206\u6790\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u304c\u904e\u9069\u5408\u3057\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3059\u308b\u4e88\u6e2c\u6027\u80fd\u304c\u4f4e\u4e0b\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u9632\u3050\u305f\u3081\u306b\u3001\u9069\u5207\u306a\u30e2\u30c7\u30eb\u3092\u9078\u629e\u3057\u3001\u76f8\u4e92\u691c\u8a3c\u3092\u901a\u3058\u3066\u30e2\u30c7\u30eb\u306e\u6027\u80fd\u3092\u8a55\u4fa1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30c7\u30fc\u30bf\u5909\u63db\u4e0d\u8db3<\/strong>: ARIMA\u30e2\u30c7\u30eb\u3092\u9069\u7528\u3059\u308b\u524d\u306b\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e <strong>\u6b63\u5e38\u6027(Stationarity)<\/strong>\u3092\u78ba\u8a8d\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5dee\u5206(\u5dee\u5206)\u3067\u6b63\u898f\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3092\u898b\u843d\u3068\u3059\u3068\u3001\u30e2\u30c7\u30eb\u304c\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u77ed\u671f\u9593\u306e\u30c7\u30fc\u30bf\u3067\u4e88\u6e2c<\/strong>: \u3042\u307e\u308a\u306b\u3082\u77ed\u3044\u671f\u9593\u306e\u30c7\u30fc\u30bf\u3067\u672a\u6765\u3092\u4e88\u6e2c\u3059\u308b\u3068\u3001\u4fe1\u983c\u6027\u304c\u4f4e\u4e0b\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u5341\u5206\u306a\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u5b66\u7fd2\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<p><strong>Q1: ARIMA\u30e2\u30c7\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3069\u306e\u3088\u3046\u306b\u9078\u629e\u3057\u307e\u3059\u304b\uff1f<\/strong><br>A: ARIMA\u30e2\u30c7\u30eb\u306e <code>p<\/code>, <code>d<\/code>, <code>q<\/code> \u5024\u306f\u30c7\u30fc\u30bf\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3001 <strong>ACF(\u81ea\u5df1\u76f8\u95a2\u95a2\u6570)<\/strong>\u3068 <strong>PACF(\u90e8\u5206\u81ea\u5df1\u76f8\u95a2\u95a2\u6570)<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u9069\u5207\u306a\u5024\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u307e\u305f\u3001\u8907\u6570\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u8a66\u3057\u306a\u304c\u3089\u3001AIC\u5024\u3092\u6700\u5c0f\u5316\u3059\u308b\u65b9\u5411\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>Q2: ARIMA\u4ee5\u5916\u306e\u4e88\u6e2c\u30e2\u30c7\u30eb\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/strong><br>A: ARIMA\u4ee5\u5916\u306b\u3082 <strong>\u9810\u8a00\u8005<\/strong>, <strong>SARIMA(\u5b63\u7bc0\u306eARIMA)<\/strong>, <strong>LSTM(\u9577\u77ed\u8a18\u61b6)<\/strong>\u306e\u3088\u3046\u306a\u6642\u7cfb\u5217\u4e88\u6e2c\u30e2\u30c7\u30eb\u304c\u3042\u308a\u307e\u3059\u3002 \u5404\u30e2\u30c7\u30eb\u306f\u3001\u30c7\u30fc\u30bf\u306e\u7279\u6027\u306b\u3088\u3063\u3066\u9069\u5408\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u8907\u6570\u306e\u30e2\u30c7\u30eb\u3092\u6bd4\u8f03\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>Q3: \u682a\u5f0f\u30c7\u30fc\u30bf\u4e88\u6e2c\u306e\u9650\u754c\u306f\u4f55\u3067\u3059\u304b\uff1f<\/strong><br>A: \u682a\u5f0f\u5e02\u5834\u306f\u3001\u7570\u5e38\u3067\u4e88\u6e2c\u304c\u56f0\u96e3\u306a\u5916\u90e8\u8981\u56e0(\u4f8b\u3048\u3070\u3001\u653f\u6cbb\u7684\u4e8b\u4ef6\u3001\u7d4c\u6e08\u5371\u6a5f)\u306e\u5f71\u97ff\u3092\u591a\u304f\u53d7\u3051\u307e\u3059\u3002 \u305d\u306e\u305f\u3081\u3001\u30e2\u30c7\u30eb\u306b\u3088\u308b\u4e88\u6e2c\u306f\u3042\u308b\u7a0b\u5ea6\u5f79\u306b\u7acb\u3061\u307e\u3059\u304c\u3001\u6b63\u78ba\u306a\u4e88\u6e2c\u306f\u4e0d\u53ef\u80fd\u3067\u3042\u308a\u3001\u30ea\u30b9\u30af\u7ba1\u7406\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6574\u7406\u3059\u308b<\/h2>\n\n\n\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001Python <strong>\u30c7\u30fc\u30bf\u5206\u6790\u4f8b<\/strong>\u3067S&amp;P500\u306e\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u305f\u6642\u7cfb\u5217\u5206\u6790\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3057\u305f\u3002\u682a\u4fa1\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u628a\u63e1\u3059\u308b\u305f\u3081\u306b\u79fb\u52d5\u5e73\u5747\u3092\u4f7f\u7528\u3057\u3001ARIMA\u30e2\u30c7\u30eb\u3092\u6d3b\u7528\u3057\u3066\u5c06\u6765\u306e\u4fa1\u683c\u3092\u4e88\u6e2c\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3057\u305f\u3002\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u5206\u6790\u306f\u3001\u682a\u5f0f\u5e02\u5834\u3060\u3051\u3067\u306a\u304f\u69d8\u3005\u306a\u5206\u91ce\u3067\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30c7\u30fc\u30bf\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u7406\u89e3\u3057\u3001\u4e88\u6e2c\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u306a\u305f\u3082\u69d8\u3005\u306a\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u6d3b\u7528\u3057\u3066\u6642\u7cfb\u5217\u5206\u6790\u3092\u5b9f\u8df5\u3057\u3001\u6295\u8cc7\u6226\u7565\u306e\u7b56\u5b9a\u306b\u5f79\u7acb\u3066\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#\u7528\u8a9e\u8aac\u660e<\/h3>\n\n\n\n<p><strong>1.\u6642\u7cfb\u5217\u5206\u6790 (Time Series Analysis)<\/strong><br>\u6642\u7cfb\u5217\u5206\u6790\u306f\u3001\u6642\u9593\u306e\u7d4c\u904e\u3068\u3068\u3082\u306b\u767a\u751f\u3059\u308b\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002\u682a\u5f0f\u30c7\u30fc\u30bf\u3001\u5929\u6c17\u3001\u7d4c\u6e08\u6307\u6a19\u306a\u3069\u3001\u6642\u9593\u306b\u3088\u3063\u3066\u5909\u5316\u3059\u308b\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3057\u3066\u30d1\u30bf\u30fc\u30f3\u3092\u898b\u3064\u3051\u3001\u672a\u6765\u3092\u4e88\u6e2c\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>2.ARIMA\u30e2\u30c7\u30eb<\/strong><br>ARIMA\u306f <strong>\u81ea\u52d5\u56de\u5e30\u7d71\u5408\u79fb\u52d5\u5e73\u5747<\/strong>\u306e\u7565\u3067\u3001\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u3082\u3068\u306b\u672a\u6765\u3092\u4e88\u6e2c\u3059\u308b\u6642\u7cfb\u5217\u30e2\u30c7\u30eb\u3067\u3059\u3002ARIMA\u30e2\u30c7\u30eb\u306f\u3001\u81ea\u5df1\u56de\u5e30(AR)\u3001\u5dee\u5206(Differencing)\u3001\u79fb\u52d5\u5e73\u5747(MA)\u306e3\u3064\u306e\u8981\u7d20\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>p<\/strong>: \u81ea\u5df1\u56de\u5e30(AR)\u306e\u6b21\u6570\u3002\u904e\u53bb\u306e\u30c7\u30fc\u30bf\u304c\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u306b\u3069\u308c\u3060\u3051\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u304b\u3092\u793a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>d<\/strong>: \u5dee\u5206\u56de\u6570\u3002\u30c7\u30fc\u30bf\u3092\u5b89\u5b9a\u3057\u305f\u5f62\u306b\u3059\u308b\u305f\u3081\u306b\u3001\u30c7\u30fc\u30bf\u9593\u306e\u5dee\u3092\u4f55\u56de\u8a08\u7b97\u3057\u305f\u304b\u3092\u793a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>q<\/strong>: \u79fb\u52d5\u5e73\u5747(MA)\u306e\u6b21\u6570\u3002\u904e\u53bb\u306e\u4e88\u6e2c\u8aa4\u5dee\u304c\u73fe\u5728\u306e\u5024\u306b\u3069\u306e\u7a0b\u5ea6\u5f71\u97ff\u3059\u308b\u304b\u3092\u793a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>3.\u79fb\u52d5\u5e73\u5747 (Moving Average)<\/strong><br>\u79fb\u52d5\u5e73\u5747\u306f\u3001\u30c7\u30fc\u30bf\u306e\u30dc\u30e9\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u6e1b\u3089\u3059\u305f\u3081\u306b\u4e00\u5b9a\u671f\u9593\u306e\u5e73\u5747\u3092\u53d6\u308b\u65b9\u6cd5\u3067\u3059\u3002\u682a\u5f0f\u5206\u6790\u3067\u306f\u3001\u77ed\u671f(50\u65e5)\u3001\u9577\u671f(200\u65e5)\u79fb\u52d5\u5e73\u5747\u3092\u3088\u304f\u4f7f\u3044\u307e\u3059\u3002\u79fb\u52d5\u5e73\u5747\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u3088\u308a\u7c21\u5358\u306b\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>4.\u7d42\u5024 (Closing Price)<\/strong><br>\u7d42\u5024\u3068\u306f\u30011\u65e5\u306e\u53d6\u5f15\u7d42\u4e86\u5f8c\u306e\u5f53\u8a72\u9298\u67c4\u307e\u305f\u306f\u6307\u6570\u306e\u6700\u7d42\u4fa1\u683c\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u682a\u5f0f\u30c7\u30fc\u30bf\u5206\u6790\u3067\u6700\u3082\u91cd\u8981\u306a\u5909\u6570\u306e\u4e00\u3064\u3067\u3042\u308a\u3001\u682a\u4fa1\u306e\u30c8\u30ec\u30f3\u30c9\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306b\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>5.yfinance<\/strong><br><strong>yfinance<\/strong>\u306f <a href=\"https:\/\/finance.yahoo.com\/\" target=\"_blank\" rel=\"noopener\">\u30e4\u30d5\u30fc\u30d5\u30a1\u30a4\u30ca\u30f3\u30b9<\/a>\u304b\u3089\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u53d6\u308a\u8fbc\u3081\u308b\u3088\u3046\u306b\u3059\u308bPython\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 \u3053\u308c\u3092\u4f7f\u3046\u3068\u3001\u7279\u5b9a\u671f\u9593\u306e\u682a\u5f0f\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5206\u6790\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>6.AIC(\u8d64\u6c60\u60c5\u5831\u57fa\u6e96)<\/strong><br>AIC\u306f\u7d71\u8a08\u30e2\u30c7\u30eb\u306e\u6027\u80fd\u3092\u8a55\u4fa1\u3059\u308b\u6307\u6a19\u3067\u3001\u30e2\u30c7\u30eb\u306e\u7cbe\u5ea6\u3068\u8907\u96d1\u3055\u3092\u4e00\u7dd2\u306b\u8003\u616e\u3057\u307e\u3059\u3002AIC\u5024\u304c\u4f4e\u3044\u307b\u3069\u3001\u3088\u308a\u826f\u3044\u30e2\u30c7\u30eb\u3068\u307f\u306a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>7.\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee (Mean Squared Error, MSE)<\/strong><br>MSE\u306f\u3001\u4e88\u6e2c\u5024\u3068\u5b9f\u969b\u306e\u5024\u306e\u5dee\u3092\u4e8c\u4e57\u3057\u305f\u5f8c\u3001\u5e73\u5747\u3092\u6c42\u3081\u305f\u5024\u3067\u3001\u4e88\u6e2c\u30e2\u30c7\u30eb\u306e\u6027\u80fd\u3092\u8a55\u4fa1\u3059\u308b\u6307\u6a19\u3067\u3059\u3002 \u5024\u304c\u5c0f\u3055\u3044\u307b\u3069\u3001\u4e88\u6e2c\u304c\u6b63\u78ba\u3067\u3042\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\uc8fc\uc2dd \uc2dc\uc7a5\uc5d0\uc11c \ub370\uc774\ud130 \ubd84\uc11d\uc740 \ub9e4\uc6b0 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4. \ud22c\uc790\uc790\ub4e4\uc740 \uc8fc\uc2dd&#8230;<\/p>","protected":false},"author":3,"featured_media":2632,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[247,34,248,249,177,244,245,246,250,251],"class_list":["post-2545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-arima","tag-python","tag-sp-500","tag-249","tag-177","tag-244","tag-245","tag-246","tag-250","tag-251"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":247,"label":"ARIMA"},{"value":34,"label":"python"},{"value":248,"label":"S&amp;P 500"},{"value":249,"label":"\uae08\uc735 \ub370\uc774\ud130"},{"value":177,"label":"\ub370\uc774\ud130 \ubd84\uc11d"},{"value":244,"label":"\uc2dc\uacc4\uc5f4 \ubd84\uc11d"},{"value":245,"label":"\uc8fc\uc2dd \ub370\uc774\ud130"},{"value":246,"label":"\uc8fc\uc2dd \uc608\uce21"},{"value":250,"label":"\uc8fc\uc2dd \ud22c\uc790"},{"value":251,"label":"\uc8fc\uc2dd \ud2b8\ub80c\ub4dc \ubd84\uc11d"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/\ud30c\uc774\uc36c-\ub370\uc774\ud130\ubd84\uc11d-\uc608\uc81c-\ud3ec\uc2a4\ud2b8-\uc378\ub124\uc77c-2-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/ja\/author\/tere\/"},"comment_info":0,"category_info":[{"term_id":6,"name":"\uc54c(R)","slug":"r-coding","term_group":0,"term_taxonomy_id":6,"taxonomy":"category","description":"","parent":20,"count":61,"filter":"raw","cat_ID":6,"category_count":61,"category_description":"","cat_name":"\uc54c(R)","category_nicename":"r-coding","category_parent":20}],"tag_info":[{"term_id":247,"name":"ARIMA","slug":"arima","term_group":0,"term_taxonomy_id":247,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":34,"name":"python","slug":"python","term_group":0,"term_taxonomy_id":34,"taxonomy":"post_tag","description":"","parent":0,"count":21,"filter":"raw"},{"term_id":248,"name":"S&amp;P 500","slug":"sp-500","term_group":0,"term_taxonomy_id":248,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":249,"name":"\uae08\uc735 \ub370\uc774\ud130","slug":"%ea%b8%88%ec%9c%b5-%eb%8d%b0%ec%9d%b4%ed%84%b0","term_group":0,"term_taxonomy_id":249,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":177,"name":"\ub370\uc774\ud130 \ubd84\uc11d","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":177,"taxonomy":"post_tag","description":"","parent":0,"count":36,"filter":"raw"},{"term_id":244,"name":"\uc2dc\uacc4\uc5f4 \ubd84\uc11d","slug":"%ec%8b%9c%ea%b3%84%ec%97%b4-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":244,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":245,"name":"\uc8fc\uc2dd \ub370\uc774\ud130","slug":"%ec%a3%bc%ec%8b%9d-%eb%8d%b0%ec%9d%b4%ed%84%b0","term_group":0,"term_taxonomy_id":245,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":246,"name":"\uc8fc\uc2dd \uc608\uce21","slug":"%ec%a3%bc%ec%8b%9d-%ec%98%88%ec%b8%a1","term_group":0,"term_taxonomy_id":246,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":250,"name":"\uc8fc\uc2dd \ud22c\uc790","slug":"%ec%a3%bc%ec%8b%9d-%ed%88%ac%ec%9e%90","term_group":0,"term_taxonomy_id":250,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":251,"name":"\uc8fc\uc2dd \ud2b8\ub80c\ub4dc \ubd84\uc11d","slug":"%ec%a3%bc%ec%8b%9d-%ed%8a%b8%eb%a0%8c%eb%93%9c-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":251,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/comments?post=2545"}],"version-history":[{"count":11,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2545\/revisions"}],"predecessor-version":[{"id":2633,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2545\/revisions\/2633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media\/2632"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media?parent=2545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/categories?post=2545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/tags?post=2545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}