Draw samples from a Beta distribution.

hanaml.beta(
  connection.context,
  m = NULL,
  a = NULL,
  b = NULL,
  seed = NULL,
  thread.ratio = NULL
)

Arguments

connection.context

ConnectionContext
SAP HANA Database connection object.

m

integer, optional
Specifies the number of random data to be generated.
Defaults to 100.

a

numeric, optional
The 1st shape parameter, positive.
Defaults to 0.5.

b

numeric, optional
The 2nd shape parameter, positive.
Defaults to 0.5.

seed

integer, optional
Indicates the seed used to initialize the random number generator:

  • 0: Uses the system time.

  • Not 0: Uses the specified seed.

Note that when multithreading is enabled, the random number sequences of different runs might be different even if the seed value remains the same.
Defaults to 0.

thread.ratio

double, optional
Controls the proportion of available threads that can be used by this function.
The value range is from 0 to 1, where 0 indicates a single thread, and 1 indicates all available threads.
Values between 0 and 1 will use up to that percentage of available threads.Values outside this range are ignored.
Defaults to 0.

Value

DataFrame containing the generated random samples, structured as follows:

  • ID, type INTEGER, ID column.

  • Generated random number columns, named by appending index number (starting from 1 to length of pvals) to Random_P, type DOUBLE. There will be as many columns here as there are values in pvals.

Examples

Draw samples from a beta distribution:


> beta <- hanaml.beta(connection.context = conn,
                      a = 1,
                      b = 1,
                      m = 20,
                      seed = 1,
                      thread.ratio = 0)

Output:


 > beta$collect()
    ID  GENERATED_NUMBER
 1   0          0.976130
 2   1          0.308346
 3   2          0.853118
 4   3          0.958553
 5   4          0.677258
 6   5          0.489628
 7   6          0.027733
 8   7          0.278073
 9   8          0.850181
 10  9          0.976244