search for: dfsane

Displaying 14 results from an estimated 14 matches for "dfsane".

Did you mean: dfsan
2011 Mar 31
0
dfsane arguments
.... The output is used as parameter values in the functions I need to solve. The second part is to solve 2 equations in 2 unknowns. This does not work. I get the error message "unexpected end of input". So what inputs am I missing here? As I understand it the arguments I have excluded from dfsane(), such as control, are set to default? parameters <- c(K_vv = 0.0047, K_rv = -0.0268, K_rr = 0.3384, theta_v = 107.4039, theta_r = 5.68, Sigma_rv= 0.0436, Sigma_rr=...
2011 Apr 23
2
Loop and Solver with Black/Scholes-Formula
...T)) - exp(-R*T) * D * pnorm(log (x[1]/D) + (R - ( (x[1]^2) / 2) ) * T ) / ( x[2] * sqrt(T))) - vE + + f[2] <- ((x[1] * exp(-T) * pnorm(log (x[1]/D) + (R + ( (x[1]^2) / 2) ) * T ) / ( x[2] * sqrt(T)) * x[2]) / vE) - sigE + + f + } + + p0 <- c( vE + D, sigE * (vE / (vE + D)) ) + + ans <- dfsane(par=p0, fn=BS) + + print(as.matrix(ans$par)) + + } The problem is, that the results I get aren?t really plausible. The next thing is, that I need the relevant Values of Output (ans$par, which includes two values - x[1]=vA and x[2]=sigA - per date) as matrix. This Matrix should look like this:...
2010 Apr 29
1
BB package
Hi I would like to solve a system of nonlinear equations below using dfsane function   mn <- 142.36; vr <- 9335.69 ; sk <- 0.81;  kur <- 0.25 test_fn <- function(p) {    f <- rep(NA, length(p))     f[1] <- p[1]*(p [2]+p[3])- mn   f[2] <- - vr + 2*p[1]*p[2]*p[3]*(p[4]-1)+p[1]*(p[2]+p[3])^2   f[3] <- - sk + (p[1]*(p [2]+p[3])^3*(p[1]+1)*(p[1]+2)...
2010 Mar 11
4
help about solving two equations
I have two matrix s1 and s2, each of them is 1000*1. and I have two equations: digamma(p)-digamma(p+q)=s1, digamma(q)-digamma(p+q)=s2, and I want to sovle these two equations to get the value of x and y, which are also two 1000*1 matrices. I write a program like this: f <- function(x) { p<- x[1]; q <- x[2]; ((digamma(p)-digamma(p+q)-s1[2,]) )^2 +((digamma(q)-digamma(p+q)-s2[2,]) )^2
2010 Nov 21
1
solve nonlinear equation using BBsolve
...3*p[2]*p[3]*p[4]) k4 <- 6*p[1]*((p[2]+p[3])^2*(p[2]^2 + p[3]^2 - 2*p[2]*p[3] + 4*p[2]*p[3]*p[4])+ 2*p[2]^2*p[3]^2*(1-p[4])^2) t[1] <- k1 - mn t[2] <- k2 - vr t[3] <- k3/(k2^1.5) - sk t[4] <- k4/(k2^2)   - kur t } I tried this p0 <- rep(0, 4) BBsolve(par = p0, fn = mgf_gammasum) dfsane(par = p0, fn = mgf_gammasum, control = list(trace = FALSE)) sane(par = p0, fn = mgf_gammasum, control = list(trace = FALSE)) and got the error message: > BBsolve(par = p0, fn = mgf_gammasum) Error in optim(par = par, fn = U, method = "Nelder-Mead", control = list(maxit = 100),  :...
2009 Mar 23
4
newton method
Hi R-users, Does R has a topic on newton's method? Thank you for the info.
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
2008 Apr 25
5
Non-linear system of equations
Hello R users, I am trying to estimate the parameters of a bimodal normal distribution using moments matching, so I have to solve a non-linear system of equations. How can I solve the following simple example? x^2 - y^2 = 6 x ? y = 3 I heard about nlsystemfit, but I don?t know how to run it exactly. I have tried the following code, but it doesn?t really work: f1 <-y~ x[1]^2-x[2]^2-6 f2
2009 Jul 23
1
Non-negative solutions to complicated equations
...<-x[2] + x3<-x[3] + + F<-rep(NA,3) + F[1]<-(0.075*x3+0,175*x2)*0.065*exp(-0.03*25) + F[2]<-(x2/0.075)*((1/50)/(0.065*0.5.125*0.872214*(1-(x2*(56/25))))-0.175) + F[3]<-(x3/0.175)*((1/70)/(0.065*0.366*0.872214*(1-(x3*(66/35))))-0.075) + return(F) + } > p0<-c(0.1,0.1,0.1) > dfsane(par=p0,fn=f,control=list(maxit=3000)) I have substituted estimated values for all the parameters into the above equations. Thanks -- View this message in context: http://www.nabble.com/Non-negative-solutions-to-complicated-equations-tp24622867p24622867.html Sent from the R help mailing list arch...
2009 Apr 20
1
Two or more dimensional root (Zero) finding
Good morning to all, I should find the zero of a specific function with respect to a vector of arguments. Does it exist something similar in R? Thank you very much, Enrico Foscolo
2009 Mar 16
1
Uniroot and Newton-Raphson Anomaly
I have the following function for which I need to find the root of a: f <- function(R,a,c,q) sum((1 - (1-R)^a)^(1/a)) - c * q To give context for the problem, this is a psychometric issue where R is a vector denoting the percentage of students scoring correct on test item i in class j, c is the proportion correct on the test by student k, and q is the number of items on the test in total. I
2009 Mar 17
3
Non-Linear Optimization - Query
Dear All, I couple of weeks ago, I’ve asked for a package recommendation for nonlinear optimization. In my problem I have a fairly complicated non-linear objective function subject to one non-linear equality constrain. I’ve been suggested to use the *Rdonlp2* package, but I did not get any results after running the program for 5 hrs. Is it normal to run this type of programs for hours? Also,
2009 Mar 25
1
intelligent optimizer (with domain restrictions?)
dear R experts---sorry, second question of the day. I want to match some moments. I am writing my own code---I have exactly as many moment conditions as parameters, and I am leary of having to learn the magic of GMM weighting matrices (if I was to introduce more). the process sounds easy conceptually. (Seen it in seminars many times, so how hard could it possibly be?...me thinks) first
2008 Jun 03
3
How to solve a non-linear system of equations using R
Dear R-list members, I've had a hard time trying to solve a non-linear system (nls) of equations which structure for the equation i, i=1,...,4, is as follows: f_i(d_1,d_2,d_3,d_4)-k_i(l,m,s) = 0 (1) In the expression above, both f_i and k_i are known functions and l, m and s are known constants. I would like to estimate the vector d=(d_1,d_2,d_3,d_4) which is solution