# What's new in Analytica 4.0?

What's new in Analytica 4.1?>>

Release 4.0 of Analytica and ADE on November 1, 2007 has dozens of major new features and hundreds of smaller enhancements. Here is an overview:

## New Logo

## Output formats

### Graphs and Charts

We have completely rewritten Analytica's charting and graphing engine, adding a wide range of new styles and options, smarter default behavior, and the flexibility to create much more elegant charts. For details, see Graph settings

- Chart styles: New styles include stacked bars, filled areas, and using symbol size and color to indicate extra dimensions. You can flip x and y axes -- e.g. to create horizontal bars for tornado diagrams.

- Axes: Log scales and reversed scales. Flexible date formats.

Label resizing and rotation for clear labels without overlaps.

- Appearance: Color and pattern for chart backgrounds, including color gradients. Line widths. Font face, size, and color for titles, axis labels, and key. Bars with 3D effects -- cylinders or boxes.

- Chart style -- e.g. continuous or categorical -- associates with the chart variable and indexes, so it switches appropriately when you pivot the chart or change uncertainty views. You can save the range and other properties of an axis as the default for the underlying index variable, so these properties will apply to all graphs using that index.

- XY comparison lets you plot a variable against other variables or expressions, or one slice against another slice over the coordinate index (Comparison index).

- You can save Graph Style Templates to reuse a set of styles and appearance in other graphs.

- You can save a graph in a variety of standard file formats, including JPEG, PNG, BMP, TIFF, and EMF, using
**Export**from the**File**menu.

### Tables

- Include dropdown menus in an Edit table, letting end users select from a list of options for any cell in a table, by using the Choice() function.

- Search a table for selected text, using
**Find...**from the**Object**menu (shortcut key control-F) when a table is the active window.

- Use dozens of new mouse and keyboard shortcuts to navigate and select regions from tables -- the same as in Excel. For example, use the mouse wheel to scroll. Drag the mouse from one cell to another to select the rectangular region between them.

- Paste a value or region to fill out a larger selected region, repeating the pasted value(s) over the destination region.

- When you reopen a table or graph, Analytica remembers
*all*settings from the last time it was displayed, including pivoting (index chosen for horizontal and vertical dimensions), slicers (values to show for other dimensions).

- Use full numerical precision when copying and pasting to or from a table.

- Include any external variable columns when exporting data (coordinate index).

- Control the ordering of slicers in a table or graph with four or more dimensions by dragging a slicer variable to the desired position.

- With Analytica Enterprise or Power Player, you can now scroll through Huge index dimensions with over 32,000 elements.

- Use the SubTable function to define a variable as part of another Edit table. Any change to a value of a Subtable is reflected in its parent table, and vice versa.

- Use computed indexes for Edit tables. automatically spliced controls the changes to table values when the computed index value changes.

### Influence Diagrams

- Make neater diagrams: New options in the
**Diagram**menu include**Align**nodes to top, left, bottom, or center;**Make same size**for height, width, or both; and**Space evenly**horizontally or vertically.

- When you've selected a Button object, Control-e now opens its Script. As before, for a Variable or Function, Control-e opens its Definition.

- The mouse wheel scrolls a diagram vertically or, pressing the control key, horizontally.

- When you're editing a definition in the Attribute pane, Alt-click on another node in the Diagram inserts the identifier of that node into the Definition.

- We have added dozens of other Keyboard Shortcuts.

- URLs in a text node appear as hyperlinks in the diagram.

- Optional red flag in node shows which objects have Descriptions.

- Model building by mouse: New and improved features let you build and edit models just by drawing arrows -- they automatically add or remove variables from some functions and expressions, without need for typing.

### Non-US text, numbers, currency, and dates

Recognizing that nearly half Analytica users are outside the US -- Analytica is finally getting a bit less US-centric:

- Date and currency formats: The Number format dialog now lets you select a much wider variety of formats, including non-US dates, currency symbols, and negative numbers. Date formats respond to the Windows region setting.

- You can now paste text containing accents, symbols, and characters from non-English languages (for ascii>127) into Object windows and diagram nodes.

- We know we still have some distance to go towards full internationalization, but this is a good start!

## The Application

**Auto save:**Analytica automatically saves each model change to a backup file. So you can no longer lose changes after a software or hardware crash. Next time you start the model after an unplanned exit, it asks if you want to continue using the changes from the backup or revert to the previously saved version.

- Analytica now
**shares CPU nicely**with other applications. Earlier versions hogged 100% of CPU cycles when the Analytica was in focus -- i.e. its application window is on top.

- It can now read model files that use
**LF**(linefeed) as the end-of-line character, instead of CR (carriage return). This convention is standard for Unix and Linux, and sometimes happens to files that are stored or emailed from a Unix server.

- If your computer has
**multiple screens**to show a larger desktop, you can now edit Analytica diagrams on any screen or across multiple screens.

- Analytica recovers more gracefully when a calculation causes it to run
**out of memory**.

- Analytica 4.0 can handle up to
**32,000 objects**-- variables, modules, functions, etc. --- double that in previous releases.

## New and Enhanced Functions

- Date functions provide much more flexibility for computing with dates, to go along with the much greater flexibility in displaying dates from the
**Number format**dialog from**Result**menu.

- MdxQuery supports the standard MDX language for querying and writing to multidimensional OLAP hypercube databases, such as Microsoft SQL Server Analysis Services. It opens up Analytica for integration with Business Intelligence applications. (Analytica Enterprise only).

### Probability distribution functions and statistical functions

- You can specify an array of independent probability distributions by specifying an
**Over**index i to any probability distribution function -- for example, Normal(0, 1, Over: i).

- By default Statistical functions, such as Mean, Variance, Frequency, Correlation, and many others, operate over the Run Index: Thus, Mean(x) gives the mean over a random Monte Carlo sample from x, indexed by Run. You can now specify a different index to operate over -- for example, Mean(x, k), useful for statistical analysis of an input dataset x indexed by k.

- Lognormal will work with parameters
*mean*and*stddev*(standard deviation), instead of the default*median*and*gsdev*(geometric standard deviation). In fact, it will work given any pair of parameters from*median*,*gsdev*,*mean*, and*stddev*.

- Truncate(x,min,max) : Now accepts min and/or max thresholds parameters (both optional, but at least one required). It now preserves sample ordering, and so rank correlation.

- Uniform(min, max, integer) adds an optional parameter,
*integer*to specify that values be integers in the range.

- CumDist(P,R,I,Smooth) adds a new optional Smooth parameter for control over the interpolation method used.

- Random( ) generates single random variate using a specified distribution.

- Shuffle(x, i) randomly shuffles an array.

- Pdf and Cdf return the estimated probability density (or mass) function or cumulative distribution function as arrays, so the model can work with them. Previously, they were only available to view as a graph or table.

- Importance weighting is a way to get more information from fewer Monte Carlo (or Latin hypercube) samples. Instead of treating all samples as equally likely, you can set a weighting vector,
**SampleWeighting**. For example, in a risk analysis with a low probability of extremely bad outcomes, you may want to increase the number of samples that lead to bad outcomes to get more detail in that region with correspondingly smaller weight to keep the distributions unbiased. You can also modify the SampleWeighting to reflect different input distributions and rapidly see the effects on the resulting distributions without having to rerun the simulation. Every probability distribution and statistical function uses the importance weights. The default uses equal weights, as before, so you don't have to worry about importance sampling unless you want to use it.

- System variable
*IsSampleEvalMode*returns true when evaluation is probabilistic, false otherwise.

- Several distribution functions much faster, especially with uncertain parameters (hierarchical distribution). Gamma, Binomial, GammaIInv are more accurate for extremely large or small parameter values.

### System Functions

- RunConsoleProcess lets you run another application from Analytica. It can pass data via a parameter or a file. It can run the process in parallel or wait for result to be returned as a file.

- GetRegistryValue( ) gives specified values from the computer registry, such as the name of default directory for model or datafiles.

- ShowPdfFile( ) shows an Adobe PDF file -- for example, to open PDF documentation for a model.

- Function AnalyticaLicenseInfo can return the expiration date, purchaser ID, user ID of the license, whether it has Educational, Beta status, or supports the Optimizer. System variable
**AnalyticaEdition**gives the Edition (Player, Professional, Enterprise, etc.)

### Array functions

- The new operator Index Position Operator::@ as in @J returns the
*position*of each element in index J -- i.e. the integers from 1 to Size(J) indexed by J. You can also use it in a subscript: A[@J = 2] is equivalent to Slice(A, J, 2). /At operator

- PositionInIndex(a, u, i) returns the position n (an integer 1 to Size(i)) in index i for which a[i=n] = u. It is the equivalent of SubIndex, except that it returns a position instead of index value. Useful when i may contain duplicate values.

- The subscript syntax now lets you to subscript an expression -- e.g., (A+B)[I=x].

- Slice assignment -- e.g. x[I=y] := b -- lets you assign to a slice of a local variable x, allowing you to write some algorithms much more efficiently.

- The new function Argmin(x, i) gives the last value of i for which x is at a minimum over i, like the existing function ArgMax(x, i). These functions can now find a min or max over one or more dimensions by specifying multiple indexes, and can return index value or position.

- Rank now lets you specify mid, lower, or upper rank in the event of a tie.

- Area adds an optional fifth parameter: Area(R,I,X1,X2,J)

- MdTable now lets you specify the first N columns of X as
*coordinates*and the rest as*measures*, as used in a*fact table*, the format used to specify OLAP hypercubes. It also supports a user-defined conglomeration function for combining elements.

- Functions ArgMax, SubIndex, LinearInterp, StepInterp and CubicInterp are now in the Array library (formerly in Special).

- The new IndexValue function provides access to a self-indexed variable's index value from a value context.

### Special Functions

- Added inverse functions ArcCos, ArcSin, ArcTan, and hyperbolic functions CosH, SinH, and TanH to the standard Sin, Cos, and Tan. All use degrees, not radians.

- TypeOf(X): Returns the type of each atom in X as a text.

- A Handle is a pointer to an object, such as a Variable or Module. Handles lets you write functions and models that navigate and change a model by working with Objects -- for example, to find the inputs or earlier ancestors of a variable. They allow an Analytica programmer to write lots of nifty functions, which the rest of us will benefit from.

*For j:=X Do ...*generalized to allow X to be any expression, including an array. When X is an index, j iterates over the IndexValues.

### Database Functions

- The index used to indexed the rows of the table retrieved using DbQuery can now be a local index, defined via Index..Do.

- Functions ReadTextFile and WriteTextFile have an additional optional parameter,
*showDialog*.

## Language Features

- Function Parameter Qualifiers specify what type, dimensions, or range of values are expected for parameters. New qualifiers include "..." meaning one or more parameters of the same type,
**NonNegative***,**ContextSamp'*(the default), and Optional indexes You can also supply default values for optional parameters, to be used when the parameter is absent.

- A variable used as an
*IndexType*parameter gives its Indexval if it has a self-index, when evaluated in the function.

- The Domain attribute specifies the set of acceptable values of a variable. When displaying a probability distribution, Analytica uses the Domain to decide whether to generate a probability density or mass function, according to whether the Domain is continuous or discrete. If the Domain is
**Automatic**, Analytica guesses from the actual values (usually correctly). If the Domain is**Index**, it gets the domain as a list of values from an Index variable.

- 0*NaN and 0*INF now give a warning and return NaN, consistent with the IEEE 754 and SANE arithmetic standards. Earlier releases simply returned 0.

- Release-gated comments. The syntax {!40000|expr} will be treated as a comment in releases prior to 4.0.0, but as the expression expr in 4.0.0 or after. {!-40001|expr} or {!40000-40001|expr} acts as expr in releases 4.0.0 through 4.0.1, but as a comment in earlier or later releases. This syntax is accepted in both typescript and expressions.

## Libraries

- New distributions in "Multivariate Distributions.ana"

- MultiUniform
- Uniform_Spherical

- Distribution variations

(Note: these distributions can also be used within the Random function for single variate generation)

- Smooth_fractile
- Warp_dist
- Erlang
- Pareto
- Rayleigh
- Lorenzian
- NegBinomial
- InverseGaussian
- Wald

- Functions in the new "Generalized Regression.ana" library

- Logistic_Regression
- Probit_Regression

(These require Analytica Optimizer)

## The Optimizer

The Analytica Optimizer offers powerful solver engines, licensed from Frontline Systems, to solve linear programms (LP) and mixed integer programs (MIP), quadratic programs (QP), and general nonlinear programs (NLP). The Optimizer is an optional extension to Analytica Enterprise, Power Player and ADE.

- Analytica Optimizer 4.0 uses the new 7.0 release of Frontline Systems Solver, which offers significant improvements in performance and functionality.

- The new
**Grouped integer**variable type lets you define a set of N integer decision variables, where a solution must assign a different integer from 1 to N to each of the variables in the group.

- QpDefine now supports quadratic constraints. (Before QP problems supported quadratic objective but constraints had to be linear.)

- The new frontline comes with some licensing restrictions that were not present previously. These are detailed at Analytica Optimizer Licensing.

- If your optimization problems are really large, you can use yet more powerful add-on solver engines, including OptQuest, Knitro NLP, Mosek SOCP and NLP, and Xpress LP, QP and MIP (priced separately).

- Function SolverInfo provides information about any installed solver engine, including engine type, all parameters, search-control settings, and their allowed ranges.

- ObjNl and LhsNl parameters add the 'Q' option to specify quadratic dependence.

- Function LpFindIIS lets you relax variable bounds (not just constraints, as before), and to optionally obtain the result as a new LP.

- LpWrite, LpRead, and LpWriteIIS support three file formats: LP, MPS, and LPFML to help you document and diagnose solver formulation and behavior.

- Tracefile helps debug NLP optimizations.

- Hooks for array abstraction in NLPs: Enhancements to NlpDefine give more flexibility to structure a large model so NLP optimization array abstracts properly -- for example, for probabilistic or WhatIf analysis with NLP.

- Almost all parameters to NlpDefine are now optional, making it simpler to define an optimization problem with a scalar decision variable, only zero or one constraints, or to find feasible solutions only.

- To speed up NLP, you can give NlpDefine an explicit expression to compute the Hessian -- second derivatives of the objective and LHS.

## Deprecated features

A few functions and system variables are still available in Analytica 4.0, but have been superseded by other functions or features, may be discontinued in future releases. So, we strongly discourage their use.

## ADE Enhancements

- Works much better with direct COM interface.

This makes it easier to use from .NET. Various newer registry settings are now required to get COM to work, and some inconsistencies between the type library and registry settings have been fixed.

- ShowAddAttributes command added

A new command (also available from Analytica) gives ACP access to the list of attributes that should be shown in the UI.

- Speed-up of model load time

To address Enrich's concerns. Load times have been sped up considerably from 3.1, but are still about 2x slower than 2.0 on his model.

- New ResultTypes

Formerly, you could only obtain the Mid, Mean or Sample result for a variable. New ResultType values allow you to obtain additional statistical results for a variable.

- Result Graph as image

From ADE, you can now obtain a result graph as an image (e.g., JPG). This makes it possible to forward, for example, to forward the graph on to a client as an image, without requiring a third-party graphing engine. In addition, the result uses the graph settings as they exist in the Analytica model.

- Picts as images

From ADE, you can obtain a PICT node's image as a JPG.

- Control over how results are returned.

- Automatic table splicing

If an index definition changes, variables defined as a Table, DetermTable or ProbTable that use that index are automatically "spliced".

- New properties and methods

- CAEngine:
- DefaultRenderingStyle
- DefaultDefTableRenderingStyle
- SendCommand

- CAObject:
- Evaluate
- PictureToStream
- PictureToFile
- RenderingStyle

- CATable:
- Subscript
- Slice
- Atomic Value
- GraphToStream
- GraphToFile
- GraphWidth
- GraphHeight
- IndexName
- RenderingStyle

- CAIndex
- RenderingStyle

- CARenderingStyle (new class)
- GeneralExpression
- NumberAsText
- FullPrecision
- StringQuotes
- VarTermFormat
- ReferenceAsText
- UndefValue
- SafeArrayLowerBound

Enable comment auto-refresher