search for: wgt

Displaying 20 results from an estimated 33 matches for "wgt".

Did you mean: gt
2018 May 03
4
adding overall constraint in optim()
...i ? This is giving me a headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ? The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim. Mo.vect <- as.vector(tail(head(mo,i),1)) wgt.vect <- as.vector(tail(head(moWeightsMax,i),1)) cov.mat <- cov(tail(head(morets,i+12),12)) opt.fun <- function(wgt.vect) -sum(Mo.vect %*% wgt.vect) / (t(wgt.vect) %...
2010 Feb 02
2
Subset and plot
Here is a runable program. When I plot Day and Wgt, it graphs all the data points. All I need is daily.sub1 plotted. I also need each "Tanks" to have its own col or pch. When I run it with the line with pch, it gives me nothing. rm(list=ls()) Trial<-rep(c(1,2),each=12) Tanks=rep(c("a3","a4","c4","...
2018 May 03
2
adding overall constraint in optim()
...g me a headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ? >> >> The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim. >> >> Mo.vect <- as.vector(tail(head(mo,i),1)) >> wgt.vect <- as.vector(tail(head(moWeightsMax,i),1)) >> cov.mat <- cov(tail(head(morets,i+12),12)) >> opt.fun <- function(wgt.vect) -s...
2018 May 06
1
adding overall constraint in optim()
Hi Michael, A few comments 1. To add the constraint sum(wgt.vect=1) you would use the method of Lagrange multipliers. What this means is that in addition to the w_i (the components of the weight variables) you would add an additional variable, call it lambda. Then you would modify your optim.fun() function to add the term lambda * (sum(wgt.vect - 1...
2018 May 03
0
adding overall constraint in optim()
...is giving me a headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ? > > The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim. > > Mo.vect <- as.vector(tail(head(mo,i),1)) > wgt.vect <- as.vector(tail(head(moWeightsMax,i),1)) > cov.mat <- cov(tail(head(morets,i+12),12)) > opt.fun <- function(wgt.vect) -sum(Mo.vect %*% wg...
2004 Sep 21
2
Ever see a stata import problem like this?
...Case identification number ------------------------------------------------------------- Percentiles Smallest 1% 197432 19721 5% 199649 19722 10% 1974116 19723 Obs 40933 25% 1983475 19724 Sum of Wgt. 40933 50% 1996808 Mean 9963040 Largest Std. Dev. 9006352 75% 1.99e+07 2.00e+07 90% 2.00e+07 2.00e+07 Variance 8.11e+13 95% 2.00e+07 2.00e+07 Skewness .18931 99%...
2018 May 04
0
adding overall constraint in optim()
...headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ? >>> >>> The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim. >>> >>> Mo.vect <- as.vector(tail(head(mo,i),1)) >>> wgt.vect <- as.vector(tail(head(moWeightsMax,i),1)) >>> cov.mat <- cov(tail(head(morets,i+12),12)) >>> opt.fun <- fu...
2009 May 31
1
Bug in gmodels CrossTable()?
...tion was that the values produced by xtabs were rounded instead of truncated: library(gmodels) abc <- c("a", "a", "b", "b", "c", "c") def <- c("d", "e", "f", "f", "d", "e") wgt <- c(0.8, 0.6, 0.4, 0.5, 1.4, 1.3) xtabs(wgt ~ abc + def) CrossTable(xtabs(wgt ~ abc + def), prop.r = F, prop.c = F, prop.t = F, prop.chisq = F) -- Jakson Aquino Professor of Political Science Federal University of Ceara, Brazil
2018 May 05
1
adding overall constraint in optim()
Hi, You can use the projectLinear argument in BB::spg to optimize with linear equality/inequality constraints. Here is how you implement the constraint that all parameters sum to 1. require(BB) spg(par=p0, fn=myFn, project="projectLinear", projectArgs=list(A=matrix(1, 1, length(p0)), b=1, meq=1)) Hope this is helpful, Ravi [[alternative HTML version deleted]]
2010 Feb 02
1
Subset and point plot
OK, I need help plotting. I have column headings of Day, Wgt, Foodin, Rep, Grp and Tanks. Rep=c(1,2,3) and Tanks=c(a1,a2,a3,a4,a5,a6, c1,c2,c3,c4,c5,c6, h1,h2,h3,h4,h5,h6). I created a subset where I only would like Rep=2, and Tanks=c(a4,c4,h4) and would like to graph (points) of Wgt and Day. I would think that I only need 3 colors, but when I run with on...
2006 Apr 19
1
Trouble with glm() .... non-integer #successes in a binomial glm
Hi R-people: When I use the command to fit a model with an intercept, only: glm ( formula=haspdata ~ 1, data=dat, family=binomial, weights= dat$hy.wgt.s, subset=(dat$haspdat0!=3) ) I get the message: Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) Does anyone know what this means?? The data for this command is listed below. Thanks, Phil Smith CDC dat.hy.wgts.s Here is my data: > table( dat$haspdat...
2003 May 31
0
logistic regression
hi all, I am fitting a logistic regression model on binary data. I care about the fitted probabilities, so I am not worried about infinite (or non-existent) MLEs. I use: > glm(Y~., data=X, weights=wgt, family=binomial(link=logit), maxit=250) I understand the three ways to fit model, and in my case Y is a factor, one column > Y <- c(rep("A",679), rep("B",38)) My question is about the weights. I can use integer weights, which makes more mathematical sense, and &...
2003 May 31
0
logistic regression (weights)
hi all, I am fitting a logistic regression model on binary data. I care about the fitted probabilities, so I am not worried about infinite (or non-existent) MLEs. I use: > glm(Y~., data=X, weights=wgt, family=binomial(link=logit), maxit=250) I understand the three ways to fit model, and in my case Y is a factor, one column > Y <- c(rep("A",679), rep("B",38)) > Y <- as.factor(Y) My question is about the weights. I can use integer weights, which makes more m...
2006 Oct 18
1
Netgear WGT Flash-fest at Astricon
Just an FYI to anyone out there who will be attending Astricon and who would like to play around with embedded Asterisk on the Netgear WGT634U platform. If you want to "bring your own" to the show, I'll be bringing all the appropriate stuff to flash them there with my latest openWGT/Asterisk build. They are available from www.justdeals.com, refurbs, for $44.95 delivered. You'll also need a USB flash drive. I u...
2009 Nov 14
4
Weighted descriptives by levels of another variables
...t; package. data(ChickWeight) attach(ChickWeight) library(Hmisc) #this gives descriptive data on the variables "Time" and "Chick" by levels of "Diet") by(cbind(Time, Chick), Diet, describe) #trying to add weights, however, does not work for reasons described above wgt=rnorm(length(Chick), 12, 1) by(cbind(Time, Chick), Diet, describe, weights=wgt) Again, my question is, does anybody know of a function that combines both the ability to provided weighted descriptives with the ability to subdivide by the levels of some other variable? Andrew Miles Department...
2010 Sep 27
3
Alphabetical sequence of data along the x-axis in a box plot
Hello All, I noticed when I generated some boxplots, the data is presented in alphabetical order along the x-axis (the data in this case was the four quandrants of a sample area (NE,NW, SE, SW) that was my first column of data). Is there a way to have R plot the data in a different order? I imagine you could use a dummy variable, but didn't know if there might be a simple argument that
2007 Oct 10
0
Warning message when using "reldist" package
...eful if anybody could help me with this problem. Thank you very much! Best wishes, Jing Shen > hse91<-read.table("h:/HSE/hse91p.txt",header=TRUE) > hse05<-read.table("h:/HSE/hse05p.txt",header=TRUE) > ghq91<-hse91$ghq12scr > ghq05<-hse05$ghq12scr > wgt91<-hse91$wgt > wgt05<-hse05$wgt > g10<-reldist(y=ghq05,yo=ghq91,smooth=0.4,ci=TRUE,ywgt=wgt05,yowgt=wgt91,yolabs=seq(-1,7,by=0.5),ylim=c(0.5,7.0),bar=TRUE,quiet=FALSE,xlab="proportion of the original cohort") This is mgcv 1.3-25 Smoothing using 0.4 Warning message: fitte...
2008 Feb 29
1
barplot and pca plot in mvpart/rpart
Hello, I'm using the R package called mvpart, which is about the multivariate regression trees. The function I wrote is: mrt1<- mvpart(coefmat~sChip+sScreen+sMem,data=mixdata, xv="pick", plot.add=TRUE,uniform=TRUE,which=4,all=TRUE,xadj=2,yadj=2,rsq=TRUE,big.pts=TRUE,wgt.ave.pca=TRUE,legend=TRUE,bars=F, pca=TRUE) where "coefmat" is a matrix(of dimension N*K) to store the coefficients of my functional data object; and the predictors in the formula are all vectors of length N. Since I set the option "bars=T" and "pca = T", I get the ba...
1999 Apr 28
2
smbmount doesn't work
...rom directory Perhaps there is something else I need to do? Again, the old smbmount works perfectly every time with: smbmount //server/share /mnt/samba-share -c CLIENT -U user -P passwd \ -u nobody -g nobody -f 666 -d 777 thanks, -bp -- B. James Phillippe . bryan@terran.org Software Engineer, WGT Inc. . http://www.terran.org/~bryan
2007 Oct 18
0
[R} Getting 'tilting' confidence intervals in R
...ot() to get the "tilting" confidence interval. Here's a program snippet: g = rgamma(N,shape=2,scale=3) #Generate a sample of N random deviates varf = function (x,i) { var(x[i]) } b = boot(g, varf, R=1000) boot.ci(b) fabc = function (x, w) { sum(x^2*w)/sum(w)-(sum(x*w)/sum(w))^2 } #wgt average (biased) variance abc.ci(g, fabc) #ABC method confidence interval bt = tilt.boot(g, varf, R=c(1000,1000,1000)) The bt object doesn't have a confidence interval method or property, even though alpha=c(.025, .975) is a default parameter in the tilt.boot() call. This must be simple, b...