R: Convert a RS or FKML GLD into RS or FKML GLD to the desired...
fun.mean.convert
R Documentation
Convert a RS or FKML GLD into RS or FKML GLD to the desired theoretical mean by
changing only the first parameter
Description
A simple transformation of altering the location of RS/FKML GLD so that
the theoretical mean is altered to the level specified. Only the first parameter
of RS/FKML GLD is altered.
Usage
fun.mean.convert(x, param, val = 0)
Arguments
x
A vector of four values representing Lambda 1, Lambda 2, Lambda 3 and Lambda 4
of RS/FKML GLD.
param
Can be "rs" or "fmkl" or "fkml"
val
The targeted theoretical mean
Value
A vector of four values representing Lambda 1, Lambda 2, Lambda 3 and Lambda 4
of the transformed RS/FKML GLD
Note
If finite first moment does not exist, original input values will be returned
Author(s)
Steve Su
Examples
# Transform RS GLD with parameters 3,2,1,1 to mean of 0
fun.mean.convert(c(3,2,1,1),param="rs")
# Check that the desired outcome is achieved
fun.theo.mv.gld(0,2,1,1,param="rs")
# Transform RS GLD with parameters 3,2,1,1 to mean of 5
fun.mean.convert(c(3,2,1,1),param="fkml",5)
# Check that the desired outcome is achieved
fun.theo.mv.gld(5,2,1,1,param="fkml")
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(GLDreg)
Loading required package: GLDEX
Loading required package: cluster
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GLDreg/fun.mean.convert.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fun.mean.convert
> ### Title: Convert a RS or FKML GLD into RS or FKML GLD to the desired
> ### theoretical mean by changing only the first parameter
> ### Aliases: fun.mean.convert
> ### Keywords: univar
>
> ### ** Examples
>
>
> # Transform RS GLD with parameters 3,2,1,1 to mean of 0
> fun.mean.convert(c(3,2,1,1),param="rs")
[1] 0 2 1 1
>
> # Check that the desired outcome is achieved
> fun.theo.mv.gld(0,2,1,1,param="rs")
mean variance skewness kurtosis
0.00000000 0.08333333 0.00000000 1.80000000
>
> # Transform RS GLD with parameters 3,2,1,1 to mean of 5
> fun.mean.convert(c(3,2,1,1),param="fkml",5)
[1] 5 2 1 1
>
> # Check that the desired outcome is achieved
> fun.theo.mv.gld(5,2,1,1,param="fkml")
mean variance skewness kurtosis
5.00000000 0.08333333 0.00000000 1.80000000
>
>
>
>
>
>
> dev.off()
null device
1
>