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)

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)ϕV(λ;κ,β2) and ΦV(λ;κ,β2)Φ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.00.01rkappa10.0.
2:     beta2 – double scalar
The argument β2β2 of the function.
Constraint: 0.0beta21.00.0beta21.0.
3:     mode – int64int32nag_int scalar
If mode = 0mode=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.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

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

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,rkappa < 0.01rkappa<0.01,
orrkappa > 10.0rkappa>10.0,
orbeta2 < 0.0beta2<0.0,
orbeta2 > 1.0beta2>1.0.
  ifail = 2ifail=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).

Accuracy

At least five significant digits are usually correct.

Further Comments

None.

Example

function nag_stat_init_vavilov_example
x = 2.5;
rkappa = 0.4;
beta2 = 0.1;
mode = int64(0);
[xl, xu, work, ifail] = nag_stat_init_vavilov(rkappa, beta2, mode);
[result, ifail] = nag_stat_pdf_vavilov(x, work)
 

result =

    0.0837


ifail =

                    0


function g01zu_example
x = 2.5;
rkappa = 0.4;
beta2 = 0.1;
mode = int64(0);
[xl, xu, work, ifail] = g01zu(rkappa, beta2, mode);
[result, ifail] = g01mu(x, work)
 

result =

    0.0837


ifail =

                    0



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–2013