Displaying 20 results from an estimated 37 matches for "w_i".
Did you mean:
_i
2017 Dec 03
1
Discourage the weights= option of lm with summarized data
...new:
BEGIN OF TEXT --------------------
(A)
Non-?NULL? ?weights? can be used to indicate that different
observations have different variances (with the values in ?weights?
being inversely proportional to the variances);
(B)
or equivalently, when the elements of ?weights? are positive integers
w_i, that each response y_i is the mean of w_i unit-weight
observations
(C)
(including the case that there are w_i observations equal to y_i and
the data have been summarized).
(D)
However, in the latter case, notice that within-group variation is not
used. Therefore, the sigma estimate and residua...
2006 Jan 23
1
weighted likelihood for lme
Dear R users,
I'm trying 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 &l...
2003 Dec 15
1
distribution of second order statistic
...am getting some weird results here and I think I am missing something.
I am trying to program a function that for a set of random variables
drawn from uniform distributions plots that distribution of the second
order statistic of the ordered variables. (ie I have n uniform
distributions on [0, w_i] for w_i different w_j and i=1..n. I want to
plot the distribution of the second order statistic ie one less the
maximum.
I thought that the way to do this is to calculate:
F= Sum over i { (1-Fi) * Product of all j different i of Fj} + Product
over all i of Fi
where Fi are just the respective...
2014 Oct 08
2
Optimización con restricciones lineales
...estricciones lineales, pero no consigo incluir dichas restricciones. Es
decir,
f<-function(w){
sd(...) # desviación típica de ciertos datos
}
optim(rep(1/2,8),fn = f,lower=0,upper=1,method='L-BFGS-B') # no se como
incluir aquí las restricciones
Las restricciones son: la suma de los w_i es 1 y todos los w_i son mayores
o iguales que cero.
Ya he mirado: constrOptim pero no consigo nada.
Salu2, y muchas gracias.
--
Víctor Nalda Castellet
[[alternative HTML version deleted]]
2006 May 20
1
(PR#8877) predict.lm does not have a weights argument for newdata
Dear R developers,
I am a little disappointed that my bug report only made it to the
wishlist, with the argument:
Well, it does not say it has.
Only relevant to prediction intervals.
predict.lm does calculate prediction intervals for linear models from
weighted regression, so they should be correct, right?
As far as I can see they are bound to be wrong in almost all cases, if
no weights
2010 Oct 27
1
GLM and Weights
Dear all,
I am trying to use the 'glm' package as part of a semiparametric technique that involves weighting a likelihood in various ways, i.e.
L(theta;data)=Sum_i=1,..,n (W_i)(log L(theta;data_i))
Where W_i can be a kernel weighting function, or W_i can be an indicator of 'non-missingness' divided by a propensity score.
In a Monte Carlo exercise, the option glm(..., weights=W_i,) works very well for the Gaussian design, but if I were to change it to a Binomial...
2017 Oct 12
4
Discourage the weights= option of lm with summarized data
...t;
>> Arie
>>
>> On Sun, Oct 8, 2017 at 4:38 PM, Viechtbauer Wolfgang (SP)
>> <wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
>>> Ah, I think you are referring to this part from ?lm:
>>>
>>> "(including the case that there are w_i observations equal to y_i and the data have been summarized)"
>>>
>>> I see; indeed, I don't think this is what 'weights' should be used for (the other part before that is correct). Sorry, I misunderstood the point you were trying to make.
>>>
>>>...
2007 Jun 28
0
maximum difference between two ECDF's
Hello,
I have a vector of samples x of length N. Associated with each
sample x_i is a certain weight w_i. All the weights are in another
vector w of the same length N.
I have another vector of samples y of length n (small n). All
these samples have equal weights 1/n. The ECDF of these samples
is defined as for example at
http://en.wikipedia.org/wiki/Empirical_distribution_function and
I can comput...
2013 Jul 02
0
Optimización MINLP
..._LN_COBYLA
(Aunque el gradiente se podría calcular, es fácil)
Ahora bien,
Quiero hacer una variación de este problema incluyendo que x_i pueda ser
cero (no se invierte en i) o si es mayor que cero ya tenga que ser como
mínimo a_i y como máximo b_i
Esto lo he puesto de la siguiente manera:
\sum w_i * f(x_i)
donde como antes
a_i < x_i < b_i
\sum w_i * f(x_i) < Presupuesto
Y donde ahora, w_i quiero que sea binario (entero).
Por lo que he estado viendo esto es un problema de MINLP: Mixed Integer Non
Linear Problem
Buscando un poco y mirando en el task view de optimización de cra...
2006 May 24
1
(PR#8877) predict.lm does not have a weights argument for
...which is dealing with a
different model.
The model fitted by lm is
y = x\beta + \epsilon, \epsilon \sim N(0, \sigma^2)
(Row vector x, column vector \beta.)
If the observations are from the model, OLS is appropriate, but weighting
is used in several scenarios, including:
(a) case weights: w_i = 3 means `I have three observations like (y, x)'
(b) inverse-variance weights, most often an indication that w_i = 1/3
means that y_i is actually the average of 3 observations at x_i.
(c) multiple imputation, where a case with missing values in x is split
into say 5 parts, with case weight...
2017 Nov 28
0
Discourage the weights= option of lm with summarized data
...el version now has (in ?lm)
Non-?NULL? ?weights? can be used to indicate that different
observations have different variances (with the values in
?weights? being inversely proportional to the variances); or
equivalently, when the elements of ?weights? are positive integers
w_i, that each response y_i is the mean of w_i unit-weight
observations (including the case that there are w_i observations
equal to y_i and the data have been summarized). However, in the
latter case, notice that within-group variation is not used.
Therefore, the sigma estimate and...
2006 Feb 10
1
Lmer with weights
...this is at all possible.
For example we can take schools data by Gelman from R2WinBUGS package.
As you can see bellow use of weights argument did not had influence on
results.
I do not know if my specification of weights i.e. 1 / sd^2 is ok. Under
least squares one minimizes sum(e^2_i) or sum(w_i * e^2_i) with weighted
LS. If I consider that \sigma_i represents uncertainty in my "data" then
e'_i = e_i / \sigma_i and we minimize sum(e'^2_i) = sum((e_i /
\sigma_i)^2) = sum(e_i * \sigma^-2_i). Therefore weights i.e. w_i are
equal to 1 / \sigma^2_i.
Can anyone help me wit...
2011 Jan 13
1
Weighted Optimization
...pars],
silent = silent, par.names = names(vars), ...))
param.est = gh.fit$par
In the above, vega are the parameters to estimate and pdf is the GH pdf. This seems to work well for the case where observations are equally weighted. However, I'm stuck on how to include a weighted vector (w_i) to turn this problem into a weighted ML optimization.
Would you please be able to suggest a function or change in code which may allow me to do this?
Thank you in advance for your time.
Jason
2005 Oct 29
2
LaTex error when creating DVI version when compiling package
...nately be passed.
}
\value{
A list with the following items:
\item{AIC}{a data.frame including LL, the maximized log-likelihood; K
the number of estimated parameters; N2K, number of observations/K; AIC,
the Akaike index criterion; deltAIC, the difference between AIC and the
lowest AIC value; w_i, the Akaike weights; AICc, the second order Akaike
criterion; deltAICc, the difference between AICc and the lowest AICc
value; w_ic, the AICc weights }
\item{models}{the list of models}
}
\references{
Anderson, D.R., Link, W.A., Johnson, D.H. and Burnham, K.P. (2001).
Suggestions for prese...
2004 Dec 15
2
how to fit a weighted logistic regression?
I tried lrm in library(Design) but there is always
some error message. Is this function really doing the
weighted logistic regression as maximizing the
following likelihood:
\sum w_i*(y_i*\beta*x_i-log(1+exp(\beta*x_i)))
Does anybody know a better way to fit this kind of
model in R?
FYI: one example of getting error message is like:
> x=runif(10,0,3)
> y=c(rep(0,5),rep(1,5))
> w=rep(1/10,10)
> fit=lrm(y~x,weights=w)
Warning message:
currently weights are ignored...
2012 Feb 29
2
Converting a function from Splus to R
...;2.d0". How can I change it
to run in R?
The function can be found in page 230 from
http://www.stat.wisc.edu/~mchung/teaching/stat471/stat_computing.pdf
Function is as follows:
gauher <- function(n) {# Gauss-Hermite: returns x,w so that
#\int_-\infty^\infty exp(-x^2) f(x) dx \doteq \sum w_i f(x_i)
EPS <- 3.e-14
PIM4 <- .7511255444649425D0
MAXIT <- 10
m <- trunc((n+1)/2)
x <- w <- rep(-1,n)
for (i in 1:m) {
if (i==1) {
z <- sqrt(2*n+1)-1.85575*(2*n+1)^(-.16667)
} else if(i==2) {
z <- z-1.14*n^.426/z
} else if (i==3) {
z <- 1.86*z-.86*x[1]
} else if (i==4) {
z...
2004 Dec 22
0
weighted kernel density estimation
...visualisation of a
"group structure" in my dataset. So far, no problem.
But i would like to estimate that density using weights according to the
COS?? values that tells me if my observation is well represented on the
factorial plan 1-2. I would like to use (1) instead of (2) where the w_i
depends on the COS??, i hacked the MASS::kde2d function to do that.
\hat{f}_n(x) = \frac{1}{n|H|} \sum_{i=1}^n w_i \times K\left[H^{-1}(x-X_i)\right] (1)
\hat{f}_n(x) = \frac{1}{n|H|} \sum_{i=1}^n K\left[H^{-1}(x-X_i)\right] (2)
I have uploaded to http://addictedto...
2013 Mar 15
1
quadprog issues---how to define the constriants
Hi list:
This is my first time to post my question on the list. Thanks for your
help.
I am solving a quadratic programming using R. Here is my question:
w = arg min 0.5*w'Mw - w'N
s. t. sum(w) = 1;
w>0
note: w is weight vector, each w_i must >=0, and the sum of w =1.
Here is my R code:
A <-matrix(c(2.26,1.26,1.12,1.12,2.27,1.13,1.12,1.13,2.2),3,3);
B <- c(0.007459281,0.007448885,0.007447850);
M <-nrow(A);
Amat <- cbind(rep(1,M), diag(M));
bvec <- c(1,rep(0,M)) ;
meq <- 1;
min <- solve.QP(Dmat...
2011 Aug 31
2
Getting the values out of histogram (lattice)
Hi,
?
I have a relatively big dataset and I want to construct
some histograms using the histogram function in lattice. One thing I am
interested in is to look at differences between density and percent. I know I can
use the hist function but it seems that this function gives sometimes some
wrong answers and the density is actually a percent since it is calculated as counts in the bin divided by
2008 Feb 26
2
AIC and anova, lme
...t, data=bdd2)
> lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site,
na.action=na.omit, data=bdd2)
Using the Akaike Criterion and selMod of the package pgirmess gives the
following output:
> selMod(list(lmmedt1,lmmedt9))
model LL K N2K AIC deltAIC w_i AICc
deltAICc w_ic
2 log(1e-04 + transat) 44.63758 4 7.5 -81.27516 0.000000 0.65 -79.67516
0.000000 0.57
1 1 43.02205 3 10.0 -80.04410 1.231069 0.35 -79.12102
0.554146 0.43
The usual conclusion would be that the two models are equivalent and to
keep the null model for...