search for: b_j

Displaying 18 results from an estimated 18 matches for "b_j".

Did you mean: b_
2011 Jul 03
3
Hint improve my code
...code below. I am worried that the parameters I want to be estimated are "not being found" when I ran my code. Is there a way I can code them so that R recognize that they should be estimated. This is the error I am getting. > out1=optim(llik,par=start.par) Error in pnorm(au_j, mean = b_j * R_m, sd = sigma_j) : object 'au_j' not found #Yet al_j,au_j,sigma_j and b_j are just estimates that balance the likelihood function? llik=function(R_j,R_m) if(R_j< 0) { sum[log(1/(2*pi*(sigma_j^2)))-(1/(2*(sigma_j^2))*(R_j+al_j-b_j*R_m))^2] }else if(R_j>0) { sum[log(1/(2*pi*(si...
2011 Jul 23
1
Extend my code to run several data at once.
...ay you help me adjust it to accomodate several rows of R_j and print the 200 results. ***Please do not get intimidated by the maths in the code.*** my code ###### afull=read.table("D:/hope.txt",header=T) library(optimx) llik = function(x) { al_j=x[1]; au_j=x[2]; sigma_j=x[3]; b_j=x[4] sum(na.rm=T, ifelse(a$R_j< 0, log(1 / ( sqrt(2*pi) * sigma_j) )- (1/( 2*sigma_j^2 ) ) * ( (a$R_j+al_j-b_j*a$R_m)^2 ) , ifelse(a$R_j>0 , log(1 / ( sqrt(2*pi) * sigma_j) )- (1/( 2*sigma_j^2 ) ) * ( (a$R_j+al_j-b...
2011 Jul 04
3
loop in optim
Hi May you help me correct my loop function. I want optim to estimates al_j; au_j; sigma_j; b_j by looking at 0 to 20, 21 to 40, 41 to 60 data points. The final result should have 4 columns of each of the estimates AND 4 rows of each of 0 to 20, 21 to 40, 41 to 60. ###MY code is n=20 runs=4 out=matrix(0,nrow=runs) llik = function(x) { al_j=x[1]; au_j=x[2]; sigma_j=x[3]; b_j=x[4]...
2011 Jul 01
2
Help fix last line of my optimization code
...args list of 'min' being evaluated was: (interval)#### My data and my code looks like below. R_j R_m 0.002 0.026567296 0.01 0.003194435 . . . . . . . . 0.0006 0.010281122 a=read.table("D:/ff.txt",header=T) attach(a) llik=function(R_j,R_m) #The parameters al_j, au_j, b_j , and sigma_j need to be estimated and there are no initial estimates to them. if(R_j< 0) { LF=sum[log(1/(2*pi*(sigma_j^2)))-(1/(2*(sigma_j^2))*(R_j+al_j-b_j*R_m))^2] }else if(R_j>0) { LF=sum[log(1/(2*pi*(sigma_j^2)))-(1/(2*(sigma_j^2))*(R_j+au_j-b_j*R_m))^2] }else { LF=sum[(log(pnorm((au_...
2011 Jul 06
1
Group Data indexed by n Variables
...%m") MonthDayCombs = paste(Months, Days) AvgDemand = data.matrix(by(Data$RescaledDemand, DayMonthCombs, mean)) On 4 July 2011 10:34, EdBo <n.bowora@gmail.com> wrote: > Hi > > May you help me correct my loop function. > > I want optim to estimates al_j; au_j; sigma_j; b_j by looking at 0 to 20, > 21 to 40, 41 to 60 data points. > > The final result should have 4 columns of each of the estimates AND 4 rows > of each of 0 to 20, 21 to 40, 41 to 60. > > ###MY code is > > n=20 > runs=4 > out=matrix(0,nrow=runs) > > llik = function(x)...
2010 Oct 18
0
specifying lme function with a priori hypothesis concerning between-group variation in slopes
...case of a single group. The model is: Y_i= a +bX_i + error where I indexes the different values of X and Y in this group . The a priori hypothesis of the slope is: b=K. This is easily tested with a t-test (b-K=0). Now imagine that there are j groups. For each group j the model is: Y_ij= a_j + b_jX_ij + error. Both the intercepts (a) and the slopes (b) are allowed to vary between groups. The a priori (null) hypothesis of interest involved the between-group values of the slopes and is: b_j=Kj where Kj is specified a priori for each group j based on theoretical considerations but whose valu...
2012 Aug 27
2
randomLCA
Can anybody, please, explain me how many parameter are estimated using randomLCA? For examples, model "dentistry.lca2random" estimate 1 scale (or variance, b_j) parameter and 2 position parameters (a_cj)? Doesn't it? Do I need at least 4 diagnostic tests for such a model? What happens if I specify options blocksize and byclass? How many diagnostic tests (or rater) I need? Extract from see "randomLCA examples", by Ken Beath. > dentis...
1999 Dec 10
1
orthogonal and nested model
I'm working with a orthogonal and nested model (mixed). I have four factors, A,B,C,D; A and B are fixed and orthogonal C is nested in AB interaction and finally, D is nested in C. I would like to model the following Y_ijklm=Mu+A_i+B_j+AB_ij+C_k(ij)+D_l(k(ij))+Error_m(...) I used the next command >summary(aov(abund~A*B + C % in % A:B + D % in % C % in % A:B ,datos)) Is it the correct formula syntax? Thaks for all. Marcelo. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list...
2007 Aug 05
0
null hypothesis for two-way anova
Dear R community, Confused by some of my lab results I ask for the definition of the null hypothesis of a two-way analysis of variance in R (anova() and aov()). Starting with the following model y = a_i + b_j , i in A and j in B is the tested null hypothesis H_0: a_i = 0 for all i in A or H_0: a_m = a_n for any m and n in A? Consequently the same questions for interaction effects. Starting with the model y = a_i + b_j + f_ij , i in A and j in B is the tested null hypothesis H_0: f_ij = 0 for al...
2012 Feb 02
0
glmer question
I would like to fit the following model: logit(p_{ij}) = \mu + a_i + b_j where a_i ~ N(0, \sigma_a^2) , b_j ~ N(0, \sigma_b^2) and \sigma_a = \sigma_b. Is it possible to fit a model with such a constraint on the variance components in glmer? -- View this message in context: http://r.789695.n4.nabble.com/glmer-question-tp4351829p4351829.html Sent from the R h...
2012 Oct 29
2
Two-way Random Effects with unbalanced data
Hi there, I am looking to fit a two-way random effects model to an *unblalanced* layout, y_ijk = mu + a_i + b_j + eps_ijk, i=1,...,R, j=1,...,C, k=1,...,K_ij. I am interested first of all in estimates for the variance components, sigsq_a, sigsq_b and sigsq_error. In the balanced case, there are simple (MM, MLE) estimates for these; In the unbalanced setup, this is much more complicated because orthogon...
2006 Oct 24
1
Variance Component/ICC Confidence Intervals via Bootstrap or Jackknife
I'm using the lme function in nmle to estimate the variance components of a fully nested two-level model: Y_ijk = mu + a_i + b_j(i) + e_k(j(i)) lme computes estimates of the variances for a, b, and e, call them v_a, v_b, and v_e, and I can use the intervals function to get confidence intervals. My understanding is that these intervals are probably not that robust plus I need intervals on the intraclass correlation coefficie...
2000 Jan 01
0
Re: Tests in linear regression
...verything, and merry christmas. FrSa> Best wishes, Francisco Sabido. Dear Francisco, I think everything you need is already part of R: summary(lm.sml <- lm(y ~ x1)) summary(lm.big <- lm(y ~ x1 + x2 + x3 + x4)) anova(lm.sml, lm.big) now will do a test of b2 = b3 = b4 = 0 if b_j is the coefficient of x_j. Look at the online help ?lm and ?anova and at demo(lm.glm) where models "l1" and "l0" are compared that way. ---------- ---------- ---------- Happy new year to everyone! ---------- ---------- ---------- Martin Maechler <maechler at stat...
2005 Dec 12
0
marginal effects in glm's
Hi, I wonder if there is a function in (some package of) R which computes marginal effects of the variables in a glm, say, for concretness, a probit model. By marginal effects of the covariate x_j I mean d P(y=1 | x), which is approx g(xB)B_j dx_j where g is the pdf of the normal distribution, x is the vector of covariates (at some points, say, the mean values) and B is the estimated vector of coefficients. Of course, it isn't difficult to write such a function, but that's exactly why I find it strange the fact that I didn&...
2004 Nov 09
0
Is nesting {} inside \eqn OK?
...earlier, here is a fuller excerpt from the input file: -------------------------------------------- With \eqn{J} possible outcomes and \eqn{p_j}{p(j)} the probability of the \eqn{j}'th outcome, the formula is \deqn{\newcommand{\B}{{\bf \beta}}\newcommand{\X}{{\bf X}} p_j = \frac{e^{\X\B_j}}{\displaystyle\sum_{k=0}^J e^{\X\B_k}}.}{ p(j) = exp[X*b(j)]/sum{exp[X*b(k)], k=0 to J}.} \eqn{{\bf\beta}_j}{b(j)} is the vector of coefficients for outcome \eqn{j} and \eqn{{\bf X}}{X} are the covariates. -------------------------------------------- By the way, the \newcommand is not gl...
2010 Dec 26
0
GLS with corAR(1) correlation structure residual/standard error calculation
...se terms are the e's. I cannot replicate the reported residuals using this approach. I also do not know how Z_0 should be calculated, i.e. what does the first step of this recursive procedure look like? >From the residuals, I also cannot replicate the reported standard errors. I am using se(b_j) = sqrt(sigma^2/sum(x_i-x_mean)^2) where sigma =sqrt(SSR/df) Any help on this or explanation of how GLS works would be much appreciated. Any clarification would be much appreciated. [[alternative HTML version deleted]]
2007 Apr 14
6
[LLVMdev] Regalloc Refactoring
On Thu, 12 Apr 2007, Fernando Magno Quintao Pereira wrote: >> I'm definitely interested in improving coalescing and it sounds like >> this would fall under that work. Do you have references to papers >> that talk about the various algorithms? > > Some suggestions: > > @InProceedings{Budimlic02, > AUTHOR = {Zoran Budimlic and Keith D. Cooper and Timothy
2020 Feb 27
2
[PATCH] Update the 5 year logo to 10 year logo
...JXDMf+GwpA@4GZ(G|~U1Dp&|h)bsfbIeuUd!thT zsuyfHga3kYGEK=f$zmjlrUi<9m$1RNT>bWD_|>`j_ovK_yV=#Ste%`VkG#tdV8UgB zxR}4Psl&@l=r~l`+Rr!ScRSOFN<&*CU{3|i>T<>!P|g|XQdxW2596h8>E}bSSu8IB z!+U`$0qV*qtv+#kNwPsypf;t}B&WV?TN<+<@4bVlH%XEx_G;DjGq?*b==lIbA-0xB z{z!KxWp6W#8~B_J-ceMMx1PxvNm&o?fHk8{5q$R&ZIkmhcLNaZND3GMTpKo)LoJ{0 zM4oXsgVGBgEW({^V8CQUSi$}&q+bD#49_$yZ?^+sA3<lK5qK^PORIrftRd@d0e%Q` zi0A!xs!au>iF;J5GKc01mGIBWi6My9VvF^moTnyh%nWroLu?6M!38&ZqhqcN{Ub?S zM>cTRmrCs4bS#%>dC(uIaO8g!vw2kqTKM~Szg3BNvkhPo5XjXpe{l|c2f<aOu@|3q zuja9p^yB)K@;Qsm9...