Last data update: 2014.03.03

R: Methods for Lambert W input and output objects
LambertW_input_output-methodsR Documentation

Methods for Lambert W input and output objects

Description

S3 methods for Lambert W input and output objects (created by create_LambertW_input and create_LambertW_output).

plot.LambertW_input plots the theoretical (1) pdf and (2) cdf of the input X sim F_X(x mid oldsymbol β).

plot.LambertW_output plots the theoretical (1) pdf and (2) cdf of the output RV Y sim Lambert W \times F_X(x mid oldsymbol β). It overlays the plot with the pdf and cdf of the input RV X sim F_X(x mid oldsymbol β) (setting γ = δ = 0, α = 1).

print.LambertW_input prints an overview of the input object.

print.LambertW_output prints an overview of the output object.

Usage

## S3 method for class 'LambertW_input'
plot(x, xlim = NULL, ...)

## S3 method for class 'LambertW_output'
plot(x, xlim = NULL, ...)

## S3 method for class 'LambertW_input'
print(x, ...)

## S3 method for class 'LambertW_output'
print(x, ...)

Arguments

x

object of class LambertW_input or LambertW_output.

xlim

lower and upper limit of x-axis for cdf and pdf plots. If NULL, it tries to determine good limits based on the family type of the distribution and the quantiles. Most of the times it will show the pdf and cdf from the 0.5% to 99.5% quantile.

...

further arguments passed to or from other methods.

Examples


# create a Normal(1, 2) input
Gauss.input <- create_LambertW_input("normal", beta = c(1, 2))
plot(Gauss.input)
# make it a bit heavy tailed (beta in theta comes from Gauss.input)
LW.Gauss <- create_LambertW_output(LambertW.input = Gauss.input, 
                                   theta = list(delta = c(0.3)))
LW.Gauss  # print a nice overview in the console
plot(LW.Gauss)

# draw random sample
LW.Gauss$r(n=10)
Gauss.input$r(n=10)
# quantiles
LW.Gauss$q(p=0.6)
Gauss.input$q(p=0.6)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LambertW)
Loading required package: MASS
Loading required package: ggplot2
This is 'LambertW' version 0.6.4.  Please see the NEWS file and citation("LambertW").

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LambertW/LambertW_input_output-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LambertW_input_output-methods
> ### Title: Methods for Lambert W input and output objects
> ### Aliases: LambertW_input_output-methods plot.LambertW_input
> ###   plot.LambertW_output print.LambertW_input print.LambertW_output
> ### Keywords: hplot print
> 
> ### ** Examples
> 
> 
> # create a Normal(1, 2) input
> Gauss.input <- create_LambertW_input("normal", beta = c(1, 2))
> plot(Gauss.input)
> # make it a bit heavy tailed (beta in theta comes from Gauss.input)
> LW.Gauss <- create_LambertW_output(LambertW.input = Gauss.input, 
+                                    theta = list(delta = c(0.3)))
> LW.Gauss  # print a nice overview in the console
 Input distribution: normal
 Output distribution: heavy-tail (one parameter) Lambert W x normal(1,2)
 with (input) parameters: mu=1, sigma=2
 and transformation parameters: delta = 0.3
> plot(LW.Gauss)
> 
> # draw random sample
> LW.Gauss$r(n=10)
 [1]  5.6522026 12.6399125  0.7813817 -0.6295115  1.6048207 -2.3463128
 [7] -0.4091832  1.6798287  0.7139503 -3.2406201
> Gauss.input$r(n=10)
 [1]  2.74392789 -2.24101242  0.06603732 -2.99629540  1.04636243  0.82995329
 [7] -0.83729877  0.21298392  1.27412672 -0.21095847
> # quantiles
> LW.Gauss$q(p=0.6)
[1] 1.511596
> Gauss.input$q(p=0.6)
[1] 1.506694
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>