[Yuima-commits] r92 - pkg/yuima/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jul 9 12:31:08 CEST 2010
Author: iacus
Date: 2010-07-09 12:31:08 +0200 (Fri, 09 Jul 2010)
New Revision: 92
Modified:
pkg/yuima/R/qmle.R
Log:
modified qmle
Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R 2010-07-09 09:53:21 UTC (rev 91)
+++ pkg/yuima/R/qmle.R 2010-07-09 10:31:08 UTC (rev 92)
@@ -181,6 +181,7 @@
mycoef <- as.list(p)
names(mycoef) <- nm[-idx.fixed]
mycoef[fixed.par] <- fixed
+ print(mycoef)
minusquasilogl(yuima=yuima, param=mycoef, print=print, env)
}
@@ -271,11 +272,48 @@
list(par = numeric(0L), value = f(start))
}
+
+ f1 <- function(p) {
+ mycoef <- as.list(p)
+ names(mycoef) <- nm
+
+ minusquasilogl(yuima=yuima, param=mycoef, print=print, env)
+ }
+
+
coef <- oout$par
+ control=list()
+ par <- coef
+ fixed <- old.fixed
+ fixed.par <- names(fixed)
+ idx.fixed <- match(fixed.par, nm)
+ con <- list(trace = 0, fnscale = 1, parscale = rep.int(1,
+ length(par)), ndeps = rep.int(0.001, length(par)), maxit = 100L,
+ abstol = -Inf, reltol = sqrt(.Machine$double.eps), alpha = 1,
+ beta = 0.5, gamma = 2, REPORT = 10, type = 1, lmm = 5,
+ factr = 1e+07, pgtol = 0, tmax = 10, temp = 10)
+ nmsC <- names(con)
+ if (method == "Nelder-Mead")
+ con$maxit <- 500
+ if (method == "SANN") {
+ con$maxit <- 10000
+ con$REPORT <- 100
+ }
+ con[(namc <- names(control))] <- control
- vcov <- if (!is.null(oout$hessian))
+
+ hess <- .Internal(optimhess(coef, f1, NULL, con))
+ hess <- 0.5 * (hess + t(hess))
+ if (!is.null(nm))
+ dimnames(hess) <- list(nm, nm)
+ oout$hessian <- hess
+
+ vcov <- if (length(coef))
solve(oout$hessian)
else matrix(numeric(0L), 0L, 0L)
+
+
+
min <- oout$value
mycoef <- as.list(coef)
More information about the Yuima-commits
mailing list