Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
28-09-2020Int-poli-inter
f<-function(s){log(s^2*sin(s) + cos(s))} curve(f,0,1) x=seq(0,1,by=0.2);x y=f(x);y points(x,y) # Supomos y=f(x) e que f(x_i)=p(x_i), em que p(s)=a_0+a_1s+a_2s^2+a_3s^3+a_4s^4 é um polinômio. # Vamos resolver o problema agora usando a ideia de Lagrange p(s)=y_0L_0(s)+y_1L_1(s)+...+y_(n-1)L_(n-1)(s) n=length(x) L<-function(i,s){ p=1 for (j in 1:n){ if ( i!=j){p=p*(s-x[j])/(x[i]-x[j])} } p } poliLag<-function(s){ p=0 for ( i in 1:n){p=p+y[i]*L(i,s)} p } curve(poliLag,min(x),max(x)) points(x,y,col="red") Erro<-function(s){f(s)-poliLag(s)} curve(Erro,0,1) points(x,Erro(x),col="red")
run
|
edit
|
history
|
help
0
Die sim
plot_cars
R1
R
code
Dendrogramm_Clusteranalyse_Länderflächen_euclid_average
R exemplo
Kruskal Wallis test
confidence interval stuff
Sierpinski curve square