Displaying 20 results from an estimated 100 matches similar to: "Newton method"
2010 Jan 26
1
newton method for single nonlinear equation
Hi r-users,
I would like to solve for z values using newton iteration method. I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn. There seem to be some output but what I expected is a vector of z values. Thank you so much for any help given.
newton.inputsingle <- function(pars,n)
{ runi <- runif(974, min=0, max=1)
2010 Feb 10
1
looping problem
Hi R-users,
I have this code here:
library(numDeriv)
fprime <- function(z)
{ alp <- 2.0165;
rho <- 0.868;
# simplified expressions
a <- alp-0.5
c1 <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)
c2 <- sqrt(rho)/(1-rho)
t1 <- exp(-z/(1-rho))
t2 <- (z/(2*c2))^a
bes1 <- besselI(z*c2,a)
t1bes1 <- t1*bes1
c1*t1bes1*t2
}
## Newton
2010 Feb 09
0
For and while in looping
I would like to solve a nonlinear eqn using newton method and here is the code:
library(numDeriv)
fprime <- function(z)
{ alp <- 2.0165;
rho <- 0.868;
# simplified expressions
a <- alp-0.5
c1 <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)
c2 <- sqrt(rho)/(1-rho)
t1 <- exp(-z/(1-rho))
t2 <- (z/(2*c2))^a
bes1 <- besselI(z*c2,a)
2010 Feb 15
1
error message error
Hi r-users,
I hope somebody can help me to understand the error message. Here is my code;
## Newton iteration
newton_gam <- function(z)
{ n <- length(z)
r <- runif(n)
tol <- 1E-6
cdf <- vector(length=n, mode="numeric")
fprime <- vector(length=n, mode="numeric")
f <- vector(length=n, mode="numeric")
for (i in 1:1000)
{
2010 Feb 09
1
how to adjust the output
Hi R-users,
I have this code below and I understand the error message but do not know how to correct it. My question is how do I get rid of “with absolute error < 7.5e-06” attach to value of cdf so that I can carry out the calculation.
integrand <- function(z)
{ alp <- 2.0165
rho <- 0.868
# simplified expressions
a <- alp-0.5
c1 <-
2004 Feb 10
1
generate random sample from ZINB
I want to generate 1,000 random samples of sample size=1,000 from ZINB.
I know there is a rnegbin() to generate random samples from NB, and I know
I can use
the following process:
do i=1 to 1000
n=0
do i=1 to 1000
if runi(1)>0.1 then x(i) = 0; else
x(i)=rnegbin();
n=n+1;
if n>1000 then stop;
end;
output;
end;
Anybody can help me out with the R code?
Thanks very much ahead of time.
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All.
I'd like to generate a sample of n observations from a k dimensional
multivariate normal distribution with a random correlation matrix.
My solution:
The lower (or upper) triangle of the correlation matrix has
n.tri=(d/2)(d+1)-d entries.
Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99)
Populate a triangle of the matrix with the sampled correlations
Mirror the
2010 Jun 21
0
Re ZINB by Newton Raphson??
Dear Mr.Zeileis & all.
(1) Thx for your reply. Yes, I am talk about the function zeroinfl() from the package "pscl". I want to use Newton Raphson to get parameter estimation ZINB, so I try this:
----------------------------------------------------------------------------------------------------------------------------------
> zinb <- zeroinfl(y
2002 Apr 24
1
Newton-Raphson
Hi,
Is there a routine available in R for the Newton-Raphson method for
simulataneous equations in several unknowns?
Thanks
Robert
--
Robert J. Chandran
Department of Botany
3506 Miller Plant Sciences Building
University of Georgia
Athens, GA 30602
Phone: (706)-583-0943
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2010 Jun 21
1
ZINB by Newton Raphson??
Dear all..
I have a respon variable y. Predictor variable are x1, x2, x3, x4, x5
(1) What is the syntax to get paramater estimation of ZINB Model by Newton Raphson (not BFGS)
(2) What syntax to plot probability of observed & predicted of ZINB
Thx.
Regards
Krist.
[[alternative HTML version deleted]]
2004 Aug 26
1
gls: Newton-Raphson or EM?
Hello,
Does anyone know whether the gls function in the nlme library uses the Newton-Raphson or EM algorithm to find the restricted log-likelihood or maximum log-likelihood estimates?
Brendan Klick
bklick@jhsph.edu
[[alternative HTML version deleted]]
2012 May 25
0
Digium's new Community Support Manager - Rusty Newton
We'd like you all to help us welcome Rusty Newton to Digium's Asterisk
development and community support team! Rusty has been with Digium for
over five years, starting in the Technical Support department and then
moving to a sales position where he assisted customers with Asterisk and
Switchvox solutions to their business needs. Prior to joining Digium he
spent more than five years in the
2004 Nov 19
2
glm with Newton Raphson
Hi,
Does anyone know if there is a function to find the maximum likelihood
estimates of glm using Newton Raphson metodology instead of using IWLS.
Thanks
Valeska Andreozzi
--------------------------------------------------------
Department of Epidemiology and Quantitative Methods
FIOCRUZ - National School of Public Health
Tel: (55) 21 2598 2872
Rio de Janeiro - Brazil
2011 Jun 02
1
newton raphson
Hi
I would like to use the newton raphson method to find the root if the
equation x^3-0.165*x+0.0003993 without using any readliy available program
in r but instead by writing my own code and loop. the problem is that i
really cant understand how to write the loop so that it keeps using the last
calcualted values. if anyone could help me or give me some tips i would
deeply appriciate it
thanks
2011 Jul 12
1
LOESS function Newton optimization
I have a question about running an optimization function on an existing LOESS
function defined in R. I have a very large dataset (1 million observations)
and have run a LOESS regression. Now, I want to run a Newton-Raphson
optimization to determine the point at which the slope change is the
greatest.
I am relatively new to R and have tried several permutations of the maxNR
and nlm functions with
2005 Nov 16
2
Newton-Raphson
Dear all,
I want to solve a score function by using Newton-Raphson algorithm. Is there such a fucntion in R? I know there's one called optim, but it seems only doing minimizing or maximizing.
Thanks,
Jimmy
2010 Dec 07
0
R programing help-newton iterations for the square root
From: jypuppy36@hotmail.com
To: r-help-bounces@r-project.org
Subject: R programing help-newton iterations for the square root
Date: Tue, 7 Dec 2010 12:00:01 -0800
NEWTON ITERATIONS FOR THE SQUARE ROOT
Newton iterations to find the root of a real valued function f , i.e. a number x for which f (x) = 0, are of the form
Example. To find the square root of a positive number y we can use
2007 Oct 27
1
Newton method iteration problem
Hi all,
I am coding for finding the root of f(x)= phi(x) -alpha where phi(x) is the
cumulative density function and alpha is constant . The problem right now is
I can't get the "initialX" representing the root out of the while loop when
ending , it seems to me it disappear when the loop ends accroding to the
error message. I need help . Please suggest the cause or solution to this
2006 May 24
1
general Gauss-Newton or support for NSUR: contemporaneously correlated non-linear models
Dear r-Help readers,
1) Is there support for NSUR in some R package yet?
2) Is there a general function of applying the Gauss-Newton or Marquard
method, in which the function of calculating the partial derivatives can
be specified by the user?
Contemporaneously correlated non-linear models (NSUR) is a method to fit
a system of non-linear equations.
I want to use to fit several non-linear
2011 Aug 10
3
Need help on Newton-Raphson optimization
Hi,
Is there available package on the optimization function using
Newton-Raphson method (iterative quadratic approximation)? I have been using
the 'optim' function in R and found it really unstable (it depends heavily
on the initial values and functional forms). If I have to code it by myself,
can I get some advice on how to start (any good reference or sample code)? I
really