function R = d2moment(b)

% Input: b      kx1 parameter vector
% Output: R     lk x k x n matrix of the second derivative of vecorized derivative matrix

global x

n = length(x(:,1));
k = length(b);
m = moment(b);
l = length(m(1,:));

R = zeros(l*k,k,n);

for i = 1:n
    R(:,:,i) = [0,2]';
end