search for: modfit

Displaying 9 results from an estimated 9 matches for "modfit".

2011 Jul 28
2
Help with modFit of FME package
Dear R users, I'm trying to fit a set an ODE to an experimental time series. In the attachment you find the R code I wrote using modFit and modCost of FME package and the file of the time series. When I run summary(Fit) I obtain this error message, and the values of the parameters are equal to the initial guesses I gave to them. The problem is not due to the fact that I have only one equation (I tried also with more equations, b...
2011 Dec 08
0
Fit initial time with modFit and modCost
Hello, I would like to use modFit and modCost from the package FME to find the optimal initial time t0 of a process. For simplicity, the process is either "off" (value 0) or "on" (value h). So I have a data vector with some zeros followed by some h's, e.g. > c(0,0,0,2,2,2,2,2,2,2) [1] 0 0 0 2 2 2 2 2 2...
2011 Aug 01
0
Help with modFit of FME package 2
...ules of the mailing lis. Again, please receive my sincere apologies for this. I re-send again the e-mail with .txt attachemnt in the hope someone an help me to solve my problem. I'm trying to fit a set an ODE to an experimental time series. In the attachment you find the R code I wrote using modFit and modCost of FME package and the file of the time series. When I run summary(Fit) I obtain this error message, and the values of the parameters are equal to the initial guesses I gave to them. The problem is not due to the fact that I have only one equation (I tried also with more equations, b...
2011 Aug 04
1
use of modMCMC
Dear all, I used modFit of the package FME to fit a set of ODE to a ste of eperiemntal data. The summary of this fit give me the following error > summary(Fit) Residual standard error: 984.1 on 452 degrees of freedom Error in cov2cor(x$cov.unscaled) : 'V' is not a square numeric matrix In addition: Warning m...
2004 May 30
1
What's wrong with this simple code???
Hi, all I can not figure this out, please have a look and help me out. thank you! Note: this is in SPLUS, not R. I have following code *********************************** modfit<-function(yir,yew, ft) { n<-length(yew) yew<-yew[1:(n-1)] yy<-yir-ft xx<-yew-ft n<-length(xx) xx0<-xx[2:n] yy0 <-yy [2:n] xx1<-xx[1:(n-1)] fit <- garch(yy0~xx0 + xx1+var.in.mean, ~garch(1,1),cond.dist='ged') summary(fit) } fs1hca<-modfit(s1hca.r, s1hca...
2011 Jun 03
0
Package dlm generates unstable results?
..._t = X_t * a_t + noise(V),(no Intercept here) a_t = a_{t-1} + noise(W)   I first run the following code: (I shall provide data at the end of the mail)   BuildMod <- function(x){  return(dlm(   m0  = x[1],   C0  = x[2],   FF  = 1,   GG  = 1,   V   = x[3],   W   = x[4],   JFF = 1,   X   = X   )) } ModFit  <- dlmMLE(Y,rep(1,4),BuildMod,debug=T) dlmMod  <- BuildMod(ModFit$par) V <- dlmMod$V W <- dlmMod$W ModFilt <- dlmFilter(Y,dlmMod) v <- tail(dlmSvd2var(ModFilt$U.C,ModFilt$D.C),1) m <- tail(ModFilt$m,1)   The results are: V = 5.945003e-05 W = 0.0003086623 v = 9.850526e-05 (t...
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
...often fails) for variance function "mu(1-mu)". Here is a short demo to show it: ################################################# set.seed(666) dat <- data.frame(x = rep((-10):10, each = 5), w = rep(1:5, 21)) dat <- transform(dat, y = rbinom(x, size = w, prob = pcauchy(1 + 2*x))) modFit <- glm(y/w ~ x, quasi(link = cauchit, variance = "mu(1-mu)"), dat, weights = w, trace = T) Deviance = 309.2785 Iterations - 1 Deviance = 3257.501 Iterations - 2 Deviance = 1043.455 Iterations - 3 .. Deviance = 1733.824 Iterations - 24 Deviance = 1665.487 Iterations -...
2011 Jun 03
0
How to reconcile Kalman filter result (by package dlm) with linear regression?
...ldMod <- function(x){  L1 = matrix(0,nFactor,nFactor)   L1[upper.tri(L1,T)] <- x[1:nMatrix]  return(dlm(   m0  = rep(0,nFactor),   C0  = diag(nFactor)*10,   FF  = matrix(1,1,nFactor),   GG  = diag(nFactor),   V   = tail(x,1)^2,   W   = crossprod(L1),   JFF = matrix(1:4,nr=1),   X   = X   )) } ModFit  <- dlmMLE(Y,rep(0.1,nTotal),BuildMod,debug=T) dlmMod  <- BuildMod(ModFit$par) V  = dlmMod$V W  = dlmMod$W m0 = dlmMod$m0 C0 = dlmMod$C0 ModFilt <- dlmFilter(Y,dlmMod) v <- tail(dlmSvd2var(ModFilt$U.C,ModFilt$D.C),1) m <- tail(ModFilt$m,1)   Here is the value of Y: 0.012567873937010...
2010 Apr 06
1
estimating the starting value within a ODE using nls and lsoda
All- I am interested in estimating a parameter that is the starting value for an ODE model. That is, in the typical combined fitting procedure using nls and lsoda (alternatively rk4), I first defined the ODE model: minmod <- function(t, y, parms) { G <- y[1] X <- y[2] with(as.list(parms),{ I_t <- approx(time, I.input, t)$y dG <- -1*(p1 + X)*G +p1*G_b dX <-