hanaml.mcmc.Rd
hanaml.mcmc is a R wrapper for SAP HANA PAL Markov chain Monte Carlo algorithm.
hanaml.mcmc(
conn,
distribution,
location = NULL,
scale = NULL,
shape = NULL,
dof = NULL,
chain.iter = NULL,
random.state = NULL,
init.radius = NULL,
adapt = NULL,
warmup = NULL,
thin = NULL,
adapt.gamma = NULL,
adapt.delta = NULL,
adapt.kappa = NULL,
adapt.offset = NULL,
adapt.init.buffer = NULL,
adapt.term.buffer = NULL,
adapt.window = NULL,
stepsize = NULL,
stepsize.jitter = NULL,
max.depth = NULL,
alpha = NULL,
beta = NULL,
lambda = NULL,
mu = NULL,
nu = NULL,
omega = NULL,
sigma = NULL,
xi = NULL,
L = NULL,
y.min = NULL
)
ConnectionContext
SAP HANA Database connection object.
character
Specifies the name of distribution. Valid options include: 'normal', 'skew.normal',
'student.t', 'cauchy', 'laplace', 'logistic', 'gumbel', 'exponential', 'chi.square'.
The valid parameters for each distribution are shown as follows:
1. "normal": mu
(location), sigma
(scale).
2. "skew.normal": mu
(location), omega
(scale), alpha
(shape).
3. "student.t": nu
(dof), mu
(location), sigma
(scale).
4. "cauchy": mu
(location), sigma
(scale).
5. "laplace": mu
(location), sigma
(scale).
6. "logistic": mu
(location), sigma
(scale).
7. "gumbel": mu
(location), beta
(scale).
8. "exponential": beta
(inverse-scale).
9. "chi.square": nu
(dof).
10. "invchi.square": nu
.
11. "gamma": alpha
, beta
.
12. "weibull": alpha
, sigma
.
13. "frechet": alpha
, sigma
.
14. "rayleigh": sigma
.
15. "multinormal": mu
, sigma
.
16. "multinormalprec": mu
, omega
.
17. "multinormalcholesky": mu
, L
.
18. "multistudent.t": nu, mu, sigma
.
19. "dirichlet": alpha
.
20. "beta": alpha, beta
.
21. "invgamma": alpha, beta
.
22. "lognormal": mu, sigma
.
23. "pareto": y.min, alpha
.
24. "lomax": lambda, alpha
.
double, optional(deprecated)
Specifies the location parameter for a distribution.
Valid when distribution is set to one of the following values:
"normal", "skew.normal", "student.t", "cauchy", "laplace", "logistic".
Defaults to 0.
Deprecated, please use mu
.
double, optional(deprecated)
Specifies the scale parameter for a distribution.
Valid only when distribution is set to one of the following values:
"normal", "skew.normal", "student.t", "cauchy", "laplace", "logistic", "exponential".
Defaults to 1.0.
Deprecated, please use sigma
or beta
(whichever depends on the type of distributions).
double, optional(deprecated)
Specifies the shape parameter for a distribution.
Valid only when distribution is set to 'skew.normal'.
Defaults to 1.0.
Deprecated, please use alpha
.
double, optional(deprecated)
Specifies the degree of freedom of a distribution.
Valid only when distribution is "student.t" or "chi.square".
Defaults to 1.0.
Deprecated, please use nu
.
integer, optional
Specifies number of iterations for each Markov chain including warmup.
Defaults to 2000.
integer, optional
Specifies the seed used to initialize the random number generator,
where 0 means current system time as seed, while other values are
simply seed values.
Defaults to 0.
double, optional
Specifies the radius to initialize the process.
Defaults to 2.0.
logical, optional
Specifies whether or not to use adaption.
Defaults to TRUE.
integer, optional
Specifies the number of warm-up iterations.
Defaults to half of chain.iter.
integer, optional
Specifies the period for saving samples.
Defaults to 1.
double, optional
Specifies the regularization scale for adaption, must be positive.
Invalid when adapt is FALSE.
Defaults to 0.05.
double, optional
Specifies the target Metropolis acceptance rate, must be restricted
between 0 and 1(inclusive of both limits).
Only valid when adapt is TRUE.
Defaults to 0.8.
double, optional
Specifies the relaxation exponent, must be positive.
Only valid when adapt is TRUE.
Defaults to 0.75.
double, optional
Specifies the adaption iteration offset, must be positive.
Only valid when adapt is TRUE.
Defaults to 10.0.
integer, optional
Specifies the width of initial fast adaption interval.
Only valid when adapt is TRUE.
Defaults to 75.
integer, optional
Specifies the width of terminal(final) fast adaption interval.
Only valid when adapt is TRUE.
Defaults to 50.
integer, optional
Specifies the initial width of slow adaption interval.
Only valid when adapt is TRUE.
Defaults to 25.
double, optional
Specifies the value for discretizing the time interval.
Defaults to 1.0.
double, optional
Specifies the uniform random jitter of step-size.
Defaults to 0.
integer, optional
Specifies the maximum tree depth.
Defaults to 10.
numeric, optional
Specifies the value of parameter alpha
in a distribution.
Mandatory and valid only if the corresponding distribution contains alpha
as a parameter.
numeric, optional
Specifies the value of parameter beta
in a distribution.
Mandatory and valid only if the corresponding distribution contains beta
as a parameter.
numeric, optional
Specifies the value of parameter lambda
in a distribution.
Mandatory and valid only if the corresponding distribution contains
lambda
as a parameter.
numeric, optional
Numerical value or vector that represents the mean value of a distribution.
Mandatory and valid if the corresponding distribution contains mu
as a parameter.
numeric, optional
Specifies the value of parameter nu
(often representing the degree of freedom)
in a distribution.
Mandatory and valid only if the corresponding distribution contains nu
as a parameter.
numeric, optional
Numerical value or vector for parameter omega
in a distribution.
Mandatory and valid only if the corresponding distribution contains omega
as a parameter.
numeric, optional
Numerical value or vector for parameter sigma
in a distribution.
Mandatory and valid only if the corresponding distribution contains omega
as a parameter.
numeric, optional
Specifies the value of parameter xi
(i.e. the mean) in skew-normal distribution.
Mandatory and valid only if distribution
is "skew.normal".
numeric, optional
A numeric vector that specifies lower triangular matrix in the cholesky decomposition
of the covariance matrix in multi-normal distribution.
Mandatory only if distribution
is "multinormalcholesky".
numeric, optional
Specifies the value of parameter y.min
in Pareto distribution.
Mandatory and valid only if distribution
is "pareto".
DataFrame
Samples of the specified distribution generated from Markov Chain Monte-Carlo process.
Given a distribution, this function generates samples
of the distribution using Markov chain Monte Carlo simulation.
The following line of code shows how to generate MCMC samples from student.t distribution with specified distribution parameters:
> res <- hanaml.mcmc(conn, distribution = "student.t",
location = 0, dof = 1,
chain.iter = 50, thin = 10,
init.radius = 0)
> res$Collect()
ID SAMPLES
1 0 -1.728452
2 1 1.575337
3 2 1.185957
4 3 4.913828
5 4 0.220282
6 5 -5.588809