Displaying 20 results from an estimated 20000 matches similar to: "integrate function"
2002 Sep 10
4
legend outside axes of image or other plot
I have tried and tried unsuccessfully to place a legend outside the plot
frame of a graph. This would allow me to draw a legend for an image() plot.
But any legend I add is cut off outside the axes.
Is there a way of doing this? Thanks for any advice on how to make this
work (I'm using R1.5.1 with Windows 2000).
Richard Condit
Smithsonian Tropical Research Institute
Unit 0948
APO AA
2002 Feb 22
2
errors in integrate function?
I have been trying the integrate function in R, a function which would be
very useful for a current project of mine. But I am encountering errors
integrating the one function I have tried. The function to be integrated is
a product of a gamma demsity and a normal density:
gamma.by.normal_function(y,x,shape,scale,stdev)
return( dgamma(y,shape=shape,scale=scale)*
2002 Feb 19
2
cdf of the standard normal distribution
Dear Experts,
I need to calculate the cdf of the standard normal distribution, i.e.
H(x) = 1/sqrt(2*pi) integral(exp(-z^2/2) dz), where z is b/w -infi to
infi.
I know there should be a way to do it in R, but did not know to do it.
I'd appreciate any help you could offer.
Charlie Liu
Graduate student intern at EPA/ECO
2008 Aug 21
2
Help Regarding 'integrate'
I have an R function defined as:
f<-function(x){
return(dchisq(x,9,77)*((13.5/x)^5)*exp(-13.5/x))
}
Numerically integrating this function, I observed a couple of things:
A) Integrating the function f over the entire positive real line gives an
error:
> integrate(f,0,Inf)
Error in integrate(f, 0, Inf) : the integral is probably divergent
B) Increasing the interval of integration
2002 Nov 07
2
The integration of the square of the c.d.f of normal distribution
Assume F(x) is the cdf of stardard normal c.d.f,
and want to get the integration of F(x)^2 over
(-infinite, +infinite).
So whats the value of this integration?
And is there some function to achieve this?
Thanks.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2007 Mar 08
2
integrate function (PR#9557)
Full_Name: Bert De Boeck
Version: R 2.2.0
OS: Windows
Submission from: (NULL) (157.193.193.152)
I think there is a bug when using integrate for integrating a function which is
0 in a whole sub-interval. For example:
#define uniform function
f<-function(x){ifelse(x<1,0,ifelse(x<3,1,0))}
#this is the correct integral
integrate(f,-10,10)
#here there is a problem
integrate(f,-50,50)
2003 Mar 18
2
To load Add-ons
Dear R Help-Team,
If I start R and type in
search()
the result is:
[1] ".GlobalEnv" "package:ctest" "Autoloads" "package:base"
I often need an Add-on-package. I can load it with "> library(package)" or
include a require-command in the .First-function. The .First-function is
fine, if I always use the same working directory. But I
2003 Jan 13
2
Bug in boxplot(..., add=TRUE) ?
R 1.6.1 on Windows NT4:
The boxplot() function appears to draw its own tick marks
and axis values even when called with add=TRUE. As a toy
example, try
x <- rnorm(100)
f <- factor(rep(1:4, each=25))
plot(c(0,4), c(-3,3), type="n", xaxt="n", yaxt="n")
boxplot(x ~ f, add=TRUE)
My expectation is that a high-level plotting function will
not mess with the axes
2002 Dec 30
2
Writing packages with `methods' package
I'm trying to write a package which uses classes/methods as defined in the
`methods' package. I have a single .R file which defines the class and
various methods for that class. At the top of the file I have
require(methods)
and then
setClass("myclass", ...)
setGeneric("intersect")
setMethod("intersect", "myclass", function(x,y) ...)
I noticed
2003 Jan 15
2
Contour Plots
r-help,
I can't seem to get the below data organized in such a manner so as to
generate a contour plot
using any of the functions {lattice.contourplot, base.contour,
base.filled.contour}. I was wondering
if anyone could please tell me what I need to do to accomplish this.
X,Y,Level
-31.105,86.911,3843
-3.385,86.911,3896
24.335,86.911,3874
-24.175,79.700,3900
-3.385,79.700,3927
2003 Feb 11
2
geoR question from new R user
Hi,
I'm a new R user. My goal is to do a variogram using geoR.
I started by trying to do the example in the geoR Illustrative Session
using my own data.
I am able to read in my Ascii data using: D <- matrix(scan("file.dat",
n=530*3), 530,3, byrow=TRUE).
Then I use: as.geodata(D, coords.col=1:2, data.col=3) to make the
object D geodata.
I check the descriptive statistics,
2002 Aug 31
1
building r-devel on RedHat 7.1 with gcc 3.1.1
Has anyone tried to build r-devel on a RedHat 7.1 with the gcc 3.1.1
compiler? I didn't have problems with gcc 2.95.x or gcc 3.0.4, but when I
ran the configure with gcc 3.1.1 I got the following error:
[...]
checking whether gcc accepts -M for generating dependencies... yes
checking whether gcc supports -c -o FILE.lo... yes
checking how to get verbose linking output from g77... -v
checking
2002 May 18
5
Length of a string
Hi,
Suppose I have created something like this in R:
foo <- "myfoo"
and I want to find out the number of character in foo (in other words, R
should return 5 since "myfoo" has 5 charactors.
How can I do it? I tried:
length(foo)
but it returned 1.
Cheers,
Kevin
------------------------------------------------------------------------------
Ko-Kang Kevin Wang
2019 Apr 12
2
integrate over an infinite region produces wrong results depending on scaling
Dear all,
This is the first time I am posting to the r-devel list. On
StackOverflow, they suggested that the strange behaviour of integrate()
was more bug-like. I am providing a short version of the question (full
one with plots: https://stackoverflow.com/q/55639401).
Suppose one wants integrate a function that is just a product of two
density functions (like gamma). The support of the
2002 Mar 11
2
gif, jpeg and png image files reader
Hi all,
Although R seems to have jpeg() and png() functions that converts data into
jpeg and png formated files, it
doesn't have functions the other way around.
Does one of R contributed packages have gif, jpeg and png image readers? I
did help.search() but no luck
Regards,
Jonathan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2003 Apr 21
4
nonlinear equation solver?
Dear R-Help,
I am trying to use R to solve a nonlinear equation many times for different values. I am looking for a mathematical nonlinear equation solution which may not have a closed solution form. For example, I have equation:
2 = (t^2)/log(t)
What is t?
I am wondering how to solve it in R.
Many thanks,
Zhu Wang
Statistical Science Department
SMU.
2003 Jan 16
7
X11 device now needs to be explicitly started?
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 6.2
year 2003
month 01
day 10
language R
>
Until this version, I've not had to explicitly start the x11 device.
Now,
2011 Aug 03
1
Case-by-case tolerance needed for successful integrate()
Hello,
We are trying to use R to simulate a model based on parameters 'a' and 'b'.
This involves the following integration:
model<-function(s,x,a,b)(exp(-s*x*10^-5.5)*(s^(a-1)*(1-s)^(b-1)))
g<- function(x,a,b){
out<-c()
for (i in 1:length(x)){
out[i]<-1- (integrate(model,0,1,x[i],a,b)$value / beta(a,b))
}
out
}
x<-
2002 Aug 28
2
sourcing a file with the plot.lme() function
I ran into a problem trying to make a plot from a file that's read using
source. Basically, I have the following code in a file "plot.R" :
library(nlme)
data(Loblolly)
fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc),
data = Loblolly,
fixed = Asym + R0 + lrc ~ 1,
random = Asym ~ 1,
start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
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