use pmin instead of min.
hth
Matthias
On 12.02.2013 16:41, dan wang wrote:
Hi All,
Can any one help to explain why min and max function couldn't work in the
integrate function directly.
For example, if issue following into R:
integrand - function(x) {min(1-x, x^2)}
integrate(integrand, lower
wang
Sent: Tuesday, February 12, 2013 7:41 AM
To: r-help@r-project.org
Subject: [R] integrate function
Hi All,
Can any one help to explain why min and max function couldn't work in the
integrate function directly.
For example, if issue following into R:
integrand - function(x) {min
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf
Of dan wang
Sent: Tuesday, February 12, 2013 7:41 AM
To: r-help@r-project.org
Subject: [R] integrate function
Hi All,
Can
Apologies for the lengthy code.
I tried a simple (and shorter) piece of code (pasted below) and it still
gives me the same error for last few rows. Is this a bug or am I doing
something totally wrong? Could anyone please provide some help/pointers ?
PS. beta0 was fixed to 0.001 in the previous
Apologies for the lengthy code.
I tried a simple (and shorter) piece of code (pasted below) and it still
gives me the same error for last few rows. Is this a bug or am I doing
something totally wrong? Could anyone please provide some help/pointers ?
PS. beta0 was fixed to 0.001 in the previous
On 06-04-2012, at 13:14, Navin Goyal wrote:
Apologies for the lengthy code.
I tried a simple (and shorter) piece of code (pasted below) and it still
gives me the same error for last few rows. Is this a bug or am I doing
something totally wrong? Could anyone please provide some
Thank you so much for your help Berend.
I did not see that my code had a typo and it was thus wrongly written ( I
overlooked the i that was supposed to be actually 1)
instead of for (q in *1*:length(comb1$ID))
I had it as for (q in *i*:length(comb1$ID))
It works correctly as
On 2012-04-06 07:19, Navin Goyal wrote:
Thank you so much for your help Berend.
I did not see that my code had a typo and it was thus wrongly written ( I
overlooked the i that was supposed to be actually 1)
instead of for (q in *1*:length(comb1$ID))
I had it as for (q in
Hi,
I am using the integrate function in some simulations in R (tried ver 2.12
and 2.15). The problem I have is that the last few rows do not integrate
correctly. I have pasted the code I used.
The column named integral shows the output from the integrate function.
The last few rows have no
On 06-04-2012, at 00:55, Navin Goyal wrote:
Hi,
I am using the integrate function in some simulations in R (tried ver 2.12
and 2.15). The problem I have is that the last few rows do not integrate
correctly. I have pasted the code I used.
The column named integral shows the output from the
Hello,
I have some trouble in terms of using integrate function in R.
f1 is a function of p and x where x is supposed to be a vector. (See the
code).
Then I want to write function f2 which is a function of the vector
x after I integrate out p.
Can some one give me some help? Many thanks!
On Dec 5, 2009, at 4:59 PM, li li wrote:
Hello,
I have some trouble in terms of using integrate function in R.
f1 is a function of p and x where x is supposed to be a vector. (See
the
code).
Then I want to write function f2 which is a function of the vector
x after I integrate out p.
Thank you very much for your reply!
It is not an assignment.
What I want to do is what we often do. If we have a bivariate function of x
and p,
I first fix x and integrate out p. Then the resultant function is only in
terms of x.
Here f1 is a bivariate function of x and p.
f1 - function (p,x)
@gmail.com
Date: Saturday, December 5, 2009 7:13 pm
Subject: Re: [R] integrate function
To: David Winsemius dwinsem...@comcast.net
Cc: r-help@r-project.org
Thank you very much for your reply!
It is not an assignment.
What I want to do is what we often do. If we have a bivariate
function of x
Medicine and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
email: rvarad...@jhmi.edu
- Original Message -
From: li li hannah@gmail.com
Date: Saturday, December 5, 2009 7:13 pm
Subject: Re: [R] integrate function
To: David Winsemius dwinsem
. (410) 502-2619
email: rvarad...@jhmi.edu
- Original Message -
From: li li hannah@gmail.com
Date: Saturday, December 5, 2009 7:13 pm
Subject: Re: [R] integrate function
To: David Winsemius dwinsem...@comcast.net
Cc: r-help@r-project.org
Thank you very much for your reply
li li-13 wrote:
Yes, f2 is the function I wanted to write. I tried to do use Vectorize
function to f1, it did not work.
f2 - function(x)
+ {
+ integrate(Vectorize(f1,vectorize.args =p), lower=0,upper=1, x)
+ }
f2(c(2,3))
Error in Vectorize(f1, vectorize.args = p) :
This is my code , when i run it ,error happed . can you tell me what's the
reason and modify it ?thank you very much !! the error is evaluation of
function gave a result of wrong length
e2-function(a) integrate(function(x) x,lower=0,upper=a)$value
integrate(e2,lower=0, upper=0.5)$value
Change e2 to the following and it works
e2 - function(a) a^2/2
The reason it doesn't is that e2 must be able to handle vector inputs
correctly. Your original function does not do this.
from ?integrate
f - an R function taking a numeric first argument and returning a
numeric vector of the
?integrate, it is in the documentation
Bhargab Chattopadhyay wrote:
Hi!
Can anyone please let me know what numerical integration procedure does the
integrate function in package stats follow?
Thank you in advance
Shant
[[alternative HTML version deleted]]
Hi!
Can anyone please let me know what numerical integration procedure does the
integrate function in package stats follow?
Thank you in advance
Shant
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
If these messages you're hearing are warnings, then the answer might be:
?warnings
--
David Winsemius
On Dec 22, 2008, at 6:07 PM, glenn roberts wrote:
Quick One if any one can help please.
On use of integration function ‘integrate’; how do I get the
function to
return just the value
.. but it turned out he wanted;
integrate(integrand)$value
--
David Winsemius
On Dec 22, 2008, at 6:26 PM, David Winsemius wrote:
If these messages you're hearing are warnings, then the answer might
be:
?warnings
-- David Winsemius
On Dec 22, 2008, at 6:07 PM, glenn roberts wrote:
23 matches
Mail list logo