hanaml.binomial {hana.ml.r}R Documentation

binomial Distribution Sampling

Description

Draw samples from a binomial distribution multivariate distribution

Usage

hanaml.binomial(conn.context,
                       m = NULL,
                       n = NULL,
                       p = NULL,
                       seed = NULL,
                       thread.ratio = NULL)

Arguments

conn.context

ConnectionContext
Database connection object.

m

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

n

integer, optional
Number of trails.
Defaults to 1.

p

codetuple of double or integer, optional
Success fractions of each category.
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

numeric, optional
Controls the proportion of available threads to use. The value range is from 0 to 1, where 0 indicates a single thread, and 1 indicates up to all available threads. Values between 0 and 1 will use that percentage of available threads. Values outside this range tell PAL to heuristically determine the number of threads to use.
Defaults to 0.

Value

DataFrame containing the generated random samples, structured as follows:
- ID, type INTEGER, ID column.
- GENERATED_NUMBER, type DOUBLE, sample value..

Examples

## Not run: 
Draw samples from a multinomial distribution:
> binomial <- hanaml.binomial(conn, n = 10, p = 0.6, m = 20, seed = 1,
> binomial$collect()
     ID RANDOM_P1 RANDOM_P2 RANDOM_P3 RANDOM_P4
1   0         0         2         4         4
2   1         2         2         4         2
3   2         4         0         5         1
4   3         0         0         5         5
5   4         1         4         2         3
6   5         4         1         4         1
7   6         1         4         2         3
8   7         2         3         2         3
9   8         3         0         6         1
10  9         2         2         3         3

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]