search for: xstar

Displaying 3 results from an estimated 3 matches for "xstar".

Did you mean: star
2011 Jun 29
1
Numerical integration
Hello! I know that probably my question is rather simple but I' m a very beginner R-user. I have to numerically integrate the product of two function A(x) and B(x). The integretion limits are [X*; +inf] Function A(x) is a pdf function while B(x)=e*x is a linear function whose value is equal to 0 when the x < X* Moreover I have to iterate this process for different value of X* and for
2009 Sep 17
2
R functions with array arguments
...ne of which is an array, but I find that the result is a single value instead of an array. This is the example I'm working on: # define integration limit vector > Mabslim <- c(-17.95, -16.65, -17.27, -17.62, -16.76, -17.07, -17.02) # Define function > schech<-function(x,alpha,xstar) (10^(0.4*(alpha+1)*(xstar- x))*exp(-10^(0.4*(xstar-x)))) # Define new function integrating the previous one > my_gamma<-function(alpha,xstar,xlim,xmax) integrate(schech,xmax,xlim,alpha,xstar)$value > my_gamma(-1,-21,Mabslim,-27) [1] 2.487746 Note that 'Mabslim' is used as...
2009 Apr 23
2
Two 3D cones in one graph
...TRUE,nrow=2) G<-eigen(Sigma) E1<-t(G$vector%*%t(A)) E2<-t(diag(sqrt(G$values))%*%t(E1)) mu<-c(0.1,0.2) E3<-sweep(E2,2,-mu) a<-sqrt(max(rowSums(sweep(E3,2,mu)**2))) b<-sqrt(min(rowSums(sweep(E3,2,mu)**2))) astar<-as.numeric(a+abs(mu[1])) bstar<-as.numeric(b+abs(mu[2])) xstar<-seq(-astar,astar,len=50) ystar<-seq(-bstar,bstar,len=50) g<-expand.grid(x=xstar,y=ystar) p1<-2*g$x*mu[1]/a**2+2*g$y*mu[2]/b**2 p2<-(g$x**2/a**2+g$y**2/b**2) p3<-mu[1]**2/a**2+mu[2]**2/b**2-1 q<-(p1+sqrt(p1**2-4*p2*p3))/(2*p2) z<-sqrt(1-(q*g$x)**2-(q*g$y)**2) zstar<-(z...