eabesmid: Murray...

Usage Arguments Examples

Usage

1
eabesmid(q, s, tau, t, x, m, y, minI)

Arguments

q
s
tau
t
x
m
y
minI

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
41
42
43
44
##---- 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 (q, s, tau, t, x, m, y, minI) 
{
    if (minI == -1) {
        x <- -x
        y <- -y
        m <- -m
    }
    bI <- 0
    if (q == s) {
        bI <- 1
        w <- x
    }
    if (q == tau) {
        bI <- 1
        w <- m
    }
    if (q == t) {
        bI <- 1
        w <- y
    }
    t <- t - s
    tau <- tau - s
    q <- q - s
    if (bI == 0) {
        if (q < tau) {
            Ra1 <- sqrt(tau)
            Ra2 <- (x - m) * (tau - q)/((tau)^(3/2))
            Ra3 <- (tau - q)/(tau)
        }
        else {
            Ra1 <- sqrt(t - tau)
            Ra2 <- (y - m) * (q - tau)/((t - tau)^(3/2))
            Ra3 <- (q - tau)/(t - tau)
        }
        BB3 <- rnorm(3, 0, sqrt(Ra3 * (1 - Ra3)))
        w <- m + Ra1 * sqrt((Ra2 + BB3[1])^2 + (BB3[2])^2 + (BB3[3])^2)
    }
    list(w = minI * w)
  }

mpoll/scale documentation built on Dec. 9, 2019, 7:15 a.m.