similar to: Optim question

Displaying 20 results from an estimated 700 matches similar to: "Optim question"

2010 Jun 02
1
Use apply only on non-missing values
I have a function that I am currently using very inefficiently. The following are needed to illustrate the problem: set.seed(12345) dat <- matrix(sample(c(0,1), 110, replace = TRUE), nrow = 11, ncol=10) mis <- sample(1:110, 5) dat[mis] <- NA theta <- rnorm(11) b_vector <- runif(10, -4,4) empty <- which(is.na(t(dat))) So, I have a matrix (dat) with some values within the matrix
2012 Jan 26
1
eRm package - Rasch simulation
When I try to create a Rasch simulation of data using the sim.rasch function, I get more items than I intend #My code library(eRm) #Number of items k <- 20 #Number of participants n <- 100 #Create Rasch Data #sim.rasch(persons, items, seed = NULL, cutpoint = "randomized") r.simulation <- sim.rasch(n,k) I end up with 20 participants and 100 items, but the instructions say
2012 Jan 26
1
eRm - Rasch modeling - First item missing from estimation
I'm trying to kick off some of the rust and learn some of the R packages for Rasch modeling. When I tried using the eRm package, I get item difficulty estimates for all my items accept the first (in terms of order) item. #Begin code library(eRm) r.simulation <- sim.rasch(20,100) r.data <- r.simulation$items #eRm results erm.rasch <- RM(r.data) names(erm.rasch) erm.items <-
2008 Sep 18
2
Ability estimates for partial credit model
Dear all, I'm working on ability estimates using Rasch model. Using the "ltm" package, the procedure is quite simple: ## Factor Scores for the Rasch model fit <- rasch(LSAT) factor.scores(fit) What about Partial Credit Model (PCM)? For PCM I use PCM function from eRm package. Is there any similar function like factor.scores to estimate ability scores using PCM model? Best,
2006 Apr 19
1
Function to approximate complex integral
I am writing a small function to approximate an integral that cannot be evaluated in closed form. I am partially successful at this point and am experiencing one small, albeit important problem. Here is part of my function below. This is a psychometric problem for dichotomously scored test items where x is a vector of 1s or 0s denoting whether the respondent answered the item correctly (1) or
2006 Apr 19
4
Basic vector operations was: Function to approximate complex integral
Dear List I apologize for the multiple postings. After being in the weeds on this problem for a while I think my original post may have been a little cryptic. I think I can be clearer. Essentially, I need the following a <- c(2,3) b <- c(4,5,6) (2*4) + (2*5) + (2*6) + (3*4) + (3*5) +(3*6) But I do not know of a built in function that would do this. Any suggestions? -----Original
2002 Jul 12
2
'R' library for Rasch modelling?
I'm new to 'R', so forgive me if I've used the wrong term. I'd like to model some Likert-style items using Rasch methods. I've been unable to find mention of these for 'R'. Would someone happen to know of any? Thanks in any case. Bill ------------ "It is the time that you have wasted for your rose that makes your rose so important."--St-Exupery
2007 Jul 26
2
error in using R2WinBUGS on Ubuntu 6.10 Linux
I am trying to run WinBUGS 1.4 from the Ubuntu 6.10 Linux distribution. I am using the R2WinBUGS packages with the source file listed below. WinBUGS appears to run properly, but I get the following message after WinBUGS starts in WINE. Does anyone know what may be causing this error and what the correction may be? Thanks ERROR MESSAGE: fixme:ole:GetHGlobalFromILockBytes cbSize is 13824
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
2011 Nov 20
2
ltm: Simplified approach to bootstrapping 2PL-Models?
Dear R-List, to assess the model fit for 2PL-models, I tried to mimic the bootstrap-approach chosen in the GoF.rasch()-function. Not being a statistician, I was wondering whether the following simplification (omit the "chi-squared-expressed model fit-step") would be appropriate: GoF.ltm <- function(object, B = 50, ...){ liFits <- list() for(i in 1:B){ rndDat <-
2016 Oct 26
2
borrar texto en una gráfica
Hola a todos, Os envío una consulta que considero sencilla pero me está resultando imposible de resolver. Si ejecutáis el siguiente código, obtendréis la gráfica que os adjunto: library(ltm) modelo <- rasch(LSAT) plot(modelo, main="Curva probabilidad pregunta 1",legend = TRUE, cx = "bottomright", items=1,xlab="Conocimiento",ylab="Probabilidad") Resulta
2010 Mar 10
2
help R non-parametric IRT simulation
Hello R, I am looking for non-parametric simulation in IRT. Is there any IRT package that does non-parametric simulation? helen L [[alternative HTML version deleted]]
2011 Jul 27
1
Inserting weights in ltm package
Afternoon R help, I want to run Rasch/IRT analyses using the ltm package, however, I am using large scale survey data which requires weighting for accurate results. I attempted to create a weighted object to insert into the formulae of the ltm packages, however, the survey data only includes 30 replicate weights and a sampling weight. The svrepdesign requires additional information such as
2008 May 09
2
which.max2()
Hello, which.max() only returns one index value, the one for the maximum value. If I want the two index values for the two largest values, is this a decent solution, or is there a nicer/better R'ish way? max2 <-function(v) { m=which.max(v) v[m] = -v[m] m2=which.max(v) result=c(m, m2) result } Seems to work ok. Thanks, Esmail
2001 Nov 05
2
Item Response Analysis
Hello, Would someone have ever heard or developed any Item Response Models library for R ? Of course, a Rasch model can be estimated through glm() but it is not the case for more complex (polytomous) response models. Similarly I would be interested in any R implementation of nonlinear multivariate analyses a la GIFI (HOMALS, PRINCALS, OVERALS). Thanks a lot in advance, Yvonnick Noel, PhD.
2009 Sep 02
1
Ability Estimates for Repeated Measurements in the eRm Package
Dear R Users, I am using the LLTM and the LRSM functions in the eRm package to do repeated measurements where there are 2 measurement points for a list of 10 items. I am trying to get ability estimates but am having trouble. I don't think that it is appropriate to use the pmat function since the person parameters are based on all 20 items. Rather, I think it would be more appropriate to
2007 Jul 21
1
Gamma MLE
Hello, I was asked to try the following code on R, gamma.mles function (xx,shape0,rate0) { n<- length(xx) xbar<- mean(xx) logxbar<- mean(log(xx)) theta<-c(shape0,rate0) repeat { theta0<- theta shape<- theta0[1] rate<- theta0[2] S<- n*matrix(c(log(rate)-digamma(shape)+logxbar,shape/rate-xbar),ncol=1) I<- n*matrix(c(trigamma(shape),-1/rate,-1/rate,shape/rate^2),ncol=2)
2008 Mar 10
1
ltm package question
Hello All, I was wondering how I can get the overall Pearson chi^2 test of model fit with its df and p value in the LTM package for the 2PL models. Thanks, -- Davood Tofighi Department of Psychology Arizona State University [[alternative HTML version deleted]]
2009 Jun 04
3
Fast way of finding top-n values of a long vector
If x is a (long) vector and n << length(x), what is a fast way of finding the top-n values of x? Some suggestions (calculating the ratio of the two top values): library("rbenchmark") set.seed(1); x <- runif(1e6, max=1e7); x[1] <- NA; benchmark( replications=20, columns=c("test","elapsed"), order="elapsed" , sort = {a<-sort(x,
2020 Jun 10
4
Read-flag of mails don't update
Hi, since one or two month I have a problem with Dovecot not updating the read-flag on mails using IMAP. I receive new mails, but when reading, they still unread on other devices (but shown as read on the first device). When I remember correct, this problem doesn't come with an update of dovecot, but just occured at some time. But I've updated dovecot since then a few times.