Contents Previous Next


GenerateData Method (BDKDistribution Object)

Description

Generates sample, density, or cumulative data.

Syntax

object.GenerateData(typeOfData As BDKDataType, numPoints as Long, seed as Long, data() as Double)

Arguments

typeOfData (Required BDKDataType) – the type of data to generate, the choices are:

numPoints (Required Long) – the number of data points to generate.

seed (Required Long) – the random number seed used to generate the data. This setting is only relevant if typeOfData is BDKDataTypeSamples.

data (Required Arrray of Doubles) – this argument receives the generated data. If typeOfData is BDKDataTypeSamples, the array is one-dimensional from (1 to numPoints). If typeOfData is BDKDataTypeDensity or BDKDataTypeCumulative, the array is two-dimensional, with the format (1 to 2, 1 to numPoints).

Return Value

None.

Example

'100 Samples from dist:
Dim data#()
dist.GenerateData(BDKDataTypeSamples, 100, 1, data())
sample1 = data(1)
sample2 = data(2)
'---etc---
'100 points along the density curve:
Dim data#()
dist.GenerateData(BDKDataTypeDensity, 100, 0, data())
x1 = data(1,1)
y1 = data(2,1)
x2 = data(1,2)
y2 = data(2,2)
'---etc---
'100 points along the cumulative curve:
Dim data#()
dist.GenerateData(BDKDataTypeCumulative, 100, 0, data())
x1 = data(1,1)
p1 = data(2,1)
x2 = data(1,2)
p2 = data(2,2)
'---etc---