Input argument "" is undefined

4 ビュー (過去 30 日間)
Anita
Anita 2011 年 11 月 30 日
My problem arises when I run the following piece of code:
theta=[psi;s_u;b];
[theta_to , f_to , cov_to] = maximize(@p_11,theta,2,1,0);
I get this error message:
??? Undefined function or method 'p_11'
for input arguments of type 'double'.
I have made sure that all my functions are in the same library. When I try to call p_ll, I get the following error message:
??? Input argument "theta" is
undefined.
Error in ==> p_ll at 3
psi=theta(1)
The p_ll function looks like this:
function ll=p_ll(theta)
global R N T x y u
psi=theta(1);
s_u=theta(2);
b=theta(3:end);
ll=zeros(N,1);
[S_AR, A]=p_S_AR(T, psi, s_u);
for i=1:N
xb_i=x((i-1)*T+1:i*T,:)*b;
y_i=y((i-1)*T+1:i*T);
ll(i)=log(p_lli(T, R, y_i, xb_i, A, u(:,:,i)));
end
It may be trivial but I cannot find my mistake(s). Does anyone have an idea?

回答 (1 件)

Hin Kwan Wong
Hin Kwan Wong 2011 年 11 月 30 日
function ll=p_ll(theta)
is p_ll with letter L not number ONE
maximize(@p_11,theta,2,1,0);
you put it as p_11 with number ONE
  1 件のコメント
Anita
Anita 2011 年 11 月 30 日
Thank you! It works now.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by