[Pomp-commits] r1248 - in pkg/pomp: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 2 20:02:54 CEST 2015


Author: kingaa
Date: 2015-07-02 20:02:54 +0200 (Thu, 02 Jul 2015)
New Revision: 1248

Modified:
   pkg/pomp/NAMESPACE
   pkg/pomp/R/nlf-guts.R
Log:
- remove need for direct call to 'lm' in 'nlf'

Modified: pkg/pomp/NAMESPACE
===================================================================
--- pkg/pomp/NAMESPACE	2015-07-02 18:02:49 UTC (rev 1247)
+++ pkg/pomp/NAMESPACE	2015-07-02 18:02:54 UTC (rev 1248)
@@ -38,10 +38,9 @@
            points,polygon,lines,plot.default,legend,hist,rect,text)		
 importFrom(grDevices,rgb,dev.interactive)
 importFrom(stats,simulate,time,coef,logLik,window,
-           lm,residuals,fitted,sd,
-           dnorm,cov,runif,median,density,
-           spec.pgram,rnorm,weighted.mean,optim,.lm.fit,
-           setNames,cor,kernel,quantile)
+           dnorm,runif,sd,cov,cor,median,density,
+           spec.pgram,rnorm,weighted.mean,optim,
+           .lm.fit,setNames,kernel,quantile)
 importFrom(mvtnorm,dmvnorm,rmvnorm)
 importFrom(subplex,subplex)
 importFrom(deSolve,ode)

Modified: pkg/pomp/R/nlf-guts.R
===================================================================
--- pkg/pomp/R/nlf-guts.R	2015-07-02 18:02:49 UTC (rev 1247)
+++ pkg/pomp/R/nlf-guts.R	2015-07-02 18:02:54 UTC (rev 1248)
@@ -160,9 +160,9 @@
   model.residuals <- matrix(0,dim(model.pred)[1],nvar)
 
   for (jvar in seq_len(nvar)) {
-    model.lm <- lm(model.pred[,jvar]~rbfbasis.model-1)
-    model.residuals[,jvar] <- residuals(model.lm)
-    ck <- coef(model.lm)
+    model.lm <- .lm.fit(rbfbasis.model,model.pred[,jvar])
+    model.residuals[,jvar] <- model.lm$residuals
+    ck <- model.lm$coefficients
     if (verbose) {
       print(ck)
       print(summary(model.lm))



More information about the pomp-commits mailing list