Mensaje de error

  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls en book_prev() (línea 775 de /home1/montes/public_html/drupal/modules/book/book.module).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters en drupal_get_feeds() (línea 394 de /home1/montes/public_html/drupal/includes/common.inc).

1. Simulacion estadistica del Ejercicio 3.2 (probabilidad a partir de una funcion de densidad)

Solapas principales

[adsense:336x280:9156825571]
Hay dos formas de simularlo estadisticamente con R-Project para calcular $P(-2<x\leq 0)$ a partir de la funcion densidad:
  • Primera forma integrando:

    > f<- function(x) 3*x^2/2;
    
    > #integramos entre los valores -2 y 0 para los valores en que la funcion
     densidad es distinta de cero
    
    > integrate(f,lower=-1,upper=0)
    0.5 with absolute error < 5.6e-15
      
  • Segunda forma instalando el paquete (package) distr:

    > library(distr)
    
    > f<- function(x) 3*x^2/2;
    
    > X <- AbscontDistribution(d = f, low1 = -1, up1 = 1)
    
    > p(X)(0) - p(X)(-2)
    [1] 0.5
    

 

Español
Pin It