Displaying 20 results from an estimated 1000 matches similar to: "adapt may "cheat""
2010 Sep 21
3
bivariate vector numerical integration with infinite range
Dear list,
I'm seeking some advice regarding a particular numerical integration I
wish to perform.
The integrand f takes two real arguments x and y and returns a vector
of constant length N. The range of integration is [0, infty) for x and
[a,b] (finite) for y. Since the integrand has values in R^N I did not
find a built-in function to perform numerical quadrature, so I wrote
my own after
2011 Jan 10
3
using Smolyak to genarate intervals
Hello
I am running a program from value intervals for a set of variables.
I thought I could use Smolyak to get my intervals adding points as I need
them , so instead of running the program for a whole interval I would run
only for the most important points.
I am new to Smolyak algorithm though, and I can not understand how can i use
smolyak.quad(d,k), to solve my problem.
Anybody can give me
2011 Nov 10
2
performance of adaptIntegrate vs. integrate
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like to perform a numerical integration in one dimension,
I = int_a^b f(x) dx
where the integrand f: x in IR -> f(x) in IR^p is vector-valued.
integrate() only allows scalar integrands, thus I would need to call
it many (p=200 typically) times, which sounds suboptimal. The
2008 Sep 27
3
Double integration - Gauss Quadrature
Hi,
I would like to solve a double integral of the form
\int_0^1 \int_0^1 x*y dx dy
using Gauss Quadrature.
I know that I can use R's integrate function to calculate it:
integrate(function(y) {
sapply(y, function(y) {
integrate(function(x) x*y, 0, 1)$value
})
}, 0, 1)
but I would like to use Gauss Quadrature to do it.
I have written the following code (using R's statmod package)
2006 May 05
0
Spline integration & Gaussian quadrature (was: gauss.quad.prob)
Spencer
Thanks for your thoughts on this. I did a bit of work and did end up
with a method (more a trick), but it did work. I am certain there are
better ways to do this, but here is how I resolved the issue.
The integral I need to evaluate is
\begin{equation}
\frac{\int_c^{\infty} p(x|\theta)f(\theta)d\theta}
{\int_{-\infty}^{\infty} p(x|\theta)f(\theta)d\theta}
\end{equation}
Where
2012 Mar 25
1
cubature
Hi,
I am using adaptIntegrate from Cubature to do numerical integration on a
double integral with a 1 x 2 vector x.
Say the function is something simple to start like f(x)=x1*x2 and I wish to
integrate x1 over (0,365-x2) and x2 over (0,365)
f <- function(x) {(x[2])*(x[1])} # "x" is vector
int1<-adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(365-x[2], 365))
I recieve
2009 Feb 08
0
recursive derivative a list of polynomials
Dear list,
This is quite a specific question requiring the package orthopolynom.
This package provides a nice implementation of the Legendre
polynomials, however I need the associated Legendre polynomial which
can be readily expressed in terms of the mth order derivative of the
corresponding Legendre polynomial. (For the curious, I'm trying to
calculate spherical harmonics [*]).
2013 Jan 08
2
Integration in R
Hi R-users.
I'm having difficulty with an integration in R via
the package "cubature". I'm putting it with a simple example here. I wish
to integrate a function like:
f(x1,x2)=2/3*(x1+x2) in the interval 0<x1<x2<7. To be sure I tried it
by hand and got 114.33, but the following R code is giving me 102.6667.
2010 Jan 14
1
adapt package missing because of licensing issue: fix?
I think this is probably known by someone, but I wanted to ask/comment:
The 'adapt' package has been removed from CRAN because of an 'unclear'
license. That makes sense, but it actually took a bit of digging for me
to discover that, and if I had been a student I might not have figured
it out. The package is simply missing from the CRAN compiled packages
page; I did find
2008 Oct 16
3
defining a function using strings
Hi All,
I need to evaluate a series expansion using Legendre polynomials.
Using the 'orthopolinom' package I can get a list of the first n
Legendre polynomials as character strings.
> library(orthopolynom)
> l<-legendre.polynomials(4)
> l
[[1]]
1
[[2]]
x
[[3]]
-0.5 + 1.5*x^2
[[4]]
-1.5*x + 2.5*x^3
[[5]]
0.375 - 3.75*x^2 + 4.375*x^4
But I can't figure out how to
2010 Sep 21
1
partial dbRDA or CCA with two distance objects in Vegan.
I am trying to use the cca/rda/capscale functions in vegan to analyse
genetic distance data ( provided as a dist object calculated using
dist.genpop in package adegenet) with geographic distance partialled out
( provided as a distance object using dist function in veganthis method
is attempting to follow the method used by Geffen et al 2004 as
suggested by Legendre and . FORTIN (2010).
I
2008 Mar 27
2
assistance with RDAtest beta version application
Pierre Legendre has developed a beta version of a new redundancy analysis package called RdaTest that is available on his web page at the Universit® de Montréal. The test example that is included with the package is based on the example provided in his book (Numerical Ecology, Chapter 11 (Legendre & Legendre 1998))
I have downloaded the package and am attempting to run it so that I might
2004 Jun 23
0
chronological clustering
Does anybody know of any R functions to perform chronological clustering
as explained in:
Legendre, P., S. Dallot & L. Legendre. 1985. Succession of species
within a community: chronological clustering, with applications to
marine and freshwater zooplankton. American Naturalist 125: 257-288.
http://www.fas.umontreal.ca/BIOL/legendre/reprints/succession_of_species.pdf
Thanks,
Angel
2024 Jun 13
1
Integration of functions with a vector argument
? Wed, 12 Jun 2024 23:42:18 +0000
"Levine, Michael" <mlevins at purdue.edu> ?????:
> f.int1 <- function(x,y) {Vectorize (function(y) f(c(x,y),H=H,j=j))}
Vectorize returns a callable function(y), so wrapping it in a
function(x,y) will not work. Since you'd like to integrate over y, we
can perform the same transformation manually using vapply:
# A version of f(...) that
2012 May 21
0
Erratic error with adaptIntegrate in cubature package
Hi everyone,
I have been using adaptIntegrate from the cubature package for a
multidimensional integral that has infinite variance (and so not
appropriate for Monte Carlo techniques). Most of the time it works but
sometimes (though not always) when I slightly increase the accuracy I want,
or increase the bounds of integration I get the following error:
REAL() can only be applied to a
2009 Oct 20
1
kendall.global
Hi every body:
I need some help with kendall.global. The example in the manual seems not working well, and cannot used with my data, always the same error.
data(mite)
> mite.hel <- decostand(mite, "hel")
>
> # Reproduce the results shown in Table 2 of Legendre (2005), a single group
> mite.small <- mite.hel[c(4,9,14,22,31,34,45,53,61,69),c(13:15,23)]
>
2010 Dec 08
2
Legendre polynomials
Hello everyone,
I would like to find out if there are already implemented function for legendre
polynomials. I tried google but returns nothing. How do you suggest me to search
for that?
Regards
Alex
[[alternative HTML version deleted]]
2013 Mar 21
1
"adaptIntegrate" function
Hi all,
it seems that there is problem with function "adaptIntegrate",
when the integration limits is infinity.
Please see the code below. The second integration does not
seem to work.
Can anyone familiar with this give some help?
Thank you with much.
Hanna
library(mnormt)
library(cubature)
ff <- function(x, rho){
mu <- rep(0,3)
Sigma
2004 Apr 21
1
(no subject)
Dear R-Help
Does "The R Package for Multivariate and Spatial Analysis Version 4.0
(Casgrain
and Legendre, 2001)" exist on CRAN and under what name? It supposedly has a
chronological clustering program ,CHRONO, that I would like to use.
Alternatively, I would ask if there is a R based program that performs
chronological clustering?
Thanks
Alex
Alex Hanke
Department of Fisheries and
2011 Jan 25
0
Multivariate polynomials Howto
Good Evening,
I would like to work with multivariate polynomials (x and y variables).
I know that there is a package called multipol but I am not sure that supports my needs.
I use a function (in reality legendre.polynomials) which creates me the polynomials I want.
For example the following returns
> legendre.polynomials(2)[[2]]
x (first order polynomial)
I would like to calculate the