Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread Ben Bolker
Jorge I Velez gmail.com> writes: > And remember: > > #install.packages('fortunes') > require(fortunes) > fortune('Yoda') > > Evelyn Hall: I would like to know how (if) I can extract some of the > information > from the summary of my nlme. > Simon Blomberg: This is R. There is no if. Only how. >

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread Jorge I Velez
Hi e eeyore, Here is one way: fx <- function(x, m) x*2/(3*m)*(1-x/(3*m)) foo <- function(m) integrate(fx, m = m, lower = 0, upper = 3*m)$value foo(3) # 3 foo(2) # 2 And remember: #install.packages('fortunes') require(fortunes) fortune('Yoda') Evelyn Hall: I would like to know how (if) I can ex

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
I know that is not Mhatematica, my question is only is it possible, it seams its not.. Sorry if I did not get it, I can interprete different your answer, not intentionally.. Thanks for your answer and patience. On Sun, Dec 4, 2011 at 5:15 PM, David Winsemius wrote: > > On Dec 4, 2011, at 11:04

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread David Winsemius
On Dec 4, 2011, at 11:04 AM, e eeyore wrote: > > > On Sun, Dec 4, 2011 at 4:47 PM, David Winsemius > wrote: > > You almost did write it in R. You just left the "m" unspecified. If > you replace "m" by 5 the code works. > > Check how wolfram work with same integral, I dont need to replace > a

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
On Sun, Dec 4, 2011 at 4:47 PM, David Winsemius wrote: > > You almost did write it in R. You just left the "m" unspecified. If you > replace "m" by 5 the code works. > Check how wolfram work with same integral, I dont need to replace anything.. http://www.wolframalpha.com/input/?i=integrate+x*2%2

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread David Winsemius
On Dec 4, 2011, at 9:52 AM, e eeyore wrote: > This is not homework, I calculate some expectations and to finish > that I must solve integral like this one.. > Upper bound have some unknown parameter, but I dont know how to > write it in R. You almost did write it in R. You just left the "m"

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
This is not homework, I calculate some expectations and to finish that I must solve integral like this one.. Upper bound have some unknown parameter, but I dont know how to write it in R. Do I must define m like symbol, or something else, just need help with that. I know how this work in MatLab, b

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-03 Thread David Winsemius
On Dec 3, 2011, at 10:23 PM, grttt nbbfg wrote: Sorry for my English, is not my first language.. I have some trouble in terms of using integrate function in R. fx is a function of m and x where m is supposed to be a unknown parameter. R is not an algebraic solver (and R-help is not a homew

[R] upper bound in the integrate function depends on a parameter

2011-12-03 Thread grttt nbbfg
Sorry for my English, is not my first language.. I have some trouble in terms of using integrate function in R. fx is a function of m and x where m is supposed to be a unknown parameter. >fx=function(m,x){ + x*2/(3*m)*(1-x/(3*m)) + } The problem is in upper bound, it depends on parameter m. >in