Displaying 20 results from an estimated 10000 matches similar to: "optimize weights for a weighted average?"
2007 Mar 27
0
Solving a system of nonlinear equations involving weighted parameters
Hi, I'm trying to solve the following system of nonlinear equations
P1 - F2 = x[1] + (1/2) * x[3] * x[1]^2
P2 - F2 = x[2] + (1/2) * x [3] * x[2]^2
F1 - F2 = -(1/2) * x[1] - (1/2) * x[2] + (1/8) * x [3] * (x[1] +
x[2])^2
B1 - F2 = (1/4) * x[1] - (1/4) * x[2] + (1/16) * x[3] * (x[1] -
x[2])^2
B2 - F2 = (1/4) * x[1] + (1/4) * x[2] + (1/16) * x[3] * (x[1]
2012 Dec 16
1
average X value of specific Y
Hello
I have a table describing butterfly range traits.
It is composed of three columns as below
Species name range size (X) latitude of range midpoint (Y)
There are 11 kinds of butterflies.
Each has its range size, and the latitude of each range midpoint ranges
from 9 to 19.
I would like to have the average range size of every degree of latitude.
For example, the average range
2010 Aug 24
0
mlm for within subject design
Thank you for reading. I am trying to get sphericity values, and I understood I need to use mlm, but how do I implement a nested within subject design in mlm? I already read the R newsletter, fox chapter appendix, EZanova, and whatever I could find online.
My original ANOVA
anova(aov(resp ~ sucrose*citral, random =~1 | subject, data = p12bl, subset = exps==1))
Or
anova(aov(resp ~
2010 Jun 13
0
Weighted Average application on Summary Dataset
Hi,
I have 2 huge datasets - May and Jun - a miniscule sample of one is given
below. I am trying to do 2 things with these datasets. I need to verify if
the weighted average of variable A for a Reason in Jun is same/different
from the same for May. To do this I am first computing the weighted average
for each SubReason using a function I wrote.
Where I need help is applying the function on both
2004 Jun 12
1
optimize linear function
I am attempting to optimize a regression model's parameters to meet a specific
target for the sum of positive errors over sum of the dependent variable
(minErr below).
I see two courses of action , 1) estimate a linear model then iteratively
reduce the regressors to achieve the desired positive error threshold
(naturally the regressors and predicted values are biased - but this is
2017 Nov 09
0
weighted average grouped by variables
hi thierry
thanks for your reply
yes, you are right, your solution is more straightforward
best
Da: "Thierry Onkelinx" <thierry.onkelinx at inbo.be>
A: "Massimo Bressan" <massimo.bressan at arpa.veneto.it>
Cc: "r-help" <r-help at r-project.org>
Inviato: Gioved?, 9 novembre 2017 15:17:31
Oggetto: Re: [R] weighted average grouped by
2011 Sep 21
2
Weighted Average on More than One Variable in Data Frame
Dear R Users,
I have looked for a solution to the following problem and I have not been
able to find it on the archive, through Google or in the R documentation.
I have a data frame, say df, which has 4 variables, one of which I would
like to use as a grouping variable (g), another one that I would like to use
for my weights (w) The other two variables are variables (x1 and x2) for
which I would
2017 Nov 09
1
weighted average grouped by variables
Hello,
Using base R only, the following seems to do what you want.
with(mydf, ave(speed, date_time, type, FUN = weighted.mean, w = n_vehicles))
Hope this helps,
Rui Barradas
Em 09-11-2017 13:16, Massimo Bressan escreveu:
> Hello
>
> an update about my question: I worked out the following solution (with the package "dplyr")
>
> library(dplyr)
>
> mydf%>%
>
2017 Nov 09
1
weighted average grouped by variables
Dear Massimo,
It seems straightforward to use weighted.mean() in a dplyr context
library(dplyr)
mydf %>%
group_by(date_time, type) %>%
summarise(vel = weighted.mean(speed, n_vehicles))
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team
2009 Oct 03
1
Problem using with panel.average in Lattice package
Hi,
I'm having a problem getting the panel.average function to work as I
expect it to in a lattice plot. I wish to draw lines between the
averages of groups of y-values at specific x-values. I have created a
dataset below which is similar to my real data. I also show an example
of using panel.loess in place of panel.average; it performs in a
manner similar to what I want panel.average to do
2009 Apr 30
0
Categorical variable in a custom nonlin function with gnm
Hi all
I want to construct a generalised nonlinear model (binomial family) using gnm, of the form:
Response = a + b variable1 + c variable2 + d variable3 - d b variable4 - d c variable5,
with the parameters b, c, and d appearing more than once. Hence, I think I need to use a custom nonlin function with gnm.
One of my predictor variables is categorical, so I have created a dummy variable for
2008 Sep 27
0
compute posterior mean by numerical integration
Dear R useRs,
i try to compute the posterior mean for the parameters omega and beta
for the following
posterior density. I have simulated data where i know that the true
values of omega=12
and beta=0.01. With the function postMeanOmega and postMeanBeta i wanted
to compute
the mean values of omega and beta by numerical integration, but instead
of omega=12
and beta=0.01 i get omega=11.49574 and
2003 Sep 09
1
charge a vector with variables and to use as variable in a checkbutton?
hello, how i cant to charge in form dynamic a checkbutton, try to do it
with a vector be charged automaticamente but not
works, for example
library(tcltk)
tt<-tktoplevel()
f<-tkframe(tt)
tkpack(f)
i<-2
if (i==1) {b1<-tkcheckbutton
(f,text="b1",variable="b1",relief="raised");tkpack(b1);print(tclvalue
("b1"))}else if (i==2) {b1<-tkcheckbutton
2003 Feb 03
1
summary.table bug in parameter (and fix) (PR#2526)
I sent this in with an old version, but it's in latest version as well. The fix is simple.
In the summary.table function, the parameter is calculated incorrectly
for a test of independence among all cells when the table is more than
2-way table.
Example:
Consider X:
> X
a b c
1 A1 B2 C1
2 A3 BA3 C2
3 A2 B1 C4
4 A1 B2 C3
5 A3 BA3 C2
6 A1 BA3 C1
7 A2 BA3 C2
8 A1
2007 Aug 23
1
nls() and numerical integration (e.g. integrate()) working together?
Dear List-Members,
since 3 weeks I have been heavily working on reproducing the results of an
economic paper. The method there uses the numerical solution of an integral
within nonlinear least squares. Within the integrand there is also some
parameter to estimate. Is that in the end possible to implement in R
[Originally it was done in GAUSS]? I'm nearly into giving up.
I constucted an
2003 Nov 18
1
aov with Error and lme
Hi
I searched in the list and only found questions
without answers e.g.
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/19955.html
: Is there a way to get the same results with lme as
with aov with Error()?
Can anybody reproduce the following results with lme:
id<-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
2009 Jan 07
0
fixed effect significance_NB mixed models_further pursuit
7 Jan 09
Hello,
I am using R version 2.7.0 in a Windows XP context.
I am also using the glmm.admb package (created by Dave Fournier, Hans
Skaug, and Anders Nielson) to run mixed-effects negative binomial
models.
To the best of my knowledge and ability, I have searched and studied
the R-help, R-sig-mixed models, and ADMB NBMM for R (through Otter
Research Ltd) list servs; R help
2013 Jan 03
0
help with NLOPTR
I have a complex function that I want to maximize (I have multiplied this
function by -1 so that it becomes a minimization problem in the code below).
This function has two equality constraints.
I get the programs to run but the answer isn't correct because, when it
does converge, at least one of the constraints is violated.
Any suggestions?
Code below Violated constraint (an easy check):
2019 Jan 25
0
[klibc:update-dash] builtin: Greater resolution in test -nt / test -ot
Commit-ID: bae97a14a3dab910cd57c1d36003b18a869f788f
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=bae97a14a3dab910cd57c1d36003b18a869f788f
Author: Martijn Dekker <martijn at inlv.org>
AuthorDate: Wed, 7 Mar 2018 17:32:29 +0000
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 25 Jan 2019 02:57:21 +0000
[klibc] builtin: Greater resolution
2013 Feb 23
1
how to calculate left kronecker product?
For an application, I have formulas defined in terms of a left Kronecker
product of matrices,
A,B, meaning
A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each
element on the right.
The standard kronecker() function is the right Kronecker product,
A \otimes_R B = {A[i,j] * B} -- matrix on the right multiplies each
element on the left.
The example below shows the result of