Displaying 20 results from an estimated 300 matches similar to: "looping problem"
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 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 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 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 <-
2010 Jan 26
1
Newton method
Hi r-users,
I hope somebody can help me with this code.
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 <-
2007 Sep 22
0
error messages
Hi,
I have a density that I need to get MLEs from, which includes definite integrals both in the denominator and in the numerator of the density function. It looks like the outcome depends on the initial values given. My program is shown below:
library(circular)
########################################
4 parameters
########################################
z<-rvonmises(100,0,1)
2003 Aug 20
2
Method of L-BFGS-B of optim evaluate function outside of box constraints
Hi, R guys:
I'm using L-BFGS-B method of optim for minimization problem. My function
called besselI function which need non-negative parameter and the besselI
will overflow if the parameter is too large. So I set the constraint box
which is reasonable for my problem. But the point outside the box was
test, and I got error. My program and the error follows. This program
depends on CircStats
2007 Jun 18
1
two bessel function bugs for nu<0
#bug 1: besselI() for nu<0 and expon.scaled=TRUE
#tested with R-devel (2007-06-17 r41981)
x <- 2.3
nu <- -0.4
print(paste(besselI(x, nu, TRUE), "=", exp(-x)*besselI(x, nu, FALSE)))
#fix:
#$ diff bessel_i_old.c bessel_i_new.c
#57c57
#< bessel_k(x, -alpha, expo) * ((ize == 1)? 2. : 2.*exp(-x))/M_PI
#---
#> bessel_k(x, -alpha, expo) * ((ize == 1)? 2. :
2001 Jan 12
1
strange loss of accuracies under Win NT
Dear All,
It's been several times I observed a very strange behaviour with R 1.2.0
under Windows NT 4.0 (with sp5): accuracies are lost in many cases. Things
are back to normal when I exit R and restart it. Here is an example of my
last encounter with this:
> bt1 <- c(7.3, 8.1, 8.4, 7, 6, 7.2, 6.7, 8.3, 9, 7.4, 8.6, 6.2, 6.9, 7.6,
5.3, 5.6)
> bt1
[1] 7 8 8 7 6 7 6 8 9 7 8 6 6 7 5 5
2008 Mar 18
6
Call signalling on BT FeatureLine Compact (Sangoma A200)
Hi,
I have a TrixBox install with a Sangoma A200 and 4 FXO ports, there
are 3 BT lines connected directly to these ports.
One of the lines has BT FeatureLine Compact and this is the line I am
having problems with, the other 2 lines are working perfectly,
detecting CID, answering incoming calls and placing external calls via
SIP devices.
I am receiving a error log entry:
chan_zap.c:
2009 Jun 03
2
code for double sum
Hi R-users,
I wrote a code to evaluate double sum as follows:
ff2 <- function(bb,eta,z,k)
{ r <- length(z)
for (i in 1:r)
{ sm1 <- sum((z[i]*bb/2)*(psigamma((0:k)+eta+1,deriv=0)/(factorial(0:k)*gamma((0:k)+eta+1))))
sm2 <- sum((besselI(z[i]*bb,eta)*log(z[i]*bb/2) - sm1)/besselI(z[i]*bb,eta))
sm2
}
ff2(bb,eta,z,10)
but it gave me the following message:
>
2010 Jun 15
1
Error in nlm : non-finite value supplied by 'nlm'
Hello,
I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]).
So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter.
My function is the negative loglikelihood derived from a mixing operator.
f=function(vector)
2007 Sep 11
1
Fitting Data to a Noncentral Chi-Squared Distribution using MLE
Hi, I have written out the log-likelihood function to fit some data I have (called ONES20) to the non-central chi-squared distribution.
>library(stats4)
>ll<-function(lambda,k){x<-ONES20; 25573*0.5*lambda-25573*log(2)-sum(-x/2)-log((x/lambda)^(0.25*k-0.5))-log(besselI(sqrt(lambda*x),0.5*k-1,expon.scaled=FALSE))}
> est<-mle(minuslog=ll,start=list(lambda=0.05,k=0.006))
2010 Jun 15
0
nlm is
Hello,
I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]).
So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter.
My function is the negative loglikelihood derived from a mixing operator.
f=function(vector)
2006 Jan 14
1
(no subject)
I am having difficulty installing the package "lattice".
First I tried downloading it from the CRAN site (in the normal way) :
the message said it worked but when I typed library I got an error
message ("there is no package").
Second I tried installing it from the local zip. I have reproduced the
result below.
utils:::menuInstallLocal()
package 'lattice'
2009 Oct 30
1
Quarterly data in PLM package
Dear all,
Does anyone know if the PLM package (to run Panel Data Analysis) accepts quarterly data?
The package vignette and documentation only use annual data -and the only time index available seems to work for years.
José
Mr José Luis Iparraguirre
Senior Research Economist
Economic Research Institute of Northern Ireland
2 -14 East Bridge Street
Belfast BT1 3NQ
Northern
2013 Feb 15
10
reading data
Hi,
#working directory data1 #changed name data to data1.? Added some files in each of sub directories a1, a2, etc.
?indx1<- indx[indx!=""]
lapply(indx1,function(x) list.files(x))
#[[1]]
#[1] "a1.txt"??????? "mmmmm11kk.txt"
#[[2]]
#[1] "a2.txt"??????? "mmmmm11kk.txt"
#[[3]]
#[1] "a3.txt"??????? "mmmmm11kk.txt"
#[[4]]
#[1]
2009 Oct 15
2
Dovecot 1.2.6 segfault in imap_fetch_begin
We recently upgraded from Dovecot 1.2.4 to 1.2.6 (with the sieve patches
of course). Everything has been running quite well since the upgrade.
The occasional issue with assert-crashing when expunging has gone away.
However, one of our users seems to have triggered a new issue. She's
been the only one to see it, but whenever she logs in, her imap process
segfaults immediately. It appears that
2004 Dec 14
1
increase thr range in R
Hello Everybody in order to get some needed results out of my function i
need to get my besselI function evaluated at some values which normally gave
Inf or 0 (expon.scaled NAN) back. So I would like to increase the range in R
from approxamittly 1e+320 to aabout 1e+500 or something like that. Is there
any possibility or pacckage to do this easily?
Thank You
Sebastian Kaiser
Institut for Statistics
2008 Jul 18
5
Reading SPSS .por files
Does anyone know how to read SPSS .por (ie Portable) files? The foreign package only deals with SPSS .sav files and not with those with a "por" extension.
Thanks,
José
Mr José Luis Iparraguirre D'Elia
Senior Research Economist
Economic Research Institute of Northern Ireland
Floral Buildings
2 - 14 East Bridge Street
Belfast BT1 3NQ
Northern Ireland
United Kingdom