rbs: Random generation for the Birnbaum-Saunders distribution.

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/RCodes.R

Description

A function for generating values from the Birnbaum-Saunders distribution.

Usage

1
rbs(n = 1, alpha = 0.5, beta = 1)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

alpha

vector of shape parameter values.

beta

vector of scale parameter value.

Details

The density function of the Birnbaum-Saunders distribution used in the function rbs() is

f_{X}(x|α, β) = \frac{1}{√{2\,π}}\,\exp≤ft[-\frac{1}{2α^2} ≤ft(\frac{x}{β}+ \frac{β}{x}-2\right)\right]\frac{(x+β)}{2α √{β x^{3}}}

Value

A sample of size n from the Birnbaum-Saunders distribution.

Note

If X is Birnbaum-Saunders distributed then

X = (β/4)(α Z + √{(α Z)^2 + 4})^2,

where Z follows a standard normal distribution.

Author(s)

Eliardo G. Costa eliardocosta@ccet.ufrn.br and Manoel Santos-Neto manoel.ferreira@ufcg.edu.br

Examples

1
2
3
x <- rbs(n=10, a = 10, b = 2.0) 
x   
     

santosneto/sampleBS documentation built on May 26, 2021, 2:45 a.m.