顯示具有 MATLAB 標籤的文章。 顯示所有文章
顯示具有 MATLAB 標籤的文章。 顯示所有文章

2010年12月6日 星期一

[學習] MATLAB polynomial regression

其實這也不是多複雜的功能
不過這次作業用到的關係
把這個指令稍微瞭解了一點
在這邊整理一下
[p,S,mu] = polyfit(x,y,n)
x 指的是預測變數值 independent variable
y 是被預測變數 dependent variable
n 是指polynomial 到的指數次方…{1,2,…}

得到的
p 是係數
S 是一些output例如df ss的值
mu 是標準化相關的值

此外還可以利用polyval得到預測值
pre_y = polyval(p,x)

差距的誤差: dif = y-pre_y

參考連結:
1. http://www.mathworks.com/help/techdoc/ref/polyfit.html
2. http://www.mathworks.com/help/techdoc/ref/polyval.html

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