==9223== Memcheck, a memory error detector
==9223== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==9223== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==9223== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla
==9223==
R Under development (unstable) (2016-02-21 r70195) -- "Unsuffered Consequences"
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.
Natural language support but running in an English locale
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.
> pkgname <- "depth"
> source(file.path(R.home("share"), "R", "examples-header.R"))
> options(warn = 1)
> library('depth')
Loading required package: abind
Loading required package: rgl
Loading required package: circular
Attaching package: ‘circular’
The following objects are masked from ‘package:stats’:
sd, var
>
> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
> cleanEx()
> nameEx("ctrmean")
> ### * ctrmean
>
> flush(stderr()); flush(stdout())
>
> ### Name: ctrmean
> ### Title: Centroid trimmed mean
> ### Aliases: ctrmean
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
>
> ## exact centroid trimmed mean
> set.seed(345)
> xx <- matrix(rnorm(1000), nc = 2)
> ctrmean(xx, .2)
==9223== Conditional jump or move depends on uninitialised value(s)
==9223== at 0xFECE6EA: halfmed_ (packages/tests-vg/depth/src/depth.f:3561)
==9223== by 0x47D539: do_dotCode (svn/R-devel/src/main/dotcode.c:1789)
==9223== by 0x4AFBC9: Rf_eval (svn/R-devel/src/main/eval.c:713)
==9223== by 0x4B2FAD: do_set (svn/R-devel/src/main/eval.c:2196)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1F58: do_begin (svn/R-devel/src/main/eval.c:1806)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1166: Rf_applyClosure (svn/R-devel/src/main/eval.c:1134)
==9223== by 0x4AF850: Rf_eval (svn/R-devel/src/main/eval.c:732)
==9223== by 0x4D3EE8: Rf_ReplIteration (svn/R-devel/src/main/main.c:258)
==9223== by 0x4D4237: R_ReplConsole (svn/R-devel/src/main/main.c:308)
==9223== by 0x4D42C0: run_Rmainloop (svn/R-devel/src/main/main.c:1022)
==9223== Uninitialised value was created by a stack allocation
==9223== at 0xFECD8F0: halfmed_ (packages/tests-vg/depth/src/depth.f:3085)
==9223==
[1] -0.03879730 0.04799199
>
> ## second example of an exact centroid trimmed mean
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1 ,sigma), mvrnorm(20, mu2, sigma))
> ctrmean(mixbivnorm, 0.3)
[1] 0.4746538 -0.1582107
>
> ## dithering used for data set not in general position
> data(starsCYG, package = "robustbase")
> ctrmean(starsCYG, .1, mustdith = TRUE)
Warning in ctrmean(starsCYG, 0.1, mustdith = TRUE) :
Data are not in general position. Dithering was used.
[1] 4.277412 4.972517
>
>
>
> cleanEx()
detaching ‘package:MASS’
> nameEx("depth-package")
> ### * depth-package
>
> flush(stderr()); flush(stdout())
>
> ### Name: depth-package
> ### Title: Depth functions tools for multivariate analysis
> ### Aliases: depth-package
> ### Keywords: package multivariate nonparametric robust
>
> ### ** Examples
>
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1, sigma), mvrnorm(20, mu2, sigma))
> depth(c(0,0),mixbivnorm)
[1] 0.33
> med(mixbivnorm)
$median
[1] 0.5136701 -0.1909707
$depth
[1] 0.42
> trmean(mixbivnorm, 0.2)
[1] 0.4555061 -0.2495018
> library(rgl)
> perspdepth(mixbivnorm, col = "magenta")
> isodepth(mixbivnorm, dpth = c(35,5), col = rainbow(2))
>
>
>
> cleanEx()
detaching ‘package:MASS’
> nameEx("depth")
> ### * depth
>
> flush(stderr()); flush(stdout())
>
> ### Name: depth
> ### Title: Depth calculation
> ### Aliases: depth
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
> ## calculation of Tukey depth
> data(starsCYG, package = "robustbase")
> depth(apply(starsCYG,2,mean), starsCYG)
[1] 0.1914894
>
> ## Tukey depth applied to a large bivariate data set.
> set.seed(356)
> x <- matrix(rnorm(9999), nc = 3)
> depth(rep(0,3), x)
[1] 0.4740474
>
> ## approximate calculation much easier
> depth(rep(0,3), x, approx = TRUE)
[1] 0.4743474
>
>
>
> cleanEx()
> nameEx("isodepth")
> ### * isodepth
>
> flush(stderr()); flush(stdout())
>
> ### Name: isodepth
> ### Title: Contour plots for depth functions
> ### Aliases: isodepth
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
>
> ## exact contour plot with 10 contours
> set.seed(601) ; x = matrix(rnorm(48), nc = 2)
> isodepth(x)
==9223== Conditional jump or move depends on uninitialised value(s)
==9223== at 0xFECEFD0: halfmed_ (packages/tests-vg/depth/src/depth.f:3425)
==9223== by 0x47D539: do_dotCode (svn/R-devel/src/main/dotcode.c:1789)
==9223== by 0x4AFBC9: Rf_eval (svn/R-devel/src/main/eval.c:713)
==9223== by 0x4B2FAD: do_set (svn/R-devel/src/main/eval.c:2196)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1F58: do_begin (svn/R-devel/src/main/eval.c:1806)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1166: Rf_applyClosure (svn/R-devel/src/main/eval.c:1134)
==9223== by 0x4AF850: Rf_eval (svn/R-devel/src/main/eval.c:732)
==9223== by 0x4D3EE8: Rf_ReplIteration (svn/R-devel/src/main/main.c:258)
==9223== by 0x4D4237: R_ReplConsole (svn/R-devel/src/main/main.c:308)
==9223== by 0x4D42C0: run_Rmainloop (svn/R-devel/src/main/main.c:1022)
==9223== Uninitialised value was created by a stack allocation
==9223== at 0xFECD8F0: halfmed_ (packages/tests-vg/depth/src/depth.f:3085)
==9223==
==9223== Conditional jump or move depends on uninitialised value(s)
==9223== at 0xFEC3651: isodepth_ (packages/tests-vg/depth/src/depth.f:3890)
==9223== by 0xFECE6CA: halfmed_ (packages/tests-vg/depth/src/depth.f:3553)
==9223== by 0x47D539: do_dotCode (svn/R-devel/src/main/dotcode.c:1789)
==9223== by 0x4AFBC9: Rf_eval (svn/R-devel/src/main/eval.c:713)
==9223== by 0x4B2FAD: do_set (svn/R-devel/src/main/eval.c:2196)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1F58: do_begin (svn/R-devel/src/main/eval.c:1806)
==9223== by 0x4AFA20: Rf_eval (svn/R-devel/src/main/eval.c:685)
==9223== by 0x4B1166: Rf_applyClosure (svn/R-devel/src/main/eval.c:1134)
==9223== by 0x4AF850: Rf_eval (svn/R-devel/src/main/eval.c:732)
==9223== by 0x4D3EE8: Rf_ReplIteration (svn/R-devel/src/main/main.c:258)
==9223== by 0x4D4237: R_ReplConsole (svn/R-devel/src/main/main.c:308)
==9223== Uninitialised value was created by a stack allocation
==9223== at 0xFECD8F0: halfmed_ (packages/tests-vg/depth/src/depth.f:3085)
==9223==
Warning in isodepth(x) : Depth contours 11,12 do not exist.
>
> ## exact colored contours
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1 ,sigma), mvrnorm(20, mu2, sigma))
> isodepth(mixbivnorm, dpth = c(35,5), col = rainbow(2))
>
> ## vertices of each contour
> set.seed(601)
> x <- matrix(rnorm(48), nc = 2)
> isodepth(x, output = TRUE)
Warning in isodepth(x, output = TRUE) :
Depth contours 11,12 do not exist.
$Contour1
[,1] [,2]
[1,] 0.6694570 -0.9499843
[2,] 1.8373267 0.5819618
[3,] 0.4521402 2.4025484
[4,] -0.4622906 1.9101397
[5,] -1.7444720 0.5035196
[6,] -1.6119743 -1.2088217
[7,] -0.3145724 -2.0136489
$Contour2
[,1] [,2]
[1,] -0.1378929 -1.2989521
[2,] 0.5101883 -1.0188264
[3,] 0.6620461 -0.8356562
[4,] 0.5208672 1.3423024
[5,] -0.2555487 1.7907328
[6,] -0.7155837 1.3930205
[7,] -0.9389596 0.9369798
[8,] -1.2376545 0.3178174
[9,] -1.3586533 -0.1756684
[10,] -0.7077322 -1.3215378
[11,] -0.3404242 -1.3673237
$Contour3
[,1] [,2]
[1,] -0.09636761 -1.2664659
[2,] 0.20098289 -1.0338416
[3,] 0.49324703 -0.2656297
[4,] 0.54980168 0.2581648
[5,] 0.50868501 1.1609767
[6,] 0.50083059 1.2641063
[7,] -0.93581195 0.9376949
[8,] -0.94402608 0.9208260
[9,] -1.18267770 0.1599229
[10,] -0.76461829 -1.0407516
[11,] -0.45436905 -1.2796016
[12,] -0.17019822 -1.2969768
$Contour4
[,1] [,2]
[1,] 0.1336891 -1.04033657
[2,] 0.1364383 -1.03771862
[3,] 0.2891535 -0.70726227
[4,] 0.4948344 0.05456886
[5,] 0.4962768 0.34553008
[6,] 0.2251196 0.78812297
[7,] -0.5947911 0.89296916
[8,] -0.8383300 0.81047136
[9,] -0.8920873 0.74414997
[10,] -0.9283455 0.64578579
[11,] -0.8878025 -0.46649511
[12,] -0.8413036 -0.68326237
[13,] -0.8273441 -0.71852049
[14,] -0.5372271 -1.10509097
$Contour5
[,1] [,2]
[1,] -0.08789519 -1.03590888
[2,] 0.03101017 -1.02241860
[3,] 0.11470365 -0.88539296
[4,] 0.27549758 -0.46278213
[5,] 0.34520780 0.07145725
[6,] 0.05515563 0.73190910
[7,] 0.01368402 0.77162829
[8,] -0.48890068 0.87568752
[9,] -0.72643334 0.43480902
[10,] -0.83918005 -0.19492137
[11,] -0.80736941 -0.55578200
[12,] -0.37301439 -1.03794924
$Contour6
[,1] [,2]
[1,] -0.03749854 -0.9291177
[2,] 0.23642193 0.1868705
[3,] 0.10957422 0.5198860
[4,] -0.24700162 0.7318752
[5,] -0.52716894 0.6891513
[6,] -0.56294093 0.6265647
[7,] -0.61002912 0.4681274
[8,] -0.68496619 -0.2633014
[9,] -0.60998236 -0.6176480
$Contour7
[,1] [,2]
[1,] -0.26864297 -0.7351216
[2,] 0.02428057 -0.5546162
[3,] 0.15911036 0.2627142
[4,] -0.13277363 0.5388162
[5,] -0.17823783 0.5378205
[6,] -0.44864011 0.2084043
[7,] -0.39827686 -0.6263219
$Contour8
[,1] [,2]
[1,] 0.01814612 -0.47848680
[2,] 0.10631906 -0.01486655
[3,] 0.14916576 0.25751068
[4,] 0.11728703 0.28839569
[5,] 0.08568955 0.30779800
[6,] -0.27447095 0.34631438
[7,] -0.39179712 0.01429352
[8,] -0.36958947 -0.58295693
[9,] -0.31366802 -0.62714786
$Contour9
[,1] [,2]
[1,] -0.061960055 -0.346381230
[2,] 0.008099344 -0.277148180
[3,] 0.094460058 -0.007013416
[4,] 0.072098561 0.208540525
[5,] -0.267373720 -0.007167450
[6,] -0.287076690 -0.374024728
[7,] -0.280256810 -0.378131196
$Contour10
[,1] [,2]
[1,] -0.08758706 -0.085398464
[2,] -0.03076444 -0.005216523
[3,] -0.05745460 0.113249435
[4,] -0.25779003 -0.026623707
[5,] -0.25938736 -0.032089314
$Contour11
NULL
$Contour12
NULL
>
> ## data set not in general position
> data(starsCYG, package = "robustbase")
> isodepth(starsCYG, mustdith = TRUE)
Warning in isodepth(starsCYG, mustdith = TRUE) :
Depth contours 20,21,22,23 do not exist.
>
> ## colored contours
> set.seed(601)
> x <- matrix(rnorm(48), nc = 2)
> isodepth(x, colcontours= rainbow(10))
Warning in isodepth(x, colcontours = rainbow(10)) :
Depth contours 11,12 do not exist.
Warning in colcontours[1:ndpth] = colcontours :
number of items to replace is not a multiple of replacement length
>
> # perspective plot
> library(rgl)
> set.seed(601)
> x <- matrix(rnorm(48), nc = 2)
> isodepth(x, twodim = FALSE)
Warning in isodepth(x, twodim = FALSE) :
Depth contours 11,12 do not exist.
>
>
>
> cleanEx()
detaching ‘package:MASS’
> nameEx("med")
> ### * med
>
> flush(stderr()); flush(stdout())
>
> ### Name: med
> ### Title: Multivariate median
> ### Aliases: med
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
>
> ## exact Tukey median for a mixture of bivariate normals
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1, sigma), mvrnorm(20, mu2, sigma))
> med(mixbivnorm)
$median
[1] 0.5136701 -0.1909707
$depth
[1] 0.42
>
> ## approximate Tukey median of a four-dimensional data set
> set.seed(601)
> zz <- matrix(rnorm(96), nc = 4)
> med(zz)
Warning in med(zz) :
Tukey's median can be calculated exactly on bivariate samples only.
Warning in med(zz) : Reach maximum number of iterations: nstep = 51
$median
[1] -0.25355415 -0.08901201 -0.00909997 0.43951226
$depth
[1] 0.3333333
>
> ## data set not in general position
> data(starsCYG, package = "robustbase")
> med(starsCYG, method = "Liu")
$median
[1] 4.45 5.22
$depth
[1] 0.3168671
>
> ## use of dithering for the Tukey median
> med(starsCYG, mustdith = TRUE)
Warning in med(starsCYG, mustdith = TRUE) :
Data are not in general position. Dithering was used.
$median
[1] 4.405786 5.014595
$depth
[1] 0.4042553
>
>
>
> cleanEx()
detaching ‘package:MASS’
> nameEx("perspdepth")
> ### * perspdepth
>
> flush(stderr()); flush(stdout())
>
> ### Name: perspdepth
> ### Title: Perspective plots for depth functions
> ### Aliases: perspdepth
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
>
> ## 2 perspective plots
> data(geyser, package = "MASS")
> perspdepth(geyser, col = "magenta")
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1, sigma),mvrnorm(20, mu2, sigma))
> perspdepth(mixbivnorm, col = "chartreuse")
>
> ## grid coordinates and corresponding depth values
> set.seed(601)
> x <- matrix(rnorm(48), nc = 2)
> perspdepth(x, output = TRUE, tt = 10)
$x
[1] -1.74447201 -1.38629214 -1.02811228 -0.66993241 -0.31175254 0.04642733
[7] 0.40460720 0.76278707 1.12096694 1.47914681 1.83732667
$y
[1] -2.0136489 -1.5720292 -1.1304095 -0.6887897 -0.2471700 0.1944497
[7] 0.6360695 1.0776892 1.5193090 1.9609287 2.4025484
$z
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
[2,] 0 0.00000000 0.04166667 0.04166667 0.04166667 0.04166667 0.04166667
[3,] 0 0.00000000 0.04166667 0.08333334 0.12500000 0.12500000 0.12500000
[4,] 0 0.04166667 0.08333334 0.20833333 0.25000000 0.20833333 0.16666667
[5,] 0 0.04166667 0.12500000 0.29166666 0.33333334 0.33333334 0.25000000
[6,] 0 0.04166667 0.12500000 0.20833333 0.33333334 0.33333334 0.20833333
[7,] 0 0.00000000 0.04166667 0.08333334 0.16666667 0.16666667 0.12500000
[8,] 0 0.00000000 0.00000000 0.04166667 0.04166667 0.04166667 0.04166667
[9,] 0 0.00000000 0.00000000 0.00000000 0.04166667 0.04166667 0.04166667
[10,] 0 0.00000000 0.00000000 0.00000000 0.00000000 0.04166667 0.04166667
[11,] 0 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
[,8] [,9] [,10] [,11]
[1,] 0.00000000 0.00000000 0.00000000 0
[2,] 0.00000000 0.00000000 0.00000000 0
[3,] 0.04166667 0.00000000 0.00000000 0
[4,] 0.08333334 0.04166667 0.00000000 0
[5,] 0.12500000 0.08333334 0.04166667 0
[6,] 0.12500000 0.08333334 0.04166667 0
[7,] 0.12500000 0.04166667 0.04166667 0
[8,] 0.04166667 0.04166667 0.04166667 0
[9,] 0.04166667 0.04166667 0.00000000 0
[10,] 0.00000000 0.00000000 0.00000000 0
[11,] 0.00000000 0.00000000 0.00000000 0
>
>
>
> cleanEx()
detaching ‘package:MASS’
> nameEx("scontour")
> ### * scontour
>
> flush(stderr()); flush(stdout())
>
> ### Name: scontour
> ### Title: Plotting spherical depth contours
> ### Aliases: scontour STD contourc
> ### Keywords: multivariate nonparametric robust directional
>
> ### ** Examples
> ## Plot of Tukey spherical depth for data on the circle.
> set.seed(2011)
> scontour(runif(30,min=0,max=2*pi))
>
> ## Tukey spherical depth contours for data
> ## on the shpere expressed in spherical coordinates.
> scontour(cbind(runif(20,min=0,max=2*pi),runif(20,min=0,max=pi)))
>
> ## Tukey spherical depth contours for data
> ## on the sphere expressed in Euclidean coordinates.
> x=matrix(rnorm(60),ncol=3)
> x=t(apply(x,1,function(y){y/sqrt(sum(y^2))}))
> scontour(x)
>
>
>
> cleanEx()
> nameEx("sdepth")
> ### * sdepth
>
> flush(stderr()); flush(stdout())
>
> ### Name: sdepth
> ### Title: Calculation of spherical depth
> ### Aliases: sdepth
> ### Keywords: multivariate nonparametric robust directional
>
> ### ** Examples
> ## Tukey spherical depth for a dataset on the circle
> set.seed(2011)
> sdepth(pi,runif(50,min=0,max=2*pi))
[1] 0.46
>
> ## Tukey spherical depth for data in spherical coordinates.
> sdepth(c(pi,pi/2),cbind(runif(50,min=0,max=2*pi),runif(50,min=0,max=pi)))
[1] 0.42
>
> ## Tukey spherical depth for data in Eudlidean coordinates.
> x=matrix(rnorm(150),ncol=3)
> x=t(apply(x,1,function(y){y/sqrt(sum(y^2))}))
> sdepth(x[1,],x)
[1] 0.3
>
>
>
> cleanEx()
> nameEx("smed")
> ### * smed
>
> flush(stderr()); flush(stdout())
>
> ### Name: smed
> ### Title: Calculating spherical medians
> ### Aliases: smed
> ### Keywords: multivariate nonparametric robust directional
>
> ### ** Examples
> ## calculation of the Tukey spherical median for data on the circle
> set.seed(2011)
> smed(runif(30,min=0,max=2*pi))
[1] 2.147178
>
>
>
> cleanEx()
> nameEx("strmeasure")
> ### * strmeasure
>
> flush(stderr()); flush(stdout())
>
> ### Name: strmeasure
> ### Title: Computing trimmed measures of sherical location
> ### Aliases: strmeasure
> ### Keywords: multivariate nonparametric robust directional
>
> ### ** Examples
> ## calculation of trimmed mean direction
> set.seed(2011)
> strmeasure(runif(30,min=0,max=2*pi),alpha=1/3,method="Mean")
[1] 2.038486
>
> ## calculating of trimmed Tukey median
> set.seed(2011)
> strmeasure(runif(30,min=0,max=2*pi),alpha=1/3,method="Tukey")
[1] 2.147178
>
>
> cleanEx()
> nameEx("trmean")
> ### * trmean
>
> flush(stderr()); flush(stdout())
>
> ### Name: trmean
> ### Title: Classical-like depth-based trimmed mean
> ### Aliases: trmean
> ### Keywords: multivariate nonparametric robust
>
> ### ** Examples
>
> ## exact trimmed mean with default constant weight function
> data(starsCYG, package = "robustbase")
> trmean(starsCYG, .1)
log.Te log.light
4.382308 5.003462
>
> ## another example with default constant weight function
> set.seed(159); library(MASS)
> mu1 <- c(0,0); mu2 <- c(6,0); sigma <- matrix(c(1,0,0,1), nc = 2)
> mixbivnorm <- rbind(mvrnorm(80, mu1, sigma), mvrnorm(20, mu2, sigma))
> trmean(mixbivnorm, 0.3)
[1] 0.6771635 -0.1432197
>
> ## example with a large data set
> set.seed(345)
> x <- matrix(rnorm(2100), nc = 3)
> trmean(x, .1, approx = TRUE)
[1] 0.01385496 0.03159727 -0.06965361
>
> ## trimmed mean with a non constant weight function
> W1 <-function(x,alpha,epsilon) {
+ (2*(x-alpha)^2/epsilon^2)*(alpha<=x)*(x set.seed(345)
> x <- matrix(rnorm(210), nc = 3)
> trmean(x, .1, W = W1, epsilon = .05)
[1] -0.14510312 -0.26821761 0.01180318
>
> ## two other examples of weighted trimmed mean
> set.seed(345)
> x <- matrix(rnorm(210), nc = 3)
> W2 <- function(x, alpha) {x^(.25)}
> trmean(x, .1, W = W2)
[1] -0.11907734 -0.17408127 -0.02513136
> W3 <- function(x, alpha, beta){1-sqrt(x)+x^2/beta}
> trmean(x, .1, W = W3, beta = 1)
[1] -0.10808467 -0.15397761 -0.03975651
>
>
>
> ### *