Re: Generalized Method of Moments



Hi Phil, thanks a lot for help.
If you don't mind please have a look at the following. I tried to
apply your suggestions.
Is it correct the following code? since it stucked on
fhandle = @(x)myfunction(x,W) telling that:
"identifier" expected, "(" found. (**)

I changed a little bit and wrote:

while (stopping_condition == false) (***)
W = eye(4); % as starting matrix (fixed one)
fhandle = myfunction(@param,W); %here I changed as response to
indicated above (**), correct??
st = [0.01 0.2 0.01];
[param] = fminunc(fhandle,st)
W = autocov(param); % generates new W matrix by external function
'autocov'

loop
end

now matlab asks me about the line (***)
"Expected a variable, function, or constant, found "% comment".", I
don't know the stopping loop value of param since I want to estimate
it. What kind of stopping_value I need ?? is it the number of
iterations?

would very appreciate your corrections to my version.
best, rob

Phil wrote:


Rob,
The structure of the code would be along these lines.

while (stopping_condition == false)
...
W=...
fhandle = @(x)myfunction(x,W)
[param]=fminunc(fhandle, 'starting value for param')
....
loop

Notice that "myfunction" is nested within an anonymous function,
that
way the function passed on to fminunc, changes according to new
values
of W in each iteration.


.



Relevant Pages

  • Re: Generalized Method of Moments
    ... did u change your "myfunction" to accept W as one of its? ... fhandle = @myfunction ...
    (comp.soft-sys.matlab)
  • Re: Generalized Method of Moments
    ... fhandle = @myfunction ... [param]=fminunc(fhandle, 'starting value for param') ... Notice that "myfunction" is nested within an anonymous function, ...
    (comp.soft-sys.matlab)
  • Re: A question on python performance.
    ... def getValue(trend, param, per): ... thought maybe I could add a caller method to the trend class and I came up ... loop one. ...
    (comp.lang.python)
  • A question on python performance.
    ... def getValue(trend, param, per): ... thought maybe I could add a caller method to the trend class and I came up ... loop one. ...
    (comp.lang.python)
  • Delay in calls to stored procedure
    ... I'm running through a loop calling a stored procedure each time. ... the SqlCommand before entering the loop and just change the param values in ... the loop before each call to ExecuteNonQuery(). ... // assign param values ...
    (microsoft.public.dotnet.framework.adonet)

Loading