You are on page 1of 3

> zx<-runif(1000,0,1)

> y<-runif(1000,0,1)
> z=x+y
> uniforme<- function(z)
+ {return (z)
+
+ }
> integrate(uniforme,0.2,0.6)
0.16 with absolute error < 1.8e-15
>
> x<-runif(1000,0,1)
> y<-runif(1000,0,1)
> z=x+y
> uniforme<- function(z)
+ {return (z)
+
+ }
> integrate(uniforme,0.2,0.6)
0.16 with absolute error < 1.8e-15
> x=y-z
> uniforme2<-function(x)
+ {return (x)
+
}
> integrate(uniforme2;0.2,0.6)
Error: inesperado ';' in "integrate(uniforme2;"
> x=y-z
> uniforme2<-function(x)
+ {return (x)
+
}
> integrate(uniforme2,0.2,0.6)
0.16 with absolute error < 1.8e-15
> integrate(uniforme2,0,1)
0.5 with absolute error < 5.6e-15
>
> pexp(c(5), rate=1, lower.tail=FALSE)
[1] 0.006737947
>
> pexp(c(5), rate=1, lower.tail=TRUE)
[1] 0.9932621
>
>
>
> x<-runif(100,0,1)
> w<-function(x)
+ {
+
return (sqrt(w))
+
}
>
integrate(w,0,1)
Error in sqrt(w) : non-numeric argument to mathematical function
> x<-runif(100,0,1)
> raizx<-function(x)
+ {
+
return (sqrt(x))
+
}
>
integrate(raizx,0,1)
0.6666667 with absolute error < 7.7e-05
> var(raizx)
Error: is.atomic(x) is not TRUE
> var(x)
[1] 0.08009423

starting httpd help server ... done


>
>
>
>
>
x<-runif(100,0,100)
>
exponencial<-function(x)
+
{
+
return(2*exp(-x))
+
}
>
integrate(exponencial,0,100)
2 with absolute error < 1.9e-05
>
>
>
> x<-runif(100,0,100)
>
exponencial<-function(x)
+
{
+
return(exp(-x))
+
}
>
integrate(exponencial,0,100)
1 with absolute error < 9.6e-06
>
>
x<-runif(100,0,2)
>
exponencial<-function(x)
+
{
+
return(exp(-x))
+
}
>
integrate(exponencial,0,100)
1 with absolute error < 9.6e-06
>
>
> x<-runif(100,0,2)
>
exponencial<-function(x)
+
{
+
return(exp(-x))
+
}
>
integrate(exponencial,0,2)
0.8646647 with absolute error < 9.6e-15
>
>
>
> pexp(c(5), rate=1, lower.tail=FALSE)
[1] 0.006737947
> pexp(c(4), rate=1, lower.tail=FALSE)
[1] 0.01831564
> pexp(c(1), rate=1, lower.tail=FALSE)
[1] 0.3678794
>
ppois(c(8), lambda = 8, lower.tail=TRUE)
[1] 0.5925473
>
>
ppois(c(10), lambda = 8, lower.tail=TRUE)
[1] 0.8158858
>
ppois(c(2), lambda = 8, lower.tail=TRUE)
[1] 0.01375397
>
ppois(c(5), lambda = 8, lower.tail=TRUE)
[1] 0.1912361
>
ppois(c(6), lambda = 8, lower.tail=TRUE)
[1] 0.3133743
>
ppois(c(7), lambda = 8, lower.tail=TRUE)

[1] 0.4529608
>

You might also like