Jouni Kerman | 1 May 2005 04:19
Favicon

[R] eigen() may fail for some symmetric matrices, affects mvrnorm()


Hi all,

Recently our statistics students noticed that their Gibbs samplers were 
crashing due to some NaNs in some parameters. The NaNs came from 
mvrnorm (Ripley & Venables' MASS package multivariate normal sampling 
function) and with some more investigation it turned out that they were 
generated by function eigen, the eigenvalue computing function. The 
problem did not seem to happen when the option "symmetric" was set to 
FALSE; at first I thought that only matrices that were not completely 
symmetric (such as ones with small errors of the magnitude 1e-17 or so) 
were affected but then we encountered matrices that were perfectly 
symmetric but eigen still generated NaNs when symmetric=TRUE.

I wrote a trivial patch to mvrnorm to detect this problem and to 
recompute the eigenvalues with symmetric=TRUE and EISPACK=TRUE. This 
seems to work. symmetric=FALSE also seems to work, but is somewhat 
slower.

If you use mvrnorm then you may want to try this. Details and the patch 
are on my web page, along with one example of a problematic symmetric 
matrix (to be loaded with the 'load' function). The NaNs should appear 
in the eigenvectors. This particular matrix may not produce an error on 
all platforms.

      http://www.stat.columbia.edu/~kerman/Software/rprog.html

Thanks to Radford Neal who suggested on our research web log (link 
below) that setting EISPACK=TRUE may help.

(Continue reading)

Prof Brian Ripley | 1 May 2005 08:42
Picon
Picon
Favicon

Re: [R] eigen() may fail for some symmetric matrices, affects mvrnorm()

I do not begin to understand this.

mvrnorm() uses EISPACK=TRUE and always has done, explicitly since there
was such an argument to eigen() (since 15 Jan 2003: the argument was
introduced in R 1.7.0 in April 2003).  Just take a look at the code.

The claimed `patch' (which is not a patch at all but a replacement) is not 
based on any remotely current version of MASS.

The puported example against eigen(EISPACK=FALSE) (the default) works 
correctly (no NaNs) on all my systems, including the distributed version 
of rw2010.  It seems that students (and `Jouni Kerman' is listed as a 
student) at the Department of Statistics, Columbia University are provided 
with a deficient computing environment (unstated despite the posting 
guide): my surmise is that a broken external BLAS or LAPACK is in use.

On Sat, 30 Apr 2005, Jouni Kerman wrote:

>
> Hi all,
>
> Recently our statistics students noticed that their Gibbs samplers were 
> crashing due to some NaNs in some parameters. The NaNs came from mvrnorm 
> (Ripley & Venables' MASS package multivariate normal sampling function) and 
> with some more investigation it turned out that they were generated by 
> function eigen, the eigenvalue computing function. The problem did not seem 
> to happen when the option "symmetric" was set to FALSE; at first I thought 
> that only matrices that were not completely symmetric (such as ones with 
> small errors of the magnitude 1e-17 or so) were affected but then we 
> encountered matrices that were perfectly symmetric but eigen still generated 
(Continue reading)

Peter Dalgaard | 1 May 2005 09:25
Picon
Favicon

Re: [R] legend(): how to put variable in subscript?

Aleksey Naumov <naumov <at> buffalo.edu> writes:

> Dear List,
> 
> I would like to plot a simple legend with two math expressions, e.g.
> 
> plot(0)
> legend(1, 0.5, expression(sigma[i], sigma[j]))
> 
> The difficulty is that i and j should be variables rather than strings "i" and 
> "j". In other words I'd like to do something like:
> 
> i = "A"
> j = "B"
> legend(1, 0.5, expression(sigma[i], sigma[j]))
> 
> and have "A" and "B" as the actual subscripts. I can substitute the variable 
> in the expression e.g.:
> 
> legend(1, 0.5, substitute(sigma[i], list(i='A', j='B')))
> legend(1, 0.5, bquote(sigma[.(i)]))
> 
> however, this gives me just one of the two entries in the legend. I cannot 
> figure out how to include both sigmas in the legend.
> 
> What would be the best way to do something like this? Thank you for your ideas 
> or suggestions.

Ick. One of those cases that suggests that our current substitute
mechanisms don't quite cut it... However, try
(Continue reading)

Matthias Kohl | 1 May 2005 10:45
Picon
Picon
Favicon

Re: [R] User-defined random variable

Achim Zeileis wrote:

>On Sat, 30 Apr 2005, Peter Dalgaard wrote:
>
>  
>
>>Paul Smith <phhs80 <at> gmail.com> writes:
>>
>>    
>>
>>>Dear All
>>>
>>>I would like to know whether it is possible with R to define a
>>>discrete random variable different from the ones already defined
>>>inside R and generate random numbers from that user-defined
>>>distribution.
>>>      
>>>
>>Yes. One generic way is to specify the quantile function (as in
>>qpois() etc.) and do qfun(runif(N)).
>>    
>>
>
>If the support discrete but also finite, you can also use sample(), e.g.
>
>  sample(myset, N, replace = TRUE, prob = myprob)
>
>Z
>
>  
(Continue reading)

Marco Chiarandini | 1 May 2005 12:54
Picon

[R] Problems using html and dvips of Hmisc

Dear all,

I am experiencing the two following problems trying to produce a
comfortable output using the package Hmisc.

If I use:

html(latex(D,file="here.tex"),file="here.html")

where D is a data.frame the function html does not write in "here.html" but
only in a temporary file somewhere else in my PC (latex instead
writes correctly in the file "here.tex".

If I use

dvips(latex(D),file="here.ps")

everything runs smooth but if the
data frame is quite large I am not able to center it properly in
the output file .ps. The table always stays high on the page
going out from the upper side of the paper.

I tested this two unwanted behaviours both under linux and under MacOsx
and the packages are all up-to-date.

Thank you for the consideration.

Regards,

Marco
(Continue reading)

Jouni Kerman | 1 May 2005 16:27
Favicon

Re: [R] eigen() may fail for some symmetric matrices, affects mvrnorm()


Hi all,

Professor Ripley is right. This problem does not affect newer versions 
of mvrnorm. We had an older version of mvrnorm which did not set 
EISPACK=TRUE as it should. Sorry for the confusion. Thank you for the 
correction.

Jouni Kerman

On May 1, 2005, at 6:08 AM, Prof Brian Ripley <ripley <at> stats.ox.ac.uk> 
wrote:
> mvrnorm() uses EISPACK=TRUE and always has done, explicitly since there
> was such an argument to eigen() (since 15 Jan 2003: the argument was
> introduced in R 1.7.0 in April 2003).  Just take a look at the code.

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Stephen Nyangoma | 1 May 2005 16:34
Picon
Favicon

[R] International Association for Statistical Computing Conference (session on Diagnostics)


Dear Everyone,
I am organizing a session on Diagnostics (Regression etc.) for the  IASC on 
Computational Statistics and Data Analysis which will take place at the 
Amathus Beach Hotel in Limassol Cyprus, October 28-31, 2005. Those of you 
who would like to attend and present a paper may submit their 
abstracts/papers online at
    http://www.csdassn.org/europe/csda2005/
The papers will be considered for publication in the CSDA Journal.

Best regards.

Dr. Stephen Nyangoma
Groningen Bioinformatics Institute
The University of Groningen
The Netherlands.

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

John Janmaat | 1 May 2005 16:47
Picon
Picon

[R] Roots of quadratic system.

Hello,

I have a system of quadratic equations (results of a Hamiltonian optimization)
which I need to find the roots for.  Is there a package and/or function which
will find the roots for a quadratic system?  Note that I am not opimizing, but
rather solving the first order conditions which come from a Hamiltonian.  I am
basically looking for something in R that will do the same thing as fsolve in
Matlab.

Thanks,

John.

==============================================
Dr. John Janmaat
Department of Economics
Acadia University
Tel: 902-585-1461

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Glazko, Galina | 1 May 2005 17:14

[R] simulate zero-truncated Poisson distribution


Dear All

I would like to know whether it is possible with R to 
generate random numbers from zero-truncated Poisson 
distribution.

Thanks in advance,
Galina

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Programas de email | 1 May 2005 18:21
Picon
Favicon

[R] Programa de email e contatos


Convidamos você a experimentar o Magic Seven,
o melhor programa de envio de emails para listas
de contatos. 

Com o Magic Seven você pode enviar emails personalizados
e com recursos multimídia, além de ser o programa mais
rápido e confiável do mercado.

O Magic Seven está no mercado há mais de 5 anos,
já estando na sua versão 5. É um produto em
constante evolução, com suporte permanente ao cliente.

Alguns dos recursos do Magic Seven:

- Opção de envio de emails 100% personalizados. Ex: "Caro José",
utilizando até 100 campos diferentes por email.
- Envio de emails com sons, músicas, animações e
qualquer recurso multimídia.
- Opção de envio de emails sem a utilização do servidor
  SMTP do seu provedor.
- Envio de milhares de emails por hora.
- Identificação de emails inexistentes e incorretos.
- Relatório(LOG) de envio dos emails.
- Os emails são enviados um a um. Por isso sua lista de emails
fica protegida, não aparecendo nas mensagens enviadas.
- Opção de attachments(arquivos) nas mensagens enviadas.
- Leitura e deleção rápida de emails e retornos de erro.
- Gerenciamento completo das listas de emails, com filtros
para emails duplicados e diversas outras opções.
(Continue reading)


Gmane