search for: b_1

Displaying 20 results from an estimated 28 matches for "b_1".

Did you mean: b1
2012 Feb 29
2
How to replace the values in a column
...eemed to be applicable to me... I have a file with many many varieties, and want to replace some of them into different names. I tried various of ways, still don't know how to do that most efficiently.. Here is part of the example data: Gen Rep A_1 1 A_1 2 A_2 1 A_2 2 B_1 1 B_1 2 B_3 1 B_3 2 OP1_1 1 OP1_1 2 OP1_5 1 OP1_5 2 For example, I want to replace A_1, B_3, OP1_1 into different name "Wynda" So that the expected file should become: Gen Rep Wynda 1 Wynda 2 A_2 1 A_2 2 B_1...
2006 Jun 06
1
Problems using quadprog for solving quadratic programming problem
Hi, I'm using the package quadprog to solve the following quadratic programming problem. I want to minimize the function (b_1-b_2)^2+(b_3-b_4)^2 by the following constraints b_i, i=1,...,4: b_1+b_3=1 b_2+b_4=1 0.1<=b_1<=0.2 0.2<=b_2<=0.4 0.8<=b_3<=0.9 0.6<=b_4<=0.8 In my opinion the solution should be b_1=b_2=0.2 und b_3=b_4=0.8. Unfortunately R doesn't find this solution and what's su...
2011 Sep 02
1
Using capture.output within a function
...ues with R stalling on me so I'd like that the output is saved for each iteration and not only at completion. Any suggestions on how to get this done would be much appreciated. Kristian Lind *Below an example of what I'm trying to do...* loglik <- function(w){ state <- c( b_1 = 0, b_2 = 0, a = 0) #declaring ODEs Kristian <-function(t, state, w){ with(as.list(c(state, w)), { db_1 = -((w[1]+w[8])*b_1+(w[2]+w[6]*w[8] +w[7]*w[9])*b_2+0.5*(b_1)^2+w[6]*b_1*b_2+0.5* ((w[6])^2+(w[7])^2)*(b_2)^2) db_2 = -w[3]...
2007 Jul 14
0
ts model challenge (transfer function)
...0, 0, 0, 0.012, 0, 0, 0.002, 0, 0, 0, 0.053, 0.178, 0.068, 0.126, 0, 0.001, 0.001, 0, 0.001, 0, 0, 0) matplot(cbind(flow,rain), type="lh") # Note that 'u' is highly skewed. # The system can be modelled by this transfer function: # x[i] <- a_1*x[i-1] + a_2*x[i-2] + b_0*u[i] + b_1*u[i-1] # I happen to know that a good model is a_1 <- 1.6545 a_2 <- -0.6580 b_0 <- 0.1149 b_1 <- -0.1115 # (This was estimated by a proprietary program using # "Simple Refined Instrumental Variable" algorithm). # The transfer function differs from the model used by 'ari...
2011 Mar 31
0
dfsane arguments
...-0.0268, K_rr = 0.3384, theta_v = 107.4039, theta_r = 5.68, Sigma_rv= 0.0436, Sigma_rr= 0.1145, lambda_v= 0, lambda_r= -0.0764 ) state <- c(b_1 = 0, b_2 = 0, a = 0) Kristian <- function(t, state, parameters){ with(as.list(c(state, parameters)),{ db_1 = -((K_vv+lambda_v)*b_1+(K_rv+Sigma_rv*lambda_v+Sigma_rr*lambda_r)*b_2+0.5*(b_1)^2+Sigma_rv*b_1*b_2+0.5*((Sigma_rv)^2+(Sigma_rr)^2)*(b_2)^2 ) db_...
2013 Mar 05
2
Issues when using interaction term with a lagged variable
Hi there! Today I tried to estimate models using both plm and pgmm functions, with an interaction between X1 and lag(X2, 1). And I notice two issues. Let "Y=b_1 * X_1 + b_2 * X_2 + b_3 * X_1 * x_2 + e" be our model. 1) When using plm, I got different results when I coded the interaction term with I(X1 * lag(X2, 1)) and when I just saved this multiplication X1 * lag(X2, 1) in a different variable of the dataset and then used it. in the regression. 2)...
2005 Mar 05
4
How to use "lag"?
Is it possible to fit a lagged regression, "y[t]=b0+b1*x[t-1]+e", using the function "lag"? If so, how? If not, of what use is the function "lag"? I get the same answer from y~x as y~lag(x), whether using lm or arima. I found it using y~c(NA, x[-length(x)])). Consider the following: > set.seed(1) > x <- rep(c(rep(0, 4), 9), len=9) > y <-
2011 Apr 28
1
DLSODA error
...;parameters" parameters <- c(K_vv, K_rv, K_rr, theta_v, theta_r, Sigma_rv, Sigma_rr, lambda_v, lambda_r) state <- c( b_1 = 0, b_2 = 0, a = 0) #declaring ODEs Kristian <- function(t, state, parameters){ with(as.list(c(state, parameters)), { db_1 = -((K_vv+lambda_v)*b_1+(K_rv+Sigma_rv*lambda_v +Sigma_rr*lambda_r)*b_2+0.5*(b_1)^2+Sigma_rv*b_1*b_2+0.5* ((Sigm...
2005 Oct 13
3
Do Users of Nonlinear Mixed Effects Models Know Whether Their Software Really Works?
...the Laplace approximation compare with the exact MLE's. We first fit the data using ADMB-RE's Laplace approximation option. Laplace approximation estimates: # Number of parameters = 4 log-likelihood = -629.817 value std dev P value b_1 -2.3321e+00 7.6973e-01 < 0.0024 b_2 -6.8795e-01 6.6185e-01 0.298 b_3 -4.6134e-01 4.0000e-02 < 0.001 sigma 4.5738e+00 7.0970e-01 The parameter of interest here the treatment effect b_2 which is the parameter reported in Lesaffre...
2006 Aug 24
1
lmer(): specifying i.i.d random slopes for multiple covariates
Dear readers, Is it possible to specify a model y=X %*% beta + Z %*% b ; b=(b_1,..,b_k) and b_i~N(0,v^2) for i=1,..,k that is, a model where the random slopes for different covariates are i.i.d., in lmer() and how? In lme() one needs a constant grouping factor (e.g.: all=rep(1,n)) and would then specify: lme(fixed= y~X, random= list(all=pdIdent(~Z-1)) ) , that?s how it's...
2007 Mar 05
1
Heteroskedastic Time Series
...time series modelling, but my requirement seems to fall just outside the capabilities of the arima function in R. I'd like to fit an ARMA model where the variance of the disturbances is a function of some exogenous variable. So something like: Y_t = a_0 + a_1 * Y_(t-1) +...+ a_p * Y_(t-p) + b_1 * e_(t-1) +...+ b_q * e_(t-q) + e_t, where e_t ~ N(0, sigma^2_t), and with the variance specified by something like sigma^2_t = exp(beta_t * X_t), where X_t is my exogenous variable. I would be very grateful if somebody could point me in the direction of a library that could fit this (or a si...
2010 Jan 19
1
change codes into loops
Hi, See example. for (i in 1:2) { for (j in 1:3) { b_1[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[1] b_2[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[2] b_3[i,j]<-rank(c(a1[i,j],a2[i,j],a3[i,j]))[3] } } The inner codes is really repeated, so i want to change the inner codes into loops. Take nn is from 1 to 3, something like, for (nn in 1...
2011 Jan 03
1
Greetings. I have a question with mixed beta regression model in nlme.
...in {1, ..., n_j}* *(level 2)* *y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij}) y_{ij} = mu_{ij} + w_{ij} * *with* *logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij} log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c2 * z2_{ij} * *Beta_{0i} = b_0 + u_{0i} Beta_{1i} = b_1 + u_{1i} Gamma_{0i} = c_0 + v_{0i} Gamma_{1i} = c_1 + v_{1i} * *The vector* *(u_{0i}, u_{1i})'* *has normal distribution with mean* *(0, 0)'* *and covariance matrix* *sigma_{00} sigma_{01} sigma_{10} sigma_{11} * *The vector* *(v_{0i}, v_{1i})'* *has normal distribution with mean* *(0,...
2011 Jan 03
0
Greetings. I have a question with mixed beta regression model in nlme (corrected version).
...n {1, ..., n_j}* *(level 2)* *y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij}) y_{ij} = mu_{ij} + w_{ij} * *with* *logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b_2 * x2_{ij} log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c_2 * z2_{ij} * *Beta_{0i} = b_0 + u_{0i} Beta_{1i} = b_1 + u_{1i} Gamma_{0i} = c_0 + v_{0i} Gamma_{1i} = c_1 + v_{1i} * *The vector* *(u_{0i}, u_{1i})'* *has normal distribution with mean* *(0, 0)'* *and covariance matrix* *sigma_{00} sigma_{01} sigma_{10} sigma_{11} * *The vector* *(v_{0i}, v_{1i})'* *has normal distribution with mean* *(0,...
2012 Jun 28
0
How to calculate Confidence Interval for a prediction using Partial Regression?
...s, so I decided to do a partial regression to predict y. I did it this way: - I regressed y to A, and calculated the residuals (e_y) (reg1) - I regressed x to A, and calculated the residuals (e_x) (reg2) - I regressed e_y to e_x (reg5) It looks like this: y = a_0 + a_1 A (reg1) x = b_0 + b_1 A (reg2) e_y = y - (a_0 + a_1 A) (3) e_x = x - (b_0 + b_1 A) (4) e_y = beta_0 + beta_1 e_x (reg5) Then, to predict a y_0 from a new x_0 and A_0, we would: Calculate e_x0 with the equation (4). Calculate e_y0 with the equation (reg5) and then: y_0 = e_y0 + (a_0 + a_1 A_0) Now, I would like to know...
2011 Apr 16
1
spatstat regression troubles
...re Quadrature scheme 944 data points, 2828 dummy points Total weight 1098.64 How do I use the Quadrature to model my intensity based off of those two covariates and an intercept term alpha? In mathematical terms, if \lambda is my intensity function, I want to estimate \lambda(s;b) = exp(alpha + b_1 * Z_1 + b_2 * Z_2). Thank you for your help! I really appreciate it. Kind regards, Greg R.
2011 Dec 05
1
Summary coefficients give NA values because of singularities
Hello, I have a data set which I am using to find a model with the most significant parameters included and most importantly, the p-values. The full model is of the form: sad[,1]~b_1 sad[,2]+b_2 sad[,3]+b_3 sad[,4]+b_4 sad[,5]+b_5 sad[,6]+b_6 sad[,7]+b_7 sad[,8]+b_8 sad[,9]+b_9 sad[,10], where the 9 variables on the right hand side are all indicator variables. The thing I don't understand is the line ' sad[, 10] NA NA NA NA ' as a result...
2002 May 06
2
A logit question?
...on and an explicite transformation of the dependent. Below some details. I'm not very familiar with the concept. As far as I have understood it's all about transformation of the dependent variable if one have frequency data (grouped data, instead of raw binaries): ln(^p(i)/(1-^p(i)) = c + b_1(X_1) +...+ b_k(X_k) + e(i). where ^p(i) is (estimated) frequency of incident (happened/all = n(i)/N), i is index of observation, c and b_. are coefficients (objects of the estimation), X_. are the explanatory variables and e is residual. So a linear regression. And some testing: > y <- r...
2004 Oct 01
2
multiple dimensional diag()
...1 0 0 [4,] 0 0 0 0 2 2 [5,] 0 0 0 0 2 2 I am trying to generalize this to two higher dimensional arrays. If x <- adiag(a,b) then I want all(dim(x)==dim(a)+dim(b)); and if dim(a)=c(a_1, a_2,...a_d) then x[1:a_1,1:a_2,...,1:a_d]=a, and x[(a_1+1):(a_1+b_1),...,(a_d+1):(a_d+b_d)]=b. Other elements of x are zero. The fact that I'm having difficulty expressing this succinctly makes me think I'm missing something basic. If a and b have identical dimensions [ie all(dim(a)==dim(b)) ], the following ghastly kludge (which is one of many) works:...
2013 Oct 23
0
[LLVMdev] First attempt at recognizing pointer reduction
...teach the vectorizer about pointer induction variables that stride for your example. Your code - as far as I can reconstruct it from memory - looks something like preheader: loop: %strided_induction_pointer = phi [preheader, %b], [loop, %str_ind_ptr_inc] = load %strided_induction_pointer %b_1 = gep %strided_induction_pointer, 1 … = load %b_1 %b_2 = gep %strided_induction_pointer, 2 … = load %b_2 %str_ind_ptr_inc = gep %strided_induction_pointer, 3 // Induction variable that strides by 3 %cmp = … br %cmp, loop, exit exit: %strided_induction_pointer here is a pointer inductio...