search for: sumsquares

Displaying 17 results from an estimated 17 matches for "sumsquares".

2002 Aug 14
3
t-test via matrix operations
I need to calculate a large number of t statistics, and would like to do so via matrix operations. So far I have figured out a way to calculate the mean of each row of the matrix: d <- matrix(runif(100000,1,10), 1000, 10) # some test data s <- rep(1,ncol(d)) # a sum vector to use for matrix multiplication means <- (d%*%s)/ncol(d) This is at least 1 order of magnitude faster than
2004 Jun 09
1
Re: R equivalent of Splus rowVars function
...set the "twopass" default to FALSE, because in finance noise is always bigger than signal. I am cc'ing to R-help, as this is really an R question. -- -- David Brahm (brahm at alum.mit.edu) colVars <- function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE, twopass=TRUE) { if (SumSquares) return(colSums(x^2, na.rm, dims)) N <- colSums(!is.na(x), FALSE, dims) Nm1 <- if (unbiased) N-1 else N if (twopass) {x <- if (dims==length(dim(x))) x - mean(x, na.rm=na.rm) else sweep(x, (dims+1):length...
2002 Nov 15
2
Why no colSDs etc
Hi people, If there is a fn "colMeans" why isn't there a "colSDs" etc Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275) GPO Box 3411 Sydney NSW 2001 Australia Mobile: +61:0411-185-652 Fax: +61:2:8923-5363 E-mail: pri at chu.com.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2003 Dec 10
3
How to calculate standard error for a vector?
Hi all! I 'm beginner and i develop a bio-application with VB and i need some statistic functions! could i calculate StdError, CoeffOfVariance, SumSquared with R langage? if yes, what are functions to use? I need also to use ANOVA and t-test... Thanks for your help! Laurent Houdusse Analyste Programmeur
2006 Mar 31
2
rowVars
I am using the R 2.2.1 in a Windows XP environment. I have a dataframe with 12 columns and 1,000 rows. (Some of the rows have 1 or fewer values.) I am trying to use rowVars to calculate the variance of each row. I am getting the following message: ?Error in na.remove.default(x) : length of 'dimnames' [1] not equal to array extent? Is there a good work-around?
2023 Aug 20
1
Determining Starting Values for Model Parameters in Nonlinear Regression
...mymod <- y ~ 1/(Beta1*x1 + Beta2*x2 + Beta3*x3) > library(nlsr) > strt<-c(Beta1=1, Beta2=2, Beta3=3) > trysol<-nlxb(formula=mymod, data=mydata, start=strt, trace=TRUE) > trysol > # or pshort(trysol) > > > Output is > > residual sumsquares =? 1.5412e-05? on? 20 observations > ? ? ?after? 29? ? Jacobian and? 43 function evaluations > ? ?name? ? ? ? ? ? coeff? ? ? ? ? SE? ? ? ?tstat? ? ? pval? ? ? gradient? ? JSingval > Beta1? ? ? ? ?0.00629212? ? ?5.997e-06? ? ? ?1049? 2.425e-42? ?4.049e-08? ? ? ?721.8 >...
2023 Aug 20
2
Issues when trying to fit a nonlinear regression model
...list(theta1 = 0.37, theta2 = exp(-1.8), theta3 = -0.05538), data=mod14data2_random) summary(nlregmod2) Object has try-error or missing parameters nlregmod2 And I get some NA values when retrieving the statistics for the fitted model: residual sumsquares = 0.0022973 on 15 observations after 2235 Jacobian and 2861 function evaluations name coeff SE tstat pval gradient JSingval theta1 9330.89 NA NA NA 5.275e-11 967470 theta2 9330.41 NA...
2002 Mar 17
5
compute variance of every column in a matrix without a loop
Is it possible to compute the variance of every column in a matrix without a loop? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
...x1, x2, x3, y) > mydata > mymod <- y ~ 1/(Beta1*x1 + Beta2*x2 + Beta3*x3) > library(nlsr) > strt<-c(Beta1=1, Beta2=2, Beta3=3) > trysol<-nlxb(formula=mymod, data=mydata, start=strt, trace=TRUE) > trysol > # or pshort(trysol) > > > Output is > > residual sumsquares = 1.5412e-05 on 20 observations > after 29 Jacobian and 43 function evaluations > name coeff SE tstat pval gradient > JSingval > Beta1 0.00629212 5.997e-06 1049 2.425e-42 4.049e-08 > 721.8 > Beta2...
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
Dear friends, This is the dataset I am currently working with: >dput(mod14data2_random) structure(list(index = c(14L, 27L, 37L, 33L, 34L, 16L, 7L, 1L, 39L, 36L, 40L, 19L, 28L, 38L, 32L), y = c(0.44, 0.4, 0.4, 0.4, 0.4, 0.43, 0.46, 0.49, 0.41, 0.41, 0.38, 0.42, 0.41, 0.4, 0.4 ), x = c(16, 24, 32, 30, 30, 16, 12, 8, 36, 32, 36, 20, 26, 34, 28)), row.names = c(NA, -15L), class =
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...theta2 = exp(-1.8), > theta3 = -0.05538), data=mod14data2_random) > summary(nlregmod2) > Object has try-error or missing parameters > nlregmod2 > And I get some NA values when retrieving the statistics for the fitted > model: > residual sumsquares = 0.0022973 on 15 observations > after 2235 Jacobian and 2861 function evaluations > name coeff SE tstat pval gradient > JSingval > theta1 9330.89 NA NA NA 5.275e-11 > 967470 > theta2...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...p(-1.8), >> theta3 = -0.05538), data=mod14data2_random) >> summary(nlregmod2) >> Object has try-error or missing parameters >> nlregmod2 >> And I get some NA values when retrieving the statistics for the fitted >> model: >> residual sumsquares = 0.0022973 on 15 observations >> after 2235 Jacobian and 2861 function evaluations >> name coeff SE tstat pval gradient >> JSingval >> theta1 9330.89 NA NA NA 5.275e-11 >> 9...
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
...theta3 = -0.05538), data=mod14data2_random) >>> summary(nlregmod2) >>> Object has try-error or missing parameters >>> nlregmod2 >>> And I get some NA values when retrieving the statistics for the fitted >>> model: >>> residual sumsquares = 0.0022973 on 15 observations >>> after 2235 Jacobian and 2861 function evaluations >>> name coeff SE tstat pval gradient >>> JSingval >>> theta1 9330.89 NA NA NA 5.275e-...
2023 Aug 19
1
Determining Starting Values for Model Parameters in Nonlinear Regression
Dear friends, Hope you are all doing well and having a great weekend. I have data that was collected on specific gravity and spectrophotometer analysis for 26 mixtures of NG (nitroglycerine), TA (triacetin), and 2 NDPA (2 - nitrodiphenylamine). In the dataset, x1 = %NG, x2 = %TA, and x3 = %2 NDPA. The response variable is the specific gravity, and the rest of the variables are the predictors.
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
I got starting values as follows: Noting that the minimum data value is .38, I fit the linear model log(y - .37) ~ x to get intercept = -1.8 and slope = -.055. So I used .37, exp(-1.8) and -.055 as the starting values for theta0, theta1, and theta2 in the nonlinear model. This converged without problems. Cheers, Bert On Sun, Aug 20, 2023 at 10:15?AM Paul Bernal <paulbernal07 at
2017 Jun 18
0
R_using non linear regression with constraints
I've seen a number of problems like this over the years. The fact that the singular values of the Jacobian have a ration larger than the usual convergence tolerances can mean the codes stop well before the best fit. That is the "numerical analyst" view. David and Jeff have given geometric and statistical arguments. All views are useful, but it takes some time to sort them all out and
2017 Jun 18
3
R_using non linear regression with constraints
I am not as expert as John, but I thought it worth pointing out that the variable substitution technique gives up one set of constraints for another (b=0 in this case). I also find that plots help me see what is going on, so here is my reproducible example (note inclusion of library calls for completeness). Note that NONE of the optimizers mentioned so far appear to be finding the true best