similar to: A faster way to compute finite-difference gradient of a scalar function of a large number of variables

Displaying 20 results from an estimated 4000 matches similar to: "A faster way to compute finite-difference gradient of a scalar function of a large number of variables"

2010 Nov 28
1
faster base::sequence
Hello, Based on yesterday's R-help thread (help: program efficiency), and following Bill's suggestions, it appeared that sequence: > sequence function (nvec) unlist(lapply(nvec, seq_len)) <environment: namespace:base> could benefit from being written in C to avoid unnecessary memory allocations. I made this version using inline: require( inline ) sequence_c <- local( {
2014 Aug 20
1
[RFC PATCH 11/11] x86/MSI: Refactor x86 MSI code
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2014 Aug 20
1
[RFC PATCH 11/11] x86/MSI: Refactor x86 MSI code
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2009 Mar 02
1
initial gradient and vmmin not finite
Dear Rhelpers I have the problem with initial values, could you please tell me how to solve it? Thank you June > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2))) Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, : NA in the initial gradient > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2),method="BFGS")) Error in optim(start, func, gr =
2011 Oct 08
1
HWEBayes, swapping the homozygotes genotype frequencies
I evaluated the Bayes factor in the k=2 allele case with a "triangular" prior under the null as in the example in the help file: HWETriangBF2(nvec=c(88,10,2)) [1] 0.4580336 When I swap the n11 entry and n22 entry of nvec, I received totally different Bayes factor: > > HWETriangBF2(nvec=c(2,10,88)) [1] 5.710153 > In my understanding, defining the genotype frequency as
2007 Jul 27
3
(PR#9811) sequence(c(2, 0, 3)) produces surprising results,
This is as doumented, and I think you could say the same thing of seq(). BTW, sequence() allows negative inputs, and I don't think you want sum(input) in that case. I've never seen the point of sequence(), but it has been around in R for a long time. It is used in packages eRm, extRemes, hydrosanity, klaR, seas. Who knows what people have in private code, so I don't see any
2007 Sep 25
2
Need help with function writing
Hello: If anyone could guide me with this I would greatly appreciate it. Thanking you in advance for your assistance. Using a 3-level input factor alternative so that a function(below) can compute both a two-sided and one-sided p-values. Making the two-sided test the default. And produce output information about which alternative was tested. Where would I place the ifelse statement?
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2007 Sep 24
1
hypothesis testing
This was sent to me by someone on the R-list ( I don't know her ) but I don't have time to look at this right now so I told her I would send it to the R-list because she said it keeps getting bounced when she sends it. #======================================================================= ==================================================================== I am a bit confused with
2012 Apr 05
4
Appropriate method for sharing data across functions
In trying to streamline various optimization functions, I would like to have a scratch pad of working data that is shared across a number of functions. These can be called from different levels within some wrapper functions for maximum likelihood and other such computations. I'm sure there are other applications that could benefit from this. Below are two approaches. One uses the <<-
2011 Jan 10
2
Integration in R
Dear all, It has been ages since I studied integration in college. Right now I try to recover all this kind of knowledge and then try to understand how integration works. Thus I am doing some first 'experiments' and I would like to request your help and comments. I have the function: p2<-function(x){0.5*(3*x^2-1)} # I found the square of p2 by using some pencil and
2010 Feb 12
1
using mle2 for multinomial model optimization
Hi there I'm trying to find the mle fo a multinomial model ->*L(N,h,S?x)*. There is only *N* I want to estimate, which is used in the number of successes for the last cell probability. These successes are given by: p^(N-x1-x2-...xi) All the other parameters (i.e. h and S) I know from somewhere else. Here is what I've tried to do so far for a imaginary data set:
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
> -----Original Message----- > From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org] > On Behalf Of Yijing Wang > Sent: Saturday, July 26, 2014 8:39 AM > To: linux-kernel at vger.kernel.org > Cc: Xinwei Hu; Wuyun; Bjorn Helgaas; linux-pci at vger.kernel.org; > Paul.Mundt at huawei.com; James E.J. Bottomley; Marc Zyngier; linux-arm- > kernel at
2011 Nov 10
3
optim seems to be finding a local minimum
Hello! I am trying to create an R optimization routine for a task that's currently being done using Excel (lots of tables, formulas, and Solver). However, otpim seems to be finding a local minimum. Example data, functions, and comparison with the solution found in Excel are below. I am not experienced in optimizations so thanks a lot for your advice! Dimitri ### 2 Inputs:
2010 Sep 07
5
question on "optim"
Hey, R users I do not know how to describe my question. I am a new user for R and write the following?code for a dynamic labor economics?model and use OPTIM to get optimizations and parameter values. the following code does not work due to the?equation: ?? wden[,i]<-dnorm((1-regw[,i])/w[5])/w[5] where w[5]?is one of the parameters (together with vector a, b and other elements in vector
2004 Oct 31
2
Obtaining fitted model information
Dear list, I am brand new to R and using Dalgaard's (2002) book Introductory Statistics with R (thus, some of my terminology may be incorrect). I am fitting regression models and I want to use Hurvich and Tsai's AICC statistic to examine my regression models. This penalty can be expressed as: 2*npar * (n/(n-npar-1)). While you can obtain AIC, BIC, and logLik, I want to impose the AICC
2009 May 07
2
[PATCH] msi-x: let drivers retry when not enough vectors
pci_enable_msix currently returns -EINVAL if you ask for more vectors than supported by the device, which would typically cause fallback to regular interrupts. It's better to return the table size, making the driver retry MSI-X with less vectors. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Hi Jesse, This came up when I was adding MSI-X support to virtio pci driver, which
2009 May 07
2
[PATCH] msi-x: let drivers retry when not enough vectors
pci_enable_msix currently returns -EINVAL if you ask for more vectors than supported by the device, which would typically cause fallback to regular interrupts. It's better to return the table size, making the driver retry MSI-X with less vectors. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Hi Jesse, This came up when I was adding MSI-X support to virtio pci driver, which