[Rd] Feature request: wrapper to gsl multiroot

2007-08-09 Thread Manuel Morales
A question that often comes up in the listserv is how to solve a system
of nonlinear equations. Recently, a new wrapper function that interfaces
with the gsl library multimin was added to the gsl package as an
alternative to optim(). Unfortunately, I can't code in C, so this is a
shameless request for anyone that might be interested in writing a
similar wrapper for the multiroot gsl library :-)

Manuel

-- 
http://mutualism.williams.edu

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Bug in coef<-.varIdent method (nlme package) (PR#9831)

2007-08-09 Thread agalecki
This is a multi-part message in MIME format.
--040502080208060001050807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

1. It appears that "coef<-.varIdent" method does not work properly in 
some instances.
Execution error:

Error in `coef<-.varIdent`(`*tmp*`, value = c(11, 12)) :
Cannot change the length of the varIdent parameter after 
initialization


occurs when  "coef<-.varIdent" is applied to an initialized object of 
class varIdent  with some of the coefficients  being _fixed_.
Attached files: 'varIdentOrthoEmail.txt'  and 'varIdentOrthoEmail.Rout' 
illustrate the problem.

2. The code for  "coef<-.varIdentX" method in  
'varIdentmethodsRevised.txt' file  illustrates how to fix this problem.

3. Specifically, to fix the problem the line

   if (length(value) != nGroups  - 1)  

   in  the "coef<-.varIdent" method should be replaced
   with the following two lines :

nFixed  <- sum(as.numeric(attr(object,"whichFix")))  # inserted 
new line
if (length(value) != nGroups - nFixed - 1) {   # 
modified original line

4. Note: Although I am using lme "3.1-80", the  related problem PR#9765 
is fixed manually by over-writing varIdent function.

Thank you

Andrzej Galecki



--040502080208060001050807
Content-Type: text/plain;
 name="varIdentXOrthoEmail.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="varIdentXOrthoEmail.txt"



ls() 
require(nlme)
sessionInfo()


## New class varIdentX and methods defined.
### coef<-.varIdentX illustrates how to fix a bug in coef<-.varIdent
# Note: PR#9765 fixed in varIdent() and varIdentX() 
source("C:/temp/varIdentmethodsRevised.txt")
ls()



 Chunk 1: Everything is OK here
# value= and fixed= arguments
# variance component at age=12 is fixed

val <- c("10"=1.10,"14"=1.14)
vf <- varIdent(value=val, form=~1|age, fixed=c("12"=1.12))
vfi <- Initialize(vf,Orthodont)
str(vfi)
coef(vfi)
coef(vfi, unconstrained = FALSE, allCoef = TRUE)  
vfiCopy <- vfi# copy of an initialized object

 Chunk 2: Bug in coef<-.varIdent illustrated

length(vfiCopy) # length is 2
coef(vfiCopy) <- c(11,12)   # Execution error
# Error in `coef<-.varIdent`(`*tmp*`, value = c(11, 12)) : 
#Cannot change the length of the varIdent parameter after initialization

 Chunk 3: Consequently the same execution error in gls

gls.error  <- gls(distance ~ age, 
weights  = vfi,
data=Orthodont)

#Error in `coef<-.varIdent`(`*tmp*`, value = c(0.095310179804325, 
0.131028262406404 : 
# Cannot change the length of the varIdent parameter after 
initialization


### Chunk 1A: 
  
val <- c("10"=1.10,"14"=1.14)
vf <- varIdentX(value=val, form=~1|age, fixed=c("12"=1.12))
vfi <- Initialize(vf,Orthodont)
str(vfi)  # Note: class varIdentX
coef(vfi)
coef(vfi, unconstrained = FALSE, allCoef = TRUE)  
vfiCopy <- vfi# copy of an initialized object

 Chunk 2A: Bug in coef<-.varIdent  *** corrected ***

length(vfiCopy) # length is 2
coef(vfiCopy) <- c(11,12)   # NO Execution error

 Chunk 3A: No execution error in gls

gls.noerror  <- gls(distance ~ age, 
weights  = vfi,
data=Orthodont)



--040502080208060001050807
Content-Type: text/plain;
 name="varIdentXOrthoEmail.Rout"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="varIdentXOrthoEmail.Rout"

> ls() 
character(0)
> require(nlme)
Loading required package: nlme
[1] TRUE
> sessionInfo()
R version 2.5.0 (2007-04-23) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "stats" "graphics"  "grDevices" "utils" "datasets"  "methods"  
[7] "base" 

other attached packages:
nlme 
"3.1-80" 
> 
> 
> ## New class varIdentX and methods defined.
> ### coef<-.varIdentX illustrates how to fix a bug in coef<-.varIdent
> # Note: PR#9765 fixed in varIdent() and varIdentX() 
> source("C:/temp/varIdentmethodsRevised.txt")
> ls()
[1] "coef.varIdentX"   "coef<-.varIdentX" "Initialize.varIdentX"
[4] "varIdent" "varIdentX"   
> 
> 
> 
>  Chunk 1: Everything is OK here
> # value= and fixed= arguments
> # variance component at age=12 is fixed
> 
> val <- c("10"=1.10,"14"=1.14)
> vf <- varIdent(value=val, form=~1|age, fixed=c("12"=1.12))
> vfi <- Initialize(vf,Orthodont)
> str(vfi)
Classes 'varIdent', 'varFunc'  atomic [1:2] 0.0953 0.1310
  ..- attr(*, "groupNames")= chr [1:4] "8" "10" "14" "12"
  ..- attr(*, "fixed")= Named num 0.113
  .. ..- attr(*, "names")= chr "12"
  ..- attr(*, "formula")=Class 'formula' length 2 ~1 | age
  .. .. ..- attr(*, ".Environment")= 
  ..- attr(*, "groups")= chr [1:108] "8" "10" "12" "14" ...
  ..- attr(*, "whichFix")= logi [1:3] FALSE FALSE

[Rd] errors in loading packages (PR#9839)

2007-08-09 Thread peterwickham
Full_Name: Peter Wickham
Version: 2.4.1
OS: Mac 10.4.10
Submission from: (NULL) (209.59.87.136)


Attempted to load "gdata" and "gregmisc" packages after using installing via
Package Installer in R. Both load attempts resulted in the following message:
"Error in loadNamespace(i[[1]], c(lib.loc, .libPaths())) :  there is no package
called 'gtools'". There is no mention of failure in the Mac OSX check summary
for packages. Another package "waveslim" installed and loaded properly (apart
from the R topic "AR1").
I might also mention that I am still using R 2.4.1 tather than R 2.5.1 as I
received warning messages in red
 R[244] and R[451] "tossing reply message sequence 1 on" when downloading the
latest version of R.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] errors in loading packages (PR#9839)

2007-08-09 Thread Ken Beath
On 10/08/2007, at 5:14 AM, [EMAIL PROTECTED] wrote:

> Full_Name: Peter Wickham
> Version: 2.4.1
> OS: Mac 10.4.10
> Submission from: (NULL) (209.59.87.136)
>
>
> Attempted to load "gdata" and "gregmisc" packages after using  
> installing via
> Package Installer in R. Both load attempts resulted in the  
> following message:
> "Error in loadNamespace(i[[1]], c(lib.loc, .libPaths())) :  there  
> is no package
> called 'gtools'". There is no mention of failure in the Mac OSX  
> check summary
> for packages. Another package "waveslim" installed and loaded  
> properly (apart
> from the R topic "AR1").

Either use the installer to download gtools etc or check the Install  
Dependencies box and they will all be automatically downloaded.

> I might also mention that I am still using R 2.4.1 tather than R  
> 2.5.1 as I
> received warning messages in red
>  R[244] and R[451] "tossing reply message sequence 1 on" when  
> downloading the
> latest version of R.
>
>

This isn't a problem, it still works, there might be a development  
version where it is fixed. For Mac related problems there is a  
special list at https://stat.ethz.ch/mailman/listinfo/r-sig-mac Check  
the archives for discussion of this problem.

Ken

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel