Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Viewing Trace Output of Functions

    As per the FAQ, I am using version 13.1.

    I have defined a function within an ado file, which is stored in a .mo file. This function is then called upon in a do file, which is situated in the same directory as the .mo file.

    When executed, I get the following:
    Code:
     
     lx_f():  3200  conformability error  <istmt>:     -  function returned error  r(3200);
    where lx_f() is the function.

    This is useful in so far as I know there a matrices that are non-conformable but no idea as to which. Even with the trace set on, the error does not provide any further information than that above.

    My question: is there a way of setting the trace on for the operation of the function, so it is possible to point to the particular matrices that are not conformable?

  • #2
    No.
    Note also that trace does not affect mata execution.

    But since you have access to the function source, split the expressions such as A=B*C*D*E into A1=B*C; A2=A1*D; A=A2*E, then write to screen in between these steps and you will know what fails.

    A well written function will first check its arguments, then start operating on them.

    Best, Sergiy Radyakin.

    Comment


    • #3
      Cross-posted on Stack Overflow.

      http://stackoverflow.com/questions/3...ion-in-mo-file

      David, please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post, paying particular attention to #8 on cross-posting. Nobody likes to find they've wasted time answering on one forum a question that has been posed and answered elsewhere.

      Comment

      Working...
      X