Learn R Programming

RcppOctave (version 0.18.1)

o_rgamma: Drawing from R Gamma Distribution in Octave

Description

This function wraps a call to the standard Octave function randg, which is redefined by RcppOctave to call the R base function rgamma. This enables to exactly reproduce stochastic computations in R and Octave, without changing the original Octave/Matlab code. See o_runif for more details.

Usage

o_rgamma(n, p = n, shape = 1, scale = 1)

Arguments

n
number of output rows
p
number of output columns (default to n)
shape
Mean of the Gamma distribution
scale
Scale of the Gamma distribution

Octave Documentation for <em>randg</em>

[results=rd,stage=render]{if( .Platform$OS.type != 'windows' || .Platform$r_arch != 'x64' ) RcppOctave::o_help(randg, format='rd')}

[Generated from Octave-RcppOctave::o_version() on Sys.time()]

# roxygen generated flag options(R_CHECK_RUNNING_EXAMPLES_=TRUE)

# Draw random gamma values (in vector form) set.seed(123) o_rgamma(1) o_rgamma(1, 10)

# Draw random gamma values (in matrix form) set.seed(123) o_rgamma(2) o_rgamma(2, 5)

# Draw random gamma values with shape and scale parameters o_rgamma(1, 5, shape=2) o_rgamma(1, 10, scale=0.5)

rgamma

Other orandom: o_rexp; o_rnorm; o_rpois; o_runif