1 | ghmean(g, h)
|
g |
|
h |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (g, h)
{
if (h < 0)
stop("h must be > 0")
val = NULL
val2 = NULL
if (h < 1)
val = (exp(g^2/(2 * (1 - h))) - 1)/(g * sqrt(1 - h))
if (h < 0.5)
val2 = (exp(2 * g^2/(1 - 2 * h)) - 2 * exp(g^2/(2 * (1 -
2 * h))) + 1)/(g^2 * sqrt(1 - 2 * h)) - (exp(g^2/(2 *
(1 - h))) - 1)^2/(g^2 * (1 - h))
list(mean = val, variance = val2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.