o_rgamma: Drawing from R Gamma Distribution in Octave

Description Usage Arguments Octave Documentation for randg See Also Examples

View source: R/random.R

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

1
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 randg

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

[Generated from Octave-\Sexpr{RcppOctave::o_version()} on \Sexpr{Sys.time()}]

See Also

rgamma

Other orandom: o_rexp; o_rnorm; o_rpois; o_runif

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 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)

RcppOctave documentation built on May 29, 2017, 11:31 a.m.