# error message

**URL:** <https://forum.certara.com/t/error-message/2991>\
**Category:** Phoenix WNL basics\
**Created:** [June 27, 2016, 6:23pm UTC](https://forum.certara.com/t/error-message/2991 "2016-06-27T18:23:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksuresh32](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@ksuresh32](https://forum.certara.com/u/ksuresh32)\
**Post date:** [June 27, 2016, 6:23pm UTC](https://forum.certara.com/t/error-message/2991/1 "2016-06-27T18:23:45Z")

</div>

Hi,

I am getting following message. When i want to compute simple linear model, y=mx+c. I have 12000 rows.

\*\*\* ERROR 10037 \*\*\* PROBLEM EXCEEDS AVAILABLE RESOURCES

Please let me know.

thanks,

Suresh

---

<div class="post-metadata">

**Author:** ![Helmut\_Schuetz](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@Helmut\_Schuetz](https://forum.certara.com/u/Helmut_Schuetz)\
**Post date:** [June 28, 2016, 12:39am UTC](https://forum.certara.com/t/error-message/2991/2 "2016-06-28T00:39:32Z")

</div>

The error message is telling, isn’t it?

I guess that PHX was not built for such a high number of cases and your are running out of available RAM.

12,000 rows are peanuts for **R**. Example:

```auto
r <- 5e7 # rows
c <- 2 # columns
x <- rnorm(r, mean = 1) # generate random
y <- x + rnorm(r, mean = 0.1) # data (slope 1, intercept 0.1)
data <- matrix(c(x, y), nrow=r, ncol=c,
               dimnames=list(rep(NULL, r),
                             c("x", "y")))
# fit a linear model with intercept
mod <- lm(y ~ x, data=as.data.frame(data))
print(mod)

```

Takes a couple of seconds on my machine (16 GB RAM) to generate a data set with 50 million (!) rows of random data and fit a linear model.

```auto
Call:
lm(formula = y ~ x, data = as.data.frame(data))

Coefficients:
(Intercept) x
     0.0977 0.99999

```

Even in basic **R** sooner or later you _will_ run out of RAM (the function lm() does not swap to disk)… If you have _really_ large data sets, consider package **biglm** ([https://cran.r-project.org/package=biglm](https://cran.r-project.org/package=biglm)).

---

<div class="post-metadata">

**Author:** ![SimonDavis](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SimonDavis](https://forum.certara.com/u/SimonDavis)\
**Post date:** [June 28, 2016, 9:19am UTC](https://forum.certara.com/t/error-message/2991/3 "2016-06-28T09:19:54Z")

</div>

It may also be you’ve not set up the problem well, e.g. no initial estimates but saying that you would provide them. Please either post the project here or email it to support.

thanks, Simon.

---

<div class="post-metadata">

**Author:** ![Helmut\_Schuetz](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@Helmut\_Schuetz](https://forum.certara.com/u/Helmut_Schuetz)\
**Post date:** [June 28, 2016, 2:16pm UTC](https://forum.certara.com/t/error-message/2991/4 "2016-06-28T14:16:44Z")

</div>

Hi Simon.

> [@sdavis](#):
>
> It may also be you’ve not set up the problem well, e.g. no initial estimates but saying that you would provide them. Please either post the project here or email it to support.

Attached an example with 12,000 rows. Only the WNL model 502 fails: No problems if coded as a PHX-model.

[Many cases.phxproj](https://forum.certara.com/uploads/short-url/y2Kz8Te31gsrSszm57SposNV8iz.phxproj) (1.26 MB)

---

<div class="post-metadata">

**Author:** ![ksuresh32](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@ksuresh32](https://forum.certara.com/u/ksuresh32)\
**Post date:** [June 28, 2016, 2:53pm UTC](https://forum.certara.com/t/error-message/2991/5 "2016-06-28T14:53:23Z")

</div>

> [@helmut\_1](#):
>
> Hi Simon.
> 
> Attached an example with 12,000 rows. Only the WNL model 502 fails: No problems if coded as a PHX-model.

> [@sdavis](#):
>
> It may also be you’ve not set up the problem well, e.g. no initial estimates but saying that you would provide them. Please either post the project here or email it to support.
> 
> thanks, Simon.

Hi,

I tried with and without initial estimates, still gave me an error. I think this is related to rows only. with more than 3000 rows it doesn’t work.

Thanks,

Suresh

---

<div class="post-metadata">

**Author:** ![ksuresh32](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@ksuresh32](https://forum.certara.com/u/ksuresh32)\
**Post date:** [June 28, 2016, 2:55pm UTC](https://forum.certara.com/t/error-message/2991/6 "2016-06-28T14:55:29Z")

</div>

> [@helmut\_1](#):
>
> Hi Simon.
> 
> Attached an example with 12,000 rows. Only the WNL model 502 fails: No problems if coded as a PHX-model.

Hi,

Thanks for PHX model. It seems working. Can you send me the same code for PHX build 6.3.0.395. when i opened Manyfiles.phx project it gave an error due to version change.

thanks,

Suresh

---

<div class="post-metadata">

**Author:** ![ksuresh32](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@ksuresh32](https://forum.certara.com/u/ksuresh32)\
**Post date:** [June 28, 2016, 2:56pm UTC](https://forum.certara.com/t/error-message/2991/7 "2016-06-28T14:56:10Z")

</div>

> [@helmut\_1](#):
>
> The error message is telling, isn’t it?
> 
> I guess that PHX was not built for such a high number of cases and your are running out of available RAM.
> 
> 12,000 rows are peanuts for **R**. Example:
> 
> ```auto
> r <- 5e7 # rows
> c <- 2 # columns
> x <- rnorm(r, mean = 1) # generate random
> y <- x + rnorm(r, mean = 0.1) # data (slope 1, intercept 0.1)
> data <- matrix(c(x, y), nrow=r, ncol=c,
> dimnames=list(rep(NULL, r),
> c("x", "y")))
> # fit a linear model with intercept
> mod <- lm(y ~ x, data=as.data.frame(data))
> print(mod)
> 
> ```
> 
> Takes a couple of seconds on my machine (16 GB RAM) to generate a data set with 50 million (!) rows of random data and fit a linear model.
> 
> ```auto
> Call:
> lm(formula = y ~ x, data = as.data.frame(data))
> 
> Coefficients:
> (Intercept) x
> 0.0977 0.99999
> 
> ```
> 
> Even in basic **R** sooner or later you _will_ run out of RAM (the function lm() does not swap to disk)… If you have _really_ large data sets, consider package **biglm** ([https://cran.r-project.org/package=biglm](https://cran.r-project.org/package=biglm)).

Hi,

If i nothing works in PHX, i will try in R.

thanks for the code,

Suresh

---

<div class="post-metadata">

**Author:** ![SimonDavis](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SimonDavis](https://forum.certara.com/u/SimonDavis)\
**Post date:** [June 28, 2016, 3:21pm UTC](https://forum.certara.com/t/error-message/2991/8 "2016-06-28T15:21:04Z")

</div>

# Helmut’s code

test(){  
covariate(x)

error(e = 1)  
observe(y = a0 + a1 \* x + e)

fixef(a0 = c(, 0.1, ))  
fixef(a1 = c(, 1, ))  
}

---

<div class="post-metadata">

**Author:** ![ksuresh32](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@ksuresh32](https://forum.certara.com/u/ksuresh32)\
**Post date:** [June 28, 2016, 3:22pm UTC](https://forum.certara.com/t/error-message/2991/9 "2016-06-28T15:22:11Z")

</div>

> [@sdavis](#):
>
> # Helmut’s code
> 
> test(){  
> covariate(x)
> 
> error(e = 1)  
> observe(y = a0 + a1 \* x + e)
> 
> fixef(a0 = c(, 0.1, ))  
> fixef(a1 = c(, 1, ))  
> }

thanks,

suresh

---

<div class="post-metadata">

**Author:** ![Helmut\_Schuetz](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@Helmut\_Schuetz](https://forum.certara.com/u/Helmut_Schuetz)\
**Post date:** [June 28, 2016, 4:25pm UTC](https://forum.certara.com/t/error-message/2991/10 "2016-06-28T16:25:48Z")

</div>

Note that the linear model 502 in WNL uses least squares minimization (O)LS, whereas all PHX-models use restricted maximum likelihood (REML).

Without knowing the background of your problem it is difficult to recommend anything. Note that in generating my data I used a variance of 1. For my data set in I got with the PHX-model:

```auto
a0     0.0769702
a1     1.01384
stdev0 0.989692

```

Note that not only the parameters (a0, a1) are estimated but the error as well.

In R:

```auto
library(nlme)
mod1 <- lm(y ~ x, data=data) # OLS
mod2 <- lme(y ~ x, random= ~ 1 | x, data=data) # REML by default
summary(mod1)
summary(mod2)

```

Gives:

```auto
Call:
lm(formula = y ~ x, data = data)

Residuals:
    Min      1Q  Median      3Q     Max
-3.9928 -0.6668  0.0048  0.6620  5.3788

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.077016   0.012763   6.034 1.64e-09 ***
x           1.013820   0.009098 111.434  < 2e-16 ***
---
Signif. codes:  0 ‘ ***’ 0.001 ‘** ’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9898 on 11998 degrees of freedom
Multiple R-squared:  0.5086,    Adjusted R-squared:  0.5086
F-statistic: 1.242e+04 on 1 and 11998 DF,  p-value: < 2.2e-16

Linear mixed-effects model fit by REML
 Data: data
       AIC     BIC    logLik
  33829.03 33858.6 -16910.52

Random effects:
 Formula: ~1 | x
        (Intercept)  Residual
StdDev:  0.05123659 0.9884501

Fixed effects: y ~ x
               Value  Std.Error    DF   t-value p-value
(Intercept) 0.076984 0.01276893 10071   6.02901       0
x           1.013845 0.00910216 10071 111.38508       0
 Correlation:
  (Intr)
x -0.706

Standardized Within-Group Residuals:
         Min           Q1          Med           Q3          Max
-4.028606196 -0.672923072  0.004855385  0.667628142  5.427081375

Number of Observations: 12000
Number of Groups: 10073

```

nlme/lme() comes close to the estimates of PHX. Personally for such a simple problem I would prefer (O)LS.
