finiteSum | R Documentation |
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. Result is returned in the log scale.
finiteSum(logFunction, parameters = numeric(), n, n0 = 0)
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. |
A summed-objects()
object. Note that the sum is returned in the
log
scale.
precompiled()
provides a list with precompiled functions
that can be used for the summation.
# Sum values from 5 to 100
finiteSum(function(x, p) log(x), numeric(), 100 - 5, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.