## 2014年1月20日 星期一

### [分享] LaTeX + TeXworks 簡潔安裝 (for windows / mac)

---

1. 首先下載 TeXworks ( 完全免費的 LaTeX 編輯軟體 for windows / mac / Linux)
(目前最新版本for windows 是 TeXworks 0.6.0 (Get it )

2. 再來 去下載一個任何一個可以執行的 LATEX 範本 ( *.tex 檔案)

3. 之後執行TeXworks 並載入之前步驟2中下載的 sample.tex 按執行 (下圖綠色撥放按鈕)

MiKTex: http://www.miktex.org/

4. 接著重新開啟 TeXworks 並再次讀取sample.tex此時若前述步驟3安裝成功，則可回到步驟2 (按下綠色播放按鈕執行)；即可發現TeXworks可以正常編譯，並成功的將LaTeX 編碼轉換成pdf檔案。至此便完成整個安裝作業。

## 2014年1月16日 星期四

### 遠期契約的特色

1. 在場外市場 (Over The Counter, OTC) 交易
2. 為買賣雙方的私人交易合約 => 流動性差 & 存在 違約風險(Default risk)
3. 非標準化合約 =>客製化
4. 可隨時到期
5. 在合約終止的時候才結算
6. 可能附加抵押品(collateralization)

### 期貨的特色

1. 在交易所(Exchange)交易 => 無違約風險 & 流動性較佳
2. 標準化合約
3. 到期時間固定
4. 每日結算(逐日盯市 Marking to Market)
5. 保證金制度(Margin)

[衍生商品] 期貨的基差風險 (Basis Risk)

ref: John C. Hull, Options, Futures and Other Derivatives 7th.

## 2014年1月14日 星期二

### [演算法] 平方收斂與超線性收斂

2. 超線性收斂 (Superlinear Convergence)

===========================

$J(u) = u^T A u + b^T u + c, \ A \succ 0$其最佳解可以在 $n$ 步或者少於 $n$ 步之內被求得。
===========================

1. 最陡坡度法 Steepest Descents Algorithm (fixed step & optimal step) 都不具備 Quadratic Convergence。(事實上最陡坡度法在搜尋解的時候會有 (歪來歪去!?) Zig-zag 的本質，這使得此法再在某些情況會收斂的異常緩慢甚至永遠不收斂...)

2. 牛頓法 (Newton-Raphson Algorithm)為Quadratic Convergence。關於牛頓法請參考：[最佳化] Generalized Newton Raphson Algorithm

3. Conjugate Direction Algorithm 為 Quadratic Convergence。有興趣的讀者請參考 Conjugate Direction Method 系列文章：[最佳化理論] Conjugate Direction Methods (0) -Basic Theory

===========================
Definition (Superlinear Convergence)

$\displaystyle \lim_{k \rightarrow \infty} \frac{||u^k - u^*||}{\theta^k} \rightarrow 0 \ \ \ \ \square$===========================

1. 超線性收斂顧名思義就是其收斂速度非常的快。比線性收斂更快。我們現在用下面幾個(收斂的)例子便可以看出超線性收斂確實是快!  比如說甚至 $exp(-k)$ 函數都不是超線性收斂。
2. Conjugate Direction Algorithm 具備 Superlinear Convergence。

===========================
Example 1:
$u^k = 1/k$ 是否為超線性收斂到 $u^* =0 ?$

Sol: NO!

$\displaystyle \lim_{k \rightarrow \infty} \frac{||u^k - u^*||}{\theta^k} = \displaystyle \lim_{k \rightarrow \infty} \frac{1/k}{(1/2)^k} = \displaystyle \lim_{k \rightarrow \infty} \frac{2^k}{k} \nrightarrow 0$事實上上述極限不收斂 $(\rightarrow \infty)$ $\square$

===========================

Example 2
$u^k = 1/k^2$ 是否為超線性收斂到 $u^* =0 ?$

Sol: NO!

===========================

Example 3
$u^k = e^{-k}$ 是否為超線性收斂 到 $u^* = 0?$

Sol: No

$\displaystyle \lim_{k \rightarrow \infty} \frac{||u^k - u^*||}{\theta^k} = \displaystyle \lim_{k \rightarrow \infty} \frac{e^{-k}}{(1/3)^k} = \displaystyle \lim_{k \rightarrow \infty} 3^k{e^{-k}} = \displaystyle \lim_{k \rightarrow \infty} 3^k (2.7183....)^{-k} \nrightarrow 0$$\square$
===========================

Example 4
$u^k = e^{-k^2}$ 是否為超線性收斂 到 $u^* = 0?$

Sol: YES

$\displaystyle \lim_{k \rightarrow \infty} \frac{||u^k - u^*||}{\theta^k} = \displaystyle \lim_{k \rightarrow \infty} \frac{e^{-k^2}}{\theta^k}$

${e^{ - {k^2}}}{\theta ^{ - k}} = {e^{ - {k^2}}}{e^{\ln {\theta ^{ - k}}}} = {e^{ - {k^2} + k\ln \frac{1}{\theta }}}$注意到不管 $\theta \in (0,1)$ 怎麼選，前方的 $-k^2$ 項都主導整個收斂速度，故上式收斂到 $u^* =0$，亦即 $u^k = e^{-k^2}$ 為超線性收斂 到 $u^* = 0$ $\square$

===========================

Example 5
$u^k = (1/k)^k$ 是否為超線性收斂 到 $u^* = 0?$

Sol: YES

$\mathop {\lim }\limits_{k \to \infty } \frac{{\left\| {{u^k} - {u^*}} \right\|}}{{{\theta ^k}}} = \mathop {\lim }\limits_{k \to \infty } \frac{{{{\left( {1/k} \right)}^k}}}{{{\theta ^k}}} \ \ \ \ (\star)$現在我們觀察
$\frac{{{{\left( {1/k} \right)}^k}}}{{{\theta ^k}}} = {k^{ - k}}{\theta ^{ - k}} = {\left( {k\theta } \right)^{ - k}}$又因為 $0 < \theta < 1$，亦即無論 $\theta$ 怎麼選，式 $(\star)$ 都必收斂
$\mathop {\lim }\limits_{k \to \infty } {\left( {k\theta } \right)^{ - k}} \to 0$故 $u^k = (1/k)^k$ 為超線性收斂。$\square$

## 2014年1月13日 星期一

### [Windows] 微軟內建的 惡意軟體移除工具

NOTE: 如果沒有此軟體的讀者，可至以下 微軟官方連結處 下載 (適用 Win XP/Vista/7/8/...)
http://www.microsoft.com/security/pc-security/malware-removal.aspx

## 2014年1月12日 星期日

### [轉載] Can Control Science Bring New Insights to Stock Trading Research?

Date:
2013
Location Information:
2013 IEEE Conference on Decision and Control - Florence, Italy, December 2013
Author:  B. Ross Barmish
Author Bio:
B. Ross Barmish received the Bachelor's degree in Electrical Engineering from McGill University in 1971. In 1972 and 1975 respectively, he received the M.S. and Ph.D. degrees, both in Electrical Engineering, from Cornell University. From 1975 to 1978, he served as Assistant Professor of Engineering and Applied Science at Yale University. From 1978 to 1984, he was as an Associate Professor of Electrical Engineering at the University of Rochester and in 1984, he joined the University of Wisconsin, Madison, where he is currently Professor of Electrical and Computer Engineering. From 2001 to 2003, he was with the Department of Electrical Engineering and Computer Science at Case Western Reserve University, where he served as Department Chair while holding the endowed Nord Professorship. Over the years, he has been involved in a number of IEEE Control Systems Society activities such as associate editorships, conference chairmanships, the Board of Governors and prize paper committees. He has also served as a consultant for a number of companies and is the author of the textbook New Tools for Robustness of Linear Systems, Macmillan, 1994. Professor Barmish is a Fellow of both the IEEE and IFAC for his contributions to the theory of robustness of dynamical systems. He received the Best Paper Award for Journal Publication in Automatica, covering a three-year period, on two consecutive occasions from the International Federation of Automatic Control. He has also given a number of plenary lectures at major conferences. While his earlier work concentrated on robustness of dynamical systems, his current research, the topic of this Bode lecture, concentrates on building a bridge between feedback control theory and trading in complex financial markets.

Abstract:
My answer is "yes." In this lecture, I will make the case that there are some important open problems in finance which are ideally suited for researchers who are well versed in control theory. To this end, I will begin the presentation by quickly explaining what is meant by the notion of "technical analysis" in the stock market. Then I will address, from a control-theoretic point of view, a longstanding conundrum in finance: Why is it that so many asset managers, hedge funds and individual investors trade stock using technical analysis techniques despite the existence of a significant body of literature claiming that such methods are of questionable worth with little or no theoretical rationale? In fact, detractors describe such stock trading methods as "voodoo" and an "anathema to the academic world." To date, in the finance literature, the case for "efficacy" of such stock-trading strategies is based on statistics and empirical back-testing using historical data. With these issues providing the backdrop, my main objective in this lecture is to describe a new theoretical framework for stock trading - based on technical analysis and involving some simple ideas from robust and adaptive control. In contrast to the finance literature, where conclusions are drawn based on statistical evidence from the past, our control-theoretic point of view leads to robust certification theorems describing various aspects of performance. To illustrate how such a formal theory can be developed, I will describe results obtained to date on trend following, one of the most well-known technical analysis strategies in use. Finally, it should be noted that the main point of this talk is not to demonstrate that control-theoretic considerations lead to new "market beating" algorithms. It is to argue that strategies which have heretofore been analyzed via statistical processing of empirical data can actually be studied in a formal theoretical framework.