Displaying 20 results from an estimated 24 matches for "m_i".
Did you mean:
_i
2012 Feb 17
2
(subscript) logical subscript too long in using apply
...rep(NA,ncol(data)*ncol(data))), nrow = ncol(data), ncol
= ncol(data) , byrow=TRUE)
med <- c(rep(NA,ncol(data)))
mean_ge <- c(rep(NA,ncol(data)))
n<-c(NA,2)
if (ncol(data)>1){
for(m_j in 1:ncol(data)){
med[m_j]<-median(data[,m_j])}
for(m_j in 1:ncol(data))
for(m_i in 1:nrow(data))
{
if(data[m_i,m_j]>med[m_j])
med_ge[m_i,m_j]=0
else
med_ge[m_i,m_j]=1
}
y=c(1,1,1,1,1,1,0,0,0,0)
n<-c(sum(y == 1),sum(y==0))
touse3 <- y==1
T1<- apply(med_ge[touse3,], 2, mean)
T0<- apply(med_ge[...
2009 May 14
1
automated polynomial regression
Dear all -
We perform some measurements with a machine that needs to be
recalibrated. The best calibration we get with polynomial regression.
The data might look like follows:
> true_y <- c(1:50)*.8
> # the real values
> m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2
> # the measured data
> x <- c(1:50)
> # and the x-axes
>
> # Now I do the following:
2004 Apr 18
2
lm with data=(means,sds,ns)
Hi Folks,
I am dealing with data which have been presented as
at each x_i, mean m_i of the y-values at x_i,
sd s_i of the y-values at x_i
number n_i of the y-values at x_i
and I want to linearly regress y on x.
There does not seem to be an option to 'lm' which can
deal with such data directly, though the regression
problem could be algebraic...
2011 Jun 15
1
Reshaping data with xtabs reorders my rows
...of matrices form.
However when using xtabs function it orders my rows alphabetically and
apparently doesn't take "reorder = FALSE" option or anything like it.
Is there anything I can do to stop it from doing so?
Relevant parts of code:
matrices.m <- melt(combined_list)
matrices.m_i[is.na(matrices.m_i$value),]$value <- predictions
matrices <- xtabs(value ~ location + variable + week, data =
matrices.m_i)
--
while(!succeed) { try(); }
2003 Jul 17
3
univariate normal mixtures
Hello,
I have a concrete statistical question:
I have a sample of an univariate mixture of an unknown number (k) of
normal distributions, each time with an unknown mean `m_i' and a
standard deviation `k * m_i', where k is known factor constant for all
the normal distributions. (The `i' is a subscript.)
Is there a function in R that can estimate the number of normal
distributions k and the means `m_i' for the different normal
distributions from a sam...
2017 May 30
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
>>>>> Serguei Sokol <sokol at insa-toulouse.fr>
>>>>> on Mon, 29 May 2017 15:28:12 +0200 writes:
> Sorry, I have seen it too late that we had different tab
> width in the original file and my editor. Here is the
> patch with all white spaces instead of mixing tabs and
> white spaces.
thank you - it still gives quite a few
2012 May 29
0
mlogit package inquiry
...package in R
called mlogit. I am not sure whether I have already found the correct
package or software. May I ask am I correct?
? Basically, let's say
? I have observations of n outcomes, for each outcome 1<=i<=n, they
were selected by a choice from a set S_i = { H(i,j) | 1 <= j <= m_i }
with utility U(i,j)
??Assuming each outcome was chosen by maximizing?the utility.
? Let U*(i) = max{ U(i,j) | 1 <= j <= m_i }
? Therefore, each outcome was chosen among m_i items by finding the
index j such that U(i,j) = U*(i).
? For the utility function U(i,j), there are some independent...
2006 May 08
2
On the speed of apply and alternatives?
...statistics matrix 1000 x 4:
qnt <- c(0.01, 0.05)
cmp_fun <- function(x)
{
LAST <- length(x)
smpls <- x[1:(LAST-1)]
real <- x[LAST]
ret <- vector(length=length(qnt)*2)
for (i in 1:length(qnt))
{
q_i <- quantile(smpls, qnt[i]) # the quantile i
m_i <- mean(smpls[smpls<q_i ] ) # mean of obs less than q_i
ret[i] <- ifelse(real < q_i, 1, 0)
ret[length(qnt)+i] <- ifelse(real < q_i, real - m_i, 0)
}
ret
}
hcvx <- apply(testm, 1, cmp_fun)
The code is functioning well, but seems to take forever to calculate
the...
2012 May 23
1
numerical integration
Greetings,
Sorry, the last message was sent by mistake! Here it is again:
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix $A_{i,j}$, $1\leq i,j\leq 5$, numerically
and check against the known analytic values.
When I run this code most components of A are correct, but some are zero.
I get the foll...
2003 Oct 21
2
Denominator Degrees of Freedom in lme() -- Adjusting and Understanding Them
...ht-line growth model (intercept and slope both have fixed and random
effects), the degrees of freedom seem to be N*T-N-1, where N is total
sample size and T is the number of timepoints (at least when data are
balanced). In the Pinheiro and Bates book (p. 91), the degrees of freedom
are given as m_i-(m_1-1+pi), where m_i is the number of groups at the ith
level, m_0=1 if an intercept is included and p_i is the sum of the degrees
of freedom corresponding to the terms estimated. I'm not sure how the
N*T-N-1 matches up with the formula given on page 91. It seems to me the
number of "...
2017 May 29
3
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Here is an attached patch.
Best,
Serguei.
Le 29/05/2017 ? 12:21, Serguei Sokol a ?crit :
> The problem or actual R implementation relies on an assumption
> that median(x[i] | x[i] <= quantile(x, 1/3)) == quantile(x, 1/6)
> which reveals not to be true despite very trustful appearance.
>
> If we continue with the example of x=y=1:9
> then quantile(x, 1/6)=2.5 (here quantile()
2018 May 12
3
(no subject)
...me
# Generating data which are right truncated
library(DTDA)
library(splines)
library(survival)
n<-25
X<-runif(n,0,1)
V<-runif(n,0.75,1)
for (i in 1:n){
while (X[i]>V[i]){
X[i]<-runif(1,0,1)
V[i]<-runif(1,0.75,1)
}}
res<-lynden(X=X,U=NA, V=V, boot=TRUE)
attach(res)
temps = time
M_i = n.event
L_t = res
F_t=1-L_t??????????????????????????????????? ?
par(mfrow=c(1,1))
plot(L_t$time,L_t$survival,type="s",lty=2:3,lwd=2,las=1,cex.lab=1.1,font.lab=2,col="red",xlab="temps",ylab="L(t)",main="Esitmation de la Fonction de Survie L(t)")...
2012 May 23
0
numerical integrals
Greetings,
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix $A_{i,j}$, $1\leq i,j\leq 5$, numerically
and check against the known analytic values.
When I run this code most components of A are correct, but some are zero.
I get the fol...
2001 Oct 03
1
package GeneSOM ?
Hello Rprofessionals,
The SOM-Obj works very well, when i normalize
my data and the plot-function, too !
But i miss or didn't find the possibility , extract the
information from the SOMplot "clusterSize" and "mean" for every cluster as quantitative information ( i.e. the DataFrame with an additional column which
define the calculate clusters from SOM)?
My intention -
2005 Sep 14
1
Random effect model
Dear R-help group,
I would like to model directly following random effect model:
Y_ik = M_ik + E_ik where M_ik ~ N(Mew_k,tau_k^2)
E_ik ~ N(0,s_ik^2)
i = number of study
k = number of treatment
---------------------------------------------------------------------------
I have practiced using the command from 'Mixed -Effects models in S and
S-plus&...
2010 Nov 08
1
try (nls stops unexpectedly because of chol2inv error
...100 simulations, only 53 are good simulations because we don't
have enough data for nls or chol2inv to work correctly.
monte
{x:
###########################################################################################
## case I ## EQUAL SAMPLE SIZES and design points
nsim = 100;
N_i = M_i = 10; ## also try (10, 30, 50, 100, 200)
r = M_i / N_i;
X.start = 170; # 6 design points, at 170,180,190, etc. where each point has
N_i elements
X.increment = 10;
X.points = 6;
X.end = 260;
Xval = seq(X.start,length.out=X.points,by=X.increment );
Xval = seq(X.start,X.end,length.out=X.points);
L =...
2004 Dec 03
3
Computing the minimal polynomial or, at least, its degree
Hi,
I would like to know whether there exist algorithms to compute the
coefficients or, at least, the degree of the minimal polynomial of a square
matrix A (over the field of complex numbers)? I don't know whether this
would require symbolic computation. If not, has any of the algorithms been
implemented in R?
Thanks very much,
Ravi.
P.S. Just for the sake of completeness, a
2018 May 13
0
(no subject)
...ary(splines)
> library(survival)
> n<-25
> X<-runif(n,0,1)
> V<-runif(n,0.75,1)
> for (i in 1:n){
> while (X[i]>V[i]){
> X[i]<-runif(1,0,1)
> V[i]<-runif(1,0.75,1)
> }}
> res<-lynden(X=X,U=NA, V=V, boot=TRUE)
> attach(res)
> temps = time
> M_i = n.event
> L_t = res
> F_t=1-L_t
> F_t=1-L_t
Error in 1 - L_t : non-numeric argument to binary operator
L_t is a list. You cannot subtract a list (at least in R). I'm not sure what you think F_t is supposed to be and you don't seem to use i...
2008 May 11
0
loess and locpoly
Dear list,
I've got a question concerning difference between loess and locpoly. I have to use a plug-in method to chose a bandwith so I take locpoly method to fit a curve.
My problem is:I know how to get predicted values in loess:
m=loess(y~x)
y_fitted=predict(m).
But how to get the same in locpoly? I computed like this:
bw=dpill(x, y, blockmax = 5, divisor = 20,trim = 0.01, proptrun =
2018 May 10
0
(no subject)
We need some idea of the problem.
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
http://adv-r.had.co.nz/Reproducibility.html
On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help <r-help at r-project.org> wrote:
Hello
Do You help me, i have the problem in the package DTDA for ?find the probability of truncation