Telegram Group & Telegram Channel
مدلسازی گام تصادفی (Random Walk) در پایتون
فرضیه گام تصادفی (که به آن ولگشت هم گفته می شود) نمایانگر حالتی است که مقدار آتی یک متغیر وابسته به مقدار حال آن به اضافه یک مقدار تصادفی است. به عنوان مثال، مسیر طی شده توسط یک مولکول هنگام حرکت درون گاز یا مایع، مسیر حرکت یک حیوان علف‌خوار، نوسانات قیمت سهام و ...؛ مواردی است که می‌تواند با گام تصادفی مدل‌سازی شود.
xt=xt−1+wt
که wt بیانگر جزء تصادفی است که دارای خصوصیات وایت نویز است. (بعدا راجع به وایت نویز صحبت می کنیم.)
یک مدل گام تصادفی به صورت زیر در پایتون قابل پیاده سازی است.
import numpy as np
import matplotlib.pyplot as plt
x = w = np.random.normal(size=1000)
for t in range(1000):
x[t] = x[t-1] + w[t]
plt.plot(x)
plt.show()

#پایتون_مالی
#مدلسازی_سری_زمانی
#سری_زمانی

پایتون برای مالی در تلگرام https://www.tg-me.com/fr/Python4Finance/com.python4finance
پایتون برای مالی در بله https://ble.im/fr/Python4Finance/com.python4finance



tg-me.com/python4finance/76
Create:
Last Update:

مدلسازی گام تصادفی (Random Walk) در پایتون
فرضیه گام تصادفی (که به آن ولگشت هم گفته می شود) نمایانگر حالتی است که مقدار آتی یک متغیر وابسته به مقدار حال آن به اضافه یک مقدار تصادفی است. به عنوان مثال، مسیر طی شده توسط یک مولکول هنگام حرکت درون گاز یا مایع، مسیر حرکت یک حیوان علف‌خوار، نوسانات قیمت سهام و ...؛ مواردی است که می‌تواند با گام تصادفی مدل‌سازی شود.
xt=xt−1+wt
که wt بیانگر جزء تصادفی است که دارای خصوصیات وایت نویز است. (بعدا راجع به وایت نویز صحبت می کنیم.)
یک مدل گام تصادفی به صورت زیر در پایتون قابل پیاده سازی است.
import numpy as np
import matplotlib.pyplot as plt
x = w = np.random.normal(size=1000)
for t in range(1000):
x[t] = x[t-1] + w[t]
plt.plot(x)
plt.show()

#پایتون_مالی
#مدلسازی_سری_زمانی
#سری_زمانی

پایتون برای مالی در تلگرام https://www.tg-me.com/fr/Python4Finance/com.python4finance
پایتون برای مالی در بله https://ble.im/fr/Python4Finance/com.python4finance

BY Python4Finance




Share with your friend now:
tg-me.com/python4finance/76

View MORE
Open in Telegram


Python4Finance Telegram | DID YOU KNOW?

Date: |

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.

Python4Finance from fr


Telegram Python4Finance
FROM USA