Learn R Programming

Conake (version 1.0.1)

simp_int: The Simpson method to compute integral

Description

This function computes the Simpson method to calculate an integral.

Usage

simp_int(x, fx, n.pts = 256, ret = FALSE)

Arguments

x

The vector where the integral is computed

fx

The function to integrate

n.pts

The number of points used to compute the integral through the Simpson technique.

ret

A boolean control parameter. Default value is FALSE.

Value

Returns the value of the integral.

Examples

Run this code
# NOT RUN {
Vec=rgamma(100,1.5,2.6)
x=seq(min(Vec),max(Vec),length.out=100)
simp_int(x,dgamma(x,1.5,2.6))

# }

Run the code above in your browser using DataLab