powered by
Evaluates the a basis of normalized shifted Legendre polynomials over a specified data vector.
Legj(u, m)
Data vector on which the polynomials are to be evaluated.
The size of the basis to be considered.
Numerical values of the first m normalized shifted Legendre polynomials.
m
# NOT RUN { x<-rnorm(1000,10,7) xx<-x[x>=10 & x<=20] G<-pnorm(20,5,15)-pnorm(10,5,15) g<-function(x){dnorm(x,5,15)/G} g<-Vectorize(g) u<-g(xx) Mmax=20 s<-as.matrix(Legj(u,Mmax)) # }
Run the code above in your browser using DataLab