search for: sum_i

Displaying 20 results from an estimated 44 matches for "sum_i".

Did you mean: ssm_i
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
...t a Cramer-von Mises type test statistic which involves double sums of max(X_i,Y_j) where X and Y are vectors of differing length. I am currently using ifelse pointwise in a vector, but have a nagging suspicion that there is a more efficient way to do this. Basically, I require three sums: sum1: \sum_i\sum_j max(X_i,X_j) sum2: \sum_i\sum_j max(Y_i,Y_j) sum3: \sum_i\sum_j max(X_i,Y_j) Here is my current implementation - any pointers to more efficient computation greatly appreciated. nx <- length(x) ny <- length(y) sum1 <- 0 sum3 <- 0 for(i in 1:nx) { sum1 <- su...
2009 Aug 06
1
solving system of equations involving non-linearities
Hi, I would appreciate if someone could help me on track with this problem. I want to compute some parameters from a system of equations given a number of sample observations. The system looks like this: sum_i( A+b_i>0 & A+b_i>C+d_i) = x sum_i( C+d_i>0 & C+d_i>A+b_i) = y sum_i( exp(E+f_i) * ( A+b_i>0 & A+b_i>C+d_i) = z A, C, E are free variables while the other letters represent values given from sample observations. The equations involve counts of the number of fulfilled c...
2005 Feb 15
1
shrinkage estimates in lme
Hello. Slope estimates in lme are shrinkage estimates which pull the OLS slope estimates towards the population estimates, the degree of which depends on the group sample size and the distance between the group-based estimate and the overall population estimate. Although these shrinkage estimates as said to be more precise with respect to the true values, they are also biased. So there is a
2013 Feb 19
2
[LLVMdev] Is va_arg correct on Mips backend?
I check the Mips backend for the following C code fragment compile result. It seems not correct. Is it my misunderstand or it's a bug. //ch8_3.cpp #include <stdarg.h> int sum_i(int amount, ...) { int i = 0; int val = 0; int sum = 0; va_list vl; va_start(vl, amount); for (i = 0; i < amount; i++) { val = va_arg(vl, int); sum += val; } va_end(vl); return sum; } int main() { int a = sum_i(6, 1, 2, 3, 4, 5, 6); return a; }
2006 Jan 23
1
weighted likelihood for lme
...to fit a simple random intercept model with a fixed intercept. Suppose I want to assign a weight w_i to the i-th contribute to the log-likelihood, i.e. w_i * logLik_i where logLik_i is the log-likelihood for the i-th subject. I want to maximize the likelihood for N subjects Sum_i {w_i * logLik_i} Here is a simple example to reproduce # require(nlme) > foo <- Orthodont > lme(distance ~ 1, random = ~ 1|Subject, method="ML", data = foo) Linear mixed-effects model fit by maximum likelihood Data: foo Log-likelihood: -257.7456 Fixed: dis...
2013 Feb 19
0
[LLVMdev] Is va_arg correct on Mips backend?
...n Tue, Feb 19, 2013 at 4:15 AM, Jonathan <gamma_chen at yahoo.com.tw> wrote: > I check the Mips backend for the following C code fragment compile result. > It seems not correct. Is it my misunderstand or it's a bug. > > //ch8_3.cpp > #include <stdarg.h> > > int sum_i(int amount, ...) > { > int i = 0; > int val = 0; > int sum = 0; > > va_list vl; > va_start(vl, amount); > for (i = 0; i < amount; i++) > { > val = va_arg(vl, int); > sum += val; > } > va_end(vl); > > return sum; > } >...
2006 Dec 08
1
MAXIMIZATION WITH CONSTRAINTS
Dear R users, I?m a graduate students and in my master thesis I must obtain the values of the parameters x_i which maximize this Multinomial log?likelihood function log(n!)-sum_{i=1]^4 log(n_i!)+sum_ {i=1}^4 n_i log(x_i) under the following constraints: a) sum_i x_i=1, x_i>=0, b) x_1<=x_2+x_3+x_4 c)x_2<=x_3+x_4 I have been using the ?ConstrOptim? R-function with the instructions I report below, and I have tried to implement them with different values of ?n?. BUT I have encountered 2 problems: 1) the result of the maximization is the same of...
2013 Feb 20
3
[LLVMdev] Is va_arg correct on Mips backend?
...emory address is a relocation record which set value by linker/loader, then it maybe is correct. clang -c ch8_3.cpp -emit-llvm -o ch8_3.bc llc -march=mips -relocation-model=pic -filetype=asm ch8_3.bc -o ch8_3.mips.s .section .mdebug.abi32 .previous .file "ch8_3.bc" .text .globl _Z5sum_iiz .align 2 .type _Z5sum_iiz, at function .set nomips16 # @_Z5sum_iiz .ent _Z5sum_iiz _Z5sum_iiz: .cfi_startproc .frame $sp,64,$ra .mask 0x80000000,-4 .fmask 0x00000000,0 .set noreorder .set nomacro .set noat # BB#0: lui $2, %hi(_gp_disp) addiu $2, $2, %lo(_gp_disp) add...
2001 May 23
2
help: exponential fit?
Hi there, I'm quite new to R (and statistics), and I like it (both)! But I'm a bit lost in all these packages, so could someone please give me a hint whether there exists a package for fitting exponential curves (of the type t --> \sum_i a_i \exp( - b_i t)) on a noisy signal? In fact monoexponential decay + polynomial growth is what I'd like to try. Thanks in advance, Mirko. -- Dr. M. Luedde <Mirko.Luedde at CellControl.De> CellControl Biomedical Laboratories AG Am Klopferspitz 19, 82152 Martinsried +49-89-895275-0 +...
2009 Apr 21
2
Changing the binning of collected data
...et of average sizes, {D_i} and plot the corresponding n_i(D_i). But what if the initial {n_i}'s observations do not belong to a known distribution and you still want to calculate n(D_i)? On the top of my head, I think that whatever I do must conserve the original total number of observations N=\sum_i{n_i}, but this does not terribly constrain the problem. Any suggestion is welcome. Many thanks Lorenzo
2013 Feb 20
0
[LLVMdev] Is va_arg correct on Mips backend?
...by linker/loader, then it maybe is > correct. > > > clang -c ch8_3.cpp -emit-llvm -o ch8_3.bc > llc -march=mips -relocation-model=pic -filetype=asm ch8_3.bc -o > ch8_3.mips.s > > .section .mdebug.abi32 > .previous > .file "ch8_3.bc" > .text > .globl _Z5sum_iiz > .align 2 > .type _Z5sum_iiz, at function > .set nomips16 # @_Z5sum_iiz > .ent _Z5sum_iiz > _Z5sum_iiz: > .cfi_startproc > .frame $sp,64,$ra > .mask 0x80000000,-4 > .fmask 0x00000000,0 > .set noreorder > .set nomacro > .set noat > # BB#0: &gt...
2009 May 07
2
lasso based selection for mixed model
Dear useRs (called Frank Harrell, most likely), after having preached for years to my medical colleagues to be cautious with stepwise selection procedures, they chanted back asking for an alternative when using mixed models. There is a half dozen laXXX packages around for all types of linear models, but as far I see there is none for mixed models such as lme. Even boot.stepAIC (which I
2007 Jul 19
1
R
Hello! I am using for logistic regression in survey data the svyglm procedure. I wondered how does the strata effect estimates SE (in addition to the weights given proportional to population size). I know that for simple regression measurements of each strata is assumed to have different variance. But in a logistic model this is not the case. Can anyone help me here? Thank you Ron [[alternative
2012 Aug 16
1
sum over extremely small numbers
Dear All, I am evaluating the value of loglikelihood and it ends up with the sum of tiny numbers. Below is an example: suppose I would like to calculate sum_i (log (sum_j x [i, j] )), the index of log (x) is in the range, say (-2000, 0). I am aware that exp(-744.5) will be expressed as 0 in 32 bit R and exp Is there a way to improve the result? R example: powd <- sample(-2000:0, 100, replace=T) # the power of x [i, j] x <- matrix(exp(powd),10)...
2007 Apr 15
1
Use estimated non-parametric model for sensitivity analysis
Dear all, I fitted a non-parametric model using GAM function in R. i.e., gam(y~s(x1)+s(x2)) #where s() is the smooth function Then I obtained the coefficients(a and b) for the non-parametric terms. i.e., y=a*s(x1)+b*s(x2) Now if I want to use this estimated model to do optimization or sensitivity analysis, I am not sure how to incorporate the smooth function since s() may not
2011 Mar 16
2
Re; Fitting a Beta distribution
I want to fit some p-values to a beta distribution. But the problem is some of the values have 0s and 1's. I am getting an error if I use the MASS function to do this. Is there anyway to get around this? -- Thanks, Jim. [[alternative HTML version deleted]]
2005 Oct 31
1
information matrix in random effects model
...model. Both functions return the covariance matrix of the estimated parameters. I have the following question: Is it possible to retrieve the information matrix of such a model (ie from the fitted object)? In particular, the information matrix can be computed as a sum of individual contributions: Sum_i H_i = H, where H_i are the contributions of each case to the Hessian matrix H. Are these individual contributions computed somewhere in either of the functions to estimate random effects models, and is it possible to extract them somehow from the fitted objects? ingmar -- Ingmar Visser Department...
2006 Mar 05
1
predicted values in mgcv gam
Hi, In fitting GAMs to assess environmental preferences, I use the part of the fit where the lower confidence interval is above zero as my criterion for positive association between the environmental variable and species abundance. However I like to plot this on the original scale of species abundance. To do so I extract the fit and SE using predict.gam. Lately I compared more
2015 Jul 30
4
[LLVMdev] RFC: Callee speedup estimation in inline cost analysis
...* The above summation is over all basic blocks in F. * Freq(BB) = BlockFrequency(BB)/BlockFrequency(Entry(F)) This dynamic instruction count measurement doesn't distinguish between a single-cycle instruction and a long latency instruction. Instead of using InstructionCount(BB)), we could use Sum_I(Weight(I)) where the summation is over all instructions I in B and Weight(I) represents the time it takes to execute instruction I. The dynamic instruction count of F into a callsite C after inlining InlinedDI(F, C) can be similary computed taking into account the instructions that are simplified...
2017 Aug 10
1
"Help On optim"
...* Each row in the above data frame represent the segment and each segment contain two-mixture component. (Latter I will increase the segment and the mixture component) So for every segment with n mixture component I have to find the *max f(x) with ?infinity < x < infinity* *f(x)=sum_i c_i N(O,mu_i,sigma_i). * *Since i need to calculate the derivate f? and set f?(x)=0 I thought of using Newton method * *In R the function I selected for my problem is optim.* *Below is my code * *l = 2 # represent the number of mixture component* *i=1# represent the segment 1 if i...