similar to: Error message in using nlm() and optim()

Displaying 20 results from an estimated 1000 matches similar to: "Error message in using nlm() and optim()"

2007 Feb 20
0
Standardized residual variances in SEM
Hello, I'm using the "sem" package to do a confirmatory factor analysis on data collected with a questionnaire. In the model, there is a unique factor G and 23 items. I would like to calculate the standardized residual variance of the observed variables. "Sem" only gives the residual variance with the "summary" function, or the standardized loadings with the
2009 Nov 12
1
Transforming a dataframe into a response/predictor matrix
I currently have a data frame whose rows correspond to each student and whose columns are different variables for the student, as shown below: Lastname Firstname CATALOG_NBR Email StudentID EMPLID Start 1 alastname afirstname 1213 *@uark.edu 10295236 # 12/2/2008 2 anotherlastname anotherfirstname 1213 **@uark.edu ## 10295236 9/3/2008 Xattempts Q1
2012 Jun 02
1
Compare data between two groups/countries on 5-point Likert scale questionnare?
Hi everyone, I'm stuck on my dissertation which is due next week. I'm a business major student and my project is a comparative research on corporate social responsibility (CSR) between Chinese and German firms. According to my literature review, it's quite obvious that German firms have much better CSR initiatives and strategies than the Chinese ones and I wanted to test whether it was
2004 Oct 12
2
constrained optimization using nlm/optim?
I'm looking for an example of a simple R script that impliments a contrained nonlinear function using nlm or optim. I'm not exactly sure how to impliment the constraints within the objective function that is passed to nlm/optim. obj.func <- function( p ) { x(p) <- unconstrained obj function value if( constraint1 > something ) { obj.func <- x(p) } else {
2011 Sep 01
0
[PATCH 5/5] resample: Add NEON optimized inner_product_single for floating point
From: Jyri Sarha <jsarha at ti.com> Also adds inline asm implementations of WORD2INT(x) macro for fixed and floating point. --- libspeex/resample_neon.h | 101 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 101 insertions(+), 0 deletions(-) diff --git a/libspeex/resample_neon.h b/libspeex/resample_neon.h index ba93e41..e7e981e 100644 --- a/libspeex/resample_neon.h +++
2010 Feb 02
1
how to use optim() or nlm() to solve three nonlinear equations
Dear all, I just know how to solve an eaquation by using optim() or nlm(). But, now, I have three nonlinear equations, how could we use optim() or nlm() to solve  a system of nonlinear equations in R?  Thank you so much. Sincerely, Joe ___________________________________________________ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! [[alternative HTML version deleted]]
2008 Oct 13
0
optim and nlm error to estimate a matrix
Dear R users, I'm trying to estimate the matrix of regression parameters. I need to do it numerically, so I used optim and nls. I got the initial parameter estimates from least squares, and input them into those functions. But when I run the optim function, it stops in 30 seconds and shows 'convergence=1'. And if I use the nlm function, then it runs for a while, and finally stops
2007 Apr 10
1
nlm() and optim()
Dear R-users, I have just joint the list and much appreciate any thoughts on 2 issues. Firstly, I want to reproduce some minimization results conducted in MATLAB. I have suceeded with nlm and optim-method CG. I have been told that I should get also with other optim methods. Actually, I found the same results when testing a very straightforward equation. However with a more complicated model it
2003 Jan 23
2
Profile on optim/nlm
Greetings, Before I reinvent the wheel has anyone done a profile function for a fit using optim (or nlm)? (like the buggy profile.ms in S+) . It seems a bit tricky as the function to be minimised has to have arguments corresponding to the variables being fitted - which is one less than the function provided to optim()... I guess you can create another function on the fly somehow. Cheers,
2002 Apr 26
1
optim or nlm with matrices
Hi, I have the following hypothetical optimization problem: -det(t(x-A%*%x1)%*%(x-A%*%x1)) where A,x,x1 are matrices. A coefficients and x and x1 are variable matrices or vectors. I tried to apply optim and nlm functions but I kept receive the following massage: Error in A%*%x1 : non-conformable arguments. The massage appears even the -det() can be calculated and the dimensions are checked. here
2010 Jul 08
2
Using nlm or optim
Hello, I am trying to use nlm to estimate the parameters that minimize the following function: Predict<-function(M,c,z){ + v = c*M^z + return(v) + } M is a variable and c and z are parameters to be estimated. I then write the negative loglikelihood function assuming normal errors: nll<-function(M,V,c,z,s){ n<-length(Mean) logl<- -.5*n*log(2*pi) -.5*n*log(s) -
2008 Aug 05
1
optimize simultaneously two binomials inequalities using nlm( ) or optim( )
Dear R users, I?m trying to optimize simultaneously two binomials inequalities (used in acceptance sampling) which are nonlinear solution, so there is no simple direct solution. Please, let me explain shortly the the problem and the question as following. The objective is to obtain the smallest value of 'n' (sample size) satisfying both inequalities: (1-alpha) <= pbinom(c, n, p1)
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
Hi everyone. I have a problem that I have been unable to determine either the best way to proceed and why the methods I'm trying to use sometimes fail. I'm using the pf() function in an optimization function to find a noncentrality parameter that leads to a specific value at a specified quantile. My goal is to have a general function that returns the noncentrality parameter that
2010 Jun 15
1
Error in nlm : non-finite value supplied by 'nlm'
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is the negative loglikelihood derived from a mixing operator. f=function(vector)
2008 Mar 19
0
Error en nlm(logdgenexpn, p = c(vmomest[[1]], vmomest[[2]]), x = x.genexp, : valor no finito provisto por 'nlm'
Dear useRs, I am analysing the behaviour of MLE for the two parameters of a kind of exponential distribution, leaving as initial values the estimators moments produced by the variation coefficient. I do using simulations, giving them an accountant, r. But running my codes remains a problem with the nlm function. To review details wearing On one of the lines put status
2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
Dear expeRts, first of all I'd like to thank you for the quick help on my last which() problem. Here is another one I could not tackle: I have data on an absorption measurement which I want to fit with an voigt profile: fn.1 <- function(p){ for (i1 in ilong){ ff <- f[i1] ex[i1] <- exp(S*n*L*voigt(u,v,ff,p[1],p[2],p[3])[[1]]) } sum((t-ex)^2) } out <-
2009 Feb 19
2
Source code for nlm()
Hi, Where can I find the source code for nlm()? I dowloaded the R2.8.1.tar.gz file and looked at all the .c and .f files, but couldn't find either nlm.c or nlm.f There is an nlm.r file, but that is not useful. Thanks for any help, Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging
2008 May 22
1
Computing Maximum Loglikelihood With "nlm" Problem
Hi, I tried to compute maximum likelihood under gamma distribution, using nlm function. The code is this: __BEGIN__ vsamples<- c(103.9, 88.5, 242.9, 206.6, 175.7, 164.4) mlogl <- function(alpha, x) { if (length(alpha) > 1) stop("alpha must be scalar") if (alpha <= 0) stop("alpha must be positive") return(- sum(dgamma(x, shape = alpha, log = TRUE)))
2012 Oct 19
2
likelihood function involving integration, error in nlm
Dear R users, I am trying to find the mle that involves integration. I am using the following code and get an error when I use the nlm function d<-matrix(c(1,1,0,0,0,0,0,0,2,1,0,0,1,1,0,1,2,2,1,0),nrow=10,ncol=2) h<-matrix(runif(20,0,1),10) integ<-matrix(c(0),nrow=10, ncol=2) ll<-function(p){ for (k in 1:2){ for(s in 1:10){ integrand<-function(x)
2008 Jun 03
1
nlm behaviour and error
Hi R-Gurus, I've been cutting along quite nicely with nlm, until I threw in the following condition in the function that nlm is minimising: if (((term*bexp) < 0.0001)) { #warning(term*bexp, "=term*bexp",psi,"=psi") theta<-2000 } Now when I run this function anywhere else, there is no problem, whether or the if's condition is met. When