Hi R users 

 

I am trying to run a non linear parameter optimization using the
function optim() and I have problems regarding memory allocation.

 

My data are in a dataframe with 9 columns. There are 656100 rows.

>head(org_results)

 

  comb.id   p H1 H2 Range Rep no.steps      dist         aver.hab.amount

1       1       0.1  0  0     1            100        0
0.2528321              0.1393901

2       1       0.1  0  0     1            100        0
0.4605934              0.1011841

3       1       0.1  0  0     1            100        4
3.4273670              0.1052789

4       1       0.1  0  0     1            100        4
2.8766364              0.1022138

5       1       0.1  0  0     1            100        0
0.3496872              0.1041056

6       1       0.1  0  0     1            100        0
0.1050840              0.3572036

> 

 

>est_coeff <- optim(coeff,SS, steps=org_results$no.steps,
Range=org_results$Range, H1=org_results$H1, H2=org_results$H2,
p=org_results$p)

 

Error: cannot allocate vector of size 5.0 Mb

In addition: Warning messages:

1: In optim(coeff, SS, steps = org_results$no.steps, Range =
org_results$Range,  : Reached total allocation of 10000Mb: see
help(memory.size)

2: In optim(coeff, SS, steps = org_results$no.steps, Range =
org_results$Range,  : Reached total allocation of 10000Mb: see
help(memory.size)

3: In optim(coeff, SS, steps = org_results$no.steps, Range =
org_results$Range,  : Reached total allocation of 10000Mb: see
help(memory.size)

4: In optim(coeff, SS, steps = org_results$no.steps, Range =
org_results$Range,  : Reached total allocation of 10000Mb: see
help(memory.size)

> 

 

> memory.size()

[1] 9978.19

> memory.limit()

[1] 10000

> 

 

 

I know that I am not sending reproducible codes but I was hoping that
you could help me understand what is going on. I set a maximum limit of
10000 mega byte (by writing this string --max-mem-size=10000M after the
target path, right click on R icon, shortcut tab). And R is telling me
that it cannot allocate a vector of size 5 Mb??? 

 

Thank you for your help

 

Lorenzo


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to