    norder = 1; % right now implememtation is only for norder=1
    
    global ws scl rt;
    ws = 1; scl = 1; rt = 1; 
    if 1
        % fs = 100;
        % t = -1:1/fs:1;
        % s = 0.1*t.^2 + 0.1; 
        % s = log(linspace(5,8,n))/scl;
        % t = linspace(0,1,n);
        if 1
            t=-1:0.005:1;
            % s = log(5+1./(1+exp(6*t)));
            s = log(3*t.^2+1);
        else
            s = [linspace(3,3,30) linspace(3,3.5,60)...
            linspace(3.5,3.5,30) linspace(3.5,4,60)...
            linspace(4,4,30)];
            t = linspace(0,1,length(t));
        end
        lmb = repmat(exp(s*scl),ws,1);
        x = poissrnd(lmb*rt);
    else
        x(1) = poissrnd(exp(s(:,1)) * rt );
        for i = 2:n
            s(:,i) = s(:,i-1) + sqrt(tao)*randn(norder,1); 
            x(i) = poissrnd(exp(s(:,i))*rt);
        end
     end
     if 1
        figure(2),subplot(211), plot(x(:));
        subplot(212), plot(exp(s));
        max(abs(s(1:end-1)-s(2:end)))
        mean(abs(s(1:end-1)-s(2:end)))
        min(abs(s(1:end-1)-s(2:end)))
    end
     
%    prs.m0 = rand(norder,1)+3;
    prs.m0 = 0;
    prs.v0 = 2*1e0*eye(norder);
    nodes = 3;
    mthd = 0;
    tao =  sqrt(mean(abs(s(1:end-1)-s(2:end)))*.001)
%    function mst = poisson_process2(x, tao, prs, t, ...
%    nodes, mthd, nfig, bsz)
    %[mst,tg] = poisson_process(x,tao,prs,t,nodes);
    mst = poisson_process2(x,tao,prs,t,nodes,mthd);

    figure, 
    plot(exp(mst(1:end))),hold on
    plot(exp(s(1:end)),'--')
    plot( x(:,1:end), ':')
    if 0    
        figure(3), 
        plot(t,exp(mst*scl)*rt), hold on
        plot(t,x,':')
    end
