search for: grad

Displaying 20 results from an estimated 420 matches for "grad".

Did you mean: grab
2010 Apr 16
1
data frame manipulation
..."PRIMARY NICKEL", "PRIMARY NICKEL", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD", "SPCL HIGH GRAD"), CREATED.DATE = structure(c(14708, 14...
2011 Feb 10
1
Newb Prediction Question using stepAIC and predict(), is R wrong?
...roblem?) The dataframe that I use to build the model is the same as the data I'm using to predict with. Here is a portion of what is happening.. This is the value it is predicting = > [1] 9.482975 Summary of the model Call: lm(formula = reservesub$paid ~ reservesub[, 3 + i] + reservesub$grads[, i] + reservesub$Sun + reservesub$Fri + reservesub$Sat) Residuals: Min 1Q Median 3Q Max -15.447 -4.993 -1.090 3.910 27.454 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.71370 1.46449 3.902 0.000149 **...
2010 Apr 15
1
sum rows in a data.frame...solution
...$DESCRIPTION,1,14)) > colnames(a)=c("DESCRIPTION") > lme=as.data.frame(c(a,lme[,2:3])) > lme DESCRIPTION CLOSING.PRICE POSITION 1 PRIMARY NICKEL 25,755.7100 0 2 PRIMARY NICKEL 25,760.8600 0 3 PRM HGH GD ALU 2,415.9000 0 4 SPCL HIGH GRAD 2,420.1000 -1 5 SPCL HIGH GRAD 2,420.4100 -1 6 SPCL HIGH GRAD 2,420.7300 1 7 SPCL HIGH GRAD 2,421.0500 1 8 SPCL HIGH GRAD 2,388.4300 0 9 SPCL HIGH GRAD 2,389.0000 0 10 SPCL HIGH GRAD 2,389.5700 0 11 SPCL HIGH GRAD 2,402.290...
2007 Sep 17
0
2 commits - libswfdec/swfdec_bits.c
...Mon Sep 17 11:31:24 2007 +0200 more bad duplication diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index bddef90..2d1551a 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -599,12 +599,14 @@ swfdec_bits_get_rgba (SwfdecBits * bits) } static inline SwfdecGradient * -swfdec_bits_do_get_gradient (SwfdecBits *bits, gboolean alpha) +swfdec_bits_do_get_gradient (SwfdecBits *bits, gboolean alpha, gboolean morph) { SwfdecGradient *grad; guint i, n_gradients; n_gradients = swfdec_bits_get_u8 (bits); + if (morph) + n_gradients *= 2; grad = g_m...
2007 Apr 22
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_font.c libswfdec/swfdec_movie.c
...>finish_movie) klass->finish_movie (movie); swfdec_js_movie_remove_jsobject (movie); diff-tree 375960447cf4f4286d6bab0e36656dfb6df89d30 (from ef2514da947a3aeb0d8210cba619fdd350281e94) Author: Benjamin Otte <otte@gnome.org> Date: Sun Apr 22 14:06:41 2007 +0200 break out of gradient loop when no more bits are available diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index 0f7e4c9..7077cdc 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -585,11 +585,15 @@ swfdec_bits_get_gradient (SwfdecBits * b n_gradients = swfdec_bits_get_u8 (bits...
2007 Jan 12
1
incorrect result of deriv (PR#9449)
Full_Name: Joerg Polzehl Version: 2.3.1 OS: x86_64, linux-gnu Submission from: (NULL) (62.141.176.22) I observed an incorrect behavior of function deriv when evaluating arguments of dnorm deriv(~dnorm(z,0,s),"z") expression({ .value <- dnorm(z, 0, s) .grad <- array(0, c(length(.value), 1), list(NULL, c("z"))) .grad[, "z"] <- -(z * dnorm(z)) attr(.value, "gradient") <- .grad .value }) deriv(~exp(-z^2/(2*s^2))/s/sqrt(2*pi),"z") expression({ .expr4 <- 2 * s^2 .expr6 <- exp(-z^2/...
2009 Nov 20
2
Problem with Numerical derivatives (numDeriv) and mvtnorm
I'm trying to obtain numerical derivative of a probability computed with mvtnorm with respect to its parameters using grad() and jacobian() from NumDeriv. To simplify the matter, here is an example: PP1 <- function(p){ thetac <- p thetae <- 0.323340333 thetab <- -0.280970036 thetao <- 0.770768082 ssigma <- diag(4) ssigma[1,2] <- 0.229502120 ssigma[1,3] <- 0.677949335...
2006 Feb 16
2
Problem with scoping a variable value
Hi there, I have a function which has a variable called show as an input: richardson.grad <- function(func, x, d=0.01, eps=1e-4, r=6, show=F){ # do some things if(show) { cat("\n","first order approximations", "\n") print(a.mtr, 12) } #do more things and return } The show variable is being used as a flag to show intermed...
2013 Mar 10
1
Error with grad() for numerical differential of a function
Hello everyone, I have programmed a function and, among other things, it has to compute the differential of a function. I have been using the function grad() and I have programmed some simulated studies. I have testes with 72,576 different combinations of the initial values and now I got an error in only 4 situations. The error comes from the function grad() and I don't understand why. This is the output: Error in grad.default(Sstar, x = t, dist1...
2004 May 14
2
NLME model question
....expr5 <- exp(((r * -1) * x)) .expr7 <- 1 + (.expr2 * .expr5) .expr13 <- .expr7^2 .value <- k/.expr7 .actualArgs <- match.call()[c("r", "k")] if(all(unlist(lapply(as.list(.actualArgs), is.name)))) { .grad <- array(0, c(length(.value), 2), list(NULL, c("r", "k"))) .grad[, "r"] <- - ((k * (.expr2 * (.expr5 * (-1 * x))))/.expr13) .grad[, "k"] <- (1/.expr7) - ((k * (1e-005 * .expr5))/.expr13) dimnames(...
2012 Jan 03
1
higher derivatives using deriv
Dear everyone, the following is obviously used to compute the nth derivative, which seems to work (deriv(sqrt(1 - x^2),x,n)) However, before using this, I wanted to make sure it does what I think it does but can't figure it out when reading the ?deriv info or any other documentation on deriv for that matter: deriv(expr, namevec, function.arg = NULL, tag = ".expr", hessian = FALSE,
2009 May 10
4
Partial Derivatives in R
Quick question: Which function do you use to calculate partial derivatives from a model equation? I've looked at deriv(), but think it gives derivatives, not partial derivatives. Of course my equation isn't this simple, but as an example, I'm looking for something that let's you control whether it's a partial or not, such as: somefunction(y~a+bx, with respect to x,
2010 Apr 06
2
Extracting formulae from expression() / deriv()
I am attempting to extract the derivative/ gradient from this expression df1p <- deriv(f1, "P") > df1p expression({ .value <- s - c - a * P .grad <- array(0, c(length(.value), 1L), list(NULL, c("P"))) .grad[, "P"] <- -a attr(.value, "gradient") <- .grad .value }) So...
2013 Mar 10
0
Steepest Ascent Algorithm
...pon lordata[4,3] like<-function(theta,data,gcomp=FALSE,hesscomp=FALSE) { a = theta[1] Bo=theta[2] B1=theta[3] d=data[,1] #treatment w=data[,2] #censored t=data[,3] #survival time mu = (t^a)*exp(Bo+d*B1) l = sum(w*log(mu)-mu+w*log(a/t)) if(gcomp==TRUE) { grad=matrix(0,3,1) grad[1]=sum(w*log(t)-mu*log(t)+w/a) #alpha grad[2]=sum(w-mu) #Bo grad[3]=sum(d*w-d*mu) #B } if(hesscomp==TRUE){ #Recall mu = (t^a)*exp(Bo+d*B1) hess = matrix(0,3,3) hess[1,1] = sum(-(mu*log(t)^2)-w/(a^2)) #dada...
2006 Nov 18
1
deriv when one term is indexed
...hat deriv does not automatically handle the indexing of the beta parameter. I modified the output of deriv from the case when the term beta is not indexed to give: dd.deriv2 <- function (Blev, beta, gamm, GL) { .expr1 <- GL^gamm .value <- Blev + rep(beta, each = 17) * .expr1 .grad <- array(0, c(length(.value), 5), list(NULL, c("Blev", "beta.rouge", "beta.vert", "beta.bleu", "gamm" ))) .grad[, "Blev"] <- 1 .grad[1:17, "beta.rouge"] <- .expr1[1:17] .grad[18:34, "beta.vert&q...
2009 Oct 29
4
deriv() to take vector of expressions as 1st arg?
...of expressions as its first argument. Aside, I saw how to give a vector argument to the second argument. like to have something like: deriv(c(~x^2+y^3, ~x^5+y^6), c("x","y")) the documentation for this function talks about being able to "returns the function values with a gradient attribute containing the gradient matrix[!!!]". and I indeed want a matrix of expressions to be returned. In effect, I want to get the Jacobian. Thank you, if you have some hints on this. Tom
2001 May 28
0
bugs in deriv(*, *, function.arg = ) (PR#953)
...10 +0200 In R versions 0.50 and 0.64.2 , the following worked > deriv(expression(sin(cos(x) * y)), c("x","y"), function(x,y){}) function (x, y) { .expr1 <- cos(x) .expr2 <- .expr1 * y .expr4 <- cos(.expr2) .value <- sin(.expr2) .grad <- array(0, c(length(.value), 2), list(NULL, c("x", "y"))) .grad[, "x"] <- -.expr4 * (sin(x) * y) .grad[, "y"] <- .expr4 * .expr1 attr(.value, "gradient") <- .grad .value } which *was* S(-plus) compatible....
2007 May 26
1
bug from nlm function (PR#9711)
Full_Name: bernardo moises lagos alvarez Version: 2.4.0 OS: Windows XP professional Submission from: (NULL) (152.74.219.16) I need obtained the MLE of weibull parameters using the nlm with exact gradient an hessian. I am doing. bug report :Erro en log(b) : el argumento "b" est? ausente, sin default 1.Construction to objectiv functin with n=1 data >fllwform<-formula(~log(a)-log(b)-(a-1)*(log(x)-log(b))- (x^a)/(b^a)) > fllwfuncH <-deriv(fllwform,c("a","b&q...
2012 Aug 31
3
fitting lognormal censored data
Hi , I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Since, there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method which requires first and second derivative of log likelihood but my problem after runing the code is the estimators were too high. with this email ,I provide
2007 Jul 30
2
deriv, loop
...ve("C:/R-2.5.0/temp.txt") But how to convert the output of the loop to a vector that I can manipulate (by prod or sum etc), without having to write and append to a file? Question 2: > deriv(~gamma(x),"x") expression({ .expr1 <- gamma(x) .value <- .expr1 .grad <- array(0, c(length(.value), 1), list(NULL, c("x"))) .grad[, "x"] <- .expr1 * psigamma(x) attr(.value, "gradient") <- .grad .value }) BUT > deriv3(~gamma(x),"x") Error in deriv3.formula(~gamma(x), "x") : Function 'psig...