Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: statistical testing of optimized parameter
Replies: 8   Last Post: May 20, 2012 4:05 PM

 Messages: [ Previous | Next ]
 Md. Ikramul Hasan Posts: 13 Registered: 4/4/12
Re: statistical testing of optimized parameter
Posted: May 18, 2012 5:54 AM

"Md. Ikramul Hasan" wrote in message <jp3qur\$14q\$1@newscl01ah.mathworks.com>...
> Hi All,
> I have optimized my model?s parameter by minimizing root mean square error (RMSE) using fmincon. Then I have calculated the Hessian matrix using that optimum parameter values and finally I tried to calculate the t-values for testing those optimized parameters.
>
> For Hessian I used John D?Errico?s function (following link)
> and, t_values = ?parameter./sqrt(diag(inv(hessian)))?
> Now, the problem is, the t values are showing unexpected values. I think there is some problem in my procedure.
> For calculating ?parameter covariance matrix? I used inverse of the hessian. Is it correct?
> Any suggestions would be great!
>
> -Hasan

Here, is the details of my problem...

------------------------------------------
Function velocity
---------------------------------------
v=zeros(n,k);
u=zeros(n,k);
n_g=zeros(n,k);
p_g=zeros(n,k);
for j=11:k
if ac(1,j-1)>=.3
w1=0;
w2=1;
v(1,j)=a(1)*u(1,j)+a(2)*p_g(1,j)+w1*a(3)*V(1,j-10)+w2*a(4)*V(1,j-10);

else
w1=1;
w2=0;
v(1,j)=a(1)*u(1,j)+a(2)*p_g(1,j)+w1*a(3)*V(1,j-10)+w2*a(4)*V(1,j-10);
end
n_g(1,j)=p_g(1,j)+(V(1,j)+V(1,j-1)-v(1,j)-u(1,j))*(h/2);
p_g(1,j+1)=n_g(1,j);
u(1,j+1)=v(1,j);
end
-------------------------------------
function myfun
-----------------------------
function sum_2=myfun(a)
global k v_data
v=velocity(a);

sig=(v(1:k)-v_data(1:k)).^2;

sum_sig=sum(sig);
sum_2=(sqrt(sum_sig/k));
-----------------------------------------------
function main:
----------------------------------------------
function main()
clear,clc

global A b k n h V v_data %para para0 vval
h=.1;
n=1;
V=car1(:,3)';
v_data=car1(:,4)';
k=length(V);
ac=car1(:,12)';
%------------------------------------------------- optimization
opts = optimset('Algorithm','sqp','display','iter','LargeScale','on','TolFun',1e-50,'TolX',1e-50,'MaxFunEvals',6000,'MaxIter',1000);
A=[];b=[];
lb=[.8 0 0 0];ub=[1 .05 .05 .05];
Aeq=[];beq=[];
nonlcon =[];
a0=[0.9,0.025,0.025 0];
[a,val]=fmincon(@myfun,a0,A,b,Aeq,beq,lb,ub,nonlcon,opts)

------------------------------------------------------------------------------------------------------
%t value and covariance of the optimized parameter value
cov=inv(H);
sigma=sqrt(diag(inv(H)))'
t_values=a./sigma;
disp(t_values);
disp(cov);

problem 1: t value are unexpectedly insignificant. Is there any problem with my coding or procedure.

problem 2: the way I have calculated the covariance matrix of parameter I think is not correct.
Any suggestion regarding these two problems would be a great help.

Date Subject Author
5/17/12 Md. Ikramul Hasan
5/18/12 Bruno Luong
5/18/12 Md. Ikramul Hasan
5/18/12 Md. Ikramul Hasan
5/18/12 Bruno Luong
5/18/12 Md. Ikramul Hasan
5/18/12 Bruno Luong
5/20/12 Md. Ikramul Hasan
5/20/12 Bruno Luong