# doc-cache created by Octave 11.2.0
# name: cache
# type: cell
# rows: 3
# columns: 5
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
johnsrnd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1566
 -- statistics: R = johnsrnd (QUANTILES)
 -- statistics: R = johnsrnd (QUANTILES, M)
 -- statistics: R = johnsrnd (QUANTILES, M, N, ...)
 -- statistics: R = johnsrnd (QUANTILES, [M, N, ...])
 -- statistics: [R, TYPE, COEFS] = johnsrnd (...)

     Random arrays from the Johnson system of distributions.

     ‘R = johnsrnd (QUANTILES)’ returns a random value drawn from the
     distribution in the Johnson system that matches the four values in
     QUANTILES.  QUANTILES is a four-element vector of the desired quantiles at
     the standard normal quantiles ‘[-1.5, -0.5, 0.5, 1.5]’, and its elements
     must be strictly increasing.  ‘johnsrnd’ fits the Johnson curve passing
     through these four points using the quantile method of Slifker and Shapiro.

     ‘johnsrnd (QUANTILES, M, N, ...)’ or ‘johnsrnd (QUANTILES, [M, N, ...])’
     returns an M-by-N-by-... array of random values, following the size
     conventions of ‘randn’.

     ‘[R, TYPE, COEFS] = johnsrnd (...)’ also returns the selected member of the
     Johnson system in TYPE, one of "SN" (the normal distribution), "SL"
     (lognormal), "SU" (unbounded), or "SB" (bounded), and the coefficients
     COEFS = ‘[GAMMA, DELTA, XI, LAMBDA]’ of the transform.  A value R is
     generated by transforming a standard normal deviate Z as ‘R = XI + LAMBDA *
     g ((Z - GAMMA) / DELTA)’, where ‘g’ is the identity, ‘exp’, ‘sinh’, or the
     logistic function for "SN", "SL", "SU", and "SB", respectively.

     See also: pearsrnd, random, randn.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Random arrays from the Johnson system of distributions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
mhsample


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3370
 -- statistics: [SMPL, ACCEPT] = mhsample (START, NSAMPLES, PROPERTY, VALUE,
          ...)

     Draws NSAMPLES samples from a target stationary distribution PDF using
     Metropolis-Hastings algorithm.

     Inputs:

        • START is a NCHAIN by DIM matrix of starting points for each Markov
          chain.  Each row is the starting point of a different chain and each
          column corresponds to a different dimension.

        • NSAMPLES is the number of samples, the length of each Markov chain.

     Some property-value pairs can or must be specified, they are:

     (Required) One of:

        • "pdf" PDF: a function handle of the target stationary distribution to
          be sampled.  The function should accept different locations in each
          row and each column corresponds to a different dimension.

          or

        • "logpdf" LOGPDF: a function handle of the log of the target stationary
          distribution to be sampled.  The function should accept different
          locations in each row and each column corresponds to a different
          dimension.

     In case optional argument SYMMETRIC is set to false (the default), one of:

        • "proppdf" PROPPDF: a function handle of the proposal distribution that
          is sampled from with PROPRND to give the next point in the chain.  The
          function should accept two inputs, the random variable and the current
          location each input should accept different locations in each row and
          each column corresponds to a different dimension.

          or

        • "logproppdf" LOGPROPPDF: the log of "proppdf".

     The following input property/pair values may be needed depending on the
     desired output:

        • "proprnd" PROPRND: (Required) a function handle which generates random
          numbers from PROPPDF.  The function should accept different locations
          in each row and each column corresponds to a different dimension
          corresponding with the current location.

        • "symmetric" SYMMETRIC: true or false based on whether PROPPDF is a
          symmetric distribution.  If true, PROPPDF (or LOGPROPPDF) need not be
          specified.  The default is false.

        • "burnin" BURNIN the number of points to discard at the beginning, the
          default is 0.

        • "thin" THIN: omits THIN-1 of every THIN points in the generated Markov
          chain.  The default is 1.

        • "nchain" NCHAIN: the number of Markov chains to generate.  The default
          is 1.

     Outputs:

        • SMPL: a NSAMPLES x DIM x NCHAIN tensor of random values drawn from
          PDF, where the rows are different random values, the columns
          correspond to the dimensions of PDF, and the third dimension
          corresponds to different Markov chains.

        • ACCEPT is a vector of the acceptance rate for each chain.

     Example : Sampling from a normal distribution

          start = 1;
          nsamples = 1e3;
          pdf = @(x) exp (-.5 * x .^ 2) / (pi ^ .5 * 2 ^ .5);
          proppdf = @(x,y) 1 / 6;
          proprnd = @(x) 6 * (rand (size (x)) - .5) + x;
          [smpl, accept] = mhsample (start, nsamples, "pdf", pdf, "proppdf", ...
          proppdf, "proprnd", proprnd, "thin", 4);
          histfit (smpl);

     See also: rand, slicesample.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Draws NSAMPLES samples from a target stationary distribution PDF using
Metrop...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
pearsrnd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1605
 -- statistics: R = pearsrnd (MU, SIGMA, SKEW, KURT)
 -- statistics: R = pearsrnd (MU, SIGMA, SKEW, KURT, M)
 -- statistics: R = pearsrnd (MU, SIGMA, SKEW, KURT, M, N, ...)
 -- statistics: R = pearsrnd (MU, SIGMA, SKEW, KURT, [M, N, ...])
 -- statistics: [R, TYPE, COEFS] = pearsrnd (...)

     Random arrays from the Pearson system of distributions.

     ‘R = pearsrnd (MU, SIGMA, SKEW, KURT)’ returns a random value drawn from
     the distribution in the Pearson system with mean MU, standard deviation
     SIGMA, skewness SKEW, and kurtosis KURT.  KURT is the (non-excess)
     kurtosis, and the moments must satisfy ‘KURT > SKEW^2 + 1’.

     ‘pearsrnd (MU, SIGMA, SKEW, KURT, M, N, ...)’ or ‘pearsrnd (..., [M, N,
     ...])’ returns an M-by-N-by-... array of random values, following the size
     conventions of ‘randn’.

     ‘[R, TYPE, COEFS] = pearsrnd (...)’ also returns the type of the Pearson
     distribution (an integer ‘0’ to ‘7’) in TYPE, and the three coefficients
     COEFS = ‘[C0, C1, C2]’ of the denominator quadratic of the Pearson
     differential equation for the standardized distribution, so that ‘F'(X) / F
     (X) = -(X + C1) / (C0 + C1 X + C2 X^2)’.

     The Pearson types are: ‘0’ normal, ‘1’ four-parameter beta, ‘2’ symmetric
     four-parameter beta, ‘3’ gamma, ‘4’ (not a named distribution), ‘5’ inverse
     gamma, ‘6’ beta prime, and ‘7’ Student's t.  Type ‘4’ is generated by
     numerical inversion of its cumulative distribution function.

     See also: johnsrnd, random, randn.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Random arrays from the Pearson system of distributions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
qrandn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 498
 -- statistics: Z = qrandn (Q, R, C)
 -- statistics: Z = qrandn (Q, [R, C])

     Returns random deviates drawn from a q-Gaussian distribution.

     Parameter Q characterizes the q-Gaussian distribution.  The result has the
     size indicated by S.

     Reference: W. Thistleton, J. A. Marsh, K. Nelson, C. Tsallis (2006)
     "Generalized Box-Muller method for generating q-Gaussian random deviates"
     arXiv:cond-mat/0605570 http://arxiv.org/abs/cond-mat/0605570

     See also: rand, randn.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Returns random deviates drawn from a q-Gaussian distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
slicesample


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2094
 -- statistics: [SMPL, NEVAL] = slicesample (START, NSAMPLES, PROPERTY, VALUE,
          ...)

     Draws NSAMPLES samples from a target stationary distribution PDF using
     slice sampling of Radford M. Neal.

     Input:
        • START is a 1 by DIM vector of the starting point of the Markov chain.
          Each column corresponds to a different dimension.

        • NSAMPLES is the number of samples, the length of the Markov chain.

     Next, several property-value pairs can or must be specified, they are:

     (Required properties) One of:

        • "PDF": the value is a function handle of the target stationary
          distribution to be sampled.  The function should accept different
          locations in each row and each column corresponds to a different
          dimension.

          or

        • LOGPDF: the value is a function handle of the log of the target
          stationary distribution to be sampled.  The function should accept
          different locations in each row and each column corresponds to a
          different dimension.

     The following input property/pair values may be needed depending on the
     desired output:

        • "burnin" BURNIN the number of points to discard at the beginning, the
          default is 0.

        • "thin" THIN omits M-1 of every M points in the generated Markov chain.
          The default is 1.

        • "width" WIDTH the maximum Manhattan distance between two samples.  The
          default is 10.

     Outputs:

        • SMPL is a NSAMPLES by DIM matrix of random values drawn from PDF where
          the rows are different random values, the columns correspond to the
          dimensions of PDF.

        • NEVAL is the number of function evaluations per sample.
     Example : Sampling from a normal distribution

          start = 1;
          nsamples = 1e3;
          pdf = @(x) exp (-.5 * x .^ 2) / (pi ^ .5 * 2 ^ .5);
          [smpl, accept] = slicesample (start, nsamples, "pdf", pdf, "thin", 4);
          histfit (smpl);

     See also: rand, mhsample, randsample.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Draws NSAMPLES samples from a target stationary distribution PDF using slice
...





