print.accept_reject {AcceptReject} | R Documentation |
Print method for accept_reject objects
## S3 method for class 'accept_reject'
print(x, n_min = 10L, ...)
x |
An accept_reject object |
n_min |
Minimum number of observations to print |
... |
Additional arguments |
The function print.accept_reject()
is responsible for printing an object of
class accept_reject
in a formatted manner, providing some information
about the accept_reject
object, including the number of observations, the
value of the constant c
that maximizes acceptance, and the acceptance
probability 1/c
. Additionally, it prints the first generated
observations. The function print.accept_reject()
delivers formatted output
when executing an object of class accept_reject
in the console or when
executing the function print()
on an object of class accept_reject
,
returned by the function accept_reject()
.
An object of class character
, providing a formatted output with some
information about the accept_reject
object, including the number of
observations, the value of the constant c
that maximizes acceptance, and
the acceptance probability 1/c
. Additionally, it prints the first
generated observations. The function print.accept_reject()
enables
formatting when executing an object of class 'accept_reject' in the console
or when executing the function print()
on an object of class
accept_reject
, returned by the function accept_reject()
.
accept_reject()
and [plot.accept_reject().
set.seed(0) # setting a seed for reproducibility
accept_reject(
n = 2000L,
f = dbinom,
continuous = FALSE,
args_f = list(size = 5, prob = 0.5),
xlim = c(0, 10)
) |> print()