search for: thetahat

Displaying 13 results from an estimated 13 matches for "thetahat".

2011 Aug 18
3
Error message: object of type 'closure' is not subsettable
Dear R-users I need to calibrate kappa, rho, eta, theta, v0 in the following code, see below. However when I run it, I get: y <- function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k, t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)} > nlminb(start=list(kappa, rho, eta, theta, v0), objective = y, lower =lb, > upper =ub) Error in dots[[1L]][[1L]] : object of type 'closure' is not subsettable And I don't know what...
2004 Dec 16
1
help with multiple imputation using imp.mix
...r1[gender1==1]<-2 gender1[gender1==0]<-1 data$gender<-gender1 x<-cbind(data$gender,data$ipip,data$ideol,data$prtyid, data$wage1992) colnames(x)<-c("gender","ipip", "ideol", "prtyid","wage") # start imputation s <- prelim.mix(x,4) thetahat <- em.mix(s) And here comes the error message: > newtheta <- da.mix(s,thetahat, steps=100,showits=TRUE) Steps of Data Augmentation: 1...Error in da.mix(s, thetahat, steps = 100, showits = TRUE) : Improper posterior--empty cells > imp.mix(s, newtheta, x)
2003 Jun 14
1
Missing data augmentation
...der 1 is not positive definite To be honest I have no idea whatsoever what that error message means, so my experiments with mice were shortlived :-) I then tried the package "norm". I got some ways with the experiment, following the help file: s <- prelim.norm(as.matrix(myDataSet)) thetahat <- em.norm(s) rngseed(1234567) theta <- da.norm(s, thetahat, steps=20, showits=TRUE) At this stage however I get the following error: Steps of Data Augmentation: 1...2...Error: NA/NaN/Inf in foreign function call (arg 2) This seems strange to me, since the whole purpose of this routine is t...
2005 Jul 08
2
missing data imputation
...ng. Thanks, Anders Corr Ph.D. Candidate #DOWNLOAD DATA (61Kb) download.file("http://www.people.fas.harvard.edu/~corr/tc.csv","C:/R") #RUN NORM tc <- read.csv("tc.csv", header = TRUE) rngseed(1234567) #set random number generator seed s <- prelim.norm(tc) thetahat <- em.norm(s) #find the MLE for a starting value theta <- da.norm(s,thetahat,steps=20,showits=TRUE,return.ymis=TRUE) #take 20 steps ximp <- imp.norm(s,thetahat,tc) #impute missing data under the MLE
2007 Jul 12
1
mix package causes R to crash
...y <-rnorm(n,1*x1+2*x2+3*x3+4*x4,2) w <-rnorm(n,3,1.2) ymis<-y ymis[floor(runif(10,1,n))]<-NA wmis<-w wmis[floor(runif(10,1,n))]<-NA dat<-as.data.frame(cbind(wmis,ymis,x1,x2,x3,x4)) s <- prelim.mix(dat,3) # do preliminary manipulations thetahat <- em.mix(s) # ML estimate for unrestricted model rngseed(1234567) # set random number generator seed newtheta <- da.mix(s,thetahat,steps=100) # data augmentation ximp <- imp.mix(s, newtheta, dat) # impute under newtheta ###############################################...
2011 Nov 24
2
da.norm function
Hello all I'm running da.norm function in R for climate data rngseed(1234567) theta1=da.norm(mydata, thetahat, steps=1000,showits=T) param1=getparam.norm(mydata,theta1) As I understand the 1000 steps represent the markov chain values. Is there a way to plot them? Something like plot(1:1000, param1$mu[]). I just can't find a way to extract them out of my theta1. Thank you, Andrey. [[alternative HTML...
2004 Aug 26
1
EM norm package (NA/NaN/Inf in foreign function call (arg 2))
...from the internet (it is not too big): library(norm) df<-download.file("http://www.tariqkhan.org/R/DataFromExcel.csv", "C:/Program Files/R/d.csv") mat<-as.matrix(read.table("C:/Program Files/R/d.csv", sep = ",")) s<-prelim.norm(mat) rngseed(1234567) thetahat<-em.norm(s, maxits = 1000, criterion = 0.0035) Iterations of EM: 1...2...3........348...349...Error: NA/NaN/Inf in foreign function call (arg 2) Someone else on the list found that using scale() helped with em.norm, but for me it only increased the number of iterations before giving the same e...
2005 Oct 04
0
The error message in package Mix
...tor("list",5) rngseed(1234567) #<-- set random number generator seed margins<-c(1,2) #<-- I have two categorical variables, if I had three, the margin=c(1,2,3) design<-matrix(c(1,1,1,1,0,1,0,1,0,0,1,1),ncol=3) for (i in 1:5){ cat("Doing imputation ",i,"\n") thetahat <- ecm.mix(s,margins,design) newtheta <- dabipf.mix(s, margins,design,thetahat, steps=2000, showits=TRUE) MI[[i]] <- imp.mix(s, newtheta) } Steps of ECM: 1...2...3...4...5...6...7...8...9...10...11...12...13...14...15...16...17... 18...19...20...21...22...23...24...25...26... Steps of Da...
2005 Oct 24
0
In da.norm Error: NA/NaN/Inf in foreign function call (arg 2)
...ple code: library(norm) n<-50 p<-5 prob.miss<-.5 #generate complete data x<-matrix(rnorm(n*p),nrow=n) #create missing data for (j in 1:p) {miss<-rbinom(n,1,prob.miss) for (i in 1:n){if (miss[i]==1) x[i,j]<-NA}} #create imputations seed<-1234 rngseed(seed) s <- prelim.norm(x) thetahat <- em.norm(s,showits=F) da.norm(s,thetahat,steps=1000,showits=F,return.ymis=TRUE)
2005 Sep 27
0
Help: A application error and failed just-in-debugging.
...iple imputation------------------------------# MI<-vector("list",10) #<--vector of complete data after MI fit.model.mi<-vector("list",10) rngseed(1234567) #<-- set random number generator seed for (i in 1:10){ cat("Doing imputation ",i,"\n") thetahat <- em.mix(s) newtheta <- da.mix(s, thetahat, steps=2000, showits=TRUE) MI[[i]] <- imp.mix(s, newtheta) } Here is help file about mix Help files with alias or concept or title matching 'mix' using regular expression matching: glmmPQL(MASS) Fit Generalized Linear...
2009 Apr 22
1
Multiple imputations : wicked dataset ? Wicked computers ? Am I cursed ? (or stupid ?)
...(w[!is.na(w[, j]), j]) : aucun argument pour max ; -Inf est renvoy? 5: NAs introduits lors de la conversion automatique 6: In max(w[!is.na(w[, j]), j]) : aucun argument pour max ; -Inf est renvoy? 7: NAs introduits lors de la conversion automatique > # Parameter estimation > system.time(thetahat<-em.mix(s,showits=TRUE)) Erreur dans rep(prior, s$ncells) : argument 'times' incorrect Timing stopped at: 0 0 0 ### indeed : s$ncells is NA ! ### Therefore, the rest crashes : > # Data augmentation proper > system.time(newtheta <- da.mix(s, thetahat, steps=100, showits=TRUE)) E...
2008 Dec 08
1
DLM - Covariates in the system equation
Is there a way to add covariates to the system equation in a time-varying approach: Y[t] = F'[t]theta[t] + v[t], v[t] ~ N[0,V] #observation equation theta[t] = theta[t-1] + psi*Z[t] + w[t], w[t] ~ N[0,W] #system equation While F[t] is a matrix of regressors to capture the short term effect on the response series Y, Z[t] measures the long-term effect of either (1) two policies by a step
2008 Jul 21
5
Coefficients of Logistic Regression from bootstrap - how to get them?
Hello all, I am trying to optimize my logistic regression model by using bootstrap. I was previously using SAS for this kind of tasks, but I am now switching to R. My data frame consists of 5 columns and has 109 rows. Each row is a single record composed of the following values: Subject_name, numeric1, numeric2, numeric3 and outcome (yes or no). All three numerics are used to predict