Skip to content

Bug in function d3 #2

@ghost

Description

The append line in the original function contains a bug as it always extracts the first element of the d2 vector:

function (n) 
{
    d2 <- d2(n)
    e <- vector()
    for (i in 1:length(n)) {
        int <- integrate(function(w) {
            w * (1 - ptukey(w, n[i], Inf))
        }, 0, Inf)
        e <- append(e, sqrt(2 * int[[1]] - (d2[1])^2))
    }
    return(e)
}

It should extract the ith element:
e <- append(e, sqrt(2 * int[[1]] - (d2[i])^2))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions