# Highlights of Analytica 4.0

Analytica has dozens of major new features and hundreds of smaller enhancements. This is a sample of the highlights:

## Contents

## Output formats

### Graphing

Graphing has been completely redone to provide a wide range of new options and much smarter behavior for default options, suited to the dimensions and indexes of your data.

- Graph styles: Stacked bars, filled areas below or between lines, flip x and y axes -- e.g. for horizontal bars for tornado diagrams. Style is attached to primary dimension, so changes intelligently when you pivot indexes.

- Axes: Log and inverted scales. Date formats. Intelligent label avoids overlaps. Label rotation enables more labels. Range and style for indexes apply to all graphs that use those indexes, if you set them as default.

- Graph appearance: Background color or pattern, in graph and around it. Font face, size, and color for graph title, axes, and key. Label rotation. 3-D bars - cylinders or cuboids. Select key position (left, bottom, or right). Appearance of tick marks,

- Graph Style Templates to create reusable templates for the graph styles you like.

- Line-style tied to primary dimension & categorical/continuous.

Leads to much smoother experience when switching between statistical views and pivoting.

- Bar Origin treated as a graphing role

- Multiple dimensions with a horizontal value dimension

E.g., XY graph when X is categorical but has multiple dimensions, so the X-values depend on what slice is being viewed. When there is also a key, the labels for multiple slices are merged.

### Table extensions

- Menus in Tables
- You can include dropdown menus in cells of an Edit table, letting users select from a predefined set of options, using the Choice() function.

- Searching Tables
- Select
**Find...**from**Object**menu or control-F to search for text in a table.

- Mouse and keyboard shortcuts in tables
- Analytica 4.0 supports many mouse and keyboard shortcuts (identical to Excel where relevant) to navigate and select regions from tables.

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

- Display of huge arrays in tables (not restricted to 32,000 values)

- Copy and paste: Copy uses full precision. You can control the order of indexes in multidimensional tables by reordering slicers. Index definition expands if needed to accommodate copied data.

### Influence Diagram

- New menu options in Diagram menu let you align nodes to top, left, bottom, or center vertically or horizontally; make nodes the same height, width, or both; space nodes evenly horizontally or vertically.
- URLs in a text node appear as hyperlinks in the diagram.
- Optional flag in node shows which objects have descriptions.

### Non-US text and numbers

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

- Accents and letters from non-English languages: You can now type or paste text containing accents and special characters (for ascii>127) into Analytica.

## Analytica Application Features

- Auto save
- Analytica automatically saves every change to a file. So, you can no longer lose changes in a crash by software or hardware. Next time you start the model, it will ask if you want to continue using the changes since the last manual save or revert to the previously saved version.

- Analytica releases CPU when waiting.

No longer takes 100% of CPU when in focus.

- DLLs eliminated.

The MathFunctions, ArrayFunctions and FinancialFunctions DLLs have been eliminated. The contained functions have been moved into the engine.

- Unix new-line standard, LF, now recognized in model files.

This has sometimes an issue when models are emailed or placed on a Unix server.

- Multi-screen editing
- If your computer desktop stretches over more than one screen, you can now edit Analytica diagrams on any screen.

- Internal exception-based handling of out-of-memory conditions.

Should cut down on the crashes that result when memory is exhausted during the evaluation of a model.

- NaN change & warning.

0*NaN and 0*INF issue a warning and return NaN, consistent with IEEE standard 754. Earlier releases of Analytica returned 0.

- Maximum number of user-defined objects increased

Analytica 4.0 allows more than 31900 user-defined objects, approximately double that in Analytica 3.1.2.

## New and enhanced Functions

- Library (re)organization

- ArgMax, ArgMin, PositionInIndex, SubIndex, LinearInterp, StepInterp and CubicInterp have all been moved to the Array library (formerly in Special).

- Date functions
- Much more flexibility for formatting dates, and new functions for computing with dates.

Returns the PDF or CDF (or Prob Mass, cum prob mass for discrete results) as an array value. Previously, these were only available in the GUI, but couldn't be used directly by the model.

- New Random number functions

- Random( ): Generates random sample from selected distribution.
- Shuffle( ): Randomly shuffles a sample.

- RunConsoleProcess( )lets you run another application from Analytica, in parallel or waiting for result to be returned.
- GetRegistryValue( )
- ShowPdfFile( ) shows an Adobe PDF file -- for example, to open documentation for a model.

- Argmin(X,I)
- A position is the number from 1 to n, identifying the position of a value in an Index of size n. The position operator @I returns the position from 1 to n for each element of index I. You can also use it in a subscript A[@I = 2] is equivalent to Slice(A, I, 2).

PositionInIndex(A,u,I) gives the

- Slice assignment, e.g. A[I=x] := b

- Subscript notation is now an operator and can be used after any expression, e.g., (A+B)[I=x].
- You can assign to a slice of a local variable L, e.g. L[I=x] := b, allowing much more efficient implementation of some algorithms.

- Special Functions

- TypeOf(X): Returns the type of each atom as a string.
- VarTerm(X)

## Enhanced Functions

Many functions have been extended, in some cases accepting additional parameters, and in others, increased scope.

- Statistical Functions
- You can now compute statistics -- such as Mean, Variance, Frequency, Correlation, and many others -- over any index, not just Run (the Monte Carlo sample index).

- Array Functions

Allows selection of mid, lower, or upper rank (i.e., rank number in the event of a tie)

Optional fifth index parameter: Area(R,I,X1,X2,J)

Allows selection of the value column. Abstracting over that parameter allows "fact-tables" (as they are called in the OLAP community) to be transformed.

- ArgMin, ArgMax: Can now perform the min/max over multiple indexes, and can return either index value or index position.

- Truncate(dist,min,max) : [ER 5556] Now accepts min and/or max threshold parameters (both optional, but at least one required), and preserves rank correlation. Note (for docs) that 2nd parameter has been renamed.
- LogNormal( ) : [ER 5928] Can be optionally specified using arithmetic mean and/or arithmetic stddev.
- Uniform( ): optional integer parameter, over parameter, and singleSampMethod parameter.
- Over parameter added to many of the distribution functions, used to specify dimensions over which independent samples should be returned.

## New Engine Features

- Ellipsis declaration syntax
- NonNegative qualifier
- ContextSamp qualifier
- Optional indexes
- Default values for optional parameters
- A parameter declared as IndexType evaluates to its index values in a value context (relevant when a variable with a self-index is passed as an index parameter).

- Automatic, discrete, and continuous domain types. This is then picked up PDF computations to determine whether a PDF or ProbMass graph (or cum versions) are appropriate for numeric-valued samples.
- Index-valued domain. The domain can obtain its values from a different index. The evaluated index values become the index values for the variable.

Although this remains a bit of a hidden feature, it is possible to assign a different weight to each sample (e.g., weight indexed by Run), which is then utilized transparently by statistics functions and views. Two important uses of this are sampling from distribution other than the target distribution, and a poor-man's version of posterior conditioning. The system variable SampleWeight specifies the weighting.

- Support for new SQL Server 2005 data types (DbTable, etc)

- Function improvements

- Hierarchical beta, geometric and hypergeometric distributions are much faster.
- Range of parameter for Gamma, Binomial distributions extended, as well as for the GammaIInv function.
- MdTable. Can be used to transform a fact table (in which the first N columns specify coordinates, and the remaining M columns specify "measures"). Also, the conglomeration parameter has been generalized -- it is possible to conglomerate using a user-defined function.
- Uniform() with an optional
**integer:true**parameter generates uniformly distributed integers.

- AnalyticaEdition
- SampleWeight
- IsSampleEvalMode

## Optimizer Enhancements

- Upgrade to Frontline 7.0
- The new frontline comes with some licensing restrictions that were not present previously. These are detailed at Analytica Optimizer Licensing.
- Ability to add-on external solver engines (Knitro, Mosek, Xpress, etc).
- Function SolverInfo can be used to retrieve information about a solver engine, such search control settings and their allowed ranges, or any of the parameters defining an LP/QP/NLP (e.g., objcoef, Q, lhs, sense, rhs, maximize, lb, ub, engine).
- QpDefine has support for quadratic constraints.
- Function LpFindIIS can be used to relax variable bounds along with constraints (or just constraints, as before). Two new parameters control this, and whether a subset of constraints is returned or a new LP.
- Grouped integer variable type.
- LpWrite, LpRead, and LpWriteIIS now support three file formats: LP, MPS, and LPFML.
- ObjNl and LhsNl parameters have another option: 'Q' (quadratic dependence)
- Tracefile for debugging NLP optimizations.
- Hooks for array abstraction in NLPs: Enhancements to NlpDefine give a model author more flexibility to structure a large model so that NLP optimization array abstracts, solving multiple optimization problems during what-if, etc.
- Almost all parameters to NlpDefine are now optional, making it less cumbersome to define an optimization problem involving a scalar decision variable, only zero or one constraints, or finding feasible solutions only.
- NlpDefine can (optionally) make use of explicit expressions that compute the Hessians -- second derivatives of the objective and lhs.

## New GUI features

### Number Formatting

- New dialog
- Currency extensions. Euro, custom currency, etc. region-aware.
- Trailing zeros option
- Region-aware and custom date format extensions.

### Keyboard and mouse shortcuts

- Control-E on a button opens its Script. As before, on a Function or Variable, Control-E opens its Definition.
- In a Table, Analytica offers dozens of shortcuts for navigation around a table, almost identical to those in Excel Navigation Shortcuts
- Mouse Wheel (vertical scrolling) and CTRL-Mouse Wheel (horizontal scrolling)
- Recent file list: # of entries controllable from user registry, defaults now to 6 rather than 4.

### Export

- While viewing a graph result, you can select File->Export... and export the graph as a JPEG, etc.
- Export table data includes any external variable columns (or coordinate index columns, of course)

## 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 to use)

Enable comment auto-refresher