search for: start_val

Displaying 4 results from an estimated 4 matches for "start_val".

2011 Dec 01
1
Estimation of AR(1) Model with Markov Switching
...logf[i] <- log(f[i]) } logl <-sum(logf) return(-logl) } # restrict intercept in state model 0 to be greater than intercept in state model 1 # thus matrix of restrictions R is [1 0 -1 0 0 0 0] R <- matrix(c(1,0,-1,0,0,0,0), nrow = 1) # pick start values for the 7 unknown parameters start_val <- matrix(runif(7), nrow = 7) # ensures starting values are in the feasible set start_val[1,] <- start_val[3,] + 0.1 # estimate pars results <-constrOptim(start_val,neg.logl,grad = NULL, ui = R, ci = 0) Regards, N -- View this message in context: http://r.789695.n4.nabble.com/Esti...
2007 Dec 12
0
IRT Likelihood problem
...s only w.r.t. theta. # x = response pattern # b = vector of location parameters # a = vector of discrimination parameters # c = vector of guessing paramete theta.3pl <- function(x, b, a, c){ opt <- function(theta) -sum(dbinom(x, 1, c + ((1-c)/(1 + exp(-1.7*a*(theta - b)))), log = TRUE)) start_val <- log(sum(x)/(length(x)/sum(x))) out <- optim(start_val , opt, method = "BFGS", hessian = TRUE) out$par } # score = the category the student scored in for item i # d = the item parameters for the ith item # a = the discrimination p # Muraki's GPCM pcm.max <- fun...
2011 Dec 17
0
time-varying parameters kalman filter estimation problem using FKF package
...capm.ss(theta["alpha"], theta["beta"], theta["sigma_e"],theta["sigma_n1"], theta["sigma_n2"]) ans <- fkf(a0 = sp$a0, P0 = sp$P0, dt = sp$dt, ct = sp$ct, Tt = sp$Tt, Zt = sp$Zt, HHt = sp$HHt, GGt = sp$GGt, yt = yt) return(-ans$logLik) } start_val <- runif(5) fit <- optim(start_val, loss.fn, hessian = TRUE, yt = y) -- View this message in context: http://r.789695.n4.nabble.com/time-varying-parameters-kalman-filter-estimation-problem-using-FKF-package-tp4208364p4208364.html Sent from the R help mailing list archive at Nabble.com.
2006 Aug 30
4
Create a vector from another vector
Dear list Suppose I have the following vector: x <- c(3,4,2,5,6) Obviously, this sums to 20. Now, I want to have a second vector, call it x2, that sums to x where 5 <= x <= 20, but there are constraints. 1) The new vector must be same length as x 2) No element of the new vector can be 0 3) Element x2[i] of the new vector cannot be larger than element x[i] of the original vector 4)