Displaying 20 results from an estimated 10000 matches similar to: "Integrate two function in R"
2011 May 29
1
Hello!
Hi, I'm a student studing for Math. & Infor. Ing. in Tirana,Albania and a have a final project in R to finish in a week, so I badly need your help...
The topic of the project is "Hermite Interpolation" and a I have allready done a script that finds the approximation in a certan point x, H(x) ~f(x) but i want to find the value of his derivative H'(x)~f'(x) as well and to
2008 Jan 07
7
Can R solve this optimization problem?
Dear All,
I am trying to solve the following maximization problem with R:
find x(t) (continuous) that maximizes the
integral of x(t) with t from 0 to 1,
subject to the constraints
dx/dt = u,
|u| <= 1,
x(0) = x(1) = 0.
The analytical solution can be obtained easily, but I am trying to
understand whether R is able to solve numerically problems like this
one. I have tried to find an
2008 Oct 15
4
a really simple question on polynomial multiplication
Dear R people:
Is there a way to perform simple polynomial multiplication; that is,
something like
(x - 3) * (x + 3) = x^2 - 9, please?
I looked in poly and polyroot and expression. There used to be a
package that had this, maybe?
thanks,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at
2013 Dec 04
1
calcular la integral indefinida (primitiva) de una función respecto un parámetro
Hola a todos
Me gustaría calcular la integral indefinida (primitiva) de una función
respecto un parámetro.
Al estilo de lo que hace la función D, pero al reves
> s <- expression(5*x^2+2 )
> D(s,"x")
5 * (2 * x)
Con integrate hay que indicar a la fuerza los límites de la integral, y
con Ryacas no funciona nada, ya que no se conecta a su ip
¿Conocéis alguna forma?
Saludos
2011 Jan 12
1
Integrate and subdivisions limit
Dear all,
I have some issues with integrate in R thus I would like to request your help.
I am trying to calculate the integral of f(x)*g(x).
The f(x) is a step function while g(x) is a polynomial.
If f(x) (step function) changes its value only few times (5 or 6 'steps') everything is calulated ok(verified results in scrap paper) but if f(x) takes like 800 different values I receive the
2009 Jan 05
2
help me
Hello,
I am a student and I working with R. I want to ask you how to solve
this integral which is shown in image attach with this letter. And how
to draw this function z = 4 ? x2 ? y2 , width intervals x = ?1, y =
?1. Thank You.
Yours sincerely,
Jolanta
2008 Sep 29
1
Integrating functions in R
I want to integrate the function (sin^7*x)*(cos^8*x)dx. I do not have
values to integrate between. I just want R to give me the integral of the
function. For example R takes the derivative of the function by
d1=D(expression(x^2*(cosh*(x^3))), "x"). Is there a similar function
available in R to find the integral?
Thanks,
Kim
2006 Mar 17
1
Derivative of a splinefun function.
Is there a way of calculating the derivative of a function returned
by splinefun()? Such a function is a cubic spline, whence it has a
calculable derivative, but is there a (simple) way of getting at it?
One workaround that I have thought of is to take a fine grid of
points, evaluate the function returned by splinefun() at these
points, put an interpolating spline through these points using
2010 Oct 05
4
Linear Integration
Hello
I would like to calculate a weighted line integral.
The integral is calculated by the cells that this lines trasverses (the small
cells belong to matrix (m*n) that represent the value that a specific area has.
I need to calculate the weights by finding out how much the line touches or
impinges inside a cell.
The weight is less if a line just touches one of the four edges of a square
2012 Apr 19
1
How to find a root for a polynomial between [-inf, -3]?
Hi all,
I have a polynomial (a big one) and I would like to find a root of it
between [-inf, -3] (it's known there is one root in this interval)...
How to find that root?
In using "uniroot" I need to supply the bounds....
In using "polyroot" I need to write it in the strict sens polynomial
format... but I cannot... i.e. the polynomial is implicit...
Thank you!
2009 Oct 27
3
Sobre funciones
Un saludo cordial para cada uno.
Les agradecería una ayuda con lo siguiente:
Debo trabajar con una función de varias variabes, digamos f(x,y,z). ¿Cómo
definir la función para usarla luego con ''integrate'' de forma tal que pueda
fijar dos valores, ''y'' y ''z'', por ejemplo, e indicar los límites de
integración para la variable que queda libre?
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]]
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial :
a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08,
-0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0,
-0.06, -0.34), 2)
A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e
fn <- function(z)
{
y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2010 Dec 15
5
Solution to differential equation
Hello,
I am trying to find the analytical solution to this differential equation
dR/dt = k1*(R^k2)*(1-(R/Rmax)); R(0) = Ro
k1 and k2 are parameters that need to fitted, while Ro and Rmax are the
baseline and max value (which can be fitted or fixed). The response (R)
increases
initially at an exponential rate governed by the rate constants k1 and k2.
Response has a S-shaped curve as a function
2009 Oct 01
2
Treating variables as symbols
Hey,
I'm trying to find how to perform operations with a variable treated as a
symbol.
For, an extremely simple, example I want to integrate a*x with respect to x
and I want to find the indefinite integral of this, (a*x^2/2), or the
definite integral with some interval for x.
Another example of such a use would be to create a function
y<-function(x) {a*x}
and by typig y(2) I would get the
2013 Oct 11
3
Gaussian Quadrature for arbitrary PDF
Hi all,
We know that Hermite polynomial is for
Gaussian, Laguerre polynomial for Exponential
distribution, Legendre polynomial for uniform
distribution, Jacobi polynomial for Beta distribution. Does anyone know
which kind of polynomial deals with the log-normal, Student抯 t, Inverse
gamma and Fisher抯 F distribution?
Thank you in advance!
David
[[alternative HTML version deleted]]
2003 May 08
2
approximation of CDF
Hi all,
is there any package in R capable of smooth approximation of CDF
basing on given sample?
(Thus, I am not speaking about ecdf)
In particular, I expect very much that the approximation should
subject to the property:
f(x0)<=f(x1) for x0<x1, where x0 and x1 belong to range of
the sample given.
Polynomial approximation could be OK for me as well.
P.S.
2007 May 24
3
Problem with numerical integration and optimization with BFGS
Hi R users,
I have a couple of questions about some problems that I am facing with
regard to numerical integration and optimization of likelihood
functions. Let me provide a little background information: I am trying
to do maximum likelihood estimation of an econometric model that I have
developed recently. I estimate the parameters of the model using the
monthly US unemployment rate series
2007 Jan 11
1
maximum likelihood, 1st and 2nd derivative
Hi guys again, it seems I haven't been doing the maximum likelihood
estimation correctly. I quote below, can someone explain to me please what
does it mean that the 2nd and 3rd derivatives of the function equals zero
and how to compute that in R.
"We have our initial estimated, subjective parameters for the gamma mixture
and we have our likelihood that is the mixture of negative
2007 Jun 28
2
minor flaw in integrate()
Hi,
I noticed a minor flaw in integrate() from package stats:
Taking up arguments lower and upper from integrate(),
if (lower == Inf) && (upper == Inf)
or
if (lower == -Inf) && (upper == -Inf)
integrate() calculates the value for (lower==-Inf) && (upper==Inf).
Rather, it should return 0.
Quick fix:
### old code ###
### [snip]
else {