Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CDF- Gaussian (trapezoids method)
fx = function(x){ (1/sqrt(2*pi))*exp((-1/2)*x^2) } at = function(f,a,b,n){ dx = (b-a)/n int = seq(a,b,dx) areas = c() for( i in 1:n){ if( f(int[i]) > f(int[i+1]) ){ B <- f(int[i]) ; bm <- f(int[i+1]) areas[i] = (B+bm)*dx/2 }else{ bm <- f(int[i]); B <- f(int[i+1]) areas[i] = (B+bm)*dx/2 } } plot(f,a,b, col = "purple",lwd = 1.5, tcl = 0.2,bty = 'l',panel.first = grid(16,16)) abline(h=0,v=0) return(sum(areas)) } h = c(-2,-1,0,1.64,1.96,2.56,3) for( i in 1: length(h)){ print(at(fx,-3,h[i],1000)) }
run
|
edit
|
history
|
help
0
Demonstration of table()
Peso diário
Linear Regression and log-log Transformation
Controle-22-03-2021
Variance Gamme process 2
Scatterplot using ggplot Sample
Monte Carlo Integration
Simple Plot
Ejercicios R
Prediction