Skip to content

Instantly share code, notes, and snippets.

@ChihChengLiang
Last active August 29, 2015 14:10
Show Gist options
  • Save ChihChengLiang/fbb4ec44b7424771ab61 to your computer and use it in GitHub Desktop.
Save ChihChengLiang/fbb4ec44b7424771ab61 to your computer and use it in GitHub Desktop.
play around Bruce E. Hansen "Least Squares Model Averaging" Econometrica (2007)
% http://www.ssc.wisc.edu/~bhansen/progs/joe_08.html
% http://www.ssc.wisc.edu/~bhansen/progs/ecnmt_07.html
octave:2> A=load("dat.txt")
A =
6.00000 4.01000 2.48000
5.90000 3.96000 2.43000
5.60000 3.99000 2.80000
5.20000 4.12000 2.96000
5.10000 4.35000 2.90000
5.00000 4.50000 3.39000
5.10000 4.58000 3.47000
5.20000 4.57000 3.50000
5.50000 4.90000 3.76000
octave:3> source("mallows.m")
octave:10> mma(A(:,1),A(:,2)-A(:,3),1,1)
% warning: the 'quadprog' function belongs to the optim package from Octave Forge
% which seems to not be installed in your system.
% Please read <http://www.octave.org/missing.html> to learn how you can
% contribute missing functionality.
% 原code是寫給matlab的,做quadratic programming的套件和octave的不一樣,傳的參數與回傳值也不同,所以沒有繼續跑下去。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment