Professional Documents
Culture Documents
R Console Variables Continuas
R Console Variables Continuas
> 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
[1] 0.4529608
>