template<class RNGTYPE>
double scythe::rng< RNGTYPE >::rf ( double  df1,
double  df2 
) [inline]

Generate a $\chi^2$ distributed random variate.Generate an exponentially distributed random variate.Generate an F distributed random variate.

This function returns a pseudo-random variate drawn from the $\chi^2$distribution with df degress of freedom.

Parameters:
df The degrees of freedom.
See also:
pchisq(double x, double df)

dchisq(double x, double df)

Exceptions:
scythe_invalid_arg (Level 1) */ double rchisq (double df) { double report;
// Check for allowable paramter SCYTHE_CHECK_10(df <= 0, scythe_invalid_arg, "Degrees of freedom <= 0");

// Return Gamma(nu/2, 1/2) variate report = rgamma (df / 2, .5);

return (report); }

template <matrix_order O, matrix_style S> Matrix< double , O, S> rchisq (unsigned int rows, unsigned int cols, __VA_ARGS__) { Matrix< double , O, Concrete> ret(rows, cols, false); typename Matrix< double ,O,Concrete>::forward_iterator it; typename Matrix< double ,O,Concrete>::forward_iterator last = ret.end_f(); for (it = ret.begin_f(); it != last; ++it) *it = rchisq ( df ); SCYTHE_VIEW_RETURN( double , O, S, ret) } Matrix< double , Col, Concrete> rchisq (unsigned int rows, unsigned int cols, __VA_ARGS__) { return rchisq <Col,Concrete> (rows, cols, df ); } double df);

/*!

This function returns a pseudo-random variate drawn from the exponential distribution described by the inverse scale parameter invscale.

Parameters:
invscale The inverse scale parameter.
See also:
pexp(double x, double scale)

dexp(double x, double scale)

Exceptions:
scythe_invalid_arg (Level 1) */ double rexp (double invscale) { double report;
// Check for allowable parameter SCYTHE_CHECK_10(invscale <= 0, scythe_invalid_arg, "Inverse scale parameter <= 0");

report = -stdlog (runif ()) / invscale;

return (report); }

template <matrix_order O, matrix_style S> Matrix< double , O, S> rexp (unsigned int rows, unsigned int cols, __VA_ARGS__) { Matrix< double , O, Concrete> ret(rows, cols, false); typename Matrix< double ,O,Concrete>::forward_iterator it; typename Matrix< double ,O,Concrete>::forward_iterator last = ret.end_f(); for (it = ret.begin_f(); it != last; ++it) *it = rexp ( invscale ); SCYTHE_VIEW_RETURN( double , O, S, ret) } Matrix< double , Col, Concrete> rexp (unsigned int rows, unsigned int cols, __VA_ARGS__) { return rexp <Col,Concrete> (rows, cols, invscale ); } double invscale);

/*!

This function returns a pseudo-random variate drawn from the F distribution with degress of freedom df1 and df2.

Parameters:
df1 The positive degrees of freedom for the $chi^2$ variate in the nominator of the F statistic.
df2 The positive degrees of freedom for the $chi^2$ variate in the denominator of the F statistic.
See also:
pf(double x, double df1, double df2)

df(double x, double df1, double df2)

Exceptions:
scythe_invalid_arg (Level 1)


Generated on Wed Aug 15 14:53:57 2007 for Scythe-1.0.2 by  doxygen 1.4.7