2010年5月14日 星期五

[學習] Matlab 基本指令

每次一段時間過後
要寫matlab指令又要再找一次
還是整理一下在這邊好了
基本中的基本:
  1. clc : 清除command....and error windows
  2. clear : 清除所有變數
  3. clf : 清除圖形
  1. mean(x)
  2. std(x)
  3. sort(x) 參考
  4. reshape(A,m,n) 參考
  5. size(a,2) 行 1->列

[學習]_Empirical distribution function

參考 http://en.wikipedia.org/wiki/Empirical_distribution_function

最近寫231報告的時候用到的
好像無母數分析裡面常常使用
當我們不確定資料的分布狀況時

給定一組資料
可以用cdf來逼近分布的狀況
就叫做empirical distribution

ps: Matlab 中相關的指令 given x is a set of data
ecdf(x)
cdfplot(x)
http://www.mathworks.com/access/helpdesk/help/toolbox/stats/ecdf.html
http://www.mathworks.com/access/helpdesk/help/toolbox/stats/cdfplot.html

2010年3月25日 星期四

[學習] Implicit function theorem

還有一個強大的定理 Implicit function theorem
基本上就是想知道 dy/dx 但是所有的關係都是透過另一個函數連在一起的
所以有人就很聰明的發展這個定理
就算兩個變數是沒有直接相關連的
我們也可以很快知道彼此對應的影響
推導的內容也只是用到簡單的chain rule而已
但是卻真的滿好用得
記錄一下

http://en.wikipedia.org/wiki/Implicit_function_theorem

[學習] Envelope theorem

記錄一下寫作業的時候用到的兩個定理:
Envelope theorem:
當面對 min f(x,r)
想知道單一變數偏微的效果時可以使用(以外為引用沒有限制的情況下)

Consider an arbitrary maximization (or minimization) problem where the objective function f(x,r) depends on some parameters r:

f^*(\bold r) = \max_{\bold x} f(\bold x,\bold r)\,

The function f *(r) is the problem's optimal-value function — it gives the maximized (or minimized) value of the objective function f(x,r)as a function of its parameters r.

Let x*(r) be the (arg max) value of x, expressed in terms of the parameters, that solves the optimisation problem, so that f*(r)=f(x*(r),r). The envelope theorem tells us how f*(r) changes as a parameter changes, namely:

\frac{d\ f^*(\bold r)}{d\ r_i} =  \frac{\partial f(\bold x,\bold r)}{ \partial r_i} \Bigg|_{\bold x = \bold x^*(\bold r)}

That is, the derivative of f*(r) with respect to ri is given by the partial derivative of f(x,r) with respect to ri, holding x fixed, and then evaluating at the optimal choice x=x*(r).

http://en.wikipedia.org/wiki/Envelope_theorem
應該是要求 f is twice differentiable continuous function.

2010年3月20日 星期六

[學習] NP hard & NPComplete

最近有人問什麼是NP 什麼是NPComplete
就順便查了一下清楚的定義
簡單的說,
NP hard的問題就是沒有辦法找到Polynomial的演算法來解決此問題
但是在NP hard的問題中又可以分成 NP Complete 跟 Weakly NP
原因是演算法複雜度包含了兩個部分
一個是演算法迭代的operation次數
一個是演算法的digits 次數
如果兩個都是NP的話,就是NP Complete
如果演算法是Polynomial的話,但是digit有可能會爆掉
就是weakly NP

參考:
http://en.wikipedia.org/wiki/Weakly_NP-complete
http://en.wikipedia.org/wiki/NP-complete

2010年3月18日 星期四

[研究] 興趣

最近在思索自己真正感興趣的方向是什麼
有些人可以很輕易找到自己喜歡的
我則是一直在思考這個問題
要找到有熱情的領域
因為影響深遠的一個決定

但是這個真的不是一個容易的決定
在思考的過程反反覆覆
還要兼顧自己的能力還有時機
總之要好好思考加油才行~~

2010年3月4日 星期四

[研究] Latex Editor

最近在用latex的時候想到朋友用的軟體可以即時顯示結果
所以就問了一下來試試看
畢竟Windet已經用了一段時間
找類似的軟體又可以提供所見即所得的效果較好
所以就試了這個 Latex Editor (LEd) http://www.latexeditor.org/index.html
他提供了內建的embedded dvi viewer
當compile成dvi後可以在旁邊看到編輯時的狀況
相對來說比之前全文書介面來的方便許多
唯一要注意的就是針對 Mitex 2.7要選正確的dll連接
還有看dvi重點的 Ghostscript 不能選太新的版本
我用最新的版本都看不到eps圖片
但是用 gs854w32.exe 就可以解決這個問題了
有興趣的朋友也可以參考看看