Parameter estimation

Please help me, when I use CVX to find theta1, I got accurate estimation, however when I tried to find theta i.e. evolution of theta, the result was incorect. CVX did not work for nonstationary parameter, is it ?

phi_y= [-y(2:end-1)  -y(1:end-2)];
phi_u= [u(2:end-1)  u(1:end-2)];
Phi=[phi_y phi_u];
[N n]=size(Phi);
    variable theta1(n)
    minimize( norm((Y-Phi* theta1)))        
% building X
X=zeros(N,N* n);
for i=1:N
    X(i,:)=[zeros(1,n*(i-1)) Phi(i,: )  zeros(1,n*N-n*(i-1)-n)];
    variable theta(n,N)
    minimize( norm((Y-X*theta(:))))        

Not all forum readers have the mind reading powers you perhaps assume we do. I assume CVX solved the problems you provided it. Whether the problems provided to CVX correspond to the statistical problems you wanted to solve is another matter.

I don’t know what you are trying to do. Do you intend for the 2nd version to be stacking a bunch of independent least norm problems together into one problem? I don’t see how that could be so, given that you have the same column vector Y in both versions occurring within a single norm, but in the 1st version there is only a column vector theta1, as opposed to a matrix theta in the 2nd version, “going up against” the column vector Y.

Does the stacking in X make any sense? I’ll let you figure that out. Perhaps you should start off simply, with N = 1. Then try N = 2, and make sure that does what you want before you try the value of N you really want.

Thanks for your reply, I modified the code to

for k=1:N
variable theta1(n)

I got the requested result, just I would like to have it at once. Could you please give me how the function minimize solves the problem (in general). Thank you again

What’s wrong with the code you have? Use the quiet option if you want to suppress the output for each run of CVX.

You could declare theta as an n by N variable, move the for loop into CVX, and separately form the norm term for each value of k (with its corresponding column of theta). Then sum the norm terms and solve with a single minimize (or perhaps use sum_square rather than norm for the individual terms). That may or may not be faster than your existing code, but I doubt it would be much faster, if at all.