Difference between revisions of "Additional libraries"

(Listed the existing libraries)
 
(Added an initial heading)
 
(67 intermediate revisions by 11 users not shown)
Line 1: Line 1:
(This page is currently a stub and needs to be filled in).
+
[[Category:Function libraries]]
 +
{{ReleaseBar}}
 +
__TOC__
  
= Libraries included with Analytica 4.0 =
 
  
''Stub section.  Library files should uploaded closer to the release, since they are likely to change before thenBrief descriptions of each need to be inserted and a list of library functions (with links to their detailed documentation) included.''
+
This page describes a set of useful Analytica function libraries.  These are ''additional'' to the [[Standard libraries]] that are automatically installed when you install AnalyticaIf you want to use any of these additional libraries, click on its link and it will download onto your computer. Depending on your download settings, it may automatically open it in Analytica. Either way, you should save it into a directory so that you can add it into your models.  It's usually most convenient to save it with your [[Standard libraries]] in directory
 +
:<code>"C: \Program Files\Lumina\Analytica {{#svarget:anarelease|6.5}}\Libraries"</code>
  
The following libraries are copied to your computer when you install any edition of Analytica (including Trial).  You can conveniently add these to a model by selecting '''Add Library...''' from the '''File''' menu in Analyica.
+
You can then easily add it into your models using the standard menu option '''Add Library...''' from the [[File menu]].
  
== Bayes Function ==
+
See [[User-defined Functions and Libraries]] to build your own functions and libraries.
  
Functions for a simple application of Bayes' rule to a complete discrete joint array of prior probabilities.
+
__TOC__
  
Download: [[Image:Bayes Function.ana]]
+
== Misc. libraries ==
 +
=== Large Sample Library ===
 +
'''Download:''' [[media:Large_Sample_Library_v10.ana]]
  
== Complex Numbers ==
+
:[[image:Large sample library.png]]
  
Functions for computing with complex numbers.
+
The [[Large Sample Library: User Guide|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.
  
Download: [[Image:Complex Library.ana]]
+
See [[Large Sample Library: User Guide]].
  
== Concatenation ==
+
===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. 
  
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 .
+
The library itself can be downloaded from [[media:Sensitivity Analysis Library.ana|Sensitivity Analysis Library.ana]], and an example model to demonstrate its usage is at [[media:Sensitivity Functions Examples.ana|Sensitivity Functions Examples.ana]].
  
Download: [[Image:Concatenation.ana]]
+
=== Model Documentation Library ===
 +
'''Download: ''' [[media:Model Documentation Library.ana|Model Documentation Library.ana]]
  
== Data Statistics ==
+
'''Prerequisites:''' [[Analytica 5.0]] or later. The [[Preferences_dialog|Domain acts as self index]] legacy preference must be OFF. You must be using [[Diagram_Style_dialog|ClearType text]] (not the very old non-clearType legacy setting).
  
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 AnalyticaFunctions allow statistics, such as SDevation, to be applied across indexes other than RunThe built-in statistical functions now allow the running index to be optionally specified.
+
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 pageThe ''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 itThus, you can end up with a very concise report on paper.
  
Download: [[Image:Data Statistics Library.ana]]
+
To use this library, load your model and then select '''File &rarr; Add Module...'''.  Add the [[media:Model Documentation Library.ana|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.
  
== Distribution Densities ==
+
=== [[Units Conversion Library]] ===
 +
'''Download: ''' [[media:Units conversion library.ANA|Units conversion library.ana]]
  
Functions that return the analytic density function for continuous distributionsThese densities can be used when using importance sampling, for example.
+
These functions convert between different units -- for example, from feet to kilometers, or from Btu (British thermal units) to gigajoules of energyThey  relieve you from having to look up conversion factors. They also make your 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.  
  
Download: [[Image:Distribution Densities.ana]]
+
[[File:Units conversion library.png|600px]]
  
== Distribution Variations ==
+
You can use the '''Conversion example''' section to enter a quantity, select its type (dimensions) and units, and convert it to another unit of that type.
  
A variety of alternative parametrizations of built-in univariate distributions, and other common parametric univariate distributions that are simple transformations of built-in distributions.
+
====Library functions====
  
Download: [[Image:Distribution Variations.ana]]
+
'''Units_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).
 +
The units parameters text values must match an abbreviation, synonym, or full name (case insensitive) in the Units data 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.
  
== Expand Index ==
+
'''Units_conversion'''(x, oldUnits, newUnits) returns the value of quantity x converted from oldUnits to newUnits. This works for units like temperature, where simple factors don't work.
Download: [[Image:Expand Index.ana]]
 
  
== Financial Functions =
+
'''Units_real_dollars'''(yr, baseYr) returns a multiplication factor used to convert nominal dollars in year yr to real (also known as constant) dollars using baseYr as the base year. If you omit baseYr, it uses the "Standard base year for inflation" which you can set in the Units Conversion Library user interface.  It uses consumer price index data provided by the US Energy Information Administration from 1949 to 2017 with projections up to 2040. It gives an error if yr or baseYr are outside that range.
  
Includes functions for derivative valuations, bond pricing, etc.
+
The '''Units_table''' contains the list of units, with abbreviation, full-name, and synonyms, type (dimensions) and conversion factors to the base unit for each type. For example, the base unit for 'Energy' is Joule. The conversion factor for gigajoule (GJ) is 10^9. You can add your own units. Be careful to select the correct type (dimensions).
  
Note: Standard financial functions (equivalent to those found in Excel) are built into Analytica and are found in the built-in Financial Functions library.
+
=== Greatest Common Divisor functions ===
 +
'''Download: ''' [[media:GCD function library.ana|GCD function library.ana]]
  
Download: [[Image:Financial Library.ana]]
+
This library contains two [[User-Defined Functions]] for computing the greatest common divisor.
  
== Flat File Library ==
+
=== [[Database library]] ===
 +
'''Download: ''' [[Media:Database library.ana|Database library.ana]]
  
Functions for reading data from a comma-separated flat file format (.CSV) into Analytica arrays.
+
A library of functions to make it easy to create, read, update, examine and delete database tables, without having to write SQL. It works with Microsoft Access, Microsoft SQL Server, MariaDB, and PostgreSQL, and can be expanded to support other database platforms.
  
Download: [[Image:Flat File Library.ana]]
+
=== DB Conversion Library ===
 +
'''Download: ''' [[media:Db conversion lib.ana|DB conversion lib.ana]]
  
== Garbage Bin ==
+
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. 
  
Provides a garbage bin iconInstead 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.
+
Press a button in this library to transform all the variables defined using [[DbQuery]], [[DbLabels]] and [[DbTable]] to literal dataVariables 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.
  
To empty the garbage bin, double click on it to open it, select all and deleteEmptying the garbage bin in this fashion is not undoableYou must delete an object (permanently) from the garbage bin before you can reuse its identifier.
+
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 definitionsDo not try to use it if the calls to these functions are embedded within larger expressions or in [[User-Defined Functions]].   
  
Download: [[Image:Garbage Bin.ana]]
+
'''''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 &rarr; Save As...''' to save the transformed model under a different filename, so you don't clobber your original model.
  
== Generalized Regression ==
+
=== Spreadsheet Helper Library ===
 +
'''Download: ''' [[media:Spreadsheet Helper lib.ana|Spreadsheet Helper lib.ana]]
  
(Requires Analytica Optimizer )
+
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 they don't have to select the file again.
  
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.
+
=== Data Standardization Library ===
 +
'''Download: ''' [[media:Data Standardization Library.ana|Data Standardization Library.ana]]
  
Download: [[Image:Generalized Regression.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.
  
== Linked Lists ==
+
== Additional probability distributions ==
  
Download: [[Image:Linked List Library.ana]]
+
=== Laplacian distribution ===
  
== Multivariate Distributions ==
+
'''Download: ''' [[media:Laplacian distribution library.ana|Laplacian distribution library.ana]]
  
Variout multi-dimensional distributions, and the ability to generated correlated distributions.
+
'''Description: ''' The Laplacian distribution (or [https://en.wikipedia.org/wiki/Laplace_distribution Laplace distribution]) is a continuous, unbounded distribution that is essentially a double-sided [[Exponential distribution]] with a «mean» parameter. The library contains the distribution function, and the analytica functions for density, cumulative density and inverse cumulative density (the quantile function).
  
Download: [[Image:Multivariate Distributions.ana]]
+
== The HDR pseudo-random number generator ==
  
== ODBC Database Functions ==
+
'''Download:''' [[media:Hubbard HDR Library.ana|Hubbard HDR Library.ana]]
* [[Image:ODBC-Library.ana]]
 
  
== Optimization Functions ==
+
'''Authors:''' [https://en.wikipedia.org/wiki/Douglas_W._Hubbard Doug Hubbard], [https://hubbardresearch.com/ Hubbard Decision Research], and Lonnie Chrisman, [https://lumina.com Lumina Decision Systems]
  
Provides some elementary optimization functions:
+
'''Description:''' [https://www.researchgate.net/publication/338824184_A_Multi-Dimensional_Counter-Based_Pseudo_Random_Number_Generator_as_a_Standard_for_Monte_Carlo_Simulations The HDR] is a simple, open-source pseudo-random number generation algorithm. It has been embraced by organizations such as [https://ProbabilityManagement.org ProbabilityManagement.org] as a standard for efficiently exchanging exact Monte Carlo samples. Given 4 integer seed values, the sequence is deterministic, so two parties with these same 4 values can reproduce precisely the same sequence up to a length of 100M samples, even from Excel.  Select a different combination of seeds to prevent any two independent simulations from inadvertently using the same random number stream. This ensures that independent simulation results can be combined without unintended correlations. Or use the same combination of seeds to intentionally produce identical simulations of the same stream. This allows entire Monte Carlo simulation samples to be communicated in just a few numbers.
* GoalSeek
 
* Solve
 
* Gradient
 
  
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.
+
This library provides the functions for using HDR in an Analytica model. The <code>Hubbard_HDR(...)</code> function enables you to obtain the nth random number in a sequence, while the <code>HDR_U(...)</code> function acts as a <code>[[Uniform|Uniform(0,1)]]</code> distribution as is convenient to use in any Inverse Cumulative Probability Function (e.g., [[CumKeelinInv]], [[CumNormalInv]], [[CumBetaInv]], etc) to encode a specific distribution inside a model.
  
Download: [[Image:Optimization Functions.ana]]
+
* Douglas Hubbard (Aug 2019), "[https://www.researchgate.net/publication/338824184_A_Multi-Dimensional_Counter-Based_Pseudo_Random_Number_Generator_as_a_Standard_for_Monte_Carlo_Simulations A Multi-Dimensional, Counter-Based Pseudo Random Number Generator as a Standard for Monte Carlo Simulations]", Winter Simulation Conference, Washington DC, DOI: 10.1109/WSC40007.2019.9004773.
  
== Profiling ==
+
== Individual functions with examples ==
  
(Required Analytica Enterprise)
+
'''Download: '''  [[media:Recumulate example.ana|Recumulate example.ana]] : Like [[Cumulate]], but resets to zero at selected points.
  
Used to determine where a model is consuming time and memory resources.
+
'''Download:''' [[media:Apportion.ana|Apportion.ana]]: Aggregates or disaggregates an array of values from one index to another index, where the second index may be larger or smaller. Does not require the indexes to be index multiples of each other. For example, if you map from a 47-element index to a 13-element index, each 3.62 elements of the original map to an element in the destination, so for example, the first 3 items map to the first item, then the fourth item is shared, with 0.62 apportioned to the first element and 0.38 apportioned to the second element. Supports aggregation types <code>'SUM'</code>, <code>'AVERAGE'</code>, <code>'MIN'</code> and <code>'MAX'</code>. Contributed by Paul Sanford of EPRI.
  
Download: [[Image:Profiling.ana]]
+
<div name="SequentialDispatch">
 +
'''Download: ''' [[media:Sequential dispatch library.ana|Sequential dispatch library.ana]] : The function '''SequentialDispatch''' generalizes the [[Dispatch]] function by adding a time-like index to carry over unsatisfied demand or unallocated capacity.  [[media:Sequential dispatch test.ana|Sequential dispatch test.ana]] is an example of its use.
 +
</div>
 +
 
 +
== The [[Legendre Library]] ==
 +
The [[Legendre Library]] includes functions for:
 +
 
 +
* Gauss-Legendre Quadrature
 +
* Numerically stable, accurate and efficient calculation of an order n Legendre Polynomial at values -1<=x<=1
 +
* Numerically stable calculation of the derivative of an order n Legendre Polynomial at x.
 +
* Calculation of the zeros of Legendre polynomials.
 +
* Calculation of the Legendre polynomial coefficients.
 +
 
 +
'''Author:''' Lonnie Chrisman, Lumina Decision Systems
 +
 
 +
'''Download:''' [[media:Legendre library.ana|Legendre library.ana]]
 +
 
 +
The library has [[Legendre Library|its own reference page]] on this wiki.
 +
 
 +
== Cell Icon Set Library ==
 +
:[[image:CellIconSetExample1.png|600px]]
 +
 
 +
Provides pre-curated icon sets for use as [[CellIcon|cell icons in tables]]. The functions automatically select which icon in a set to use to depict the value that you want the icon to depict. Each icon set uses a consistent color scheme and consistent icon shapes having a consistent theme. Icon sets include shape collections, directional indicators, indicator styles and rating styles.
 +
 
 +
Without this library, you can use cell icons in table cells by using the [[CellIcon]] function in a [[Computed cell format attribute]]. But this requires you to find suitable icon images and write logic to map from your values to these images. This library takes care of these pain points for you.
 +
 
 +
'''Documentation:''' [[Cell Icon Set Library]]
 +
 
 +
'''Download:''' [[media:Cell_Icon_Set_Library.ana|Cell_Icon_Set_Library.ana]]
 +
 
 +
'''Author:''' Lonnie Chrisman, Lumina Decision Systems
 +
 
 +
==See Also==
 +
* [[Standard libraries]]: Installed with Analytica
 +
* [[User Libraries]]: How to create your own Libraries
 +
* [[Example Models]]
 +
* [[Large Sample Library: User Guide]]
 +
* [[Modules and Libraries]]
 +
* [[Filed modules and libraries]]
 +
* [[User-defined Functions and Libraries]]
 +
* [[Example Models and Libraries]]
 +
* [[Financial library functions]]
 +
* [[The Sensitivity Analysis Library]]
 +
* [[Distribution Densities Library]]
 +
* [[Linked list library]]
 +
* [[Base Conversion Function Library]]
 +
* [[Performance Profiler library]]
 +
* [[List of libraries]]

Latest revision as of 21:23, 5 July 2024



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5  •  6.6



This page describes a set of useful Analytica function libraries. These are additional to the Standard libraries that are automatically installed when you install Analytica. If you want to use any of these additional libraries, click on its link and it will download onto your computer. Depending on your download settings, it may automatically open it in Analytica. Either way, you should save it into a directory so that you can add it into your models. It's usually most convenient to save it with your Standard libraries in directory

"C: \Program Files\Lumina\Analytica 6.5\Libraries"

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

See User-defined Functions and Libraries to build your own functions and libraries.


Misc. libraries

Large Sample Library

Download: media: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

Prerequisites: Analytica 5.0 or later. The Domain acts as self index legacy preference must be OFF. You must be using ClearType text (not the very old non-clearType legacy setting).

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

These functions convert between different units -- for example, from feet to kilometers, or from Btu (British thermal units) to gigajoules of energy. They relieve you from having to look up conversion factors. They also make your 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.

Units conversion library.png

You can use the Conversion example section to enter a quantity, select its type (dimensions) and units, and convert it to another unit of that type.

Library functions

Units_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). The units parameters text values must match an abbreviation, synonym, or full name (case insensitive) in the Units data 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.

Units_conversion(x, oldUnits, newUnits) returns the value of quantity x converted from oldUnits to newUnits. This works for units like temperature, where simple factors don't work.

Units_real_dollars(yr, baseYr) returns a multiplication factor used to convert nominal dollars in year yr to real (also known as constant) dollars using baseYr as the base year. If you omit baseYr, it uses the "Standard base year for inflation" which you can set in the Units Conversion Library user interface. It uses consumer price index data provided by the US Energy Information Administration from 1949 to 2017 with projections up to 2040. It gives an error if yr or baseYr are outside that range.

The Units_table contains the list of units, with abbreviation, full-name, and synonyms, type (dimensions) and conversion factors to the base unit for each type. For example, the base unit for 'Energy' is Joule. The conversion factor for gigajoule (GJ) is 10^9. You can add your own units. Be careful to select the correct type (dimensions).

Greatest Common Divisor functions

Download: GCD function library.ana

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

Database library

Download: Database library.ana

A library of functions to make it easy to create, read, update, examine and delete database tables, without having to write SQL. It works with Microsoft Access, Microsoft SQL Server, MariaDB, and PostgreSQL, and can be expanded to support other database platforms.

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 they don'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.

Additional probability distributions

Laplacian distribution

Download: Laplacian distribution library.ana

Description: The Laplacian distribution (or Laplace distribution) is a continuous, unbounded distribution that is essentially a double-sided Exponential distribution with a «mean» parameter. The library contains the distribution function, and the analytica functions for density, cumulative density and inverse cumulative density (the quantile function).

The HDR pseudo-random number generator

Download: Hubbard HDR Library.ana

Authors: Doug Hubbard, Hubbard Decision Research, and Lonnie Chrisman, Lumina Decision Systems

Description: The HDR is a simple, open-source pseudo-random number generation algorithm. It has been embraced by organizations such as ProbabilityManagement.org as a standard for efficiently exchanging exact Monte Carlo samples. Given 4 integer seed values, the sequence is deterministic, so two parties with these same 4 values can reproduce precisely the same sequence up to a length of 100M samples, even from Excel. Select a different combination of seeds to prevent any two independent simulations from inadvertently using the same random number stream. This ensures that independent simulation results can be combined without unintended correlations. Or use the same combination of seeds to intentionally produce identical simulations of the same stream. This allows entire Monte Carlo simulation samples to be communicated in just a few numbers.

This library provides the functions for using HDR in an Analytica model. The Hubbard_HDR(...) function enables you to obtain the nth random number in a sequence, while the HDR_U(...) function acts as a Uniform(0,1) distribution as is convenient to use in any Inverse Cumulative Probability Function (e.g., CumKeelinInv, CumNormalInv, CumBetaInv, etc) to encode a specific distribution inside a model.

Individual functions with examples

Download: Recumulate example.ana : Like Cumulate, but resets to zero at selected points.

Download: Apportion.ana: Aggregates or disaggregates an array of values from one index to another index, where the second index may be larger or smaller. Does not require the indexes to be index multiples of each other. For example, if you map from a 47-element index to a 13-element index, each 3.62 elements of the original map to an element in the destination, so for example, the first 3 items map to the first item, then the fourth item is shared, with 0.62 apportioned to the first element and 0.38 apportioned to the second element. Supports aggregation types 'SUM', 'AVERAGE', 'MIN' and 'MAX'. Contributed by Paul Sanford of EPRI.

Download: Sequential dispatch library.ana : The function SequentialDispatch generalizes the Dispatch function by adding a time-like index to carry over unsatisfied demand or unallocated capacity. Sequential dispatch test.ana is an example of its use.

The Legendre Library

The Legendre Library includes functions for:

  • Gauss-Legendre Quadrature
  • Numerically stable, accurate and efficient calculation of an order n Legendre Polynomial at values -1<=x<=1
  • Numerically stable calculation of the derivative of an order n Legendre Polynomial at x.
  • Calculation of the zeros of Legendre polynomials.
  • Calculation of the Legendre polynomial coefficients.

Author: Lonnie Chrisman, Lumina Decision Systems

Download: Legendre library.ana

The library has its own reference page on this wiki.

Cell Icon Set Library

CellIconSetExample1.png

Provides pre-curated icon sets for use as cell icons in tables. The functions automatically select which icon in a set to use to depict the value that you want the icon to depict. Each icon set uses a consistent color scheme and consistent icon shapes having a consistent theme. Icon sets include shape collections, directional indicators, indicator styles and rating styles.

Without this library, you can use cell icons in table cells by using the CellIcon function in a Computed cell format attribute. But this requires you to find suitable icon images and write logic to map from your values to these images. This library takes care of these pain points for you.

Documentation: Cell Icon Set Library

Download: Cell_Icon_Set_Library.ana

Author: Lonnie Chrisman, Lumina Decision Systems

See Also

Comments


You are not allowed to post comments.