sctchoi / gail

Automatically exported from code.google.com/p/gail
1 stars 0 forks source link

control variates and meanMC_g.m #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
%Problem with GAIL and control variables
mu=meanMC_g(@(n) yCV(n))

function ytilde=yCV(n)
d=3
x=rand(n,d);
meanx=0.5*ones(1,d);
xbar=mean(x,1);
y=x(:,1).^2;
beta=(x-repmat(xbar,n,1))\(y-mean(y));
ytilde=y-(x-repmat(meanx,n,1))*beta;

What is the expected output? No warning
What do you see instead?
Warning: Rank deficient, rank = 0, tol =
0.000000e+00. 
> In yCV at 6
  In @(n)yCV(n)
  In meanMC_g at 126
  In CVGAILProblem at 3 

Because x-repmat(xbar,n,1) is rank deficient for n<=d

Please use labels and text to provide additional information.

Original issue reported on code.google.com by fjhicker...@gmail.com on 23 Oct 2013 at 7:20