constant {rv} | R Documentation |
Tests or coerces objects that are non-random.
is.constant(x) ## S3 method for class 'rv': is.constant(x) ## Default S3 method: is.constant(x) as.constant(x) ## S3 method for class 'rv': as.constant(x)
x |
an object, random variable (rv) or not |
is.constant
returns TRUE
for each component of the argument object
if the implied variance (sample variance of the simulations) is zero
or if there is only one simulation (that is, the variable is ``constant").
Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman
Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.
is.constant(1) # TRUE is.constant(as.rv(1)) # TRUE is.constant(rvnorm(1)) # FALSE