search for: gradient

Displaying 20 results from an estimated 1002 matches for "gradient".

2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
libswfdec/Makefile.am | 2 libswfdec/swfdec_as_strings.c | 17 + libswfdec/swfdec_as_types.c | 16 + libswfdec/swfdec_as_types.h | 2 libswfdec/swfdec_gradient_pattern.c | 129 +++++++++++++++ libswfdec/swfdec_gradient_pattern.h | 67 +++++++ libswfdec/swfdec_movie_as_drawing.c | 172 +++++++++++++++++++- libswfdec/swfdec_pattern.c | 123 -------------- test/image/Makefile.am...
2011 Aug 29
3
gradient function in OPTIMX
...r, when I use OPTIMX with BFGS( or spg), I've got the following an error message. ---------------------------------------------------------------------------------------------------- > optimx(par=theta0, fn=obj.fy, gr=gr.fy, method="BFGS", > control=list(maxit=10000)) Error: Gradient function might be wrong - check it! ---------------------------------------------------------------------------------------------------- I checked and checked my gradient function line by line. I could not find anything wrong. Is it a bug or something? I prefer OPTIMX, so I'd like to know...
2011 Jul 06
1
gradient generation
Dear R-help subscribers; I have a question regarding making gradients in R. I've searched on the web, but was only able to find functions that make a gradient between color X and Y, which is not what I want. I want to 'pick out' individual, smaller pieces of a gradient based on a range of numbers. Say that I have a range of numbers, leading from 0 to...
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 errors. By correct, I mean they match another software program as well as the rasch() function in the ltm package. Now, when I pass the gradient to optim, I get a message of succe...
2011 Nov 30
1
How can I pick a matrix from a function? (Out Product of Gradient)
Hi all, I would like to use optim() to estimate the equation by the log-likelihood function and gradient function which I had written. I try to use OPG(Out Product of Gradient) to calculate the Hessian matrix since sometime Hessian matrix is difficult to calculate. Thus I want to pick the Gradient matrix from the gradient function. Moreover, could R show the process of calculation on gradient functio...
2007 Sep 17
4
graphs with gradients of colors
Hi All, I would like to fill the area under a curve with a gradient of colors. Are there any packages or trick I could use Thanks Stefan Stefan Van Dongen Antwerp [[alternative HTML version deleted]]
2005 Aug 04
4
optim
Dear R-helpers, The function optim implements algorithms that I would like to use. I have function implemented in R, which given the parameters of which minimization is to take place returns a scalar as well as the gradient. Unfortunately optim requires two function _fn_ and _gr_ where fn returns the function value and gr the gradient. Splitting my function in two functions would be easy, however I am wondering if evaluating both is not doubling the the very high computational costs. Most of the computational inte...
2009 Jun 25
3
grid.polygon() + color gradient
Hi, I wonder whether there is a way to generate a polygon (a triangle in my case) with color gradient using grid.polygon() in package grid? I tried something like library(grid) grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA, fill=colorRampPalette(c("green", "lightgray"), space="Lab")(200))) But am only getting...
2011 May 03
3
help with the maxBHHH routine
Hello R community, I have been using R's inbuilt maximum likelihood functions, for the different methods (NR, BFGS, etc). I have figured out how to use all of them except the maxBHHH function. This one is different from the others as it requires an observation level gradient. I am using the following syntax: maxBHHH(logLik,grad=nuGradient,finalHessian="BHHH",start=prm,iterlim=2) where logLik is the likelihood function and returns a vector of observation level likelihoods and nuGradient is a function that returns a matrix with each row corresponding to a si...
2006 Oct 06
3
is it possible to fill with a color or transparency gradient?
Hi all, Is there a way to fill a rectangle or polygon with a color and/or transparency gradient? This would be extremely useful for me in terms of adding some additional information to some plots I'm making, especially if I could define the gradient on my own by putting functions into rgb something like rgb( r=f(x,y), g=f(x,y), b=f(x,y), alpha=f(x,y) ). Not so important whether the coor...
2008 Apr 22
2
optimization and gradient
Dear all, I am using the functions 'optim' and 'nlminb'. For both, you can provide a function which computes the gradient of the objective function (to enhance speed and precision). In my case, both the objective function and the gradient take time to be computed and share many common computations (similar matrix, products, etc...). Therefore, I have to compute these quantities twice which slows down the procedure...
2003 Jan 17
1
supplying gradient to constrOptim()
Hi, I'm very interested in using the constrOptim() function currently in the R-devel sources. In particular, I'm trying to fit point process conditional intensity models via maximum likelihood. However, I noticed that the gradient of the objective function must be supplied for all but the Nelder-Mead method. I was wondering why this was because optim() itself does not require a gradient function for the BFGS or Conjugate Gradient methods. Thanks, -roger _______________________________ UCLA Department of Statistics rpeng@s...
2008 Mar 28
1
Singular Gradient in nls
//Referring to the response posted many years ago, copied below, what is the specific criterium used for singularity of the gradient matrix? Is a Singular Value Decomposition used to determine the singular values? Is it the gradient matrix condition number or some other criterion for determining singularity? // //Glenn // / / /> What does the error 'singular gradient' mean during a nonlinear regression? / T...
2011 Aug 29
0
Error: Gradient function might be wrong ----- in OPTIMX
Dear R users When I use OPTIMX with BFGS, I've got the following error message. ----------------------------------------------------------------- > optimx(par=theta0, fn=obj.fy, gr=gr.fy, method="BFGS") Error: Gradient function might be wrong - check it! ----------------------------------------------------------------- So, I checked and checked my gradient function line by line. However, I could not find anything wrong. When I remove the gradient, I've got ----------------------------------------------...
2004 Mar 29
1
calculate length of gradient ?
...tests=MSGID_FROM_MTA_HEADER,RCVD_IN_BL_SPAMCOP_NET autolearn=no version=2.63 Dear r-help list, my question is about ordination technics: To decide using a linear model response or a unimodal model response, in Canoco (software for ordination technics) you can calculate a so-called "length of gradient". (from Canoco Help file:) > The length of gradient is a measure of how unimodal the species > responses are along an ordination axis. It is the range of the > sample scores divided by the average within-species standard > deviation along the axis. The gradient length is expressed...
2013 Mar 14
2
question about nls
Hi,all: I met a problem of nls. My data: x y 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: > nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out the reason for the error. Any suggesions are welcome. Many thanks. [[alternative HTML version deleted]]
2003 Mar 27
1
How to obtain final gradient estimation from optim
I use optim to compute maximum likelihood estimations without giving an analytical gradient to optim. However, I would like to get an output of the final numerical gradient vector and the final matrix of contributions to the gradient. But I did not find any mention of this kind of output in help pages. Does anyone know how to do that ? Stephane Luchini GREQAM Marseille, France
2013 Jun 11
2
How can we access an element in a structure
Hi, I have a structure, which is the result of a function How can I access the elements in the gradient? > dput(test1) structure(-1.17782911684913, gradient = structure(c(-0.0571065371783791, -0.144708170683529), .Dim = 1:2, .Dimnames = list(NULL, c("x1", "x2")))) > test1[[1]] [1] -1.177829 > test1 [1] -1.177829 attr(,"gradient") x1 x2 [1,...
2006 Sep 29
1
linear gradient in nls
Hello, I hope this doesn't turn into a statistics question but here I go. I am using the nls function with a Gaussian distribution, see coding below. When I run the nls I get an error back saying that I have a linear gradient. I then, of course am unable to do anything else. The data that I am using are intensity values from some mass spectrometry data. Is there something I can do to stop the linear gradient, and I dare to ask why am I getting a linear gradient. I apologies if I haven't supplied enough information o...
2005 Apr 23
1
start values for nls() that don't yield singular gradients?
..., 17, 18, 19) # arbitrary example data here; y <- c(0.1, 1.8, 2.2, 2.6, 2.9) # actual data is similar gm <- nls(y ~ a+b*exp(-exp(-c*(x-d))), start=c(a=?, b=?, c=?, d=?)) I have been unable to properly set the starting value '?'s. All of my guesses yield either a "singular gradient" error if they are decent guesses, or a "singular gradient matrix at initial parameter estimates" error if they are bad guesses like all zeros. How can I pick starting values that don't result in singular gradients? I have had no luck with the "selfStart" models, e.g....