similar to: integration function

Displaying 20 results from an estimated 10000 matches similar to: "integration function"

2010 Jun 13
2
help with R
Hi all, I want to solve the following equation for x with rho <- 0.5 pnorm(-x)*pnorm((rho*dnorm(x)/pnorm(x)-x)/sqrt(1-rho^2))==0.05 Is there a function in R to do this? Thank you very much! Hannah [[alternative HTML version deleted]]
2018 Feb 06
0
question with integrate function
Sorry. I meant in the previous email that the function h() is a monotone decreasing function. Thanks very much. 2018-02-06 13:32 GMT-05:00 li li <hannah.hlx at gmail.com>: > Hi all, > The function h below is a function of c and it should be a monotone > increasing function since the integrand is nonnegative and integral is > taken from c to infinity. However, as we can see
2011 Feb 21
1
question about solving equation using bisection method
Hi all, I have the following two function f1 and f2. f1 <- function(lambda,z,p1){ lambda*(p1*exp(-3*z-9/2)+(0.2-p1)*exp(4*z-8))-(1-lambda)*0.8} f2 <- function(p1,cl, cu){ 0.8*(pnorm(cl)+(1-pnorm(cu)))/(0.8*(pnorm(cl)+(1-pnorm(cu)))+p1*(pnorm(cl+3)+(1-pnorm(cu+3)))+(0.2-p1)*(pnorm(cl-4)+(1-pnorm(cu-4))))}-0.05 First fix p1 to be 0.15. (i) choose a lambda value, say lamda=0.6, (ii)
2018 Feb 06
2
question with integrate function
Hi all, The function h below is a function of c and it should be a monotone increasing function since the integrand is nonnegative and integral is taken from c to infinity. However, as we can see from the plot, it is not shown to be monotone. Something wrong with the usage of integrate function? Thanks so much for your help. Hanna h <- function(c){ g <- function(x){pnorm(x-8.8,
2018 Feb 06
1
question with integrate function
Hi Hanna, your function is essentially zero outside a short interval around 9. And the help page states: "If the function is approximately constant (in particular, zero) over nearly all its range it is possible that the result and error estimate may be seriously wrong." You could try to integrate over a finite interval, say (7, 12). G?ran Brostr?m On 2018-02-06 19:40, li li wrote:
2011 Sep 11
3
(no subject)
Dear all, Can anyone take a look at my program below? There are two functions: f1 (lambda,z,p1) and f2(p1,cl, cu). I fixed p1=0.15 for both functions. For any fixed value of lambda (between 0.01 and 0.99), I solve f1(p1=0.15, lambda=lambda, z)=0 for the corresponding cl and cu values. Then I plug the calculated cl and cu back into the function f2. Eventually, I want to find the lambda value
2012 Apr 24
2
Some Help Needed
Dear all, I need to do some calculation where the code used are below. I get error message when I choose k to be large, say greater than 25. The error message is "Error in integrate(temp, lower = 0, upper = 1, k, x, rho, m) : the integral is probably divergent". Can anyone give some help on resolving this. Thanks. Hannah m <- 100 alpha <- 0.05 rho <- 0.1 F0
2011 Sep 03
3
question with uniroot function
Dear all, I have the following problem with the uniroot function. I want to find roots for the fucntion "Fp2" which is defined as below. Fz <- function(z){0.8*pnorm(z)+p1*pnorm(z-u1)+(0.2-p1)*pnorm(z-u2)} Fp <- function(t){(1-Fz(abs(qnorm(1-(t/2)))))+(Fz(-abs(qnorm(1-(t/2)))))} Fp2 <- function(t) {Fp(t)-0.8*t/alpha} th <- uniroot(Fp2, lower =0, upper =1,
2009 Dec 15
1
Help in R
Hello, Can anyone give me some suggestion in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all
2010 Jun 23
2
question about a program
Dear all, I have the following program for a multiple comparison procedure. There are two functions for the two steps. First step is to calculate the critical values, while the second step is the actual procedure [see below: program with two functions]. This work fine. However, However I want to put them into one function for the convenience of later use [see below: program with one
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 <-
2013 Apr 04
1
Plotting several functions in the same display (again)
To superimpose two functions plots in the same page. The functions L0 and L1, as defined below, I use the following code: # An accumulative normal distribution function with # several parametres f0 <- function(mu, xm, ds, n) { 1 - pnorm((xm-mu)/(ds/sqrt(n))) } f1 <- function(mu,n) f0(mu, 386.8, 48, n) # Two functions with just the parameter mu L0 <- function(mu)
2011 Apr 20
2
question regarding qmvnorm
Dear all, I wrote the following function previously. It worked fine with the old mvtnorm package. Somehow with the updated package, I got a error message when trying to use the function. I need some help. It is sort of urgent. Can anyone please take a look. The function is the following. Thank you very much! Hannah library(mvtnorm) cc_f <- function(m, rho,
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 <-
2013 Jan 30
2
Integration of mixed normal distribution
Hi, I already found a conversation on the integration of a normal distribution and two suggested solutions (https://stat.ethz.ch/pipermail/r-help/2007-January/124008.html): 1) integrate(dnorm, 0,1, mean = 0, sd = 1.2) and 2) pnorm(1, mean = 0, sd = 1.2) - pnorm(0, mean = 0, sd = 1.2) where the pnorm-approach is supposed to be faster and with higher precision. I want to integrate a mixed
2007 Jan 21
5
Integration + Normal Distribution + Directory Browsing Processing Questions
Hi everyone, I am new to R, but it's really great and helped me a lot! But now I have 2 questions. It would be great, if someone can help me: 1. I want to integrate a normal distribution, given a median and sd. The integrate function works great BUT the first argument has to be a function so I do integrate(dnorm,0,1) and it works with standard m. and sd. But I have the m and sd given.
2012 Jul 26
2
density
Hi all, I have a question regarding the density function which gives the kernel density estimator. I want to decide the bandwidth when using gaussian kernel, given a set of observations. I am not familiar with different methods for bandwidth determination. Below are the different ways in R on deciding the bandwidth. Can anyone give an idea on which ones are preferred. Also, how can I take
2005 Sep 25
2
getting variable length numerical gradient
Hi all. I have a numerical function f(x), with x being a vector of generic size (say k=4), and I wanna take the numerically computed gradient, using deriv or numericDeriv (or something else). My difficulties here are that in deriv and numericDeric the function is passed as an expression, and one have to pass the list of variables involved as a char vector... So, it's a pure R programming
2000 Sep 20
1
integration in R?
I have the following problem. inf p= Int [dnorm(x-d) * pnorm(x) ^ (m-1)] dx -inf Given p and m, I want to find d. For example, p m d .9 2 1.81 Is there a way to solve this problem in R? Ideally I would have a function with arguments p and m, and output d. Thanks very much for any help. Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing
2012 Jul 01
4
geom_boxplot
Also, it is possible to change "ylim" also? 2012/7/1 li li <hannah.hlx@gmail.com> > Dear all, > I have a few questions regarding the boxplot output from the > "geom_boxplot" function. > Attached is the output I get. Below are my questions: > > 1. How can I define the xlab and ylab myself? > Also I would like to remove