similar to: Different values for double integral

Displaying 20 results from an estimated 4000 matches similar to: "Different values for double integral"

2004 Oct 21
2
How to calculate a double integral ...?
Dear R-Friends, How can I calculate a double integral like \int_a^b \int_c^y g(x, y) dx dy where a, b, c are constants, g(x, y), e.g., g(x, y) = tan(x + y). I tried to nested integrate() and adapt(), but none of them working, seemingly due to the limits can not be specified constants. Best regards, C. Joseph Lu Department of Statistics National Cheng-Kung University Voice:
2006 Mar 01
1
a strange problem with integrate()
Dear all, I am stuck on the following problem with integrate(). I have been out of luck using RSiteSearch().. My function is g2<-function(b,theta,xi,yi,sigma2){ xi<-cbind(1,xi) eta<-drop(xi%*%theta) num<-exp((eta + rep(b,length(eta)))*yi) den<- 1 + exp(eta + rep(b,length(eta))) result=(num/den)*exp((-b^2)/sigma2)/sqrt(2*pi*sigma2)
2012 Oct 26
1
Openbugs- Array Index
Hi, I'm working on the codes below however every time I run them when they get to OpenBUGS I keep getting the error message: array index is greater than array upper bound for hab. Any help would be greatly appreciated, Suzie Codes: ungulate <- read.csv(file.choose ()) #ungulate ungulate <- as.matrix(ungulate);colnames(ungulate)<-NULL;rownames(ungulate)<-NULL
2011 Aug 05
2
integral depending on a parameter
Is it possible to use the "integrate" function when it depends on a parameter? in other words can i get something like f(y) = integrate (g(x,y))? If not, how else can I get that? thanks in advance BL -- View this message in context: http://r.789695.n4.nabble.com/integral-depending-on-a-parameter-tp3722185p3722185.html Sent from the R help mailing list archive at Nabble.com.
2013 Apr 09
1
Solving an integral in R gives the error “The integral is probably divergent”
I am trying to solve an integral in R. However, I am getting an error when I am trying to solve for that integral. The equation that I am trying to solve is as follows: $$ C_m = \frac{{abs{x}}e^{2x}}{\pi^{1/2}}\int_0^t t^{-3/2}e^{-x^2/t-t}dt $$ [image: enter image description here] The code that I am using is as follows: a <- seq(from=-10, by=0.5,length=100) ## Create a function to compute
2011 Feb 17
1
Integration with an Indicator Function in R
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-
2011 Feb 17
1
Integrate with an indicator function
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-
2009 Oct 06
1
how to output profile plots for groups using lattice package
Dear R users, I am trying to have an xyplot of a data set which has the following variables: case (n=10,20,30) parameter (parm=a,b) group (grp=g1,g2) y (y values) x (x=2,4,8) My plot should be parameter by case such that I have 2 rows (each row= each parameter) and 3 columns (each column=each case). My R-code is as follows but I am not able to get what I want to: tp1.sim <- xyplot(y~ x | case
2004 Apr 01
5
Zap Channels Hang
Hi, i have an asterisk box running with E100P (E1) line as PSTN gw. Sometimes zap channels hang and i couldn't make any PSTN calls but SIP calls are still fine. When this happens I also couldn't restart/reload asterisk from the CLI. I have to kill the asterisk process and run safe_asterisk again. any ideas? asterisk*CLI> show channels Channel (Context
2008 Sep 24
2
keep the row indexes/names when do aggregate
Hi, R-users, If I have a data frame like this: >x<-data.frame(g=c("g1","g2","g1","g1","g2"),v=c(1,7,3,2,8)) g v 1 g1 1 2 g2 7 3 g1 3 4 g1 2 5 g2 8 It contains two groups, g1 and g2. Now for each group I want the max v: > aggregate(x$v,list(g=x$g),max) g x 1 g1 3 2 g2 8 Beautiful. But what if I want to keep the row index of (g1
2004 Jan 14
1
Collapsing a factor in R
I'm trying to collapse the following table along the sub-group factor. In this case, collapsing means taking the average ages within a subgroup and creating a new table. I seem to be running into trouble trying to create this new data frame. I can use the ave() function to find averages within a subgroup but how do I maintain the Group/Gender factors after collapsing? (see bottom table) Can
2009 Dec 29
2
pass functions and arguments to function
Hi, I wonder how to pass several functions and their arguments as arguments to a function. For example, the main function is f = function(X ) { process1(X) ... process2(X) } I have a few functions that operate on X, e.g. g1(X, par1), g2(X, par2), g3(X, par3). par1, par2 and par3 are parameters and of different types. I would like to pass g1, g2, g3 and their arguments to f and g1,
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users, I used to "OPTIM" to minimize the obj. function below. Even though I used the true parameter values as initial values, the results are not very good. How could I improve my results? Any suggestion will be greatly appreciated. Regards, Kathryn Lord #------------------------------------------------------------------------------------------ x = c(0.35938587,
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users, I used to "OPTIM" to minimize the obj. function below. Even though I used the true parameter values as initial values, the results are not very good. How could I improve my results? Any suggestion will be greatly appreciated. Regards, Kathryn Lord #------------------------------------------------------------------------------------------ x = c(0.35938587,
2009 Mar 26
1
loop problem
Dear R members I have a problem regarding storing the lists. Let L=number of distinct values of any predictor (say L=5) P=number of predictors (say P=20) g1 <- c() for(i in 1:P){ if(L > 1){ for(j in 1:(L-1)){ g <- .... g1[j] <- g } } g2[]=sort.list(g1) } Now the question is: What should we use inside brackets of g2[....], whether
2008 Sep 10
4
HP T/R2200 G2
Has anyone had any success with the HP T/R2200 G2? I have used the T/R2200 with nut a few times before and it works great, but the G2 doesn't want to talk to me. I have tried bcmxcp from 2.0.4, 2.2.2, and svn, as well as the usb drivers. Maybe the G2 isn't a rebadged powerware unit? Thanks James
2008 Sep 10
4
HP T/R2200 G2
Has anyone had any success with the HP T/R2200 G2? I have used the T/R2200 with nut a few times before and it works great, but the G2 doesn't want to talk to me. I have tried bcmxcp from 2.0.4, 2.2.2, and svn, as well as the usb drivers. Maybe the G2 isn't a rebadged powerware unit? Thanks James
2013 Jul 18
1
Bland Altman summary stats for all column combinations
Hello, I have the following data.frame structure(list(Study = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
2006 Jan 06
1
Problem with integrating ISDN PBX using NT mode
Hi, I'm just in the process of replacing a crappy Siemens PBX with a new and shiny Asterisk system. To connect Legacy equipment I hooked up a small ISDN PBX (DeTeWe OpenCom 36) to one port on a Junghanns.net quadBRI card. That port is configured for NT Point to Multipoint (Mehrgeraeteanschluss) mode. Now I can place calls from the ISDN PBX to the other Asterisk extensions but the other way
2009 Jul 15
1
Help with averaging
Hi I am using the following script to average a set of data 0f 62 columns into 31 colums. The data consists of values of ln(0.01) or -4.60517 instead of NA's. These need to be averaged for each row (i.e 2 values being averaged). What I would I need to change for me to meet the conditions: 1. If each run of the sample has a value, the average is given 2. If only one run of the sample has a