-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patho_rpois.Rd
60 lines (50 loc) · 1.61 KB
/
o_rpois.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/random.R
\name{o_rpois}
\alias{o_rpois}
\title{Drawing from R Poisson Distribution in Octave}
\usage{
o_rpois(n, p = n, lambda)
}
\arguments{
\item{n}{number of output rows}
\item{p}{number of output columns (default to \code{n})}
\item{lambda}{Mean of the Poisson distribution}
}
\description{
This function wraps a call to the standard Octave function \code{randp},
which is redefined by \code{RcppOctave} to call the R base function
\code{\link[stats]{rpois}}.
This enables to exactly reproduce stochastic computations in R and Octave,
without changing the original Octave/Matlab code.
See \code{\link{o_runif}} for more details.
}
\details{
This function calls the Octave function \code{randp} as provided by
\code{RcppOctave}, which returns the draws as double.
The result is converted into integer to match the behaviour of
\code{\link{rpois}}
}
\section{Octave Documentation for \emph{randp}}{
\Sexpr[results=rd,stage=render]{if( .Platform$OS.type != 'windows' || .Platform$r_arch != 'x64' ) RcppOctave::o_help(randp, format='rd')}
\emph{[Generated from Octave-\Sexpr{RcppOctave::o_version()} on \Sexpr{Sys.time()}]}
}
\examples{
\dontshow{
options(R_CHECK_RUNNING_EXAMPLES_=TRUE) ## roxygen generated flag
}
# 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)
}
\seealso{
rpois
Other orandom: \code{\link{o_rexp}},
\code{\link{o_rgamma}}, \code{\link{o_rnorm}},
\code{\link{o_runif}}
}