R/geom.series.R

Defines functions geom.series

Documented in geom.series

geom.series <-
function(n, p=0.001){
    ## Compute the geometric sequence
        ##  n: Number of frequencies to compute 
        ##  p: Parameter of the geometric function.
    if(!is(n, "numeric") & !is(p, "numeric"))
        stop("All arguments must be numeric \n")
    k <- seq_len(n)
    return((1-p)^(k-1)*p)
}

Try the QSutils package in your browser

Any scripts or data that you put into this service are public.

QSutils documentation built on Nov. 8, 2020, 7:42 p.m.