Re: [R] Re : Memory in R.

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Wed, 02 Apr 2008 17:00:16 +0100

On Wed, 2008-04-02 at 16:46 +0200, R RR wrote:
> Dear R users,
> Many thanks for your answers.
> I've made much progress since my last posting.
>
> I have now the followuing problem. I've run the GAM model
>
> mygam <- gam(Y ~ factor(year)
> + m1.q02 + m1.q05y + m1.q05y2 + m1.q06 + m4b.q05 + m4b.q052 + m5a.q01
> + depratio + depratio2 + residence10y + urbrur + factor(prefect)
> + m1.q02_ps
> + m1.q05y_ps
> + m1.q05y2_ps
> + m1.q06_ps
> + m4b.q05_ps
> + m4b.q052_ps
> + m5a.q01_ps
> + depratio_ps
> + depratio2_ps
> + residence10y_ps
> + urbrur_ps
> +factor(hhid), data=cwp2)
>
> and obtained the following error code:

No idea if this will help, but seeing as there doesn't appear to be any smooth terms in that model (s() or lo() depending on whether this is mgcv:::gam or gam:::gam), and you are fitting a Gaussian model (no family so default used), why not fit this using lm? You might find this takes less memory than the way gam handles making the model matrix.

HTH G

>
> Erreur : impossible d'allouer un vecteur de taille 236.3 Mo
> (in english: cannot allocate a 236.3 Mo vector memory).
>
> I have 7237 observations in my data.
>
> Is there any way to increase the memory to fit the model?
>
> Best regards.
>
> Amadou DIALLO
>
>
>
> 2008/4/1, Liviu Andronic <landronimirc_at_gmail.com>:
> > Hello Amadou,
> >
> > On Mon, Mar 31, 2008 at 4:53 PM, R RR <rstat.diallo_at_gmail.com> wrote:
> > > 1 - I want to increase memory, but I can't find
> > > the right way. E.g: in stata, you just type "set memory 1g".
> > > When I try to load huge datasets, R crashes.
> >
> > You will find this recent thread [1] interesting. You'd also want to
> > check packages filehash, ff and sqldf.
> > Regards,
> > Liviu
> >
> > [1] http://www.nabble.com/How-to-read-HUGE-data-sets--tt15729830.html
> >
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 02 Apr 2008 - 16:10:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Apr 2008 - 16:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive