[R] Newton-RaphsonMethod

2019-02-24 Thread malika yassa via R-help
HELLOplease I want to approximate the solution of the equation f(x)=x*(x-2)+log(x)=0 for that i did this program f <- function(x){x*(x-2)+log(x)} x <- c(1 : 2) f(x) h <- 1e-7 df.dx <- function(x){(f(x + h) - f(x)) / h} df.dx(3/2);df.dx(2)  newton <- function(f, tol = 1e-7, x0 = 3/2, N = 100){  h

[R] (no subject)

2019-02-02 Thread malika yassa via R-help
Please, can you help me I have a equation to solve by newton method but I can not do it for example f<-function(x) { 2+X2-X3=0} this equation have un solution in [1,2] is there a function in R for solve it or i have to programme it [[alternative HTML version deleted]] _

[R] sustraction of two vectors of matrix

2018-12-05 Thread malika yassa via R-help
helloplease   I want to make a sustration of two vectors of a matrix i have this program aa<-matrix(outer(0:3,0:4,function(x,y) x+y*2),nrow=4,ncol=5) for(i in 1:4) + {for(j in 2:5) + {bb[i,j-1]=aa[i,j]-aa[i,j-1] + } + } at the end i obtain the bb=matrix( nrow=4,ncol=4) but i cann't obtain this mat

[R] extrat non diagonal

2018-11-14 Thread malika yassa via R-help
hello for examplei have this matrix w2<-c(0.1,0.2,0.4,0.2,0.4,0.1)aa<-matrix(w1,nrow=3,ncol=3)aa [,1] [,2] [,3] [1,]  0.4  0.4  0.4 [2,]  0.1  0.1  0.1 [3,]  0.2  0.2  0.2 if i use this code matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],2,3) i will obtaine this matrix[,1] [,2] [,3] [

[R] extrat non diagonal

2018-11-14 Thread malika yassa via R-help
helloi didn't obtaine the matrix after extrat non diagonalmy programx<-rnorm(6,0,1) aa<-matrix(x,nrow=6,ncol=6) matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],5,6) nrow=5ncol=6thank you [[alternative HTML version deleted]] __ R-help@r-p

[R] extrat non diagonal value

2018-11-14 Thread malika yassa via R-help
helloplease i have this matrixx<-rnorm(6,0,1) aa<-matrix(x,nrow=6,ncol=6) i have to extrat non diagonal value, i use this code matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],5,6) but i didn't get the resultthank you [[alternative HTML version deleted]] __

[R] calculate the integral

2018-10-24 Thread malika yassa via R-help
helloplease can anyone help me, I find it difficult to calculate this integrali have this programmx<-rnorm(10,0,1)y<-rexp(10,2)z<-exp(10,3)s<-vector()for (  j in 1:10)s[j]<-x[j+1]+x[j]s1[i]<-s[j]/2f<-function(y,u){exp(y-u)}sapply(x, function(i){  z[j] integrate(f,lower=s1[j],upper=,s1[j+1] x=i)$

[R] calculate the integral

2018-10-24 Thread malika yassa via R-help
helloplease can anyone help me, I find it difficult to calculate this integrali have this programmx<-rnorm(10,0,1)y<-rexp(10,2)z<-exp(10,3)s<-vector()for (  j in 1:10)s[j]<-x[j+1]+x[j]s1[i]<-s[j]/2f<-function(y,u){exp(y-u)}sapply(x, function(i){  z[j] integrate(f,lower=s1[j],upper=,s1[j+1] x=i)$

[R] integral of the fuction for each value

2018-10-21 Thread malika yassa via R-help
hello please you help me i have this functionx<-rnorm(10,0,1)f<-fuction(u,x)  {exp((x-u)}I want to calculate the integral of this function for each value of x{for(i in 1:lenght(x)integrate(f,lower=1,upper=4) thinks [[alternative HTML version deleted]] __

[R] (no subject)

2018-10-20 Thread malika yassa via R-help
hello please you help mei have this functionx<-rnorm(10,0,1)f<-fuction(u,x)  {exp((x-u)}I want to calculate the integral of this function for each value of x{for(i in 1:lenght(x) integrate(f,lower=1,upper=4) }but I can not find the vector of resulatwhere is the errorthinks [[alternativ

[R] (no subject)

2018-10-20 Thread malika yassa via R-help
hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3 ) I want to delete the diagonal values of this matrix can anyone do thisthinks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

[R] (no subject)

2018-08-06 Thread malika yassa via R-help
hellothis is my programmeyou can help me, i cann't found a solution for H  and this  function i calculate for all value for x1thank you x<-rexp(N,2) z<-rnorm(0,1,n) g=k)-k*(Z-m<=-k)} k1<-function(u,x1){-1/(2*pi)exp((x1-u)/h1} for (i in 1:n) {k1(u,x1)=integrate(-1/(2*pi)exp((x1-u)/h1,lower=

[R] (no subject)

2018-05-14 Thread malika yassa via R-help
hello > p(X ≤ V) diffetente zero > look this > Let X and V be two independent random variables with unknow >  distribution functions (d.f.’s) F and G respectively. Under truncation from >the right we observe (X, Z) only if X ≤ Z > I simulate X and Z and I use Lynden bell estimation > I need now to

Re: [R] (no subject)

2018-05-12 Thread malika yassa via R-help
had.co.nz/Reproducibility.html On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help wrote: Hello Do You help me, i have the problem in the package DTDA for  find the probability of truncation  (alpha) thank you     [[alternative HTML version deleted]]

[R] (no subject)

2018-05-10 Thread malika yassa via R-help
Hello Do You help me, i have the problem in the package DTDA for  find the probability of truncation  (alpha) thank you [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.et