help with matlab code-PLEASE

조회 수: 1 (최근 30일)
Ozmando
Ozmando 2012년 1월 11일
Dear Users,
New into MATLAB and I am trying to run a code but encounter the following error message:
Undefined function 'mvnrnd' for input arguments of type 'double'.
Error in apply_LSDV (line 161)
smpi_rnd = mvnrnd(smpi,kron(omega,iQ)/nobs);
I have attached a portion (top portion) (please see below) of the code upto line 161 where the problem appears to be.
Please can you help?
Thanks,
Ozmando
% Set up Pi matrix (Hamilton 11.1.6)
piprime = zeros(K,K*p+dis*(q+1));
for i = 1:p;
piprime(:,1+(i-1)*K:K*i) = phi(1+(i-1)*K:K*i,:);
end;
for i = 1:q+1;
piprime(:,(K*p)+1+(i-1)*dis:(K*p)+i*dis) = theta(1+(i-1)*K:K*i,:);
end;
pimat = piprime';
smpi = reshape(pimat,K*(K*p+dis*(q+1)),1); % small pi (vector)
% **************************************************************
% Monte Carlo loop
mr_rnd = zeros((st+1)*dis,monte);
ce = zeros(dis,monte); % Cumulative effects
for num = 1:monte; % 'monte' times of iterations
smpi_rnd = mvnrnd(smpi,kron(omega,iQ)/nobs);

채택된 답변

Walter Roberson
Walter Roberson 2012년 1월 11일
That routine is part of the Stats Toolbox. Do you have that installed and licensed?
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 1월 12일
To check: is the problem now solved, or does it continue?
What does
which -all mvnrnd
show ?
Ozmando
Ozmando 2012년 1월 12일
The problem continues; I am reinstalling matlab again as it has crashed few times now. Maybe that could be the problem.
Thanks for your kind advise.
best wishes,
Oz

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Econometrics Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by