PM
To: Ravi Varadhan
Cc: 'Doran, Harold'; r-help@stat.math.ethz.ch
Subject: RE: [R] Numerical Integration
Hi Ravi and Harold,
Thanks for the input. I'm using trapezoidal rule and like to know if
there's other alternatives. This f(x) is the kernel density estimator and
thus we can get an estimate
Hi everyone,
I'm trying to integrate f(x) over x where f(x) does not have a close form
but only numerical values at certurn knots of x. Is there a way that I can
use any generical R function (such as integrate) or any package to do so?
Thanks! I appreciate your time.
Best Regards,
Martha Cao
You might try the statmod package which provides nodes and weights for
gaussian quadrature.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Xiaofan Cao
Sent: Wednesday, November 08, 2006 12:43 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Numerical
You could approximate it with splines and then integrate that:
x - 0:10/10
f - function(x) 1 + x + x^2 + x^3 + x^4
y - f(x)
fs - splinefun(x, y)
integrate(fs, 0, 1)
integrate(f, 0, 1)
On 11/8/06, Xiaofan Cao [EMAIL PROTECTED] wrote:
Hi everyone,
I'm trying to integrate f(x) over x where f(x)
@stat.math.ethz.ch
Subject: Re: [R] Numerical Integration
You might try the statmod package which provides nodes and weights for
gaussian quadrature.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Xiaofan Cao
Sent: Wednesday, November 08, 2006 12:43 PM
To: r
Hi,
I have got problems integrating the following function using integrate:
lambdat-function(t){
tempT-T[k,][!is.na(T[k,])]#available values from k-th row of matrix T
tempJ-J[k,][!is.na(J[k,])]
hg-length(tempT[tempT=t tempJ==0])#counts observations satisfing the
conditions
przeszczepan wrote:
Hi,
I have got problems integrating the following function using integrate:
lambdat-function(t){
tempT-T[k,][!is.na(T[k,])]#available values from k-th row of matrix T
tempJ-J[k,][!is.na(J[k,])]
hg-length(tempT[tempT=t tempJ==0])#counts observations satisfing the
On 6/29/2006 7:38 AM, Sundar Dorai-Raj wrote:
przeszczepan wrote:
Hi,
I have got problems integrating the following function using integrate:
lambdat-function(t){
tempT-T[k,][!is.na(T[k,])]#available values from k-th row of matrix T
tempJ-J[k,][!is.na(J[k,])]
Hi, I was looking for a routine that would do numerical integration
using x,y data rather than integrating a function.
Searching CRAN showed me the sfsmisc package, which contains
integrate.xy. However the documentation mentions that its not good for
noisy data and plans to implement the Romberg