o_rpois: Drawing from R Poisson Distribution in Octave

Description Usage Arguments Details Octave Documentation for randp See Also Examples

View source: R/random.R

Description

This function wraps a call to the standard Octave function randp, which is redefined by RcppOctave to call the R base function rpois. 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_rpois(n, p = n, lambda)

Arguments

n

number of output rows

p

number of output columns (default to n)

lambda

Mean of the Poisson distribution

Details

This function calls the Octave function randp as provided by RcppOctave, which returns the draws as double. The result is converted into integer to match the behaviour of rpois

Octave Documentation for randp

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

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

See Also

rpois

Other orandom: o_rexp; o_rgamma; o_rnorm; o_runif

Examples

1
2
3
4
5
6
7
8
9
# Draw random poisson values (in vector form)
set.seed(123)
o_rpois(1, lambda = 4)
o_rpois(1, 10, 4)

# Draw random poisson values (in matrix form)
set.seed(123)
o_rpois(2, lambda = 4)
o_rpois(2, 5, lambda = 4)

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