hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_stat_init_vavilov (g01zu)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_stat_init_vavilov (g01zu) is used to initialize functions nag_stat_prob_vavilov (g01eu) and nag_stat_pdf_vavilov (g01mu).
It is intended to be used before a call to nag_stat_prob_vavilov (g01eu) or nag_stat_pdf_vavilov (g01mu).

Syntax

[xl, xu, rcomm, ifail] = g01zu(rkappa, beta2, mode)
[xl, xu, rcomm, ifail] = nag_stat_init_vavilov(rkappa, beta2, mode)

Description

nag_stat_init_vavilov (g01zu) initializes the array rcomm for use by nag_stat_prob_vavilov (g01eu) or nag_stat_pdf_vavilov (g01mu) in the evaluation of the Vavilov functions ϕVλ;κ,β2 and ΦVλ;κ,β2 respectively.
Multiple calls to nag_stat_prob_vavilov (g01eu) or nag_stat_pdf_vavilov (g01mu) can be made following a single call to nag_stat_init_vavilov (g01zu), provided that rkappa or beta2 do not change, and that either all calls are to nag_stat_prob_vavilov (g01eu) or all calls are to nag_stat_pdf_vavilov (g01mu). If you wish to call both nag_stat_prob_vavilov (g01eu) and nag_stat_pdf_vavilov (g01mu), then you will need to initialize both separately.

References

Schorr B (1974) Programs for the Landau and the Vavilov distributions and the corresponding random numbers Comp. Phys. Comm. 7 215–224

Parameters

Compulsory Input Parameters

1:     rkappa – double scalar
The argument κ of the function.
Constraint: 0.01rkappa10.0.
2:     beta2 – double scalar
The argument β2 of the function.
Constraint: 0.0beta21.0.
3:     mode int64int32nag_int scalar
If mode=0, then nag_stat_pdf_vavilov (g01mu) is to be called after the call to nag_stat_init_vavilov (g01zu). Otherwise, nag_stat_prob_vavilov (g01eu) is to be called.

Optional Input Parameters

None.

Output Parameters

1:     xl – double scalar
xl, a threshold value below which ϕVλ;κ,β2 will be set to zero by nag_stat_pdf_vavilov (g01mu) and ΦVλ;κ,β2 will be set to zero by nag_stat_prob_vavilov (g01eu) if λ<xl.
2:     xu – double scalar
xu, a threshold value above which ϕVλ;κ,β2 will be set to zero by nag_stat_pdf_vavilov (g01mu) and ΦVλ;κ,β2 will be set to unity by nag_stat_prob_vavilov (g01eu) if λ>xu.
3:     rcomm322 – double array
This argument should be passed unchanged to nag_stat_prob_vavilov (g01eu) or nag_stat_pdf_vavilov (g01mu).
4:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
On entry,rkappa<0.01,
orrkappa>10.0,
orbeta2<0.0,
orbeta2>1.0.
   ifail=2
The initialization has been abandoned due to an internal error. This error exit is unlikely to occur, but if it does change the values of rkappa and/or beta2 and rerun nag_stat_init_vavilov (g01zu).
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

At least five significant digits are usually correct.

Further Comments

None.

Example

See Example in nag_stat_pdf_vavilov (g01mu) and nag_stat_prob_vavilov (g01eu).
function g01zu_example


fprintf('g01zu example results\n\n');

x      = 2.5;
rkappa = 0.4;
beta2  = 0.1;

fprintf('  x     rkappa    beta2        y\n\n');

% Initialize rcomm array (new value of rkappa or beta2)
mode = int64(0);
[xl, xu, rcomm, ifail] = g01zu( ...
                               rkappa, beta2, mode);

% Compute value of Vavilov density function
[y, ifail] = g01mu( ...
                    x, rcomm);

% Display results
fprintf('%4.1f%9.1f%9.1f%15.4e\n', x, rkappa, beta2, y);


g01zu example results

  x     rkappa    beta2        y

 2.5      0.4      0.1     8.3675e-02

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015