# m2bgumbel: Bimodal Gumbel: Theoretical E(X^2) In bgumbel: Bimodal Gumbel Distribution

## Description

Bimodal Gumbel: Theoretical E(X^2)

## Usage

 `1` ```m2bgumbel(mu, sigma, delta) ```

## Arguments

 `mu` First location parameter. `sigma` Scale parameter. `delta` Second location parameter.

Vector.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40``` ```(EX2 <- m2bgumbel(mu = -2, sigma = 1, delta = -1)) # Comparison: Theoretical E(X^2) and empirical second moment x <- rbgumbel(100000, mu = -2, sigma = 1, delta = -1) mean(x^2) abs(EX2 - mean(x))/abs(EX2) # relative error # Variance EX <- m1bgumbel(mu = -2, sigma = 1, delta = -1) EX2 - EX^2 var(x) abs(EX2 - EX^2 - var(x))/abs(EX2 - EX^2) # relative error # grid 1 mu <- seq(-5, 5, length.out = 100) delta <- seq(-5, 5, length.out = 100) z <- outer( X <- mu, Y <- delta, FUN = function(x, y) m2bgumbel(mu = x, sigma = 1, delta = y) ) persp(x = mu, y = delta, z = z, theta = -30, ticktype = 'detailed') # grid 2 mu <- seq(-5, 5, length.out = 100) delta <- seq(-5, 5, length.out = 100) sigmas <- seq(.1, 10, length.out = 20) for (sigma in sigmas) { z <- outer( X <- mu, Y <- delta, FUN = function(x, y) m2bgumbel(mu = x, sigma = sigma, delta = y) ) persp(x = mu, y = delta, z = z, theta = -45, zlab = 'E(X^2)') Sys.sleep(.5) } ```

bgumbel documentation built on April 1, 2021, 1:06 a.m.