Displaying 20 results from an estimated 600 matches similar to: "help about solving two equations"
2017 Jun 12
2
Possible with enableJIT function
In this email to the R-help list: https://stat.ethz.ch/pipermail/r-help/2017-June/447474.html
and in this question on Stackoverflow: https://stackoverflow.com/questions/44486643/nleqslv-memory-use-in-r
Andrew Leach has raised a question about the memory usage of my package nleqslv.
In a model with a loop within a function he has experienced continuously increasing memory usage
by package nleqslv
2011 Apr 23
2
Loop and Solver with Black/Scholes-Formula
Hello,
for my diploma thesis I need to program a solver for Merton?s respectively
Black?s and Scholes? Option pricing formula, which should be achieved for
several dates.
What I want to do is to estimate the value of a firm?s assets "vA" (x[2]
denotes vA) and the option-implied volatility of firm?s assets "sigA" (x[1]
denotes sigA) by solving it simultaneous using the Black
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
I'm solving 4 complex equations simultaneously. Code is below. The code
returns only zero's for the solution though there should also be a non-zero
result. I'm pretty confident that the equations are correct because they
are straight from a published paper and I checked them pretty thoroughly.
The parameter values I used are from the published paper as well. Any
suggestions for how
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
2004 Feb 29
1
digamma with negative arguments (PR#6626)
Full_Name: Chanseok Park
Version: 1.8.1
OS: linux-gnu
Submission from: (NULL) (130.127.112.183)
digamma with any negative value does not give a right answer.
It gives -1.797693e+308 for any negative arguments.
For example, digamma(-1.1) gives -1.797693e+308.
The right answer should be 10.15416
This bug can be easily fixed by using the following digamma identity.
digamma(x) = digamma(1-x) -
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
2017 Aug 09
2
Package nleqslv ERROR
Dear all,
I am relatively new to R and have had some difficulty in understanding an error i get when running a code to solve a system of non-linear equations, with four equations and two variables.
This is my code:
ALPHA <- c(-0.0985168033402, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4)
BETA <- c(-0.0985168033402, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4)
GAMMA <- c(0.3940672148378, 0.1, 0.15,
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)-6*p[1]*p[2]*p[3]*(p[2]+
2010 Nov 21
1
solve nonlinear equation using BBsolve
Hi r-users,
I would like to solve system of nonlinear equation using BBsolve function and
below is my code. I have 4 parameters and I have 4 eqns.
mgf_gammasum <- function(p)
{
t <- rep(NA, length(p))
mn <- 142.36
vr <- 9335.69
sk <- 0.8139635
kur <- 3.252591
rh <- 0.896
# cumulants
k1 <- p[1]*(p[2]+p[3])
k2 <- p[1]*(2*p[2]*p[3]*p[4] +p[2]^2+p[3]^2)
k3 <-
2017 Aug 09
0
Package nleqslv ERROR
Santi,
In the second line of your function you have the following:
f <- numeric(length(x))
This sets the length of this numeric vector (i.e., "f") to the length of the vector "x".
Later, inside the function you assign to values to 4 elements of the vector "f".
This assumes that "f" is at least 4 element in length.
However, you define
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
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
2010 Jan 04
1
polygamma or Hurwitz zeta function
Hi,
Is there any R library that is capable of handling polygamma function
(Hurwitz zeta function also works)? I am aware of digamma(0 and trigamma(),
but could not find more advanced versions.
I'd appreciate any help.
Hakan Demirtas
2007 Oct 14
1
Extending deriv3()
Hello,
I was wondering if the functions deriv3(), deriv() etc. could be extended
to handle psigamma() and its special cases (digamma(), trigamma()
etc.). From the error message it seems that 'psigamma' needs to be
added to the derivatives table.
This might be easy since psigamma() has a deriv argument.
Additionally, this error message is also obtained when requesting for
the Hessian of
2005 Jun 23
2
solving equation system
Hello,
I want to solve some two dimensional equation system with R. Some systems
are not solvable analytically.
Here is an example:
(I) 1/n*sum{from_i=1_to_n}(Xi) = ln lambda + digamma(c)
(II) mean(X) = x / lambda
I want to find lambda and c,
which R-function could do that task?
Carsten
[[alternative HTML version deleted]]
2009 Jun 03
2
problem with uniroot
Hi R-users,I'm trying to solve a non linear equation, to find the degrees of
freedom of a mixture of t student. I'm sure i wrote the minimization
equation in the right way, but when i try to run the EM algorithm to
estimate the parameters of the mixture, the following error will appear:
Error in uniroot(function(z) log(z/2) - digamma(z/2) + 1 - log((z + d)/2) +
:
f() values at end
2009 May 16
1
maxLik pakage
Hi all;
I recently have been used 'maxLik' function for maximizing G2StNV178 function with gradient function gradlik; for receiving this goal, I write the following program; but I have been seen an error in calling gradient function;
The maxLik function can't enter gradlik function (definition of gradient function); I guess my mistake is in line ******** ,that the vector ‘h’ is
2007 Jul 21
1
Gamma MLE
Hello,
I was asked to try the following code on R,
gamma.mles
function (xx,shape0,rate0)
{
n<- length(xx)
xbar<- mean(xx)
logxbar<- mean(log(xx))
theta<-c(shape0,rate0)
repeat {
theta0<- theta
shape<- theta0[1]
rate<- theta0[2]
S<- n*matrix(c(log(rate)-digamma(shape)+logxbar,shape/rate-xbar),ncol=1)
I<- n*matrix(c(trigamma(shape),-1/rate,-1/rate,shape/rate^2),ncol=2)
2010 May 05
1
testInstalledBasic question
Hi,
I'm currently in the process of writing an R-installation SOP for my
company. As part of that process I'm using the recommendations from the 'R
Installation and Administration' document, section 3.2, "Testing an
installation". This is done on an XP machine, using the latest binary of
2.11.0.
The binary is downloaded and then installed from the installer. I then