Displaying 20 results from an estimated 10000 matches similar to: "question about solving equation using bisection method"
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,
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]]
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,
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,
2005 Mar 09
3
problem using uniroot with integrate
Hi,
I'm trying to calculate the value of the variable, dp, below, in the
argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1). This
corresponds to the estimate of the sensitivity of an observer in an
m-alternative forced choice experiment, given the probability of
a correct response, Pc, a Gaussian assumption for the noise and
no bias. The function that I wrote below gives me an error:
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
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
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:
2012 Apr 07
1
Uniroot error
Dear All
I am trying to find a uniroot of a function within another function (see
example) but I am getting an error message (f()values at end points not of
opposite sign). I was wondering if you would be able to advise how redefine
my function so that I can find the solution. In short my first function
calculates the intergrale which is function of "t" , I need to find the
uniroot of
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
2007 Sep 10
2
Are the error messages of ConstrOptim() consisten with each other?
Dear Friends.
I found something very puzzling with constOptim(). When I change the
parameters for ConstrOptim, the error messages do not seem to be
consistent with each other:
> constrOptim(c(0.5,0.3,0.5), f=fit.error, gr=fit.error.grr, ui=ui,ci=ci)
Error in constrOptim(c(0.5, 0.3, 0.5), f = fit.error, gr = fit.error.grr, :
initial value not feasible
> constrOptim(c(0.5,0.9,0.5),
2013 Mar 11
1
Implementation of the PL2 weighting scheme of the DFR Framework
Hello guys.I am working on implementing the PL2 weighting scheme of the DFR
framework by Gianni Amati.
It uses the Poisson approximation of the Binomial as the probabilistic
model (P), the Laplace law of succession to calculate the after effect of
sampling or the risk gain (L) and within document frequency normalization
H2(2) (as proposed by Amati in his PHD thesis).
The formula for w(t,d) in
2005 Sep 26
2
nls and na/Nan/Inf error
I am trying to it a particular nonlinear model common in Soil Science to
moisture release data from soil. I have written the function as shown
below according to the logist example in Ch8 of Pinheiro & Bates. I am
getting the following error (R version 2.1.1)
*Error in qr(attr(rhs, "gradient")) : NA/NaN/Inf in foreign function
call (arg 1)*
Below is the function and data.
/#
2009 Sep 23
1
Maximum Likelihood Est. regarding the degree of freedom of a multivariate skew-t copula
Hello,
I have a bigger problem in calculating the Maximum Likelihood Estimator regarding the degree of freedom of a multivariate skew-t copula.
First of all I would like to describe what this is all about, so that you can understand my problem:
I have 2 time series with more than 3000 entries each. I would like to calculate a multivariate skew-t Copula that fits this time series.
Notice:
2006 Mar 30
1
warning message in hand-made function
Dear Rusers,
I tried to implement a function comparing mean scores between one
subject (the patient) and a group a control subjects. The function
returns attended results, but I also obtained the following warning :
Warning message:
the condition has length > 1 and only the first element will be used
in: if (substr(fp, 1, 1) == "<") fp else paste("=", fp)
Maybe
2009 Jul 30
1
lmer() and "$ operator is invalid for atomic vectors"
Hi all,
I am a bit mystified by this error message that I get when I try to apply
lmer() to a simple dataset with one between factor (age) and one within
factor (item): "$ operator is invalid for atomic vectors"
I'll just provide the code, because I don't see where the problem is:
library(lme4)
options(contrasts=c("contr.helmert","contr.poly"))
data =
2010 Mar 01
1
integration function
Hi all,
I have some problem regarding the integration function. Can any one
take a look at the following and give me some help? Thank you in advance!
Hannah
## f0 is a function of r,x, and y
f0 <- function(r, x, y){
pnorm((x-sqrt(r)*y)/sqrt(1-r), mean=0,sd=1, lower.tail=T)^2*dnorm(y)
}
## f1 is the function of r and x after integrating out y
f1 <- function(r,x)
2009 Apr 24
1
the puzzle of eigenvector and eigenvalue
Dear all
I am so glad the R can provide the efficient calculate about
eigenvector and eigenvalue.
However, i have some puzzle about the procedure of eigen.
Fristly, what kind of procedue does the R utilize such that the eigen
are obtained?
For example, A=matrix(c(1,2,4,3),2,2)
we can define the eigenvalue lamda, such as
det | 1-lamda 4 | =0
| 2 3-lamda |
then