<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by kuankuan on Medium]]></title>
        <description><![CDATA[Stories by kuankuan on Medium]]></description>
        <link>https://medium.com/@lynn10008?source=rss-7b7b4f661ade------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fk6untRc5kpnq-Io</url>
            <title>Stories by kuankuan on Medium</title>
            <link>https://medium.com/@lynn10008?source=rss-7b7b4f661ade------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 15:10:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lynn10008/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MySQL recode]]></title>
            <link>https://medium.com/@lynn10008/mysql-recode-5b3bd858722c?source=rss-7b7b4f661ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b3bd858722c</guid>
            <dc:creator><![CDATA[kuankuan]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 14:29:46 GMT</pubDate>
            <atom:updated>2024-11-12T14:30:26.895Z</atom:updated>
            <content:encoded><![CDATA[<h3>MySQL record-1</h3><p>Install Mysql connector enable to control mySQL in python<br><em>pip install mysql-connector-python</em></p><p>Make sure mysql is ready to use<br><em>import mysql.connector<br>print(mysql.connector)</em></p><blockquote>Test for creating a table:<br>import mysql.connector</blockquote><blockquote># 連接到 MySQL<br>connection = mysql.connector.connect(<br> host=”localhost”,<br> user=”root”,<br> password=”your_password”, # 替換為你的 MySQL 密碼<br> database=”my_database”<br>)</blockquote><blockquote># 建立 cursor<br>cursor = connection.cursor()</blockquote><blockquote># 執行 SQL 指令來創建一個表<br>cursor.execute(“CREATE TABLE IF NOT EXISTS users (id INT PRIMARY KEY, name VARCHAR(50))”)</blockquote><blockquote># 插入數據<br>cursor.execute(“INSERT INTO users (id, name) VALUES (1, ‘Ella’)”)<br>connection.commit() # 提交更改</blockquote><blockquote># 查詢數據並打印<br>cursor.execute(“SELECT * FROM users”)<br>for row in cursor.fetchall():<br> print(row)</blockquote><blockquote># 關閉連接<br>cursor.close()<br>connection.close()</blockquote><p>Show all database<br><em>cursor.execute(“SHOW DATABASES”)<br>for db in cursor:<br>print(“資料庫:”, db[0])</em></p><p>Delete database<br><em>cursor.execute(“DROP DATABASE database_name”)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b3bd858722c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Financial Engineering -1]]></title>
            <link>https://medium.com/@lynn10008/financial-engineering-1-7d13996d19d4?source=rss-7b7b4f661ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d13996d19d4</guid>
            <dc:creator><![CDATA[kuankuan]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 09:35:25 GMT</pubDate>
            <atom:updated>2024-11-12T09:35:25.142Z</atom:updated>
            <content:encoded><![CDATA[<p>Influential Nobel prize winners in Economics<br>1952 — Markowitz mean-variance analysis<br>1990 — H. Markowitz, W. Sharpe, and M. Miller<br>1973 — Black &amp; Scholes option pricing problem<br>1997 — M. Scholes &amp; R. Merton</p><p>Financial Derivative Products is developed to meet specific financial needs and to manage risks associated with market fluctuations.Primarily it is for hedging to prevent potential loss, other function such as speculation and arbitrage are some of the reasons why the institutes and the investors own own derivative products.</p><p>❶ Option<br>Option gives the buyer the right to buy but not obligation, however seller bear the obligation.Investor can purchase this type of product when they expect to be bull or bear market.<br><strong>Call Options</strong>: Holder has the right to buy an asset at the strike price before expiration. Investors often buy calls if they expect the asset price to rise.<br><strong>Put Options</strong>: Holder has the right to sell an asset at the strike price before expiration. Investors often buy puts if they expect the asset price to fall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*_HQQwl83ODXRMuqOh6D0mQ.jpeg" /></figure><p>❷ Forward<br>Forward is the contract that allow buyer and seller make a agreement e agreement in which two parties agree to buy or sell an asset at a forward price on a future date. Unlike standardized futures contracts, forwards are customizable, privately negotiated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzxDs4Cig5gBR-n8IcgceQ.png" /></figure><p>❸Futures<br>Futures contracts are standardized financial derivatives that obligate parties to buy or sell an asset at a predetermined price on a specific future date.Being traded on exchanges and have standardized terms. This makes futures more accessible and less risky than forwards, as they involve lower counterparty risk due to the role of the exchange acting as a clearinghouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*emRhUat_xG8CTWkRCDJFTg.jpeg" /></figure><p>❹Swap is a financial derivative contract in which two parties agree to exchange, or “swap,” specific cash flows or other financial instruments over a set period. Swaps are primarily used to manage different types of financial risks, such as interest rate risk, currency risk, and credit risk, or to gain exposure to specific financial markets without actually owning the underlying assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*CPr5ZDAlGdYFARysiXEwiw.jpeg" /></figure><p>Interest rate swaps serve not only as tools for investment hedging but also as indicators for assessing default risk in financial markets. The <strong>swap spread</strong>, defined as the difference between the fixed rate of an interest rate swap contract and the yield of a government bond with the same maturity, reflects the market’s perception of credit risk. Thus, it plays a crucial role in measuring the <strong>credit spread</strong> associated with a particular asset’s credit risk premium.<br>SWAP asset:An <strong>asset swap</strong> is a type of interest rate swap in which a fixed-rate asset, like a bond, is swapped for a floating-rate asset.<br>SWAP liability:A <strong>liability swap</strong> is a swap arrangement designed to manage the interest rate exposure on a liability (such as a loan or bond issued by a corporation). The borrower swaps a fixed-rate liability for a floating-rate one, or vice versa, to better align with their financial strategy or outlook on interest rates.</p><p>Next article, we would discuss value evaluation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d13996d19d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Series Overview]]></title>
            <link>https://medium.com/@lynn10008/time-series-overview-c59b950fc7ae?source=rss-7b7b4f661ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/c59b950fc7ae</guid>
            <dc:creator><![CDATA[kuankuan]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 02:25:40 GMT</pubDate>
            <atom:updated>2024-11-07T02:25:40.284Z</atom:updated>
            <content:encoded><![CDATA[<p>Target: Forecast for a series of data.(Yi is not dependent on Yj)<br>Using past data to predict future trend explore between concurrent and lead-lag condition.</p><p>Mainly two kind of data series: <br>(1) Trend components<br>(2) Seasonal components</p><p>There are stationary time series and unstationary time series, if the data series is not stationary then we will apply “difference” in order to stablize it.</p><p>Memorial Type Model<br>(a) AR(Auto regressive) :自己和自己做回歸<br>*Auto regressive model of order one(AR1):<br>Zt = at +𝜑 (Zt-1)<br>*Autoregressive model of order n(AR(p)):<br>Zt = at +𝜑 1(Zt-1) + 𝜑2(Zt-2)…+𝜑p(Zt-p)<br>=&gt; (1-𝜑1(B)-…𝜑p(B^p))*Zt = at<br>=&gt; 𝜑(B)*Zt = at</p><p>(b) MA(Moving average):自己和過去的error做回歸<br>*moving average model of order one(MA1):<br>Zt = at -𝜃1at-1<br>*moving average model of order n(MA(q)):<br>Zt = at -𝜃1at-1 -𝜃2at-2…-𝜃qat-q<br>=&gt;(1-𝜃1(B)-…𝜃q(B^q))at = Zt<br>=&gt;𝜃(B)*at = Zt</p><p>*at = Zt — Zt hat, at~N(0,𝝈²) we called it “white noise(unknown error).<br>**B^kZt = Zt-k backward k term**</p><p>(c) ARMA(p,q):自己和自己以及過去的error做回歸<br>Zt-𝜑 1(Zt-1) + 𝜑2(Zt-2)…+𝜑p(Zt-p)=at -𝜃1at-1 -𝜃2at-2…-𝜃qat-q</p><p>(d)ARIMA(Autoregressive Integreted Movingaverage):Paramatic modeling<br>ARIMA(p,d,q):<br>Wt-𝜑1Wt-1-…𝜑pWt-p = at -𝜃1at-1-…𝜃qat-q,<br>in this equation equal to 𝜑(B)Wt = 𝜃(B)at<br>and due to Wt =(1-B)^d*Zt we get 𝜑(B)* (1-B)^d*Zt= 𝜃(B)at</p><p>Single variance Time Series:<br>Non-linear Multi-variance Time Series:<br>(A) ARCH Model<br>(B) Threshold AR Model<br>(C) Co-Integration<br>(D) Reduced Rank Model<br>(E) Scalar Components Model<br>(F) State-space Model</p><p>(1) Homogeneous Non-stationary Models均齊無定向模型<br>Use differece to stablize it:<br>ex.first difference: Wt = Zt — Zt-1=(1-B)Zt</p><p>❶ AR(p) test-&gt; Partial Autocorrelation Function(ACF)偏自我相關函數:<br>𝜙kk<br>❷ MA(q)test-&gt; Autocorrelation Function(ACF)自我相關函數:<br>𝜌k= Cov(Zt,Zt+k)/[(Var(Zt))^(1/2)*(Var(Zt+k))^(1/2)]<br>𝜌k hat ~N(0,Sd(𝜌k hat)²), k≥(q+1)</p><p>(2) Dynamic Regression Model<br>Xt-&gt;Yt (Transfer Function) , Xt&amp;Yt are time series<br>Yt = C + 𝜈(B)Xt +Nt <br>𝜈(B) = 𝜮vi*Bi = 𝝎(B)*B^b/𝛿(B)為轉換函數<br>𝝎(B) = 𝝎0-𝝎1B-…𝝎zB^z<br>𝛿(B) = 1-𝛿1(B)-…𝛿rB^r</p><p>❶ Cross Correlation Function(CCF)交叉相關函數<br>𝜌xy = Cxy/Sx*Sy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzAMmJMqBv_efyM2Ay8TVA.jpeg" /></figure><p>Intervention Model介入模式:<br>Zt~ARIMA<br>① Yt =Zt + 𝝎(B)/𝛿(B)𝜉t <br>② Zt = C + 𝜃(B)/𝜙(B)*at</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c59b950fc7ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bubble study//1— Tulipmania]]></title>
            <link>https://medium.com/@lynn10008/bubble-study-1-tulipmania-2c177d60330a?source=rss-7b7b4f661ade------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c177d60330a</guid>
            <dc:creator><![CDATA[kuankuan]]></dc:creator>
            <pubDate>Sat, 10 Feb 2024 12:18:05 GMT</pubDate>
            <atom:updated>2024-02-10T12:18:05.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*pbKahcKJIq9EDXFm.jpg" /></figure><p>graphs from : Cornell University</p><blockquote><strong>What was Dutch Tulip Bulb Market Bubble?</strong></blockquote><p>The Dutch tulip bulb market bubble occurred in Holland during the early to mid-1600s. It was first appeared in Europe in the 16th century, the distinction of the flower makes them unlike other flowers native to the continent.Due to the fragility of the tulips, professional cultivators began to refine the technique and produce the flowers locally in Holland.The bulb grew from seed would take 7 to 12 years before flowering, however the bulb itself could flower vary in next year.Back then tulip was a fixture in the garden of the dutch, it stands for the symbol of status , the wealth and popularity.The tulip trade became viral soon, even the citizens in lower status embarked on tulip trade.</p><p>Due to high demand for tulip, the market price of the flower skyrocketed.People invest in tulip market, not because of the intristic value but for the reason that they believe the price will continue to grow.Nevertheless, this frenzy investment was short-lived, when the bubble eventually burst, investors are no choice but to sell out all the worthless bulbs, which lead to significant loss of wealth for many traders.</p><blockquote><strong>How the tulip future market works?</strong></blockquote><p>The Tulip Futures Market allowed grower and buyers to hedge against price fluctuations, it also allowed for speculation.Even people who had no interest in growing or buying tulips began to purchase futures contract, which led to a speculative frenzy.Being lack of regulation even results in fraud, buyers selling tulip which did not exist or selling to multiple buyers.</p><blockquote><strong>How did the market crash?</strong></blockquote><p>The signs of impending market crash can be observed in many perspectives.First of all, the overvaluation of the market price was priced far beyond the true worth.Second, when investors exhibit irrational exuberance, buying tulip at any cost just believe the market price will never go down.Third, media attention on a specific market can lead to another trend, which makes more people invest in them.Last, many people bought tulip bulbs on credit even they are unaffordable, high levels of debt led to unimaginable crash.</p><p>sources from:</p><p><a href="https://www.investopedia.com/terms/d/dutch_tulip_bulb_market_bubble.asp">Tulipmania: About the Dutch Tulip Bulb Market Bubble</a></p><p><a href="https://fastercapital.com/content/Tulipmania--Unraveling-the-Dutch-Tulip-Bulb-Market-Bubble.html">https://fastercapital.com/content/Tulipmania--Unraveling-the-Dutch-Tulip-Bulb-Market-Bubble.html</a></p><p><a href="https://en.wikipedia.org/wiki/Irrational_exuberance">Irrational exuberance - Wikipedia</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c177d60330a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>