CB.DefineAltParms

This function creates or changes an alternate parameter set for continuous distributions (listed in Table 53). The function returns a value used  by CB.DefineAssumND.

Note:

If you use CB.DefineAltParms to define an alternate parameter set using only percentiles, you will not be able to retrieve parameter values with CB.GetAssum.

Table 49. CB.DefineAltParms Returned Data Type

Returned Value

Returned Data Type

An encoded integer that indicates the distribution and parameter set that CB.DefineAssumND should use

Integer

Note:

A return value of -1 indicates an improperly defined alternate parameter set.

Table 50. CB.DefineAltParms Parameters

Parameter

VBA Data Type

Value

Description

DistType

Integer

Integer value or named constant. See Table 53.

Specifies a distribution type for the assumption. The number of parameters varies with the distribution type. See Table 53 for types and associated parameters.

Parm1, Parm2, Parm3 (All are required)

Double

Double value or named constant. See Table 51, following.

Specifies the alternate parameters used to define the distribution. You must supply three parameters whether or not the distribution needs three. That is, if a distribution uses only one or two parameters, you must still supply three, using the cbParmNone parameter to round out the argument list. For more information, see Table 51.

Parm4 (Optional)

Variant

Named constant or other value

Specifies an optional fourth alternate parameter, currently required only for the beta distribution

The following constant and index values (shown in Table 51) can be used with Parm1, Parm2, Parm3, and Parm4 described in Table 50.

Table 51. CB.DefineAltParms Parm1 Through Parm4 Constant and Index Values

Named Constant

Index Value

Description

cbParmNone

-1

Placeholder in the parameter list for distributions that require fewer than three parameters. This parameter must come at the end of the argument list. See the examples for how to use this parameter.

cbParmRegular

-2

Regular parameter for the distribution (for example, the mean or standard deviation for the normal distribution). You can’t use this parameter for lognormal distributions.

cbParmLogMean

-3

Log mean

cbParmLogStDev

-4

Log standard deviation

cbParmGeoMean

-5

Geometric mean

cbParmGeoStDev

-6

Geometric standard deviation

cbParmMean

-7

Mean

cbParmStDev

-8

Sandard deviation

cbParmMinimum

-9

Mnimum value

cbParmLikeliest

-10

Lieliest value

cbParmMaximum

-11

Maximum value

cbParmLocation

-12

Location parameter. See Table 53.

cbParmScale

-13

Scale parameter. See Table 53.

cbParmMode

-15

Mode

cbParmAlpha

-16

Alpha parameter. See Table 53.

cbParmBeta

-17

Beta parameter. See Table 53.

cbParmShape

-18

Shape parameter. See Table 53.

cbParmRate

-19

Rate value. See Table 53.

cbParmMidpoint

-20

Midpoint value. See Table 53

cbParmDegFreedom

-21

Degrees of freedom value. See Table 53

cbParmPercentile

0

Percentile value. Add the desired percentile to this parameter; for example, cbParmPercentile + 80 indicates the 80th percentile.

Note:

Because there are three alternate parameter sets (in addition to percentiles) for the lognormal distribution, the cbParmRegular named constant cannot be passed to CB.DefineAltParms when setting up an alternate parameter set for the lognormal distribution. You must explicitly set the parameter set with, for example, cbParmLogMean and cbParmLogStDev. cbParmMode is included to support the extreme value distribution for backward compatibility with Crystal Ball 2000.x (5.x). In later versions of Crystal Ball , that distribution is replaced with the maximum extreme and minimum extreme distributions. cbParmMode is deprecated in this version of Crystal Ball and is obsolete in a future version.