Description Usage Arguments Details Value Author(s) References Examples
rvnsims
returns the number of simulations stored in each component of
its argument; setnsims
sets the default number of simulations;
getnsims
retrieves the default number of simulations.
1 | rvnsims(x)
|
x |
an rv object. |
If the argument is a non-rv numeric vector, rvnsims
returns 1
(corresponding to a ‘constant’) for each component.
The minimum number of default simulations is 2.
rvnsims
: a vector of integers.
setnsims
: previously set default number of simulations.
getnsims
: (integer) currently set default number of simulations.
Jouni Kerman jouni@kerman.com
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
1 2 3 4 5 6 7 8 9 10 | #
rvnsims(1.23) # 1
x <- rvnorm(1) # an rv
rvnsims(x) # equal to setnsims()
rvnsims(x)==nrow(sims(x)) # TRUE
rvnsims(x)==getnsims() # TRUE
setnsims(1000) # set n.sims to 1000
n.sims <- setnsims(10000) # s is now 1000
print(getnsims()) # prints 10000
setnsims(n.sims) # restore the number of simulations back to 1000
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.