function par = contplot( c, g,a,b,dt,z)
n=length(z)-1;
z1=z(1:n);
dz=diff(z);
m2 = dt*c^2*(z1.^(2*g)).*(1+.5*c^2*g^2*dt*z1.^(2*g-2));
 w = 1./m2;
p=wreg(z1,dz,w);
b=(log(1+p(2)))/dt;
a = p(1)*b/p(2);
c1=c;
g1=g;
v0 = -.01:.001:.02;
v = -.3005:.02:.3;
C1 = c+v0;
G1 = g+v;
[C,G] = meshgrid(C1,G1);
for i=1:length(G1)
  for j=1:length(C1)
   c=C(i,j);
   g=G(i,j);
   Z(i,j)=log(ss(resid7(g,a,b,c,dt,z,w)));
  end
end
[v,i] = min(Z);
[v,j]=min(v);
'minimum is ... at '
c=C(i(j),j);
g=G(i(j),j);
K=contour(C1,G1,Z, 80);
xlabel('c');
ylabel('g');
text(c,g,'min');
title(['log(SS): Initial a, b, c, g= ',num2str(a),' ', num2str(b),' ', num2str(c1),' ', num2str(g1)] );
par=[a,b,c,g];