finiteSum {sumR} | R Documentation |
Calculates the sum of a discrete series with a single maximum for a pre-set number of evaluations
Description
A discrete finite series is calculated exactly with no need for approximations. This can also be used for infinite series approximation with a pre-determined number of iterations, but this has no guarantee of quality of approximation
Usage
finiteSum(logFunction, parameters = numeric(), n, n0 = 0)
Arguments
logFunction |
The function that returns the series value
an in
the log scale. Can either be an |
parameters |
A numeric vector with parameters used in logFunction.
Vectorized summation over various parameter values sets is not implemented.
Use |
n |
A single integer positive number indicating the number of iterations to perform in the function. |
n0 |
The sum will be performed for the series starting at this value. |
Value
A summed-objects()
object.
See Also
precompiled()
provides a list with precompiled functions
that can be used for the summation.
Examples
# Sum values from 5 to 100
finiteSum(function(x, p) log(x), numeric(), 100 - 5, 5)