Analytica 4.2 beta Release Notes/Changes in 4.2.0.19

< Analytica 4.2 beta Release Notes
Revision as of 18:19, 8 July 2009 by Lchrisman (talk | contribs) (Changes to dynamic)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<< Back to Beta Tester Page

This page lists changes in 4.2.0.19 since beta build 4.2.0.18.

Bugs Introduced

We know of two bugs that have been inadvertently introduced into build 4.2.0.19:

  • Function Evaluate -- issues a spurious warning that shouldn't be there.
  • Function AskMsgText -- dialog messaged up, so function doesn't work.

Both will be fixed in the next beta build. Since both involve esoteric functions, and since we wanted to get some enhancements to FindInText out in time for the Regular Expressions Webinar, we released this beta build anyway.

Changes to Dynamic

Build 4.2.0.18 introduced several enhancements to the processing of Dynamic models. Through the beta testing, we learned that some of these caused inefficiencies and introduced new problems into some legacy models. So we've refined this further, backing out to some degree a few of the enhancements. These changes restore/improve backward compatibility with models originally created in Analytica 4.1. If you did something in the 4.2.0.18 beta build that relied on these new enhancements, you might experience a change in functionality.

I will explain the primary issue in some detail here. If you aren't interested in the gory details, you can skip the remainder of this section without missing much.

Suppose Variable X is in a dynamic loop, and the identifier of Y appears in X's definition (e.g., perhaps X is defined as (1+Y^2)). During the evaluation of X, the sub-expression Y evaluates to Y[Time=Time] -- i.e., only the Time-slice for the current dynamic evaluation context is returned. This is how it worked in Analytica 4.1 (and up through beta 4.2.0.11), and how it now works once again in 4.2.0.19.

In build 4.2.0.18, we attempted to generalize this, such that if Y was in the same dynamic loop as X, then Y[Time]] was used as before, but if Y was outside X's dynamic loop, then the full value of Y was returned. This made it possible to apply a function that operated over the Time index to the result, e.g., Sum(1+Y^2,Time). We also did this as part of an enhancement making it possible for a User-Defined Function to be part of a dynamic loop. In Analytica 4.1, UDFs always dropped the dynamic context, which made it possible for them to operate over the dynamnic Time index, but prevented them from actually being part of a dynamic loop.

In build 4.2.0.19, we've backed out this change when variables are being evaluated. As before, when a variable is being evaluated, an identifier Y always evaluates to Y[Time], as it always has. But, in a User-Defined Function, an identifier Y evaluates to Y[Time]] if Y and the UDF belong to the same dynamic loop, but Y evaluates to the full Y, unsliced along Time, when Y does not belong to the same dynamic loop. Therefore, UDFs that are part of a dynamic loop can operate over the Time index, provided the value they are operating over can be computed fully outside of the dynamic loop that the UDF belongs to.

These changes improve backward compatibility with models that were originally created in 4.1.

Suppose Y is not in X's dynamic loop, but you want to operate over Time on Y's result. How would you do that? Well, there are two possible methods.

Method 1: You could introduce a new variable, Z, that does the operation over Time on Y's value. Then you could use Z inside X's definition. This method works in 4.1. However, it also has a limitation - you can't operate over Time on a result that depends both on Y and on a dynamic value, such as Sum(Y^X[Time-1],Time).

Method 2: You can create a UDF:

Function Full(v:Variable) := v

Then inside X's definition, use Full(Y) instead of Y. For example: Sum(1+Full(Y)^2,Time). This obtains the full unsliced value of Y since in a UDF the full value is retrieved.

Comments


You are not allowed to post comments.