Advertisement
Guest User

TCL.sce

a guest
Jan 27th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.83 KB | None | 0 0
  1.  
  2. s = 10000              // # de points pour le tracé
  3. L = linspace(-3, 3, s) // domaine des fonctions de répartition
  4.  
  5. function F = frep(X)
  6.     // X : vecteur contenant d réalisations d'une v.a.
  7.     F = []
  8.     for i = 1:s
  9.         F(i) = length(find(X <= L(i))) / length(X)
  10.     end
  11. endfunction
  12.  
  13.  
  14. //----------------------------------------------------------
  15. // suite de tirages
  16.  
  17. n = 10          // # de tirages dans une réalisation
  18. d = 5000        // # de réalisations
  19.  
  20. Xn = grand(n, d, "uin", 0, 3)
  21. mu = 1.5
  22. V = 9/12
  23.  
  24.  
  25. //----------------------------------------------------------
  26. // moyenne empirique
  27.  
  28. Xnb = sum(Xn, 1) / n
  29.  
  30. //plot2d(L, frep(Xnb))
  31.  
  32.  
  33. //----------------------------------------------------------
  34. // moyenne empirique centrée réduite
  35.  
  36. M = (Xnb - mu * ones(1, d)) ./ sqrt(V/n)
  37.  
  38. plot2d(L, frep(M))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement