Displaying 20 results from an estimated 1000 matches similar to: "Extending deriv3()"
2007 Jul 30
2
deriv, loop
Hi, 2 questions:
Question 1: example of what I currently do:
for(i in 1:6){sink("temp.txt",append=TRUE)
dput(i+0)
sink()}
x=scan(file="temp.txt")
print(prod(x))
file.remove("C:/R-2.5.0/temp.txt")
But how to convert the output of the loop to a vector that I can manipulate
(by prod or sum etc), without having to write and append to a file?
Question 2:
>
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
2004 Mar 24
1
Question on deriv3()
Hello:
Why is deriv3() functioning differently in R from that in Splus
using library(MASS) ? For example
deriv3(~(t1*log(t2)+lgamma(t1)+(1-t1)*log(y)+y/t2),c("t1","t2"),function(y,t1,t2)NULL)
complains of lgamma.
Mervyn
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
2006 Oct 30
1
psigamma derivative
Hello,
I am trying to find a hessian matrix that
involves log(gamma(1/p)) second derivative, p being one of the parameters
of the function. I am using a function "deriv" with the hessian=TRUE
option, but psigamma is not on the list of derivative functions.
I know that it is possible to use 'psigamma(p,deriv)', but it doesn't work
with 1/p. Does anybody can help with this?
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) -
2002 Mar 11
1
problem with deriv3?
Using S+ 6 for Linux and
R 1.4.1
Taking verbatim some lines from S-Plus that work
perfectly, and running them on R, I get an
unexpected error message:
R : Copyright 2002, The R Development Core Team
Version 1.4.1 (2002-01-30)
> library(MASS)
> data <- read.table("/usr/local/data/mcmanus.dat",header=T)
> mcmanus.frm <-
2001 May 06
1
deriv3 example on Venables/Ripley page 263
What does it require to run the example on page 263
of Venables/Ripley book using R 1.3.0?
I got the following error and I have no clue how to correct it.
Thank you very much. (If you reply to the list, please send a
copy to me.)
> lmix2 <- deriv3(
+ ~ -log(p*dnorm((x-u1)/s1)/s1 + (1-p)*dnorm((x-u2)/s2)/s2),
+ c("p", "u1", "s1", "u2",
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)
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:
>
2004 Apr 12
1
R 1.9.0 is release
I've rolled up R-1.9.0.tgz a short while ago. This is a new version
with a number of new features, most notably a substantial
reorganization of the standard packages, a major update of the grid
package, and the fact that underscore can now be used as a regular
character in variable names. See below for further changes.
Because of the disturbances at the machine that hosted the CVS
archives,
2004 Apr 12
1
R 1.9.0 is release
I've rolled up R-1.9.0.tgz a short while ago. This is a new version
with a number of new features, most notably a substantial
reorganization of the standard packages, a major update of the grid
package, and the fact that underscore can now be used as a regular
character in variable names. See below for further changes.
Because of the disturbances at the machine that hosted the CVS
archives,
2009 Nov 20
1
Bessel function with large index value
I am looking for a method of dealing with the modified Bessel function
K_\nu(x) for large \nu.
The besselK function implementation of this allows for dealing with
large values of x by allowing for exponential scaling, but there is no
facility for dealing with large \nu.
What would work for me would be an lbesselK function in the manner of
lgamma which returned the log of K_\nu(x) for large
2009 Mar 23
4
newton method
Hi R-users,
Does R has a topic on newton's method?
Thank you for the info.
2017 Feb 17
4
Wish List: Extensions to the derivatives table
The derivative table resides in the function D. In S+ that table is extensible because it is written in the S language. R is faster but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p,
2007 Oct 26
5
help
hello,
please can anyone help me out. Am a new user of R
program. Am having problem
with this code below, not getting the expected
results.
1. Each m, the cumulative sum should be 1.000 but the
2nd and 3rd m returned 2.000 and 3.000
instead of 1.000.
2. to get the LCL(m) and UCL(m) for each m base on
these instructions
if out.cum > 0.025 then LCL(m)= y-1
if out.cum >0.975
2007 Oct 29
2
help please
hello,
please can anyone help me out. Am a new user of R
program. Am having problem
with this code below, not getting the expected
results.
Each m, the cumulative sum should be 1.000 but the
2nd and 3rd m returned 2.000 and 3.000
instead of 1.000.
thanks
Aruike
pp=function(x,n,M){z=1.0;a=2.3071430;b=7.266064;H=3
out.h=c()
out.y=c()
out.m=c()
out.prob=c()
2011 Aug 17
1
multinomRob - error message
Hi,
I would like to use the multinomRob function to test election results.
However, depending on which independent variables I include and how
many categories I have in the dependent variable, the model cannot be
estimated.
My data look like this (there are 68 observations):
> head(database)
RESTE09 GAUCHE09 PDC09 PLR09 UDC09 MCG09 RESTE05 GAUCHE05 PDC05
D1 1455
2006 Jul 22
1
ifelse command
Dear:
I try to revise the maximum likelihood function below using something constrains. But it seems something wrong with it. Becasue R would not allow me to edit the function like this. It is very appreciate if you can help.
function (parameters,y,x1,x2)
{
p<-parameters[1]
alpha1<-parameters[2]
beta1<-parameters[3)]
delta1<-parameters[4]
alpha2<-parameters[5]
2005 Jul 03
2
over/under flow
I am porting some FORTRAN to R in which an Inf triggers an if(). The
trigger is infinite on exp(lgamma(OVER)). What is the canonical R
style of determining OVER when exp(OVER)== Inf? The code structure
that I am
porting is best left intact--so I need to query R somehow to the value
of OVER that causes exp(lgamma(OVER)) to equal Inf.
On my system,
exp(lgamma(171)) is about first to equal Inf.