113
16 <SCRIPT> TAG
114
LON-CAPA Function
Description
@return
array=&random
noncentral
f
($item
cnt,$seed,$dfn,$dfd,$nonc)
NOTE:
$dfn must be at least 1, $dfd MUST be
positive, and $nonc must be non-negative.
Generate $item
cnt deviates of noncentral F
(variance ratio) distribution with degrees of
freedom $dfn (numerator) and $dfd (denomi-
nator). $nonc is the noncentrality parameter.
@return
array=&random
multivariate
normal
($item
cnt,$seed,\@mean,\@covar)
NOTE:
@mean should be of length p array of real
numbers. @covar should be a length p array of
references to length p arrays of real numbers
(i.e. a p by p matrix.
Generate $item
cnt deviates of multivari-
ate
normal distribution with mean vector
@mean and variance-covariance matrix.
@return
array=&random
multinomial
($item
cnt,$seed,@p) NOTE: $item
cnt is
rounded with int() and the result must be
non-negative. The number of elements in @p
must be at least 2.
Returns single observation from multinomial
distribution with $item
cnt eventsclassified into
as many categories as the length of @p. The
probability of an event being classified into cat-
egory i is given by ith element of @p. The ob-
servation is an array with length equal to @p,
so when called in a scalar context it returns the
length of @p. The sum of the elements of the
obervation is equal to $item
cnt.
@return
array=&random
permutation
($seed,@array)
Returns @array randomly permuted.
@return
array=&random
uniform
($item
cnt,$seed,$low,$high)
NOTE: $low
must be less than or equal to $high.
Generate $item
cntdeviates from auniform dis-
tribution.
@return
array=&random
uniform
integer
($item
cnt,$seed,$low,$high) NOTE: $low and
$high are both passed through int(). $low must
be less than or equal to $high.
Generate $item
cntdeviates from auniform dis-
tribution in integers.
@return
array=&random
binomial
($item
cnt,$seed,$nt,$p) NOTE: $nt is rounded
using int() and the result must be non-negative.
$p must be between 0 and 1 inclusive.
Generate $item
cnt deviates from the binomial
distribution with $nt trials and the probabilty
of an event in each trial is $p.
@return
array=&random
negative
binomial
($item
cnt,$seed,$ne,$p) NOTE: $neis rounded
using int() and the result must be positive. $p
must be between 0 and 1 exclusive.
Generate an array of $item
cnt outcomes gen-
erated from negative binomial distribution with
$ne events and the probabilty of an event in
each trial is $p.
The &EXT() external function is extremely powerful, and is used to access parameters
and submission values. It can be used within scripts and also within cell formulas in
the grading spreadsheet. Some examples can be found by browsing in the repository to
/res/msu/albertel/test/ext
examples.html. The &EXT() function can be used to obtain val-
uesforthe sameparameters asare retrived by some of the other (newer) helperfunctions sum-
marized in the tableabove, such as&firstname()which isequivalent to&EXT(‘environment.firstname’),
and ¶meter
setting($name,$partid)isequivalent to&EXT(‘resource.’.$partid.‘.’.$name).