[R] problem downloading Red Hat R-1.7.1-1.i386.rpm

2003-10-01 Thread Sam McClatchie
System info:
Red Hat 9.0
R Version 1.7.0
ESS 5.1.21
Emacs 21.2.1
---
Colleagues

At work I've had to migrate from Mandrake 9.1 to Red Hat 9.0 and I'm 
reinstalling R. I am having a problem downloading from 
R-1.7.1-1.i386.rpm from /bin/linux/redhat/9/i386. Basically the download 
does not complete. I am using mozilla, and when I click on the link the 
screen corrupts with odd symbols. Is there a problem with the site? (I 
don't have any problem downloading the user-contributed packages or the 
R-1.7.1.tgz.

Sam
--
Sam McClatchie, Research scientist (fisheries acoustics))
NIWA (National Institute of Water  Atmospheric Research Ltd)
PO Box 14 901, Kilbirnie, Wellington, New Zealand
[EMAIL PROTECTED]
Research home page http://www.smcc.150m.com/
/\
 xX(
 /// \\\
 
   ///  %)Xx
  /  \\
(((@
  (((% ..xX(?O?)Xx
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] problem downloading Red Hat R-1.7.1-1.i386.rpm

2003-10-01 Thread Peter Dalgaard BSA
Sam McClatchie [EMAIL PROTECTED] writes:

 System info:
 Red Hat 9.0
 R Version 1.7.0
 ESS 5.1.21
 Emacs 21.2.1
 ---
 
 Colleagues
 
 At work I've had to migrate from Mandrake 9.1 to Red Hat 9.0 and I'm
 reinstalling R. I am having a problem downloading from
 R-1.7.1-1.i386.rpm from /bin/linux/redhat/9/i386. Basically the
 download does not complete. I am using mozilla, and when I click on
 the link the screen corrupts with odd symbols. Is there a problem with
 the site? (I don't have any problem downloading the user-contributed
 packages or the R-1.7.1.tgz.
 
 Sam

Mozilla gets confused about the .rpm ending I think. Just use
Shift-Button1 to download, or right-click, save target as...

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] problem downloading Red Hat R-1.7.1-1.i386.rpm

2003-10-01 Thread Arne Henningsen
*right* click the link and then left click Save Target As (or something 
similar.

Arne 

On Wednesday 01 October 2003 08:31, Sam McClatchie wrote:
 System info:
 Red Hat 9.0
 R Version 1.7.0
 ESS 5.1.21
 Emacs 21.2.1
 ---

 Colleagues

 At work I've had to migrate from Mandrake 9.1 to Red Hat 9.0 and I'm
 reinstalling R. I am having a problem downloading from
 R-1.7.1-1.i386.rpm from /bin/linux/redhat/9/i386. Basically the download
 does not complete. I am using mozilla, and when I click on the link the
 screen corrupts with odd symbols. Is there a problem with the site? (I
 don't have any problem downloading the user-contributed packages or the
 R-1.7.1.tgz.

 Sam

-- 
Arne Henningsen
Department of Agricultural Economics
Christian-Albrechts-University Kiel
24098 Kiel, Germany
Tel: +49-431-880-4445
Fax: +49-431-880-1397 
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] installing DBI_0.1-6.tar.gz

2003-10-01 Thread Joke Allemeersch
Dear,

I tried to install the DBI package in R-1.7.1, but this gave the
following error:


/volume1/scratch/jallemee/R/lib/R/bin/INSTALL: line 1:  1856
Done( echo
options(save.image.defaults=${save_image_defaults}); if test
-s R_PROFILE.R; then
cat R_PROFILE.R;
fi; echo invisible(.libPaths(c(\${lib}\, .libPaths(; cat
${R_PACKAGE_DIR}/R/${pkg} )
  1857 Segmentation fault  | ${R_EXE} --slave --save
${save_args}
ERROR: execution of package source for 'DBI' failed

Can somebody help me?  
Thanks a lot,

Kind regards,
Joke.


Joke Allemeersch 
Kasteelpark Arenberg 10 
3001 Heverlee (Leuven) 
http://www.esat.kuleuven.ac.be/~dna/BioI/

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] truncating axis

2003-10-01 Thread Jason Turner
Diego Riano wrote:

Hello

Does anyone know how to truncate and axis in R?

Not sure what you mean, but do to plot arguments xlim and ylim do what 
you want?  See help(par) for these and other plot controls.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] truncating axis

2003-10-01 Thread Ko-Kang Kevin Wang
On 1 Oct 2003, Diego Riano wrote:

 Does anyone know how to truncate and axis in R?

What do you mean by truncate?  Do you mean to change the range of the 
axes?  If so then something like
  plot(x, xlim = range(), ylim = range())
should do (just put the desired range


-- 
Cheers,

Kevin

--
On two occasions, I have been asked [by members of Parliament],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?' I am not able to rightly apprehend the
kind of confusion of ideas that could provoke such a question.

-- Charles Babbage (1791-1871) 
 From Computer Stupidities: http://rinkworks.com/stupid/

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
x88475 (City)
x88480 (Tamaki)

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] FW: error predicting values from the LME

2003-10-01 Thread Andrej Kveder
Thanks for the hint. And it's a general one I intend to use more often.
I managed to sort out the problem proceeding with the simpler models first
and getting to more komplex ones. Even the one I presented in my question
suddenly worked.
However I think I found the problem, but I'm unable to solve it. With the
problematic prediction I used the prespecified model using the as.formula.
This is my exapmle:

# first way
m.gr-as.formula(y ~ v11+v21+v22+v23 | inter)
m.fix-as.formula(y ~ v11+v21+v22+v23+v21:v11+v22:v11+v23:v11)
m.ran-as.formula(~ v11 | inter)
d.n.gr.1-grouped.data(m.gr data=d.n)
m.1-lme(m.fix, random=m.ran, data=d.n.gr.1, na.action=na.omit)
dnNew-subset(d.n,is.na(d.n$y),select=c(v11,v21,v22,v23,inter))
p.1-predict(m.1,dnNew)
# second way
d.n.gr.2-grouped.data(y ~ v11+v21+v22+v23 | inter data=d.n)
m.2-lme(y ~ v11+v21+v22+v23+v21:v11+v22:v11+v23:v11, random=~ v11 | inter,
data=d.n.gr.2, na.action=na.omit)
p.2-predict(m.1,dnNew)

Second way works, while the first way doesn't. I get all the model
specifications from the first one including fitted and residuals, everything
that is derived from the lme object itself. However with the predictions I
get the error.

Error in eval(expr, envir, enclos) : 1 argument passed to $ which requires
2.

I have saved the 3 objects: both models and the test dataset and attached it
to the message in hope to help solve my problem, however my message was
rejected as being to big (the attached file is 80K). If somebody has an idea
how to solve the problem, I can send the data to him/her.

Is there a solution to the problem?

Thanks for the help so far.
I would appreciate any other suggestions.


Andrej



-Original Message-
From: Spencer Graves [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 3:13 PM
To: Andrej Kveder
Cc: R-Help
Subject: Re: [R] FW: error predicting values from the LME


  Could you dumb it down to a toy example with 4 observations for a
model like y ~ 1 | inter, 2 observations for each of 2 levels of
inter?  If that works, then you can play with the example that works
and the example that doesn't;  this is one of the strategies mentioned
in Poly (1971) How to Solve It (Princeton U. Pr.).  With luck, this will
help you figure out what you need to do to get the answers you want.  If
not, it should help you produce a small toy example that doesn't work,
which you can then send us.  Please include a data.frame call, so
someone can copy your example into R and try it in 2 seconds.  That
should increase the chances that you would get a helpful reply.

  Also, have you read Pinhiero and Bates (2000) Mixed-Effect Models
in S and S-Plus (Springer)?  I've found that book to be indispensible
for using lme.

  hope this helps.  spencer graves

Andrej Kveder wrote:

HI all,

I might add some more information in order to possibly solve my problem.
I'm
really stuck and no obvious solutions do the trick.
I'm using R 1.7.1 on Windows 2000 with the packages regurarly updated.
I'm using hypothetical data constructed as a pseudo population conforming
to
a certain Var-Cov structure.
I might add that just



predict(level2)



works. But when I add the new dataset it doesn't. Following a suggestion I
even tried refactoring of the grouping variable (inter) after I created the
subset. It didn't work. I have no other factor variables in the model. I
really have got no clue what could be wrong.

There is a sample from my data:


dnNew


Grouped Data: y ~ v11 + v21 + v22 + v23 | inter
 v11 v21  v22 v23inter
4 5.55186635 5.6620022 24.18033 5.003409 1
13 2.03852426 5.6620022 24.18033 5.003409 1
15 2.19825772 7.5676798 31.03986 4.746891 2
16 4.51368278 7.5676798 31.03986 4.746891 2
18 3.35322702 7.5676798 31.03986 4.746891 2
19 2.46414346 7.5676798 31.03986 4.746891 2
20 2.66670834 7.5676798 31.03986 4.746891 2

and this is the model:


level2


Linear mixed-effects model fit by REML
Data: d.n.gr.2
Log-restricted-likelihood: -533.0011
Fixed: model$fixed
(Intercept) v11 v21 v22 v23 v11:v21
3.205519074 0.298941539 -0.017743958 0.016007280 -0.410760471 0.002700954
v11:v22 v11:v23
-0.003680952 -0.018005717
Random effects:
Formula: ~v11 | inter
Structure: General positive-definite, Log-Cholesky parametrization
StdDev Corr
(Intercept) 0.385620605 (Intr)
v11 0.003147431 -0.048
Residual 0.450012367
Number of Observations: 729
Number of Groups: 50
If this give you some more insight to my problem.

I would reallly appreciate any suggestion.

Thanks

Andrej

-Original Message-
From: Andrej Kveder [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 7:05 PM
To: R-Help
Subject: predicting values from the LME


Dear listers,

I experinced a problem prdicting the values using the LME with multilevel
data.
I have NA's in my dependent variable and the model is fitted only on the
completed cases.
I want to estimate the predicted values for the rest of the data (those
cases with missing dep. variable)
I extracted a 

[R] R-1.7.1 for Redhat 9

2003-10-01 Thread Joke Allemeersch
Dear,

I have problems with installing R-1.7.1 for Redhat 9.  When I applied
`./configure' and `make', I get the following error:

make check
make[1]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
make[2]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
make[3]: Entering directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
make[4]: Entering directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
make[4]: `Makedeps' is up to date.
make[4]: Leaving directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
make[4]: Entering directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1
make[4]: Leaving directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
make[3]: *** [test-Examples-Base] Error 2
make[3]: Leaving directory
`/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
make[2]: *** [test-Examples] Error 2
make[2]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
make[1]: *** [test-all-basics] Error 1
make[1]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
make: *** [check] Error 2


I found on the web that one has to change something in the file
src/main/arithmetic.c, but this was already done in my file, so that
can`t cause the error.  Is there somebody who knows how to solve this?

Thanks a lot,

kind regards, 
Joke


Joke Allemeersch 
Kasteelpark Arenberg 10 
3001 Heverlee (Leuven) 
http://www.esat.kuleuven.ac.be/~dna/BioI/


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Evaluating outer, numeric, variables in an lme object.

2003-10-01 Thread C-G Pettersson
Hello!
I´m working with a dateset from twelve fertilizer experiments (Trial) with 
a block structure of three replicats (Block). The treatment levels consist 
of application method and product but only one intensity. The factor TrCode 
could for example be BC(CAN) for broadcast calcium ammonium nitrate. I´ve 
used the following call to fit a lme-object to the data:

ejna1t4b.lme - lme( Yield ~ TrCode, data = ejna1t4,
+   random = ~ 1 | Trial/Block)
This seems, for me, to work quite well. Or should I code differently?

What I want to do now, is to evaluate the impact from a load of soil and 
weather data where I only have one reading from each Trial/variable. These 
variables are all numeric.

Is this possible in the lme context?
It is naturally possible to calculate treatment means of all Trials and run 
a regression analysis on the new dataset, but I have a feeling there are 
smarter ways of doing this. Or?

Is there anything on this type of problem in MASS or Pinheiro  Bates? So 
far, if I have found the proper texts, I have not understood it... ;-)

Thanks
/CG


CG Pettersson, MSc, PhD-stud
Department of Ecology and Crop Production Science, SLU
P.O. Box 7043
S-750 07 Uppsala, Sweden
Phone: +46 (0)18 67 12 24; Fax: +46 (0)18 67 29 06
   +46 (0)70 330 66 85
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Text cutoff in legends

2003-10-01 Thread Marcel Sutter
Dear r-help

If I display plots on the X11 device, the legends looks fine. But if 
make an EPS, the longer entry in the legend is cutoff (and also in the 
.pdf I do from the .eps)

Can you give me a hint and tell me what I do wrong, please ?

postscript(plot.eps,paper=special,horizontal=F,onefile=F,width=8.0,height=7.0)
dev.set (2)
dev.copy (which=3)
dev.off (3)
R Version 1.6.1  (2002-11-01) on SuSE Linux 8.0

Thank you very much

Marcel

--
Marcel Sutter
PMOD/WRC
Dorfstrasse 33
CH-7260 Davos Dorf
Switzerland
http://www.pmodwrc.ch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R-1.7.1 for Redhat 9

2003-10-01 Thread Liaw, Andy
Tell us the output of something like

  tail -20 /volume1/scratch/jallemee/R-1.7.1/tests/Examples/base-Ex.Rout

so we know where it bombed (and may be how it bombed).

Andy

 -Original Message-
 From: Joke Allemeersch [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 01, 2003 6:02 AM
 To: [EMAIL PROTECTED]
 Subject: [R] R-1.7.1 for Redhat 9
 
 
 Dear,
 
 I have problems with installing R-1.7.1 for Redhat 9.  When I 
 applied `./configure' and `make', I get the following error:
 
 make check
 make[1]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
 make[2]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
 make[3]: Entering directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 make[4]: Entering directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 make[4]: `Makedeps' is up to date.
 make[4]: Leaving directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 make[4]: Entering directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1
 make[4]: Leaving directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 make[3]: *** [test-Examples-Base] Error 2
 make[3]: Leaving directory 
 `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
 make[2]: *** [test-Examples] Error 2
 make[2]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
 make[1]: *** [test-all-basics] Error 1
 make[1]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
 make: *** [check] Error 2
 
 
 I found on the web that one has to change something in the 
 file src/main/arithmetic.c, but this was already done in my 
 file, so that can`t cause the error.  Is there somebody who 
 knows how to solve this?
 
 Thanks a lot,
 
 kind regards, 
 Joke
 
 
 Joke Allemeersch 
 Kasteelpark Arenberg 10 
 3001 Heverlee (Leuven) 
 http://www.esat.kuleuven.ac.be/~dna/BioI/
 
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo /r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Text cutoff in legends

2003-10-01 Thread Jason Turner
Marcel Sutter wrote:

Dear r-help

If I display plots on the X11 device, the legends looks fine. But if 
make an EPS, the longer entry in the legend is cutoff (and also in the 
.pdf I do from the .eps)

Can you give me a hint and tell me what I do wrong, please ?
Probably nothing.  The X11 and postscript devices have different 
boundaries.  The plot is made to fit them, and the legend added to that. 
  I don't usually use dev.copy(); I just repeat the plot commands after 
the postscript() device is opened.  Try that; if that doesn't work, 
adjust your legend placement.

postscript(plot.eps,paper=special,horizontal=F,onefile=F,width=8.0,height=7.0) 

dev.set (2)
dev.copy (which=3)
dev.off (3)
R Version 1.6.1  (2002-11-01) on SuSE Linux 8.0
Might as well upgrade R while you're at it.  1.8 will be out Real Soon Now.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Simulation of Levy Processes and Fractional Brownian motion

2003-10-01 Thread Paul Divid
Dear R users, 
 
Are there any functions that can be used for the
Simulation of Levy Processes and Fractional Brownian motion?
 
Paul.



-

ÁðïêôÞóôå ôçí äùñåÜí [EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R-1.7.1 for Redhat 9

2003-10-01 Thread Joke Allemeersch
In that Examples directory I have the files base-Ex.Rout.fail and
base-Ex.R. If I perform  tail -50 on  base-Ex.R, I get 


   
 
data(esoph) # following on from help(esoph)
model3 - glm(cbind(ncases, ncontrols) ~ agegp + C(tobgp, , 1) +
 C(alcgp, , 1), data = esoph, family = binomial())
summary(model3)
 
 
 
options(contrasts = c(unordered = contr.treatment,ordered =
contr.poly))
cleanEx(); ..nameEx - zMachine
 
### * zMachine
 
### Name: .Machine
### Title: Numerical Characteristics of the Machine
### Aliases: .Machine
### Keywords: sysdata programming math
 
### ** Examples
 
str(.Machine)
 
 
 
cleanEx(); ..nameEx - zScript
 
### * zScript
 
### Name: .Script
### Title: Scripting Language Interface
### Aliases: .Script
### Keywords: interface
 
### ** Examples
 
.Script(perl, massage-Examples.pl,
paste(tools, system.file(R-ex, package = tools)))
 
 
 
### * FOOTER
###
cat(Time elapsed: , proc.time() - get(ptime, env =
.CheckExEnv),\n)
dev.off()
###
### Local variables: ***
### mode: outline-minor ***
### outline-regexp: \\( \\)?### [*]+ ***
### End: ***
quit('no')


 If I perform  tail -20 on base-Ex.Rout.fail, I just get the text you
see when starting R in the terminal.

   R : Copyright 2003, The R Development Core Team

Version 1.7.1  (2003-06-16)
 
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.
 
R is a collaborative project with many contributors.
Type `contributors()' for more information.
 
Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.

Thanks,
Joke


On Wed, 2003-10-01 at 12:43, Liaw, Andy wrote:

 Tell us the output of something like
 
   tail -20 /volume1/scratch/jallemee/R-1.7.1/tests/Examples/base-Ex.Rout
 
 so we know where it bombed (and may be how it bombed).
 
 Andy
 
  -Original Message-
  From: Joke Allemeersch [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, October 01, 2003 6:02 AM
  To: [EMAIL PROTECTED]
  Subject: [R] R-1.7.1 for Redhat 9
  
  
  Dear,
  
  I have problems with installing R-1.7.1 for Redhat 9.  When I 
  applied `./configure' and `make', I get the following error:
  
  make check
  make[1]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
  make[2]: Entering directory `/volume1/scratch/jallemee/R-1.7.1/tests'
  make[3]: Entering directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  make[4]: Entering directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  make[4]: `Makedeps' is up to date.
  make[4]: Leaving directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  make[4]: Entering directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1
  make[4]: Leaving directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  make[3]: *** [test-Examples-Base] Error 2
  make[3]: Leaving directory 
  `/volume1/scratch/jallemee/R-1.7.1/tests/Examples'
  make[2]: *** [test-Examples] Error 2
  make[2]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
  make[1]: *** [test-all-basics] Error 1
  make[1]: Leaving directory `/volume1/scratch/jallemee/R-1.7.1/tests'
  make: *** [check] Error 2
  
  
  I found on the web that one has to change something in the 
  file src/main/arithmetic.c, but this was already done in my 
  file, so that can`t cause the error.  Is there somebody who 
  knows how to solve this?
  
  Thanks a lot,
  
  kind regards, 
  Joke
  
  
  Joke Allemeersch 
  Kasteelpark Arenberg 10 
  3001 Heverlee (Leuven) 
  http://www.esat.kuleuven.ac.be/~dna/BioI/
  
  
  [[alternative HTML version deleted]]
  
  __
  [EMAIL PROTECTED] mailing list 
  https://www.stat.math.ethz.ch/mailman/listinfo /r-help
  

Joke Allemeersch 
Kasteelpark Arenberg 10 
3001 Heverlee (Leuven) 
http://www.esat.kuleuven.ac.be/~dna/BioI/

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Simulation of Levy Processes and Fractional Brownian mot

2003-10-01 Thread Ted Harding
On 01-Oct-03 Paul Divid wrote:
 Dear R users, 
  
 Are there any functions that can be used for the
 Simulation of Levy Processes and Fractional Brownian motion?

Warning: computer simulation of fractal/chaotic processes can be
danegrously misleading:

  chaos-function(xstart,n) {
x-xstart; y-x;
for(i in (1:n)){
  if(y=0.5){y-2*y} else {y-2*(1-y)}
  x-c(x,y)
}
return(x)
  }

Mathematically, this function is genuinely chaotic, for almost all
values of 0  xstart  1.

Try it with

  chaos(sqrt(2)/2,100)

With tongue (somewhat) in cheek,
Ted.




E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 01-Oct-03   Time: 13:09:51
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Solving a tridiagonal system

2003-10-01 Thread Will Harvey
I need to find solutions to a tridiagonal system. By
this I mean a set of linear equations Ax = d where A
is a square matrix containing elements A[i,i-1],
A[i,i] and A[i,i+1] for i in 1:nrow, and zero
elsewhere. R is probably not the ideal way to do this,
but this is part of a larger problem that requires R.

In my application it is much easier (and much faster)
to generate the diagonal and off-diagonal elements of
A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c =
A[i,i+1]. So I have three vectors that define A, along
with a solution vector d. The conventional method of
solving such systems is to use the so-called Thomas
algorithm, see e.g. 
http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/01pa/hyb74/node24.html.
This is very easy to code, but much more difficult to
vectorize. Is anyone aware of a library that
contains a fast implementation of this algorithm?

Another alternative is to use backsolve. I can easily
eliminate the lower diagonal a, but I'm still left
with b and c, whereas backsolve requires a matrix.
Again, I can write a function to read b and c into a
matrix, but this requires loops, and is too slow. Is
there a vectorized way of doing it? Of course, the
diag command works for b, but what about c? In Octave,
diag allows for an offset, but R apparently does not.

I would appreciate any and all assistance you experts
can offer. Thanks in advance.

Will Harvey

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Re: Mandelbrot set and C code

2003-10-01 Thread ucgamdo
  I decided to take on the 'proper' solution to calculate the
Mandelbrot set in R, i.e. to do the raw calculations in C and then link
that code with R. I thought it would be a hard task, but I was pleasantly
surprised when I saw how easily was to write the bit of C code (I am not a
C programmer myself!) and how even easier was to link it with R using .C()
and R CMD SHLIB. If you are interested (or anyone else) here is the (very
fast) code to calculate the mandelbrot set, I hope you enjoy playing with
it as much as I did.

# BEGINNING OF R CODE: 

###
# Function to calculate the Mandelbrot set. This function calls a #
# C routine in order to perform the calculations faster.  #
# #
# Written by Mario dos Reis. September 2003   #
###

mandelbrot - function(x = c(-3, 1),# x limits
   y = c(-1.8, 1.8),# y limits
   nx = 600,# x resolution
   ny = 600,# y resolution
   iter = 20)   # maximun number of iterations
{
  xcoo - seq(x[1], x[2], len = nx) # x coordinates
  ycoo - seq(y[1], y[2], len = ny) # y coordinates
  set = numeric(nx*ny)  # this will store the output of
# the C routine

  # This is the call to the C function itself
  the.set = .C(mandelbrot,
xcoo = as.double(xcoo),
ycoo = as.double(ycoo),
nx = as.integer(nx),
ny = as.integer(ny),
set = as.integer(set),
iter = as.integer(iter))$set

  # Create a list with elements x, y and z,
  # suitable for image(), persp(), etc. and return it.
  return(list(x = xcoo, y = ycoo, z = matrix(the.set, ncol = ny, byrow = T)));
}
# END OF R CODE. ###


/* BEGINNING OF C CODE: ***/

#include stdio.h

/***
 *  Function to evaluate a series of complex numbers that  *
 *  form a subset of the Argand plane, to see if   *
 *  they belong to the Mandelbrot set. *
 *  This function has been written with the intention of   *
 *  linking it to some R code in order to create a *
 *  practical way to play with the set.*
 * *
 *  Written by Mario dos Reis. September 2003  *
 * *
 ***/

void mandelbrot(double *xcoo, double *ycoo, int *nx, 
 int *ny, int *set, int *iter)

/* 'xcoo' and 'ycoo' are the x and y coordinates respectively
 *  of all the points to be evaluated.
 * 'nx' and 'ny' number of divisions along the x and y axes
 * 'set' will store the practical output of the function
 * 'iter' is the maximun number of iterations
 */

{
int i, j, k;
double z[2], c[2], oldz[2];

for(i = 0; i  *nx; i++) {

for(j = 0; j  *ny; j++) {
  
/* initialise the complex point to be tested
 * c[0] (or z[0]) is the real part
 * c[1] (or z[1]) is the imaginary part
 */
c[0] = xcoo[i]; c[1] = ycoo[j];
z[0] = 0;   z[1] = 0;

for(k = 1; k  *iter + 1; k++) {

oldz[0] = z[0]; oldz[1] = z[1];

// the mandelbrot mapping z - z^2 + c
z[0] = oldz[0]*oldz[0] - oldz[1]*oldz[1] + c[0];
z[1] = 2 * oldz[0]*oldz[1] + c[1];

if((z[0]*z[0] + z[1]*z[1])  4) {

break;
}
}

/* fills the set vector
 * notice the trick 'i * (*ny) + j' to find
 * the apporpiate position of the output in the 
 * vector set. The R function will take care of
 * transforming this vector into a suitable matrix
 * for plotting, etc.
 */
set[i * (*ny) + j] = k;
}
}
return;
}
/* END OF C CODE. **

To anyone interested in trying out these functions, just save the C code
into a file, say 'mandelbrot.c', to be able to use the C code with R a
shared object needs to be created. This is done simple running the
following command from the directory where 'mandelbrot.c' is stored (note
this code was tried in Linux, for Win users I think the instructions are
similar but you need you check it out):

R CMD SHLIB mandelbrot.c

This will create the file 'mandelbrot.so' in that same directory.

Start R from this directory and paste the above R code into the console. 

Re: [R] installing DBI_0.1-6.tar.gz

2003-10-01 Thread David James
Hi,

I've never seen R core dumping during a package installation,
if indeed the 1857 Segmentation Fault message applies to R.
Could you give us more details (OS, etc.)?  Also, have you had
problems with any other packages or is this the only one you're
having problems with, etc.?

Regards,

--
David

Joke Allemeersch wrote:
 Dear,
 
 I tried to install the DBI package in R-1.7.1, but this gave the
 following error:
 
 
 /volume1/scratch/jallemee/R/lib/R/bin/INSTALL: line 1:  1856
 Done( echo
 options(save.image.defaults=${save_image_defaults}); if test
 -s R_PROFILE.R; then
 cat R_PROFILE.R;
 fi; echo invisible(.libPaths(c(\${lib}\, .libPaths(; cat
 ${R_PACKAGE_DIR}/R/${pkg} )
   1857 Segmentation fault  | ${R_EXE} --slave --save
 ${save_args}
 ERROR: execution of package source for 'DBI' failed
 
 Can somebody help me?  
 Thanks a lot,
 
 Kind regards,
 Joke.
 
 
 Joke Allemeersch 
 Kasteelpark Arenberg 10 
 3001 Heverlee (Leuven) 
 http://www.esat.kuleuven.ac.be/~dna/BioI/
 
   [[alternative HTML version deleted]]
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
David A. James
Statistics Research, Room 2C-253Phone:  (908) 582-3082   
Bell Labs, Lucent Technologies  Fax:(908) 582-3340
Murray Hill, NJ 09794-0636

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Acces violation ???

2003-10-01 Thread Juan Ramon Gonzalez
Dear R-listers,

I have created a dll and I call it from a R function. However R stops and
shows the message:

Unhandled exception in Rgui.exe (R.DLL): 0xC005: Access Violation

I get this error in other situations and I solved it verifying that all
parameters are called fine. (e.g., double precision - as.double, integer -
as.integer,...). I have verify this. Then, I have tried to debug Fortran
program in order to verify why (or where) function doesn't work.
Surprisingly the subroutine arrives until the end.

What is happening?

Thank you in advance

Juan

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Solving a tridiagonal system

2003-10-01 Thread Roger Koenker
SparseM is really intended for arbitrary sparse structure,
for banded structural there are much more efficient methods,
some of which are, if I'm not mistaken, now available in lapack.


url:www.econ.uiuc.edu/~roger/my.htmlRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

On Wed, 1 Oct 2003, Thomas W Blackwell wrote:

 Will  -

 Take a look at Roger Koenker's package  SparseMatrix,
 available from CRAN.  Look also for some other package
 from Roger which depends on SparseMatrix, but has a
 different name.  It's a place to look.  I don't recall
 whether it will answer your need or not.

 -  tom blackwell  -  u michigan medical school  -  ann arbor  -

 On Wed, 1 Oct 2003, Will Harvey wrote:

  I need to find solutions to a tridiagonal system. By
  this I mean a set of linear equations Ax = d where A
  is a square matrix containing elements A[i,i-1],
  A[i,i] and A[i,i+1] for i in 1:nrow, and zero
  elsewhere. R is probably not the ideal way to do this,
  but this is part of a larger problem that requires R.
 
  In my application it is much easier (and much faster)
  to generate the diagonal and off-diagonal elements of
  A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c =
  A[i,i+1]. So I have three vectors that define A, along
  with a solution vector d. The conventional method of
  solving such systems is to use the so-called Thomas
  algorithm, see e.g.
  http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/01pa/hyb74/node24.html.
  This is very easy to code, but much more difficult to
  vectorize. Is anyone aware of a library that
  contains a fast implementation of this algorithm?
 
  Another alternative is to use backsolve. I can easily
  eliminate the lower diagonal a, but I'm still left
  with b and c, whereas backsolve requires a matrix.
  Again, I can write a function to read b and c into a
  matrix, but this requires loops, and is too slow. Is
  there a vectorized way of doing it? Of course, the
  diag command works for b, but what about c? In Octave,
  diag allows for an offset, but R apparently does not.
 
  I would appreciate any and all assistance you experts
  can offer. Thanks in advance.
 
  Will Harvey
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Solving a tridiagonal system

2003-10-01 Thread Gabor Grothendieck

The following will create a matrix x with given sub diagonal,
diagonal and super diagonal.

# define test vectors for a, b and c
va - -(1:4); vb - 11:15; vc - 1:4

# diag.num is a matrix whose ith super diagonal equals i and 
#  sub diagonal equals -i
diag.num - -outer(seq(vb),seq(vb),-)

x - diag(vb)
x[diag.num == 1] - va
x[diag.num == -1] - vc

---

Date: Wed, 1 Oct 2003 05:56:34 -0700 (PDT) 
From: Will Harvey [EMAIL PROTECTED]
To: [EMAIL PROTECTED] 
Subject: [R] Solving a tridiagonal system 
 
I need to find solutions to a tridiagonal system. By
this I mean a set of linear equations Ax = d where A
is a square matrix containing elements A[i,i-1],
A[i,i] and A[i,i+1] for i in 1:nrow, and zero
elsewhere. R is probably not the ideal way to do this,
but this is part of a larger problem that requires R.

In my application it is much easier (and much faster)
to generate the diagonal and off-diagonal elements of
A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c =
A[i,i+1]. So I have three vectors that define A, along
with a solution vector d. The conventional method of
solving such systems is to use the so-called Thomas
algorithm, see e.g. 
http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/01pa/hyb74/node24.html;.
This is very easy to code, but much more difficult to
vectorize. Is anyone aware of a library that
contains a fast implementation of this algorithm?

Another alternative is to use backsolve. I can easily
eliminate the lower diagonal a, but I'm still left
with b and c, whereas backsolve requires a matrix.
Again, I can write a function to read b and c into a
matrix, but this requires loops, and is too slow. Is
there a vectorized way of doing it? Of course, the
diag command works for b, but what about c? In Octave,
diag allows for an offset, but R apparently does not.

I would appreciate any and all assistance you experts
can offer. Thanks in advance.

Will Harvey

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

 
 
 
 message or move to Select a Folder- Folders --InboxDraftsSentTrashBulk 
Mail My Folders R
 Back to Inbox | Prev Next 
 
   As AttachmentAs Inline Text 
 
 




 
 




Make My Way Your Home Page  |  Spread the Word

My Settings: Overview | Search | Email | Chat | Portfolio | Calendar | Groups | 
Profile 
 

IMPORTANT: We do not present our users with pop-ups, banners or any other non-text 
advertising. Nor do we send email
to our users. If you see or receive one of these items, it is coming from an outside 
source, either as a result of something you
have previously downloaded or as an exit pop-up from the site you just visited. It 
is not coming from our site.

Privacy Policy   Terms of Service   Partner with Us   Our Mission   Advertise with Us  
 Sign In   Sign Out   Help Center

© 2002-2003 My Way

 
 

  
 



___
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Solving a tridiagonal system

2003-10-01 Thread Gabor Grothendieck

I just noticed that you defined a to be the lower diagonal
whereas I had it as the upper diagonal so the previous email
should be as follows to correspond to your notation:


# define test vectors for a, b and c
va - -(1:4); vb - 11:15; vc - 1:4

# diag.num is a matrix whose ith diagonal equals i
diag.num - -outer(seq(vb),seq(vb),-)

x - diag(vb)
x[diag.num == -1] - va
x[diag.num == 1] - vc


From: Gabor Grothendieck [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED] 
Subject: RE: [R] Solving a tridiagonal system 

 
 

The following will create a matrix x with given sub diagonal,
diagonal and super diagonal.

# define test vectors for a, b and c
va - -(1:4); vb - 11:15; vc - 1:4

# diag.num is a matrix whose ith super diagonal equals i and 
# sub diagonal equals -i
diag.num - -outer(seq(vb),seq(vb),-)

x - diag(vb)
x[diag.num == 1] - va
x[diag.num == -1] - vc

---

Date: Wed, 1 Oct 2003 05:56:34 -0700 (PDT) 
From: Will Harvey [EMAIL PROTECTED]
To: [EMAIL PROTECTED] 
Subject: [R] Solving a tridiagonal system 

I need to find solutions to a tridiagonal system. By
this I mean a set of linear equations Ax = d where A
is a square matrix containing elements A[i,i-1],
A[i,i] and A[i,i+1] for i in 1:nrow, and zero
elsewhere. R is probably not the ideal way to do this,
but this is part of a larger problem that requires R.

In my application it is much easier (and much faster)
to generate the diagonal and off-diagonal elements of
A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c =
A[i,i+1]. So I have three vectors that define A, along
with a solution vector d. The conventional method of
solving such systems is to use the so-called Thomas
algorithm, see e.g. 
http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/01pa/hyb74/node24.html;;.
This is very easy to code, but much more difficult to
vectorize. Is anyone aware of a library that
contains a fast implementation of this algorithm?

Another alternative is to use backsolve. I can easily
eliminate the lower diagonal a, but I'm still left
with b and c, whereas backsolve requires a matrix.
Again, I can write a function to read b and c into a
matrix, but this requires loops, and is too slow. Is
there a vectorized way of doing it? Of course, the
diag command works for b, but what about c? In Octave,
diag allows for an offset, but R apparently does not.

I would appreciate any and all assistance you experts
can offer. Thanks in advance.

Will Harvey

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




message or move to Select a Folder- Folders --InboxDraftsSentTrashBulk 
Mail My Folders R
Back to Inbox | Prev Next 

As AttachmentAs Inline Text 












Make My Way Your Home Page | Spread the Word

My Settings: Overview | Search | Email | Chat | Portfolio | Calendar | Groups | 
Profile 


IMPORTANT: We do not present our users with pop-ups, banners or any other non-text 
advertising. Nor do we send email
to our users. If you see or receive one of these items, it is coming from an outside 
source, either as a result of something you
have previously downloaded or as an exit pop-up from the site you just visited. It 
is not coming from our site.

Privacy Policy Terms of Service Partner with Us Our Mission Advertise with Us Sign In 
Sign Out Help Center

© 2002-2003 My Way









___
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

 
 
 
 message or move to Select a Folder- Folders --InboxDraftsSentTrashBulk 
Mail My Folders R
 Back to Inbox | Prev Next 
 
   As AttachmentAs Inline Text 
 
 




 
 




Make My Way Your Home Page  |  Spread the Word

My Settings: Overview | Search | Email | Chat | Portfolio | Calendar | Groups | 
Profile 
 

IMPORTANT: We do not present our users with pop-ups, banners or any other non-text 
advertising. Nor do we send email
to our users. If you see or receive one of these items, it is coming from an outside 
source, either as a result of something you
have previously downloaded or as an exit pop-up from the site you just visited. It 
is not coming from our site.

Privacy Policy   Terms of Service   Partner with Us   Our Mission   Advertise with Us  
 Sign In   Sign Out   Help Center

© 2002-2003 My Way

 
 

  
 



___
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Solving a tridiagonal system

2003-10-01 Thread Liaw, Andy
I see that the LAPACK routine DGTSV is in the R source, and defined in
R_ext/lapack.h,  but I don't know how to get to it from R.

Andy

 -Original Message-
 From: Roger Koenker [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 01, 2003 10:33 AM
 To: Thomas W Blackwell
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] Solving a tridiagonal system
 
 
 SparseM is really intended for arbitrary sparse structure,
 for banded structural there are much more efficient methods, 
 some of which are, if I'm not mistaken, now available in lapack.
 
 
 url:  www.econ.uiuc.edu/~roger/my.htmlRoger Koenker
 email [EMAIL PROTECTED]   Department of Economics
 vox:  217-333-4558University of Illinois
 fax:  217-244-6678
 Champaign, IL 61820
 
 On Wed, 1 Oct 2003, Thomas W Blackwell wrote:
 
  Will  -
 
  Take a look at Roger Koenker's package  SparseMatrix, 
 available from 
  CRAN.  Look also for some other package from Roger which depends on 
  SparseMatrix, but has a different name.  It's a place to look.  I 
  don't recall whether it will answer your need or not.
 
  -  tom blackwell  -  u michigan medical school  -  ann arbor  -
 
  On Wed, 1 Oct 2003, Will Harvey wrote:
 
   I need to find solutions to a tridiagonal system. By
   this I mean a set of linear equations Ax = d where A
   is a square matrix containing elements A[i,i-1],
   A[i,i] and A[i,i+1] for i in 1:nrow, and zero
   elsewhere. R is probably not the ideal way to do this,
   but this is part of a larger problem that requires R.
  
   In my application it is much easier (and much faster)
   to generate the diagonal and off-diagonal elements of
   A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c = 
 A[i,i+1]. So I 
   have three vectors that define A, along with a solution vector d. 
   The conventional method of solving such systems is to use the 
   so-called Thomas algorithm, see e.g.
   
 http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/0
1pa/hyb74/node24.html.
  This is very easy to code, but much more difficult to
  vectorize. Is anyone aware of a library that
  contains a fast implementation of this algorithm?
 
  Another alternative is to use backsolve. I can easily eliminate the 
  lower diagonal a, but I'm still left with b and c, whereas backsolve 
  requires a matrix. Again, I can write a function to read b and c 
  into a matrix, but this requires loops, and is too slow. Is
  there a vectorized way of doing it? Of course, the
  diag command works for b, but what about c? In Octave,
  diag allows for an offset, but R apparently does not.
 
  I would appreciate any and all assistance you experts
  can offer. Thanks in advance.
 
  Will Harvey
 
  __
  [EMAIL PROTECTED] mailing list 
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Solving a tridiagonal system

2003-10-01 Thread Will Harvey
Thanks. This works, but still seems too slow for my
application. It looks like my best option is to figure
out how to interface the LAPACK routine DGTSV to R.
The inputs to DGTSV are four vectors: the three
diagonals and the RHS vector.

Will


--- Gabor Grothendieck [EMAIL PROTECTED]
wrote:
 
 I just noticed that you defined a to be the lower
 diagonal
 whereas I had it as the upper diagonal so the
 previous email
 should be as follows to correspond to your notation:
 
 
 # define test vectors for a, b and c
 va - -(1:4); vb - 11:15; vc - 1:4
 
 # diag.num is a matrix whose ith diagonal equals i
 diag.num - -outer(seq(vb),seq(vb),-)
 
 x - diag(vb)
 x[diag.num == -1] - va
 x[diag.num == 1] - vc
 
 
 From: Gabor Grothendieck [EMAIL PROTECTED]
 To: [EMAIL PROTECTED],
 [EMAIL PROTECTED] 
 Subject: RE: [R] Solving a tridiagonal system 
 
  
  
 
 The following will create a matrix x with given sub
 diagonal,
 diagonal and super diagonal.
 
 # define test vectors for a, b and c
 va - -(1:4); vb - 11:15; vc - 1:4
 
 # diag.num is a matrix whose ith super diagonal
 equals i and 
 # sub diagonal equals -i
 diag.num - -outer(seq(vb),seq(vb),-)
 
 x - diag(vb)
 x[diag.num == 1] - va
 x[diag.num == -1] - vc
 
 ---
 
 Date: Wed, 1 Oct 2003 05:56:34 -0700 (PDT) 
 From: Will Harvey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] 
 Subject: [R] Solving a tridiagonal system 
 
 I need to find solutions to a tridiagonal system. By
 this I mean a set of linear equations Ax = d where A
 is a square matrix containing elements A[i,i-1],
 A[i,i] and A[i,i+1] for i in 1:nrow, and zero
 elsewhere. R is probably not the ideal way to do
 this,
 but this is part of a larger problem that requires
 R.
 
 In my application it is much easier (and much
 faster)
 to generate the diagonal and off-diagonal elements
 of
 A as vectors, i.e. a = A[i,i-1], b = A[i,i] and c =
 A[i,i+1]. So I have three vectors that define A,
 along
 with a solution vector d. The conventional method of
 solving such systems is to use the so-called Thomas
 algorithm, see e.g. 

http://www.enseeiht.fr/hmf/travaux/CD0001/travaux/optmfn/hi/01pa/hyb74/node24.html;;.
 This is very easy to code, but much more difficult
 to
 vectorize. Is anyone aware of a library that
 contains a fast implementation of this algorithm?
 
 Another alternative is to use backsolve. I can
 easily
 eliminate the lower diagonal a, but I'm still left
 with b and c, whereas backsolve requires a matrix.
 Again, I can write a function to read b and c into a
 matrix, but this requires loops, and is too slow. Is
 there a vectorized way of doing it? Of course, the
 diag command works for b, but what about c? In
 Octave,
 diag allows for an offset, but R apparently does
 not.
 
 I would appreciate any and all assistance you
 experts
 can offer. Thanks in advance.
 
 Will Harvey
 
 __
 [EMAIL PROTECTED] mailing list

https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 
 
 
 
 message or move to Select a Folder- Folders
 --InboxDraftsSentTrashBulk Mail My Folders
 R
 Back to Inbox | Prev Next 
 
 As AttachmentAs Inline Text 
 
 
 
 
 
 
 
 
 
 
 
 
 Make My Way Your Home Page | Spread the Word
 
 My Settings: Overview | Search | Email | Chat |
 Portfolio | Calendar | Groups | Profile 
 
 
 IMPORTANT: We do not present our users with pop-ups,
 banners or any other non-text advertising. Nor do we
 send email
 to our users. If you see or receive one of these
 items, it is coming from an outside source, either
 as a result of something you
 have previously downloaded or as an exit pop-up
 from the site you just visited. It is not coming
 from our site.
 
 Privacy Policy Terms of Service Partner with Us Our
 Mission Advertise with Us Sign In Sign Out Help
 Center
 
 © 2002-2003 My Way
 
 
 
 
 
 
 
 
 
 ___
 No banners. No pop-ups. No kidding.
 Introducing My Way - http://www.myway.com
 
 __
 [EMAIL PROTECTED] mailing list

https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 
  
  
  
  message or move to Select a Folder- Folders
 --InboxDraftsSentTrashBulk Mail My Folders
 R
  Back to Inbox | Prev Next 
  
As AttachmentAs Inline Text 
  
  
 
 
 
 
  
  
 
 
 
 
 Make My Way Your Home Page  |  Spread the Word
 
 My Settings: Overview | Search | Email | Chat |
 Portfolio | Calendar | Groups | Profile 
  
 
 IMPORTANT: We do not present our users with pop-ups,
 banners or any other non-text advertising. Nor do we
 send email
 to our users. If you see or receive one of these
 items, it is coming from an outside source, either
 as a result of something you
 have previously downloaded or as an exit pop-up
 from the site you just visited. It is not coming
 from our site.
 
 Privacy Policy   Terms of Service   Partner with Us 
  Our Mission   Advertise with Us   Sign In   Sign
 Out   Help Center
 
 © 2002-2003 My Way
 
  
  
 
=== message 

[R] fitting Markov chains

2003-10-01 Thread Tamas Papp
I need to find a computationally simple process for the movement of
interest rates. In this simplified model, an interest rate can have
3--5 possible values, and its movement is characterized by a matrix of
transition probabilities (ie, it is a Markov process).

I would like to estimate this process from a given set of data. 

For example, let the interest rate time series be:

7 3 8 2 5 9 6

Assume that the discretized variable can take the following values:
(3, 5, 8), then we find the nearest discrete point and give its index:

3 1 3 1 2 3 2

Then estimate the transition probabilities.

I have the following questions:

- how should I select the discrete set of values that the variable can
assume? Eg simply get the maximum and minimum, and divide this
interval into, say, three pieces? Or estimate the mean, and make the
other two values mean plus-minus one standard deviation?

- once the variable is discretized, how do I transform each data point
to its discretized value (its index)?

- the most important: how should I estimate the transition
probabilities?

References to introductory literature on estimating Markov chains like
this would be welcome. Most importantly, I need to know how robust an
estimation is to selecting the discrete points, or is there a simple
goodness of fit estimation.

Thanks,

Tamas Papp

-- 
Tamás K. Papp
E-mail: [EMAIL PROTECTED] (preferred, especially for large messages)
[EMAIL PROTECTED]
Please try to send only (latin-2) plain text, not HTML or other garbage.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] SOS Cor

2003-10-01 Thread carla piccini

   Ho iniziato ad utilizzare R da pochi giorni e onestamente ho delle
   difficoltà.
   Devo correlare una variabile con il resto del dataframe (quindi una
   variabile con tutte), ma sbaglio nella sintassi e onestamente non so
   dove. Le singole correlazioni riesco a farle, ma è un lavoro un pò
   dispersivo.
   Mi hanno consigliato di utilizzare cbind oppure as.matrix, ma non so
   continuare.
   Il problema seguente è cercare di correlare una variabile con altre
   che sono io a scegliere per motivi di ricerca, ma anche qui non so
   come selezionare le colonne che a me interessano (non sono intervalli,
   ma sono disposte a salti).
   Qualcuno mi può aiutare? GRAZIE CARLA.
 _

   Nuovo MSN Messenger 6.0: con sfondi, foto e giochi. [1]Provalo subito!

References

   1. http://g.msn.com/8HMAITIT/2728??PS=
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Macintosh binaries; was: Rcmdr and Macintosh

2003-10-01 Thread Aniko Szabo
I am a Windows user and trying to make life easier for my Mac-using students. After 
investigating the Mac situation more, it appears that the key to easy use is having 
precompiled binaries. However the packages I am interested in (Rcmdr and its required 
package, car) do not have one. I do not have easy access to a Mac, so I have a plea to 
Macintosh users: could someone please create them if it is not too difficult? I am 
planning to use R 1.7.1. Please forgive me if my request is inappropriate.

Aniko

This e-mail may contain confidential and/or privileged infor...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] fitting Markov chains

2003-10-01 Thread Ted Harding
On 01-Oct-03 Tamas Papp wrote:
 I need to find a computationally simple process for the movement of
 interest rates. In this simplified model, an interest rate can have
 3--5 possible values, and its movement is characterized by a matrix of
 transition probabilities (ie, it is a Markov process).
 
 I would like to estimate this process from a given set of data. 
 
 For example, let the interest rate time series be:
 7 3 8 2 5 9 6
 Assume that the discretized variable can take the following values:
 (3, 5, 8), then we find the nearest discrete point and give its index:
 3 1 3 1 2 3 2
 Then estimate the transition probabilities.
 
 I have the following questions:
 - how should I select the discrete set of values that the variable can
 assume? Eg simply get the maximum and minimum, and divide this
 interval into, say, three pieces? Or estimate the mean, and make the
 other two values mean plus-minus one standard deviation?

I would suggest dividing the interval, trying to get equal numbers
in each interval. If (e.g. because the originals are discrete)
this can't quite be done, try to find an similar arrangement which
maximises the minimum count.

 - once the variable is discretized, how do I transform each data point
 to its discretized value (its index)?

? Something like
 a-c(0,1,2,3,4);b-c(1,2,3,4,5)
 x-3.5;which((ax)(x=b))
 [1] 4
 x-1.5;which((ax)(x=b))
 [1] 2

 - the most important: how should I estimate the transition
 probabilities?

Most simply as Nij/Ni. where Ni. is the number of times the system
has been in state i, and Nij is the number of transitions from i to j.

Statistical properties of even this estimator can be a bit elusive
because the sample sizes Ni. are random; the above recommendation
about how to select intervals will probably help on this front.

Also, after grouping the system is no longer a Markov Chain (even
assuming it really was in the first place) since the probability
of transition from i to j will depend somewhat on which member within i
was arrived at, and this will depend (though hopefullly not much)
on where it was before. By refining your grouping you can diminish
this effect, though you will also reduce the Ni. and hence the
quality of estimation.

To discuss such issues one really need to know more about your data,
in particular how long the series are, what groupings are you thinking
of, and how the series behave.

Also, you don't seem to be thinking about trends, cycles etc. ...

Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 167 1972
Date: 01-Oct-03   Time: 17:49:21
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] question about predictions with linear models

2003-10-01 Thread Rajarshi Guha
Hi,
  this question is probably very obvious but I just cant see where I
might be going wrong. 

I'm using the lm() function to generate a linear model and then make
predictions using a different set of data.

To generate the model I do (tdata  pdata are matrices of observations
and parameters, tdepv, pdepv are response vectors)

x - as.data.frame(tdata)
x$tdepv - tdepv
lnegth(tdepv) = 140

model - lm(x$tdepv ~ x$V1 + x$V2 + x$V3 + x$V4, x)

pred - predict(model, x)
length(pred) = 140

y - as.data.frame(pdata)
y$pdepv - pdepv
length(pdepv) = 16

pred - predict(model, y)
length(pred) = 140

But I expect that length(pred) = 16

Why do I get a different length? Furthermore, the original formula
specified the variable tdepv which is not in the dataframe that I send
to predict() - should I also make a variable called tdepv in the
dataframe y?

Thanks,

---
Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
The way to love anything is to realize that it might be lost.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] hypergeometric population estimates

2003-10-01 Thread Jesse . Whittington
help

We want to estimate the number of caribou in Jasper.  We recently conducted
an aerial survey and saw 70 uncollared caribou and 8 of 11 collared
caribou.  We want to estimate the number of caribou in this population with
95% confidence limits.  Gary White uses the hypergeometric distribution and
determines the population estimates using maximum likelihood and 95%CL as
-2LogLikelihoods.  Below, I determined the population estimate using
dhyper(x,m,n,k) and maximizing the density value as a function of n, but do
not know how I should calculate MLE with this distribution.


x - 8 # number resighted caribou (white balls drawn)
m -11 # number collared caribou (white balls total)
k - 70#  number caribou seen (# balls drawn)
n - 1:500 #  ?? unknown number of uncollared caribou (# black balls)

d - unlist(lapply(n, function(i) dhyper(x,m,i,k))) # density estimate
for each value of n
data - data.frame(estimate = n+m, d)
data - data[is.finite(data$d), ] # filter out NA's

max.d - max(data$d)
pop.estimate - data[data$d == max.d, 1]

Thank-you for your assistance,
Jesse

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] sas.get problem

2003-10-01 Thread Duncan Murdoch
On Wed, 01 Oct 2003 14:02:15 -0400, Peter Flom [EMAIL PROTECTED] wrote
:

When I try

 citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')


I get the following errors and warnings:


'sas' is not recognized as an internal or external command,
operable program or batch file.

That's an S-PLUS function rather than an R function, isn't it?  Does
some R package supply sas.get?

I believe the S-PLUS implementation requires that you have SAS
installed, and it looks like the error message is saying that you
don't.  But if you're using S-PLUS, you'd be better asking on the
s-news mailing list.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] hypergeometric population estimates

2003-10-01 Thread RBaskin

I'm not sure I understand your notation:
(1) We recently conducted an aerial survey and saw 70 uncollared caribou and
8 of 11 collared caribou.
(2) k - 70#  number caribou seen (# balls drawn)

It's the number of balls drawn parenthetical remark that bothers me - I
think the total number of balls drawn should be 78 and the number of
non-white balls drawn is 70.

If
x - 8 # number resighted caribou (white balls drawn)
m -11 # number collared caribou (white balls total)
totaldrawn - 78#  number caribou seen (total # balls drawn)

I believe that the maximum likelihood estimator you are looking for is given
by

MLE - floor(m * totaldrawn / x)  #floor(11 * 78 / 8) = 107

I believe the trick is to look at f(n) = P(x|m,totaldrawn,n) as a function
of n and consider the ratio f(n) / f(n-1).  If this ratio is greater than 1
the function is increasing and if the ratio is less than 1 the function is
decreasing.  Then algebraically show that the maximum occurs at floor(m *
totaldrawn / x).

Bytheway, this MLE includes both collared and uncollared balls so it may be
that you are looking for 107 - 11 as your estimate??

hth
Bob
Usual disclaimers...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2003 12:56 PM
To: [EMAIL PROTECTED]
Subject: [R] hypergeometric  population estimates

help

We want to estimate the number of caribou in Jasper.  We recently conducted
an aerial survey and saw 70 uncollared caribou and 8 of 11 collared
caribou.  We want to estimate the number of caribou in this population with
95% confidence limits.  Gary White uses the hypergeometric distribution and
determines the population estimates using maximum likelihood and 95%CL as
-2LogLikelihoods.  Below, I determined the population estimate using
dhyper(x,m,n,k) and maximizing the density value as a function of n, but do
not know how I should calculate MLE with this distribution.


x - 8 # number resighted caribou (white balls drawn)
m -11 # number collared caribou (white balls total)
k - 70#  number caribou seen (# balls drawn)
n - 1:500 #  ?? unknown number of uncollared caribou (# black balls)
d - unlist(lapply(n, function(i) dhyper(x,m,i,k))) # density estimate
for each value of n
data - data.frame(estimate = n+m, d)
data - data[is.finite(data$d), ] # filter out NA's

max.d - max(data$d)
pop.estimate - data[data$d == max.d, 1]

Thank-you for your assistance,
Jesse

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] sas.get problem

2003-10-01 Thread Marc Schwartz
On Wed, 2003-10-01 at 13:23, Duncan Murdoch wrote:
 On Wed, 01 Oct 2003 14:02:15 -0400, Peter Flom [EMAIL PROTECTED] wrote
 :
 
 When I try
 
  citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')
 
 
 I get the following errors and warnings:
 
 
 'sas' is not recognized as an internal or external command,
 operable program or batch file.
 
 That's an S-PLUS function rather than an R function, isn't it?  Does
 some R package supply sas.get?
 
 I believe the S-PLUS implementation requires that you have SAS
 installed, and it looks like the error message is saying that you
 don't.  But if you're using S-PLUS, you'd be better asking on the
 s-news mailing list.
 
 Duncan Murdoch


Duncan,

sas.get() is in Frank Harrell's Hmisc package on CRAN (recently
available there) for R.

I would defer to Frank's comments here, but reading the .PDF file that
is on CRAN, it does confirm that one must be able to run SAS in order to
use sas.get():

Note

You must be able to run SAS (by typing sas) on your system. If the S
command !sas does not start SAS, then this function cannot work.

HTH,

Marc Schwartz

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] sas.get problem

2003-10-01 Thread James MacDonald
It's actually in the Hmisc package. The error looks like Hmisc hasn't
been attached yet, so you might try library(Hmisc) first.

In addition, it does appear from the help file that you need SAS
installed to output the ASCII files that are required to import the
data.

HTH,

Jim



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623

 Duncan Murdoch [EMAIL PROTECTED] 10/01/03 02:23PM 
On Wed, 01 Oct 2003 14:02:15 -0400, Peter Flom [EMAIL PROTECTED] wrote
:

When I try

 citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')


I get the following errors and warnings:


'sas' is not recognized as an internal or external command,
operable program or batch file.

That's an S-PLUS function rather than an R function, isn't it?  Does
some R package supply sas.get?

I believe the S-PLUS implementation requires that you have SAS
installed, and it looks like the error message is saying that you
don't.  But if you're using S-PLUS, you'd be better asking on the
s-news mailing list.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Macintosh binaries; was: Rcmdr and Macintosh

2003-10-01 Thread Don MacQueen
Did you try install.packages()?

I know this is not exactly what you're looking for, but with the 
sometimes-called 'Darwin' version of R 1.7.1 for Mac OS X, installed 
from source code, not a precompiled binary, and using X Windows,
  install.packages('Rcmdr')
  install.packages('car')
were successful.

 version
 _ 
platform powerpc-apple-darwin6.6
arch powerpc   
os   darwin6.6 
system   powerpc, darwin6.6
status 
major1 
minor7.1   
year 2003  
month06
day  16
language R 

I'm not up to date on whether install.packages() will work from a 
precompiled binary for OS X.

I haven't tried it, but I do not expect install.packages() to work if 
the Mac OS is 9.x or before, as these are not unix-based. (and 
support for R pre-OS X is waning if not completely gone)

-Don

At 10:42 AM -0600 10/1/03, Aniko Szabo wrote:
I am a Windows user and trying to make life easier for my Mac-using 
students. After investigating the Mac situation more, it appears 
that the key to easy use is having precompiled binaries. However the 
packages I am interested in (Rcmdr and its required package, car) do 
not have one. I do not have easy access to a Mac, so I have a plea 
to Macintosh users: could someone please create them if it is not 
too difficult? I am planning to use R 1.7.1. Please forgive me if my 
request is inappropriate.

Aniko

This e-mail may contain confidential and/or privileged infor...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


--
--
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] sas.get problem

2003-10-01 Thread Peter Flom
Thanks to all who responded

Marc Schwartz wrote

A quick follow up. I installed Frank's Hmisc under R 1.8.0 beta. If
Hmisc is not attached (ie. library(Hmisc)), you get:

 citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')
Error: couldn't find function sas.get

which you would reasonably expect.

Thus, it seems more likely that Dr. Flom either does not have SAS on
his
system or perhaps the SAS executable file (sas.exe? IIRC) is not in
Dr.
Flom's 'PATH' on his system if SAS is installed.


This does seem to be the problem

Thanks again

Peter

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] sas.get problem

2003-10-01 Thread Marc Schwartz
On Wed, 2003-10-01 at 13:43, Marc Schwartz wrote:
 On Wed, 2003-10-01 at 13:23, Duncan Murdoch wrote:
  On Wed, 01 Oct 2003 14:02:15 -0400, Peter Flom [EMAIL PROTECTED] wrote
  :
  
  When I try
  
   citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')
  
  
  I get the following errors and warnings:
  
  
  'sas' is not recognized as an internal or external command,
  operable program or batch file.
  
  That's an S-PLUS function rather than an R function, isn't it?  Does
  some R package supply sas.get?
  
  I believe the S-PLUS implementation requires that you have SAS
  installed, and it looks like the error message is saying that you
  don't.  But if you're using S-PLUS, you'd be better asking on the
  s-news mailing list.
  
  Duncan Murdoch
 
 
 Duncan,
 
 sas.get() is in Frank Harrell's Hmisc package on CRAN (recently
 available there) for R.
 
 I would defer to Frank's comments here, but reading the .PDF file that
 is on CRAN, it does confirm that one must be able to run SAS in order to
 use sas.get():
 
 Note
 
 You must be able to run SAS (by typing sas) on your system. If the S
 command !sas does not start SAS, then this function cannot work.
 
 HTH,
 
 Marc Schwartz


A quick follow up. I installed Frank's Hmisc under R 1.8.0 beta. If
Hmisc is not attached (ie. library(Hmisc)), you get:

 citypro - sas.get('c:/ndri/cvar/data', member = 'citypro2')
Error: couldn't find function sas.get

which you would reasonably expect.

Thus, it seems more likely that Dr. Flom either does not have SAS on his
system or perhaps the SAS executable file (sas.exe? IIRC) is not in Dr.
Flom's 'PATH' on his system if SAS is installed.

HTH,

Marc

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] curious error with tkcheckbutton

2003-10-01 Thread solares
Hello, the following code produces an error when executing it, it is a code 
that produces 6 checkbutton that at 
the beginning are empty, when selecting the first checkbox he says that  
doesn't know the second 
variable tcl, he say: 

[1] 1
Error in structure(.External(dotTcl, ..., PACKAGE = tcltk), class 
= tclObj) : 
[tcl] can't read ::RTcl2: no such variable.

when six variables tcl has been created in the array b and they exist:

 b
[1] ::RTcl1 ::RTcl2 ::RTcl3 ::RTcl4 ::RTcl5 ::RTcl6

the script is(I'm use R 1.7.1 for win, the fail is in the first execution
of the script):

library(tcltk)
tt-tktoplevel()
f-tkframe(tt)
tkpack(f)
j-6
nbre-c(c1,c2,c3,c4,c5,c6)
b-c()
i-1
 while (i=j){
  aux-paste(b,i,sep=)
  aux-tclVar(init=0)
  b-c(b,as.character(aux))
  tclvalue(b[i])-0
  i-i+1
 }
 i-1
 while (i=j){
 t-tkcheckbutton(f,text=nbre[i],variable=eval(b
[i]),relief=raised,command=function()ver())
 tkpack(t)
 i-i+1
 }
 
 ver-function(){
 k-1
 while (k=j){
  print(tclvalue(b[k]))
  k-k+1
  }
  }

 any help will be welcome. Thank you Ruben

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Re: Mandelbrot set and C code

2003-10-01 Thread Jason Turner
[EMAIL PROTECTED] wrote:

  I decided to take on the 'proper' solution to calculate the
Mandelbrot set in R, i.e. to do the raw calculations in C and then link
that code with R. 
This is very cool.  I did a slight tweak to your mandelbrot.R code, so 
that x can be a list with components x and y.  This allows you to keep 
zooming in using your mouse to click on the plot (one of the incredibly 
nifty features of such sets).

Using the tweaked version below, call the function as you suggested:

image(mandelbrot(), col = c(heat.colors(49), black))

Then use locator(2) to define your next view:

image(mandelbrot(locator(2)), col = c(heat.colors(49), black))

Click the mouse in the corners of the zoom window, and away you go. 
Lather. Rinse. Repeat.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] hypergeometric population estimates

2003-10-01 Thread Remington, Richard
# another vote for 107

n - 1:500
x - 8
m - 11
totaldrawn - 78
MLE - floor(m * totaldrawn / x)
likelihood - choose(m,x)*choose(n-m,totaldrawn-x)/choose(n,totaldrawn)
plot(n, likelihood)
abline(v=MLE)
[EMAIL PROTECTED] wrote:

I'm not sure I understand your notation:
(1) We recently conducted an aerial survey and saw 70 uncollared caribou and
8 of 11 collared caribou.
(2) k - 70#  number caribou seen (# balls drawn)
It's the number of balls drawn parenthetical remark that bothers me - I
think the total number of balls drawn should be 78 and the number of
non-white balls drawn is 70.
If
x - 8 # number resighted caribou (white balls drawn)
m -11 # number collared caribou (white balls total)
totaldrawn - 78#  number caribou seen (total # balls drawn)
I believe that the maximum likelihood estimator you are looking for is given
by
MLE - floor(m * totaldrawn / x)  #floor(11 * 78 / 8) = 107

I believe the trick is to look at f(n) = P(x|m,totaldrawn,n) as a function
of n and consider the ratio f(n) / f(n-1).  If this ratio is greater than 1
the function is increasing and if the ratio is less than 1 the function is
decreasing.  Then algebraically show that the maximum occurs at floor(m *
totaldrawn / x).
Bytheway, this MLE includes both collared and uncollared balls so it may be
that you are looking for 107 - 11 as your estimate??
hth
Bob
Usual disclaimers...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2003 12:56 PM
To: [EMAIL PROTECTED]
Subject: [R] hypergeometric  population estimates

help

We want to estimate the number of caribou in Jasper.  We recently conducted
an aerial survey and saw 70 uncollared caribou and 8 of 11 collared
caribou.  We want to estimate the number of caribou in this population with
95% confidence limits.  Gary White uses the hypergeometric distribution and
determines the population estimates using maximum likelihood and 95%CL as
-2LogLikelihoods.  Below, I determined the population estimate using
dhyper(x,m,n,k) and maximizing the density value as a function of n, but do
not know how I should calculate MLE with this distribution.
x - 8 # number resighted caribou (white balls drawn)
m -11 # number collared caribou (white balls total)
k - 70#  number caribou seen (# balls drawn)
n - 1:500 #  ?? unknown number of uncollared caribou (# black balls)
d - unlist(lapply(n, function(i) dhyper(x,m,i,k))) # density estimate
for each value of n
data - data.frame(estimate = n+m, d)
data - data[is.finite(data$d), ] # filter out NA's
max.d - max(data$d)
pop.estimate - data[data$d == max.d, 1]
Thank-you for your assistance,
Jesse
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
	[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
--

Richard E. Remington III
Statistician
KERN Statistical Services, Inc.
PO Box 1046
Boise, ID 83701
Tel: 208.426.0113
KernStat.com
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R on fairly large machines

2003-10-01 Thread Allan Tingey
Hi,

We are considering using R on a large problem that will require four 64 
bit cpu's and 64Gb of ram and some flavor of unix.  We are just 
wondering if R is going to be happy in this environment.  If have 
experience with this please let me know.

Thanks,
Allan Tingey
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] lda source code

2003-10-01 Thread Wei Geng
I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was
implemented in R. Does anyone know where to find out lda source code ?
Thanks.

Wei

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Jason Turner
Wei Geng wrote:

I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was
implemented in R. Does anyone know where to find out lda source code ?
Thanks.
Here:

http://cran.r-project.org

Hint: MASS is a *package*.  You want to view its *source*.

Same with most other R packages.  Or just about anything else you want 
to know about R.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Spencer Graves
Consider the following: 

 library(MASS)
 lda
function (x, ...)
UseMethod(lda)
environment: namespace:MASS
 methods(lda)
[1] lda.data.frame lda.defaultlda.formulalda.matrix   

Now type lda.data.frame or lda.default, etc., at a command prompt to 
see the corresponding R code. 

Is this what you want?
spencer graves
Wei Geng wrote:

I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was
implemented in R. Does anyone know where to find out lda source code ?
Thanks.
Wei

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] lda source code

2003-10-01 Thread Wei Geng
Hi Jason, Spencer,

Thanks for the prompt response. The strange thing about MASS is that it's
not in Package Sources as most of other R packages are. It seems to come
with the binary R installation. I checked out the Rxx/library/MASS on my
laptop, there are source code (script) for Venables  Ripley's book but no
source code for lda().

The lda.data.frame or lda.default at prompt (after loading MASS
library(MASS)) has
Error: Object lda.data.frame not found

Wei

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Frank Gibbons
Wei Geng,

I asked the same question about six weeks ago, so let me try to answer it. 
The source for the entire package 'MASS' is in a single file, I believe (at 
least this is true on my Linux setup). The exact location of that file 
you'll have to determine by searching the directory/folder where you 
installed it. The function 'lda' is implemented entirely in R itself, like 
much of its functionality. Look at the functions 'lda' and 'predict.lda' in 
this file for details.

Comments are sparse in most R code, from what I gather, but if you look in 
Pattern Recognition and Neural Networks by Brian Ripley (one of the 
authors of this package), you'll find a discussion in section 2.4 
'Predictive classification' that covers much of what's going on, from what 
I've been able to glean.

I hope that helps. There are certainly others out there who are more au 
fait with this than me.

-Frank Gibbons

At 05:47 PM 10/1/2003, you wrote:
Wei Geng wrote:

I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was
implemented in R. Does anyone know where to find out lda source code ?
Thanks.
Here:

http://cran.r-project.org

Hint: MASS is a *package*.  You want to view its *source*.

Same with most other R packages.  Or just about anything else you want to 
know about R.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PhD, Computational Biologist,
Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
Tel: 617-432-3555   Fax: 
617-432-3557   http://llama.med.harvard.edu/~fgibbons

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Spencer Graves
With R 1.7.1 on Windows 2000, I got fine R source code for each of the 4 
options.  What version of R and what exactly did you do?  I can't 
reproduce your error. 

hope this helps.  spencer graves

Wei Geng wrote:

Hi Jason, Spencer,

Thanks for the prompt response. The strange thing about MASS is that it's
not in Package Sources as most of other R packages are. It seems to come
with the binary R installation. I checked out the Rxx/library/MASS on my
laptop, there are source code (script) for Venables  Ripley's book but no
source code for lda().
The lda.data.frame or lda.default at prompt (after loading MASS
library(MASS)) has
Error: Object lda.data.frame not found
Wei

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Gavin Simpson
Wei Geng wrote:
Does anyone know where to find out lda source code ?
Try typing lda.default at the prompt. That should get you started. Also see:

 methods(lda)

as lda.default isn't the only bit of code used in lda()

Alternatively, grab the source from CRAN and read it at your leisure.

HTH

Gav

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [T] +44 (0)20 7679 5522
ENSIS Research Fellow [F] +44 (0)20 7679 7565
ENSIS Ltd.  ECRC [E] [EMAIL PROTECTED]
UCL Department of Geography   [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Gavin Simpson
Wei Geng wrote:

Hi Jason, Spencer,

Thanks for the prompt response. The strange thing about MASS is that it's
not in Package Sources as most of other R packages are. It seems to come
with the binary R installation. I checked out the Rxx/library/MASS on my
laptop, there are source code (script) for Venables  Ripley's book but no
source code for lda().
Wei, MASS is actually distributed in a bundle called VR, which is on 
CRAN. VR as in Venables and Ripley, the authors of MASS (the book). The 
VR bundle contains MASS, nnet, spatial and class packages.

The reason MASS comes with your binary installation is that the VR 
bundle has Recommended status - and should therefore be available in all 
binary distributions.

HTH,

G
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [T] +44 (0)20 7679 5522
ENSIS Research Fellow [F] +44 (0)20 7679 7565
ENSIS Ltd.  ECRC [E] [EMAIL PROTECTED]
UCL Department of Geography   [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Jason Turner
Wei Geng wrote:
Hi Jason, Spencer,

Thanks for the prompt response. The strange thing about MASS is that it's
not in Package Sources as most of other R packages are. It seems to come
with the binary R installation. I checked out the Rxx/library/MASS on my
laptop, there are source code (script) for Venables  Ripley's book but no
source code for lda().
Ah.  On CRAN, the MASS library is part of a bundle called VR.  Download 
the source for that.

There are a few bundles on the CRAN source pages - if you encounter this 
problem again, just follow the Package Sources link, and search the page 
for MASS (or whatever the package name is).  Use Edit-Find, or 
Ctrl-F, or whatever.  In the case of MASS, you find this one:

VR:

Functions and datasets to support Venables and Ripley, `Modern 
Applied Statistics with S' (4th edition).
Bundle of:	MASS class nnet spatial

It's the Bundle of part you're looking for.

Cheers

Jason
--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] lda source code

2003-10-01 Thread Roger D. Peng
You are using a *beta* version of R 1.8.0 and in that version 
lda.default is not visible to the user (hidden in a namespace).  You can 
access it though by using the ::: (triple colon) operator, as in

 library(MASS)
 MASS:::lda.default
Actually, the first library() call is not necessary.

-roger

Wei Geng wrote:

I am new to R. Trying to find out how lda() {in MASS R1.8.0 Windows} was
implemented in R. Does anyone know where to find out lda source code ?
Thanks.
Wei

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] install from source again

2003-10-01 Thread Erin Hodgess
What does Error 255 stand for in the make bitmapdll, please?

Thanks,
erin
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Re: Mandelbrot set and C code

2003-10-01 Thread Jason Turner
Jason Turner wrote:

...I did a slight tweak to your mandelbrot.R code, so
that x can be a list with components x and y.  This allows you to keep 
zooming in using your mouse to click on the plot (one of the incredibly 
nifty features of such sets).

Using the tweaked version below, call the function as you suggested:

image(mandelbrot(), col = c(heat.colors(49), black))

Then use locator(2) to define your next view:

image(mandelbrot(locator(2)), col = c(heat.colors(49), black))

Of course, I would've been nice if I'd included the tweaked version.  D'ho!

###
# Function to calculate the Mandelbrot set. This function calls a #
# C routine in order to perform the calculations faster.  #
# #
# Written by Mario dos Reis. September 2003   #
# Modified: added if(is.list(x)){...} at start to check if co-ords#
#   are from locator() or similar - jason turner oct 2 2003   #
###
mandelbrot - function(x = c(-3, 1),# x limits
   y = c(-1.8, 1.8),# y limits
   nx = 600,# x resolution
   ny = 600,# y resolution
   iter = 20)   # maximun number of iterations
{
  if(is.list(x)) {
y - range(x$y)
x - range(x$x)
  }
  xcoo - seq(x[1], x[2], len = nx) # x coordinates
  ycoo - seq(y[1], y[2], len = ny) # y coordinates
  set = numeric(nx*ny)  # this will store the output of
# the C routine
  # This is the call to the C function itself
  the.set = .C(mandelbrot,
xcoo = as.double(xcoo),
ycoo = as.double(ycoo),
nx = as.integer(nx),
ny = as.integer(ny),
set = as.integer(set),
iter = as.integer(iter))$set
  # Create a list with elements x, y and z,
  # suitable for image(), persp(), etc. and return it.
  return(list(x = xcoo, y = ycoo, z = matrix(the.set, ncol = ny, byrow 
= T)));
}

--
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] how calculate mean for each group

2003-10-01 Thread szhan
Hello, R experts:
I got data like this:
group   duplicate   treatment 
A Y  5
A Y  3
A N  6
B Y  2
B N  4
B Y  1
How to sort the data and calculate the average treatment value for each group 
in two level of duplicate. Results like this:
group   duplicate   treatment 
A Y  4
A N  6
B Y  1.5
B N  4
Thank you in advance.

Josh

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] how calculate mean for each group

2003-10-01 Thread Spencer Graves
Have you considered aggregate? 

hope this helps.  spencer graves

[EMAIL PROTECTED] wrote:

Hello, R experts:
I got data like this:
group   duplicate   treatment 
A Y  5
A Y  3
A N  6
B Y  2
B N  4
B Y  1
How to sort the data and calculate the average treatment value for each group 
in two level of duplicate. Results like this:
group   duplicate   treatment 
A Y  4
A N  6
B Y  1.5
B N  4
Thank you in advance.

Josh

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] how calculate mean for each group

2003-10-01 Thread Marc Schwartz
On Wed, 2003-10-01 at 20:15, [EMAIL PROTECTED] wrote:
 Hello, R experts:
 I got data like this:
 group   duplicate   treatment 
 A Y  5
 A Y  3
 A N  6
 B Y  2
 B N  4
 B Y  1
 How to sort the data and calculate the average treatment value for each group 
 in two level of duplicate. Results like this:
 group   duplicate   treatment 
 A Y  4
 A N  6
 B Y  1.5
 B N  4
 Thank you in advance.
 
 Josh


# Create a dataframe
df - data.frame(group = c(rep(A, 3), rep(B, 3)), 
 duplicate = c(Y, Y, N, Y, N, Y), 
 treatment = c(5, 3, 6, 2, 4, 1))

# Use aggregate
aggregate(df$treatment, list(df$group, df$duplicate), mean)
  Group.1 Group.2   x
1   A   N 6.0
2   B   N 4.0
3   A   Y 4.0
4   B   Y 1.5

Aggregate returns a data frame in this case, so that you can then set
the colnames and order the output if you wish.

HTH,

Marc Schwartz

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help