ml3_neglog: internal

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/ml3_neglog.R

Description

internal use only

Usage

1
ml3_neglog(param, dat, mlmax = 1e+15, fixed = FALSE, ...)

Arguments

param
dat
mlmax
fixed
...

Details

internal use only

Value

internal use only

Note

internal use only

Author(s)

P. Rakonczai

References

internal use only

See Also

internal use only

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
##---- 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 (param, dat, mlmax = 1e+15, fixed = FALSE, ...) 
{
    loglik = mlmax
    lik = NULL
    x = dat[, 1]
    y = dat[, 2]
    z = dat[, 3]
    if (fixed) 
        param[1] = 0
    lik = try(dtgpd_neglog(x, y, z, mar1 = param[1:3], mar2 = param[4:6], 
        mar3 = param[7:9], dep = param[10]))
    if (!is.null(lik)) {
        loglik = -sum(log(lik))
        if (min(1 + param[3] * (x - param[1])/param[2]) < 0) 
            loglik = mlmax
        if (min(1 + param[6] * (y - param[4])/param[5]) < 0) 
            loglik = mlmax
        if (min(1 + param[9] * (z - param[7])/param[8]) < 0) 
            loglik = mlmax
    }
    loglik
  }

mgpd documentation built on May 30, 2017, 12:45 a.m.