Displaying 20 results from an estimated 2000 matches similar to: "A question about for loop"
2009 Dec 11
3
how to creat a matrix
Dear R family
I am attempting to create a matrix. e.g.,
0 0 0 0 1
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
How could I write a R program?
Later I want to extend it to a N by N case.
Thanks in advance
best
Moohwan
2010 Jul 05
4
To detect the location of duplicate values
Dear R family,
I have a question about how to detect some duplicate numeric observations.
Suppose that I have two variables dataset.
order value
1 0.52
2 0.23
3 0.43
4 0.21
5 0.32
6 0.32
7 0.32
8 0.32
9 0.32
10 0.12
11 0.46
12 0.09
13 0.32
14 0.25
;
Could you help me indicate where the duplicate observations in a row
(e.g., 0.32) are?
best,
moohwan
2009 Dec 18
1
to remove an error with log(zero)
Dear R family
I have an arbitrary column vector.
1
2
4
0
7
5
0
0
0
9
11
12
When I attempt to take natural logarithm of the series, as you guess
there is an error message. To overcome this problem, my idea is to
replace a zero or zeros in a row with appropriate numbers.
In order to implement it, I need to detect where zeros are.
Then I am going to take the average of two adjacent neighbors. In the
2007 Dec 02
1
speeding up likelihood computation
R Users:
I am trying to estimate a model of fertility behaviour using birth history data with maximum likelihood. My code works but is extremely slow (because of several for loops and my programming inefficiencies); when I use the genetic algorithm to optimize the likelihood function, it takes several days to complete (on a machine with Intel Core 2 processor [2.66GHz] and 2.99 GB RAM). Computing
2010 Nov 16
2
Integrating functions / vector arithmetic
Hello,
I was trying to build some functions which I would like to integrate over an
interval using the function 'integrate' from the 'stats' package. As an
example, please consider the function
h(u)=sin(pi*u) + sqrt(2)*sin(pi*2*u) + sqrt(3)*sin(pi*3*u) + 2*sin(pi*4*u)
Two alternative ways to 'build' this function are as in f and g below:
coeff<-sqrt(1:4)
2009 Dec 10
2
Assigning variables into an environment.
I am working with a somewhat complicated structure in which
I need to deal with a function that takes ``basic'' arguments
and also depends on a number of parameters which change depending
on circumstances.
I thought that a sexy way of dealing with this would be to assign
the parameters as objects in the environment of the function in
question.
The following toy example gives a bit of the
2007 Apr 18
3
Problems in programming a simple likelihood
As part of carrying out a complicated maximum likelihood estimation, I
am trying to learn to program likelihoods in R. I started with a simple
probit model but am unable to get the code to work. Any help or
suggestions are most welcome. I give my code below:
************************************
mlogl <- function(mu, y, X) {
n <- nrow(X)
zeta <- X%*%mu
llik <- 0
for (i in 1:n) {
if
2003 Oct 11
1
boot statictic fn for dual estimation of 2 stats?
Hi,
I am trying to use boot() to refit an ordinal logit (polr in MASS) model.
(A very basic bootstrap which samples from the data frame without
replacement and updates the model.)
I need to extract two statistics per run (the coefficients and zeta) and I
tried concatenating them into a single vector after fitting, but I get the
following error:
Error in "[<-"(*tmp*, r, ,
2013 May 30
2
Re: libguestfs-1.22.1 compilation error
Yes i am using ArchLinux (what else is there ?)
and i hate/love (mixed feelings) when you have a valid point and give
such pointers!
indeed there is a diff between your perl and mine
[tmp]> diff -u rwm perl
--- rwm 2013-05-30 13:24:21.066286908 +0300
+++ perl 2013-05-30 13:26:27.149615793 +0300
@@ -1,14 +1,14 @@
- if ($t =~ /\G([^\n]{0,$ll})($break|\n+|\z)/xmgc) {
+ if
2010 Apr 22
1
nv20tcl and renouveau questions
First some data errors I get with both nv20 exa and nv20 dri/mesa.
1.
RT_FORMAT
LINEAR + X8R8G8B8
Ch 1/5 Class 0x0597 Mthd 0x0208 Data 0x00800080:0x00000105
Ch 1/5 Class 0x0597 Mthd 0x0208 Data 0x01000100:0x00000105
LINEAR + A8R8G8B8
Ch 1/5 Class 0x0597 Mthd 0x0208 Data 0x01000100:0x00000108
Ch 1/5 Class 0x0597 Mthd 0x0208 Data 0x00800080:0x00000108
The only value I found in renouveau dump
2006 Oct 07
6
Minor regexp oversight for setext headings
Noticed the patterns for setext style headings are:
^(.+)[ \t]*\n=+[ \t]*\n+
Should be:
^(.+?)[ \t]*\n=+[ \t]*\n+
2010 Jul 22
1
, how to express bar(zeta) in main title in boxplot
Hi everyone, I am plotting a boxplot with main title as main =
bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn't work. The program said they cannot find the function "bar". Does anyone know how to do it correctly? Thanks.
tin
[[alternative HTML version deleted]]
2009 Jun 17
2
Difference beetwen element in the same column
Hi, i have this file
pressure,k,eps,zeta,f,velocity:0,velocity:1,velocity:2,vtkValidPointMask,Point
Coordinates:0,Point Coordinates:1,Point Coordinates:2,vtkOriginalIndices
0.150545,0.000575811,0.0231277,0.000339049,-0.0193008,0.00318629,-6.24066e-07,5.39599e-05,^A,7,0,0,0
0.150546,0.000782719,0.0226157,0.000497957,-0.0192084,0.00367781,5.09813e-06,5.90689e-05,^A,7,0.0003035,0.000225,1
2005 Apr 04
2
Problems with predict.lm: incorrect SE estimate (PR#7772)
Full_Name: Marek Ancukiewicz
Version: 2.01
OS: Linux
Submission from: (NULL) (132.183.12.87)
It seems that the the standard error of prediction of the linear regression,
caclulated with predict.lm is incorrect. Consider the following example where
the standard error is first calculated with predict.lm, then using delta
method. and finally, using the formula rms*sqrt(1+1/n+(xp-x0)^2/Sxx).
Marek
2009 Apr 04
2
threshold distribution
Dear ALL
I have a list of data below
0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559
0.85009 0.85804 0.73324 1.04826 0.84002
1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549
0.93641 0.80418 0.95285 0.76876 0.82588
1.09394 1.00195 1.14976 0.80008 1.11947 1.09484 0.81494 0.68696
0.82364 0.84390 0.71402 0.80293 1.02873
all of them are ninty.
Nowaday, i try to find a
2007 Jan 19
1
naive bayes help
Hello
I have a rather simple code and for some reason it produces an error
message. If someone can tell me why and how to fix it, I would be very
greatful. Thank you in advance.
##### create data
set.seed(10)
n <- 200 # number of training points
n.test <- 200 # number of test points
p<-2 # dimension of input space
z <-
2010 Nov 03
2
bugs and misfeatures in polr(MASS).... fixed!
In polr.R the (several) functions gmin and fmin contain the code
> theta <- beta[pc + 1L:q]
> gamm <- c(-100, cumsum(c(theta[1L], exp(theta[-1L]))), 100)
That's bad. There's no reason to suppose beta[pc+1L] is larger than
-100 or that the cumulative sum is smaller than 100. For practical
datasets those assumptions are frequently violated, causing the
2010 Jan 04
1
polygamma or Hurwitz zeta function
Hi,
Is there any R library that is capable of handling polygamma function
(Hurwitz zeta function also works)? I am aware of digamma(0 and trigamma(),
but could not find more advanced versions.
I'd appreciate any help.
Hakan Demirtas
2007 Feb 08
1
Zeta and Zipf distribution
Dear R user,
I want to estimate the parameter of ZETA or/and ZIPF distributions
using R, given a series of integer values. Do you know a package
(similar to MASS) or a function (similar to fitdistr) I can use to
estimate the parameter of these distributions using MLE method?
Otherwise do you know a function (which use MLE method to estimate
distribution parameters) that allow me to specify a
2019 May 14
2
git llvm push errors
This looks like you're using the wrong repository. The 'git llvm' command
only works with the new repository layout. Please clone
https://github.com/llvm/llvm-project/ instead.
*From: *Ryan Taylor via llvm-dev <llvm-dev at lists.llvm.org>
*Date: *Tue, May 14, 2019 at 2:18 PM
*To: * <paul.robinson at sony.com>
*Cc: *llvm-dev
It's both "No such file or