search for: varx

Displaying 20 results from an estimated 32 matches for "varx".

Did you mean: var
2009 Jan 06
2
[LLVMdev] LLVM Optmizer
The following C code : #include <stdio.h> #include <stdlib.h> int TESTE2( int parami , int paraml ,double paramd ) { int varx=0,vary; int nI =0; //varx= parami; if( parami > 0 ) { varx = parami; vary = varx + 1; } else { varx = vary + 1; vary = paraml; } varx = varx + parami + paraml; for( nI = 1 ; nI <= paraml; nI++) { varx = varx + parami + 1 ; vary = varx + nI; } va...
2005 Oct 05
1
(no subject)
...ork. m=matrix(c(0,0),2,1) v=matrix(c(1,0,0,1),2,2) Y=function(X1,X2,mu=m,V=v) { X=matrix(c(X1,X2),2,1) a=(1/((2*pi)*sqrt(det(V))))*exp((-0.5)*(t(X-mu)%*%solve(V)%*%(X-mu))) a[1] } x1=seq(-1,1) x2=x1 Z=outer(x1,x2,FUN="Y",mu=m,V=v) persp(x1,x2,Z) my code: BINORMAL<-function(varx=1,vary=1,covxy=0,meanx=0,meany=0) { #the following function plots the density of a bi variate normal distribution covXY<-matrix(c(varx,covxy,covxy,vary),2,2) A<-solve(covXY) #up<-max(meanx+4*varx^.5,meanx-4*varx^.5,meany+4*vary^.5,meany-4*vary^.5) #x <- seq(-up,up,length=50) #y...
2009 Jan 07
3
[LLVMdev] LLVM optmization
...MSVC assembler is solved in the optimization pass more efficiently than that in LLVM. Is there an way to get a optimization result in LLVM like that of the MSVC? Manoel Teixeira #include <windows.h> #include <stdio.h> int TESTE ( int parami ,int paraml ,double paramd ) { int varx=0,vary=0; int nI =0; if( parami > 0 ) { varx = parami; vary = 0; } else { varx = 0; vary = paraml; } for( nI = 1 ; nI <= paraml; nI++) { varx = varx + parami + 1 ; vary = varx + nI; } return varx ; } unsigned long thread_call( LPVOID c ) { int n...
2011 Jan 20
2
adding text to y-axis per row of panels (lattice)
...too high", and the rest of the negative scale as "too low". The text should be printed in parallel to the y-axis. If this was a base graphic plot, I'd use mtext, but I'm not sure how to get to the same results when using lattice. Here is some example data: library(lattice) varx <- c(1:4,1:4,1:4,1:4) vary <- c(2,2,1.5,0.3,1,2,3,4,-1,-0.5,3,-1,-1,-0.5,1,-3) condvar <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) exampledata <-data.frame(cbind(varx,vary,condvar)) exampledata xyplot(vary~varx|condvar, type="o",data=exampledata, ? ? ? scales=list(alternating=F,x=li...
2009 Jan 14
0
[LLVMdev] LLVM optmization
Hi Manoel, > Hi, Duncan. > > Here an example : > #include <stdio.h> > #include <stdlib.h> > // > int TESTE ( int parami ,int paraml ) > { > int varx=0; > int nI =0; > > if( parami > 0 ) > { > varx = parami; > } > else > { > varx = 1; > } > > for( nI = 1 ; nI <= paraml; nI++) > { > varx = varx + parami+ 1; > } > > return varx ; > } > &gt...
2017 Apr 28
2
ggplot dentro de una función
...), by = "day"), V1 = rnorm(10), V2 = rnorm(10)) Quiero crear una función para pintar un gráfico cuyos argumentos sean el data table y la variable a pintar en el eje de las x. Se me ocurre ésta: grafico <- function(dt, varx) { ggplot(dt, aes(x = Date, y = varx)) + geom_point() ## un montón de código de configuración del gráfico, etc } grafico(datos, V1) Pero ggplot dice que no encuentra V1... Error in eval(expr, envir, enclos) : object 'V1' not found In addition: Warning message: In eval(expr, envir,...
2008 Feb 26
2
Combining series of variables using identifier
..., var2 = rep(c("B20", "X40", "D50", "G60"), each=5), var2_lab= rep(c("car", "bicycle", "train", "bus"), each=5)) str(a) I'd like to create new variables by combining "varX" and "varX_lab" like this: a$var1_new <- factor(paste(a$var1, a$var1_lab, sep=": ")) a$var2_new <- factor(paste(a$var2, a$var2_lab, sep=": ")) a But, in the real world, I have multiple df:s and many of variables named by the same manner. Is there a possibi...
2012 Feb 18
3
foreach %do% and %dopar%
...MCVRFNM[simx] <- sum(FNMSDE) } The changes makes the script fail, saying somtehing like: abscent value where TRUE/FALSE is necessary, the variables that are supposed to pass the information to the Valuation.R script are empty, and error comes because it does something like this at some point: VarX = A/B #But because the variables values are not getting into the Valuation.R script then #A = MCPVMPA = 0 and B = MCMKMPA = 0 So VarX = NaN Then it does something like: if (VarZ>VarX) VarY = 0 else VarY = VarX-VarZ #This line generates the error I have all the libraries ins...
2005 Jul 05
1
by (tapply) and for loop differences
...some data - I'll do 2 simulations... > > xvar = rnorm(40, 20, 5) > yvar = rnorm(40, 22, 2) > num = factor(rep(1:2, each=20)) > sdat = data.frame(cbind(num, xvar, yvar)) > > # Define a function to do a simple t test and return some values... > > kindtest = function(varx, vary){ + res = t.test(varx, vary) + x.mn = res$estimate[1] + y.mn = res$estimate[2] + diff = y.mn-x.mn + pval = res$p.value + cat("Mean xvar =", x.mn, " Mean yvar =", y.mn) + cat(" diff =", diff, " p-value=", pval, "\n\n") +...
2012 Nov 05
1
Potencia de la prueba T
...rueba variando el tamaño de la muestra pues no logro acomodar el elemento del vector para que genere la muestra aleatoria de datos normales. Mx=170 M0=168 alpha=0.05 sigma=8 T=qt((1-alpha/2),n-1) T2=qt(alpha/2,n-1) Nr=1000 Nrechazo=0 n=seq(10,900, 70) dF <- data.frame(PromX = rep(0,length(n)), VarX = rep(0,length(n))) for(i in 1:Nr){ x <- rnorm(n[i], Mx, sigma) dF$PromX[i] <- mean(x) dF$VarX[i] <- var(x) Tobs=(mean(x)-M0)/(sqrt(var(x)/n[i])) Rechazo=ifelse(Tobs>=T| Tobs<=T2 ,1,0) Nrechazo=Nrechazo+Rechazo } Nrechazo/Nr la idea es que cada que haga las nr´repeticiones d...
2009 Jan 08
0
[LLVMdev] LLVMdev Digest, Vol 55, Issue 16
.... > > Is there an way to get a optimization result in LLVM like that of the MSVC? > > Manoel Teixeira > > > > #include <windows.h> > > #include <stdio.h> > > > > int TESTE ( int parami ,int paraml ,double paramd ) > > { > > int varx=0,vary=0; > > int nI =0; > > > > if( parami > 0 ) > > { > > varx = parami; > > vary = 0; > > } > > else > > { > > varx = 0; > > vary = paraml; > > } > > for( nI = 1 ; nI <= paraml;...
2001 Jul 12
2
Package DSE
Hi, If I try to do this: if(is.R()) data("eg1.DSE.data.diff", package="dse1") model <- est.VARX.ls(eg1.DSE.data.diff) (Page 14 - DSE Package Manual) I obtain a Segment Violation. I use R-1.3.0 and the last dse package version Maximino Ameneiro Gomez -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~horni...
2017 Nov 01
3
repeat a function
...b) <- c(-1,0,1) a<- 0.1 dt<-1 ExpX <-function(x,a,dt) { ######Defines the Expectation of X on t+1 | t ExpX <- x*exp(-a*dt) ExpX } Mfactor<-function(a,dt) { #######Factor multiplicative Mfactor<- exp(-a*dt)-1 Mfactor } VarX <-function(sigma,a,dt) { #######Defubes the Variance of X on t+1 | t VarX <- (sigma^2/(2*a))*(1-exp(-2*a*dt)) VarX } DeltaX <-function(sigma,a,dt) { ######Defines the change of X DeltaX<- sqrt(3*VarX(sigma,a,dt)) DeltaX<-value(Del...
2017 Nov 02
0
repeat a function
...<-function(x,a,dt) { ######Defines the Expectation of X > on t+1 | t > ExpX <- x*exp(-a*dt) > ExpX > } > Mfactor<-function(a,dt) { #######Factor multiplicative > Mfactor<- exp(-a*dt)-1 > Mfactor > } > VarX <-function(sigma,a,dt) { #######Defubes the Variance of X > on t+1 | t > VarX <- (sigma^2/(2*a))*(1-exp(-2*a*dt)) > VarX > } > DeltaX <-function(sigma,a,dt) { ######Defines the change of X > DeltaX<- sqrt(3*VarX(sigma...
2017 Nov 02
2
repeat a function
...<-function(x,a,dt) { ######Defines the Expectation of X > on t+1 | t > ExpX <- x*exp(-a*dt) > ExpX > } > Mfactor<-function(a,dt) { #######Factor multiplicative > Mfactor<- exp(-a*dt)-1 > Mfactor > } > VarX <-function(sigma,a,dt) { #######Defubes the Variance of X > on t+1 | t > VarX <- (sigma^2/(2*a))*(1-exp(-2*a*dt)) > VarX > } > DeltaX <-function(sigma,a,dt) { ######Defines the change of X > DeltaX<- sqrt(3*VarX(sigma...
2006 Aug 10
0
Updating a database record using Javascript variables
...ata that is stored in a Javascript variables as a parameter, but I am not sure how to do it. Can someone show me how I should be doing this? Below is a simplified version of the code I am trying to produce: View: <script type="text/javascript"> <!-- function my_Func() { varx = dd.obj.x; // Not sure how to call the controller in the next line <%= render_component :action => ''updatex'', :xvalue => varx %> } --> </script> Controller: Def updatex Person.update(10, {:xvalue => params[:xvalue]}) end -- Posted via http://...
2017 Nov 03
0
repeat a function
...######Defines the Expectation of X > > on t+1 | t > > ExpX <- x*exp(-a*dt) > > ExpX > > } > > Mfactor<-function(a,dt) { #######Factor multiplicative > > Mfactor<- exp(-a*dt)-1 > > Mfactor > > } > > VarX <-function(sigma,a,dt) { #######Defubes the Variance of X > > on t+1 | t > > VarX <- (sigma^2/(2*a))*(1-exp(-2*a*dt)) > > VarX > > } > > DeltaX <-function(sigma,a,dt) { ######Defines the change of X > >...
2013 Mar 15
0
[LLVMdev] Simple question
...var2 = 12 > ret i32 %var2 > } > > What is the simplest way to make %var2 = 12 ? To add to the other response, it is important to note that your %var1, %var2 above are not variables at all, because they can't be reassigned (i.e. they can't appear again on the left hand of a %varX = ... expression.) They are just names for the values corresponding to the instructions.
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users, I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this? BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively. Any suggestion to solve this question? Thanks, Kate
2013 Mar 16
3
[LLVMdev] Simple question
...; > } > > > > What is the simplest way to make %var2 = 12 ? > > To add to the other response, it is important to note that your %var1, > %var2 above are not variables at all, because they can't be reassigned > (i.e. they can't appear again on the left hand of a %varX = ... > expression.) They are just names for the values corresponding to the > instructions. > Ok, maybe i asked the wrong question. Instead of using the value 12 all the way through the llvm ir text file. How do i use %friendlyName instead? I.e. The equivalent of something like #define F...