[R] uniroot

Berend Hasselman bhh at xs4all.nl
Fri Feb 4 17:01:46 CET 2011



dpender wrote:
> 
> Hi,
> 
> I am using the uniroot function in order to carry out a bivariate Monte
> Carlo simulation using the logistics model.
> 
> I have defined the function as:
> 
> BV.FV <- function(x,y,a,A)
> (((x^(-a^-1)+y^(-a^-1))^(a-1))*(y^(a-1/a))*(exp(-((1^(-a^-1)+y^(-a^-1))^a)+y^-1)))-A
> 
> and the procedure is as follows:
> 
> Randomly generate values of A~(0,1), y0 = -(lnA)^-1
> 
> Where: A=Pr{X<xi|Y=yi-1} and a is the dependency between X and y (0.703)
> 
> Use y0 to determine x where x = x(i) and y = y0(i-1) in the above
> equation.
> 
> Unfortunately when the randomly defined A gets to approximately 0.46 the
> intervals I provide no longer have the opposite signs (both -ve).
> 

Try

curve(BV.FV(x,y=y0,a=.703,A=.7),from=1,to=10)

for different values of a, A and y0.
I have a feeling that your function or something else is not quite correct.

Berend
-- 
View this message in context: http://r.789695.n4.nabble.com/uniroot-tp3260090p3260438.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list