Displaying 20 results from an estimated 82 matches for "denom".
2012 Jan 13
2
[LLVMdev] Odd weak symbol thing on i386
...om the NetBSD standard library. It works on ARM, Mips,
Microblaze,ppc, ppc64, and x86_64. On i386 a very strange thing happens.
Here's the source:
#include <stdlib.h>
#define __weak_alias(sym) __attribute__ ((weak, alias (#sym)))
lldiv_t lldiv(long long int num, long long int denom) __weak_alias(_lldiv);
lldiv_t _lldiv(long long num, long long denom)
{
lldiv_t r;
r.quot = num / denom;
r.rem = num % denom;
if (num >= 0 && r.rem < 0) {
r.quot++;
r.rem -= denom;
}
return (r);
}
I get...
2006 Jul 03
1
Problem with try()
Dear R-experts,
I am running a large simulation exercise where the enough complicated integration is required.
The integral is computed within a C-function called Denom by use of function qags from the gsl library.
Here is a piece of R-code:
denom<-try(.C("Denom",as.double(x),as.integer(n), as.integer(p),
as.double(param), as.double(delta),res=as.double(results)))
denomres=if (class(denom)=="try-error") NA else de...
2007 Aug 23
0
indexing and regression testing
...0.00 0.00 0.00
> iVec2 <- index(Vec2, verbose=TRUE)
finalized tree
user.self sys.self elapsed
sort 7.78 0 7.79
tree 0.00 0 0.00
>
> timefactor(any(Vec1=="a999"), any(iVec1=="a999"), 10, 100)
finalized tree
nom denom factor
user.self 0.041 0.0036 11.38889
sys.self 0.000 0.0000 NaN
elapsed 0.041 0.0036 11.38889
> timefactor(any(Vec2=="a999"), any(iVec2=="a999"), 10, 100)
nom denom factor
user.self 0.040 0.0036 11.11111
sys.self 0.000 0.0000 NaN
elapsed 0.04...
2007 Aug 28
1
Age-Length key with kimura algorith
Se ha borrado un texto insertado con un juego de caracteres sin especificar...
Nombre: no disponible
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070828/6641b572/attachment.pl
2012 Jan 13
0
[LLVMdev] Odd weak symbol thing on i386
...ry. It works on ARM, Mips,
> Microblaze,ppc, ppc64, and x86_64. On i386 a very strange thing happens.
> Here's the source:
>
> #include <stdlib.h>
> #define __weak_alias(sym) __attribute__ ((weak, alias (#sym)))
>
> lldiv_t lldiv(long long int num, long long int denom) __weak_alias(_lldiv);
>
> lldiv_t _lldiv(long long num, long long denom)
> {
> lldiv_t r;
> r.quot = num / denom;
> r.rem = num % denom;
> if (num >= 0 && r.rem < 0) {
> r.quot++;
> r.rem -= denom;
&...
2012 Aug 07
4
help to program my function
...cteur a[j] where j: 1...8
>this is the code in R:
>aj.fun <- function(j, i, X, z, E, beta0, beta1){
+ n <- length(X)
+ iX <- order(X)
+ iz <- order(z)
+ e1 <- -(beta)*z[ iz[1:(i - 1)] ]
+ numer <- E[j] - sum( X[ iX[1:(i - 1)] ] * exp(e1) )
+ e2 <- -(beta)*z[ iz[i:n] ]
+ denom <- sum( exp(e2) )
+ numer/denom
+ }
> iX<-order(X)
> iX
[1] 75 37 29 60 73 20 69 55 30 70 72 38 26 35 65 61 74 50 71 57 25 54 64 76
56
[26] 58 48 67 46 63 28 62 36 49 47 66 1 42 41 19 39 43 22 51 68 33 27 9 15
11
[51] 10 59 32 40 45 44 52 16 18 34 4 53 21 23 31 7 6 13 14 12 17 24...
2006 May 31
1
trouble with boot ()
Dear members,
I am trying to use boot () to compute the distributions of a statistic
of a data set. The statistic is defined in the following code:
eds<-function(x) {
r<-cor(x)
paren<-1-abs(r)/2
denom<-sum(sum(paren)+0.5)
desvio<-sd(x)
media<-mean(x)
a<-desvio/media
nom<-sum(a*(sum(paren)+0.5))
eds_abs<-nom/denom
print(eds_abs)
}
I need to calculate the nonparametric bootstrap confidence in...
2012 Feb 09
1
Constraint on one of parameters.
...*(xa-theta1[9])*(xb-theta1[10])/sqrt(theta1[9]*(1-theta1[9]))/sqrt(theta1[10]*(1-theta1[10])))/
(2*pi*theta[18]*theta[20]*sqrt(1-theta[21]^2))*exp(-2*(1-theta[21]^2))^(-1)*((xc-theta[17])^2/theta[18]^2+(xd-theta[19])^2/theta[20]^2-2*theta[21]^2*(xc-theta[17])*(xd-theta[19])/(theta[18]*theta[20]))
denom=nume1+nume2+nume3+nume4+nume5
Ep1=nume1/denom
Ep2=nume2/denom
Ep3=nume3/denom
Ep4=nume4/denom
Ep5=nume5/denom
elogld=
sum(Ep1*(-log(2*pi*theta[2]*theta[4]*sqrt(1-theta[21]^2))-(2*(1-theta[21]^2))^(-1)*((xc-theta[1])^2/theta[2]^2+(xd-theta[3])^2/theta[4]^2-2*theta[21]^2*(xc-theta[1])*(xd-theta[3]...
2001 Nov 21
2
distances from points to line
Dear all,
I have discovered that there are many things that I used to do in my GIS
which are easily done directly in R, for example calculating interpoint
distances using geoR and pick out points inside a polygon using splancs.
I now wonder, is there a function to create a line object like a
watercourse and then calculate the distances between many points in space
and this line?
I couldn't
2011 Feb 17
1
Integrate with an indicator function
...ate(func1, lower = 0, upper = Inf,x)$val}
T <- function(x){
0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))}
func2 <- function(x,c){(T(x) <=c)*0.3*dnorm(x)}
func3 <- function(x,c){(T(x) <= c)*(0.3*dnorm(x)+0.7*m1star(x))}
numer <- function(c){
integrate(func2, -Inf, Inf, c)$val}
denom <- function(c){
integrate(func3, lower, Inf,c)$val}
The error message is as below :
> numer(0.5)
Error in integrate(func1, lower = 0, upper = Inf, x) :
the integral is probably divergent
[[alternative HTML version deleted]]
2018 Feb 02
1
R-gui sessions end when executing C-code
...);
double mu_c = asReal(mu);
double mu2_c = 1.0 - mu_c;
double error_c = asReal(err);
double lowest_double = 1e-15;
double tmp_c;
double denom;
double error_temp;
double error_i_c;
/* Make ready vector froms input */
PROTECT(q); n_prot++;
PROTECT(v); n_prot++;
PROTECT(psi); n_p...
2007 May 24
3
Problem with numerical integration and optimization with BFGS
...bs(alpha[5])/(1+abs(alpha[5])) # between 0 and
lstar
delta <- 0.01 + exp(alpha[6]) # greater than
0.01
##########################################
# THE THREE FUNCTIONS TO INTEGRATE
# FOR COMPUTING THE LOGLIKELIHOOD
##########################################
denom <- 2*pi*sigep*sigeta*(sqrt(1-rho2^2)) # A CONSTANT TO BE USED
# FOR DEFINING THE
# THREE FUNCTIONS
f1 <- function(z1) { # FIRST FUNCTION
b11 <- ((z1-muep)^2)/((-2)*(1-rho2^2)*(sigep^2...
2024 Sep 05
0
BUG: atan(1i) / 5 = NaN+Infi ?
...operation is carried out. I had assumed
this was documented in ?complex, but I don't see it there. Maybe it
should be.
If you want z/5 to be carried out using the correct mathematical
approach, you'll probably have to define it yourself. For example,
CxByReal <- function(num, denom) {
if (is.complex(denom)) stop("this is for a real denominator!")
complex(real = Re(num)/denom, imaginary = Im(num)/denom)
}
CxByReal(complex(real=0, imaginary=Inf), 5)
# [1] 0+Infi
Duncan Murdoch
>
> Sincerely,
>
> Leonard
>
> ------------------...
2009 Sep 19
1
Poisson Regression - Query
Hi All,
My dependent variable is a ratio that takes a value of 0 (zero) for 95% of
the observations and positive non-integer values for the other 5%. What
model would be appropriate? I'm thinking of fitting a GLM with a Poisson ~.
Now, becuase it takes non-integer values, using the glm function with
Poisson family issues warning messages.
Warning messages:
1: In dpois(y, mu, log = TRUE) :
2012 Apr 10
3
How to get the SS and MS from oneway.test?
...t;?
My R code and the results are as follows.
Thank you very much. :)
> oneway.test(BackCalac~factor(Assay), var.equal=T,data=Control)
One-way analysis of means
data: BackCalac and factor(Assay)
F = 56.2191, num df = 4, denom df = 20, p-value = 1.345e-10
> oneway.test(BackCalac~factor(Assay), var.equal=F,data=Control)
One-way analysis of means (not assuming equal variances)
data: BackCalac and factor(Assay)
F = 92.8834, num df = 4.000, denom df = 9.625, p-value = 1.165e-07
--
View this message in context:...
2002 Mar 15
1
calibration/inverse regression?
I wonder if anyone out there has written a routine to solve the simple
linear calibration problem?
- fit regression of y vs x
- estimate the value x0 (with 95% CI) that gives y0
Thanks for any help.
Bill
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2012 May 29
1
need help to find type I error rate for modified F statistic
...t;-rep(NA,asim)
ssd1<-rep(NA,asim)
ssd2<-rep(NA,asim)
madN1<-rep(NA,asim)
madN2<-rep(NA,asim)
lo.w<-rep(NA,asim)
up.w<-rep(NA,asim)
lo.x<-rep(NA,asim)
up.x<-rep(NA,asim)
hw<-rep(NA,asim)
hx<-rep(NA,asim)
xbar.t<-rep(NA,asim)
num<-rep(NA,asim)
df2<-rep(NA,asim)
denom<-rep(NA,asim)
F<-rep(NA,asim)
asim<-1000
for(j in 1:asim)
{
print(j)
set.seed(j)
a<-rnorm(15,0,1)
b<-rnorm(15,0,1)
w<-a*exp(h*a^2/2)
x<-b*exp(h*b^2/2)
matw<-sort(w)
matx<-sort(x)
trim1[j]=1/((1-2*alpha)*n)*(sum(matw[i:m])+r*(matw[k]+matw[n-k+1]))
trim2[j]=1/((1-2*alp...
2008 May 27
4
help with simple function
I have a matrix of frequency counts from 0-160.
x<-as.matrix(c(0,1,0,0,1,0,0,0,1,0,0,0,0,1))
I would like to apply a function creating a new column (x[,2])containing
values equal to:
a) log(x[m,1]) if x[m,1] > 0; and
b) for all x[m,1]= 0, log(next x[m,1] > 0 / count of preceding zero values
+1)
for example, x[1,2] should equal log(x[2,1]/2) = log(1/2) = -0.6931472
whereas x[3,2] should
2005 Feb 25
1
anova grouping of factors in lme4 / lmer
...the
Experimenter factor, I get a sequential anova table where factor
levels are fit one at a time, ie,
> anova(lmer(Response ~ Weight + Experimenter
+ + (1 | SUBJECT.NAME) + (1 | Date.StudyDay),
+ data=data.df))
Analysis of Variance Table
Df Sum Sq Mean Sq Denom F value Pr(>F)
Weight 1 10.8 10.8 4242.0 14.4457 0.0001463 ***
Experimentercarmena 1 0.5 0.5 4242.0 0.6708 0.4128136
Experimentercnunez 1 4.8 4.8 4242.0 6.5042 0.0107969 *
Experimenterlsolberg 1 0.4 0.4 4242.0 0.5910 0.4420783
Experimenter...
2009 Mar 16
1
Uniroot and Newton-Raphson Anomaly
...test
item i in class j, c is the proportion correct on the test by student k,
and q is the number of items on the test in total.
I have programmed this using Newton-Raphson as follows:
numer <- function(R,a,c,q){
result <- sum((1-(1-R)^a)^(1/a))-c*q
result
}
denom <- function(R,a,c,q){
result <- sum(-((1 - (1 - R)^a)^(1/a) * (log((1 - (1 - R)^a)) *
(1/a^2)) +
(1 - (1 - R)^a)^((1/a) - 1) * ((1/a) * ((1 - R)^a * log((1 -
R))))))
result
}
aConst <- function(R, c, q, con){
a <- .5 # starting value for a...