Additional libraries

Revision as of 21:06, 27 February 2016 by Max (talk | contribs)


Individual functions with examples

Libraries Not Included with the Analytica Installer

Large Sample Library

Download: Large sample library v10.ana

Large sample library.png

The Large Sample Library is an Analytica library that lets you run a Monte Carlo simulation for large models or a large sample size that might otherwise exhaust computer memory, including virtual memory. It breaks up a large sample into a series of batch samples, each small enough to run in memory. For selected variables, known as the Large Sample Variables or LSVs, it accumulates the batches into a large sample. You can then view the probability distributions for each LSV using the standard methods — confidence bands, PDF, CDF, etc. — with the full precision of the large sample.

See Large Sample Library: User Guide.

The Sensitivity Analysis Library

The Sensitivity Analysis Library provides functions for analyzing the sensitivity of an output to each cell of each array-valued chance input, and locating those individual scalar inputs that have the greatest impact on the result. See The Sensitivity Analysis Library for documentation on using this library.

The library itself can be downloaded from Sensitivity Analysis Library.ana, and an example model to demonstrate its usage is at Sensitivity Functions Examples.ana.

Model Documentation Library

Download: Model Documentation Library.ana

Some people like to create a concise report on paper that contains all objects in their model along with descriptions or other selected attributes. The "Print Report" feature in Analytica can be used for this purpose, but is not at all concise and ends up placing each object window on a separate page. The Model Documentation Library allows you to select a module from your model and produce a result table containing every object within that module with its selected attributes such as title, description, units, definition, or user-defined attributes. This table can then be exported to Excel where you can format it nicely and print it. Thus, you can end up with a very concise report on paper.

To use this library, load your model and then select File → Add Module.... Add the Model Documentation Library.ana module file using Embed. In that module, using the pulldown, select the top-level module for the report. Follow the instructions shown on the diagram. If you make changes to your model later, press the Update Model Documentation button to adjust the pulldown content.

Units Conversion Library

Download: Units conversion library.ana

The functions in this library provide conversions between different units -- for example, from feet to kilometers, or from Btu (British thermal units) to gigajoules of energy. Using this library relieves you from having to look up conversion factors. It also makes the model more transparent by making it clear where you are converting from one units to another -- instead of just embedding conversion constants in the formulas.

Use Conversion_Factor(oldUnits, newUnits) to give a conversion factor between two units.

If you omit «newUnits», it will assume the standard units for that type (dimensions).

When specifying units , you must use a symbol (abbreviation) from the Units table.

If the units are of different dimensions, e.g. energy and power, or if it doesn't recognize the units, it will give an error.

Use Nom_to_real_dollars(yr, baseYr) to convert from nominal dollars for year «yr» to "real dollars" for specified «baseYr». If you omit «baseYr», it defaults to the Standard base year, initially 2000.

These conversion factors were provided on October 20, 2007 by Chris Marnay of the Lawrence Berkeley Laboratory, as part of his work on the SEDS project.

Greatest Common Divisor functions

Download: GCD function library.ana

This library contains two User-Defined Functions for computing the greatest common divisor.

DB Conversion Library

Download: DB conversion lib.ana

Lets you embed data obtained from a database into the Analytica model. This breaks the need to use it with an external database, so -- for example -- you can send to someone (e.g. Lumina tech support) who does not have access to the database or has an edition of Analytica (e.g. Professional) that doesn't support database access.

Press a button in this library to transform all the variables defined using DbQuery, DbLabels and DbTable to literal data. Variables and indexes defined using DbQuery or DbLabels are transformed to list definitions, and those defined using DbTable are transformed into edit tables. This breaks the connection to the external database. So, of course, the model will no longer be able to get new or extended data from the database.

The library is limited in its scope. It only works when all calls to DbQuery, DbLabels and DbTable occur at the top level of variable definitions. Do not try to use it if the calls to these functions are embedded within larger expressions or in User-Defined Functions.

Use with extreme caution!!: Make a copy of your original model before adding and executing this module. After running the transformation, be sure to use File → Save As... to save the transformed model under a different filename, so you don't clobber your original model.

Spreadsheet Helper Library

Download: Spreadsheet Helper lib.ana

Includes functions that return the list of worksheet names and the Excel filename of the workbook. It also contains a SpreadsheetOpenEx function that can be used in place of SpreadsheetOpen, but which remembers the filename selected by the user so the next time he doesn't have to select the file again.

Data Standardization Library

Download: Data Standardization Library.ana

Imported data is often inconsistent. This library allows you to choose what the "standard" values should be in a column of data. You can then map any non-standard value to one of the standard values. The result is a column of consistent data.

Standard libraries included with Analytica

The standard Analytica libraries contain a wide variety of useful functions that you can add into any Analytica model to supplement the built-in Analytica functions. When you install Analytica (any edition including Free 101), it automatically installs them into the Libraries folder along with the Analytica application. See Extra libraries for additional libraries available only from this wiki.

To add a library into your Analytica model, select Add Library... from the File menu. It opens a file dialog with the Libraries folder from which you can select the library you want.

Sometimes we update these standard libraries between Analytica releases. You can download the latest version of these libraries from the links below. If you do that, we suggest you save the new library into the folder

  c: Lumina/Analytica 4.6/Libraries

so you can easily add it into your models using the standard menu option Add Library... from the File menu

ACP style library

This library file helps modelers customize the display of their model in Analytica Cloud Player (ACP). Most of the ACP styles attributes can be applied using this library, and It simplifies the process by using a GUI rather than by having to enter the attributes by typing them out.

Download: media:ACP style library.ana

See ACP Style Library for documentation on how to use this library

Bayes Function

Functions for a simple application of Bayes' rule to a complete discrete joint array of prior probabilities.

Download: media:Bayes Function.ana

Complex Numbers

Functions for computing with complex numbers.

Download: media:Complex Library.ana

Concatenation

Functions for concatenation of arrays. Several ConcatN functions allow N arrays to be concatenated in a single call, as an alternative to calling the built-in Concat function N times in sequence. ConcatRows joins the rows of an array .

Download: media:Concatenation.ana

Data Statistics

This library is deprecated (obsolete) in Analytica 4.0, but is still included for backward compatibility for models that used these functions in earlier versions of Analytica. Functions allow statistics, such as SDeviation, to be applied across indexes other than Run. The built-in statistical functions now allow the running index to be optionally specified.

Download: media:Data Statistics Library.ana

Distribution Densities

Functions that return the analytic density function for continuous distributions. These densities can be used when using importance sampling, for example. The library is described in detail at Distribution Densities Library.

A new version (after the 4.1.1 release) is now available that includes density functions for all built-in continuous and discrete distributions, as well as for a few other distributions (F-dist, Wishart, Gaussian,...). This version also include cumulative distribution functions and inverse cumulative distribution functions for many distributions. See Distribution Densities Library for more details. To get the newest version, download the library below, then replace the one in your Libraries directory.

Download: Distribution Densities.ana

Distribution Variations

A variety of alternative parametrizations of built-in univariate distributions, and other common parametric univariate distributions that are simple transformations of built-in distributions.

Download: media:Distribution Variations.ana

Expand Index

Download: media:Expand Index.ana

Financial Functions

Includes functions for derivative valuations, bond pricing, etc.

Note: Standard financial functions (equivalent to those found in Excel) are built into Analytica and are found in the built-in Financial Functions library.

Download: media:Financial Library.ana

Flat File Library

Functions for reading data from a comma-separated flat file format (.CSV) into Analytica arrays.

Download: media:Flat File Library.ana

Garbage Bin

Provides a garbage bin icon. Instead of deleting nodes, you can drag them to the garbage bin. The "deletion" can then be undone if necessary. Also, if the node you delete has dependents or dependencies, this is immediately evident by the arrows emanating to or from the garbage bin.

To empty the garbage bin, double click on it to open it, select all and delete. Emptying the garbage bin in this fashion is not undoable. You must delete an object (permanently) from the garbage bin before you can reuse its identifier.

Download: media:Garbage Bin.ana

Generalized Regression

(Requires Analytica Optimizer )

Logistic and Probit regression. These functions are used to fit a function that predicts the probability of an outcome based on a set of continuous independent variables, from a data set where each data point is classified as either 0 or 1.

Download: media:Generalized Regression.ana

Linked Lists

Download: media:Linked List Library.ana

Multivariate Distributions

Various multi-dimensional distributions, and the ability to generated correlated distributions.

Download: media:Multivariate Distributions.ana

ODBC Database Functions

Optimization Functions

Provides some elementary optimization functions:

These are usable even without Analytica Optimizer; however they are based on a rudimentary gradient-descent algorithm and don't have anything near the power of the Frontline solver functions provided by Analytica Optimizer functions.

Download: media:Optimization Functions.ana

Performance Profiler

(Required Analytica Enterprise)

Used to determine where a model is consuming time and memory resources.

Download: media:Performance Profiler.ana

See Also

Comments


You are not allowed to post comments.