From bhs2 at mevik.net  Thu Oct  6 13:30:57 2005
From: bhs2 at mevik.net (=?iso-8859-1?q?Bj=F8rn-Helge_Mevik?=)
Date: Thu, 06 Oct 2005 13:30:57 +0200
Subject: [Rd] R crashes for large formulas in lm() (PR#8180)
In-Reply-To: <x27jcsnpe9.fsf@viggo.kubism.ku.dk> (Peter Dalgaard's message
	of "05 Oct 2005 14:01:50 +0200")
References: <50214.194.57.165.22.1128511281.squirrel@webmail.lyon.inserm.fr>
	<x27jcsnpe9.fsf@viggo.kubism.ku.dk>
Message-ID: <m0hdbuvq4u.fsf@bar.nemo-project.org>

Peter Dalgaard wrote:

> You could still have a point, but with 255^2 terms (all but 255 of
> which will be redundant since x^2 == x:x == x in modeling language).
> Presumably someone thought that noone in their right mind would
> specify 65000 terms...

I don't think this is a fixed limit on the number of terms: On "my" R
(see below),

set.seed(123)
x1 <- runif(1000)
x2 <- runif(1000)
x3 <- runif(1000)
x4 <- runif(1000)
x5 <- runif(1000)
x6 <- runif(1000)
x7 <- runif(1000)
x8 <- runif(1000)
x9 <- runif(1000)
x10 <- runif(1000)
y <- rnorm(1000)
fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8*x9)^2)

works fine, but

fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8*x9*x10)^2)

crashes.


> version
         _                
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    2                
minor    1.1              
year     2005             
month    06               
day      20               
language R                

The OS is Debian 3.1, the machine has 512MB RAM, and R was compiled
"out of the box" from the official sources.

-- 
Bj?rn-Helge Mevik



[Rd] R crashes for large formulas in lm() (PR#8180)
=?iso-8859-1?q?Bj=F8rn-Helge_Mevik?=