search for: logx

Displaying 20 results from an estimated 21 matches for "logx".

Did you mean: log
2003 Oct 22
1
: Prediction interval for a Gaussian family log-link model
...ow to build a prediction interval for a gaussian log-link model for the reponse variable?? I can find the standard error of the predictions but I cant seem to find the prediction interval. Is there a way I can calculate the prediction interval from the standard errors?? Here's the example: logX<-rnorm(100) logY<--2-0.5*logX+rnorm(100,0,0.4) Y<-exp(logY) my.glm.mod<-glm(Y~logX,family=gaussian(link="log")) predict(my.glm.mod,type="response",se.fit=TRUE) Thanks, Wayne Dr Wayne R. Jones Senior Statistician / Research Analyst KSS Group plc St James's Bui...
2011 Feb 26
0
A problem about realized garch model
Hi, I am trying to write the Realized GARCH model with order (1,1) The model can be describe bellow: r_t = sqrt( h_t) * z_t logh_t = w + b*logh_(t-1) + r*logx_(t-1) logx_t = c + q*logh_t + t1*z_t +t2*(z_t ^2 -1) + u_t and z follow N(0,1) , u follow N(0, sigma.u^2) But I'm troubled with the simulation check for my code. After I simulate data from the model and estimate the data, I can't get precise estimation for my setting parameters. This...
2011 Feb 11
3
How can we make a vector call a function element-wise efficiently?
Hello I have a time-comsuming program which need to simplify, I have tested the annotated program as follow: > #define function which will be call > calsta <- function(c, n=100000) + { + i <- seq(from=0, length=c) + logx <- lchoose(NT-n, CT-i) + lchoose(n, i) + logmax <- max(logx) + logmax + log(sum(exp(logx - logmax))) + } > CT=6000 #assignment to CT > NT=29535210 #assignment to NT > > vec<-c(2331,524,918,218,1100,547,289,1167,450,1723) > vec [1] 2331 524 918 218 1100 547 289...
2010 Aug 26
3
Using termplot() with transformations of x
Hi all I was playing with termplot(), and came across what appears to be an inconsistency. It would appreciate if someone could enlighten me: > # First, generate some data: > y <- rnorm(100) > x <- runif(length(y),1,2) > # Now find the log of x: > logx <- log(x) > > # Now fit two models that are exactly the same, but specified differently: > m1 <- lm(y~log(x)) # Using log in the call > m2 <- lm(y~logx) # Using the variable logx > > # The two termplots() are different: > par(mfrow=c(1,2)) > termplot(m1) > termpl...
2011 Jan 07
4
how to calculate this natural logarithm
Hello I want to calculate natural logarithm of sum of combinations as follow: (R code) { com_sum=choose(2000000,482)*choose(1000000,118)+choose(2000000,483)*choose(1000000,117)+...+choose(2000000,i)*choose(1000000,600-i)+...+choose(2000000,600)*choose(1000000,0) #calculate the sum result=log(com_sum) #calculate the log of the sum } But
2011 Feb 12
1
how to improve the precison of this calculation?
...which can't implement due to the precision problem i<-0:(c-1) vec<-choose(n,i)*choose(NT-n,CT-i) #get the vector which need summation result<-log(sum(vec)) #get the log of summation # thanks to Petr, we have a solution calsta <- function(c, n) { i <- seq(from=0, length=c) logx <- lchoose(NT-n, CT-i) + lchoose(n, i) logmax <- max(logx) logmax + log(sum(exp(logx - logmax))) } # now, new problem arise, in theory, the "result" of different (c,n) pair should most probably differ, so I can order them, but > calsta(918,100000)-calsta(718,100000) [1] 0 &g...
2019 Jun 24
2
Calculation of e^{z^2/2} for a normal deviate z
...:47 -0700 writes: > include/Rmath.h declares a set of 'logspace' functions for use at the C > level. I don't think there are core R functions that call them. > /* Compute the log of a sum or difference from logs of terms, i.e., > * > * log (exp (logx) + exp (logy)) > * or log (exp (logx) - exp (logy)) > * > * without causing overflows or throwing away too much accuracy: > */ > double Rf_logspace_add(double logx, double logy); > double Rf_logspace_sub(double logx, double logy); > double Rf_log...
2019 Jun 24
1
Calculation of e^{z^2/2} for a normal deviate z
...>> include/Rmath.h declares a set of 'logspace' functions for use at the C >> level. I don't think there are core R functions that call them. >> /* Compute the log of a sum or difference from logs of terms, i.e., >> * >> * log (exp (logx) + exp (logy)) >> * or log (exp (logx) - exp (logy)) >> * >> * without causing overflows or throwing away too much accuracy: >> */ >> double Rf_logspace_add(double logx, double logy); >> double Rf_logspace_sub(double logx, double logy);...
2007 Nov 05
1
Help with cochran.test
Hi, I have been trying to use the function cochran.test from the Outliers package to test for homogeneity of variance. This works well except when I use transformed data. Would anyone have an idea why it doesn't work and how I could do the cochran test on transformed data? Thanks, Stephanie >library(outliers) > set.seed(1234) > x=rnorm(100) >
2009 Sep 22
0
snowfall: sfExport apparently harmless error
...--- script ------------------------------------ library('Rmpi', verbose=FALSE) library('snowfall', verbose=FALSE) # Initialize cluster sfInit(parallel=TRUE, cpus=3, type="MPI") for(i in 1:2) { # Prepare fake data n <- 46000 x <- runif(n, 0.02, 0.54) logx <- log(x) sfExport("logx") # Compute fake function computeTakens <- function(r0idx) { if(r0idx == 1) return(NA) return(1/(logx[r0idx] - sum(logx[1:(r0idx-1)])/(r0idx-1))) } res <- sfClusterApplyLB(n:1, computeTakens) } sfStop() -- Ing. Mari...
2010 Jan 12
1
barplot: border color when stacked
Dear R-users, I am using R version 2.10.1 under windows. In a barplot, I want to mark one of the bars with a special border color. For example: barplot(c(3, 7, 11), border = c(NA, "red", NA)) But how to do this when the bars are stacked? for example: barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try: barplot(matrix(1:6,
2008 Jun 05
0
bug in barplot.default (graphics) (PR#11585)
...) col <- grey.colors(nrow(height)) } else stop("'height' must be a vector or a matrix") if (is.logical(legend.text)) legend.text <- if (legend.text && is.matrix(height)) rownames(height) stopifnot(is.character(log)) logx <- logy <- FALSE if (log !=3D "") { logx <- length(grep("x", log)) > 0L logy <- length(grep("y", log)) > 0L } if ((logx || logy) && !is.null(density)) stop("Cannot use shading lines in bars when log sca...
2019 Jun 23
0
Calculation of e^{z^2/2} for a normal deviate z
include/Rmath.h declares a set of 'logspace' functions for use at the C level. I don't think there are core R functions that call them. /* Compute the log of a sum or difference from logs of terms, i.e., * * log (exp (logx) + exp (logy)) * or log (exp (logx) - exp (logy)) * * without causing overflows or throwing away too much accuracy: */ double Rf_logspace_add(double logx, double logy); double Rf_logspace_sub(double logx, double logy); double Rf_logspace_sum(const double *logx, int nx); Bill Dunlap TIBCO S...
2019 Jun 23
2
Calculation of e^{z^2/2} for a normal deviate z
I agree with many the sentiments about the wisdom of computing very small p-values (although the example below may win some kind of a prize: I've seen people talking about p-values of the order of 10^(-2000), but never 10^(-(10^8)) !). That said, there are a several tricks for getting more reasonable sums of very small probabilities. The first is to scale the p-values by dividing the
2019 Jun 24
0
Calculation of e^{z^2/2} for a normal deviate z
...:47 -0700 writes: > include/Rmath.h declares a set of 'logspace' functions for use at the C > level. I don't think there are core R functions that call them. > /* Compute the log of a sum or difference from logs of terms, i.e., > * > * log (exp (logx) + exp (logy)) > * or log (exp (logx) - exp (logy)) > * > * without causing overflows or throwing away too much accuracy: > */ > double Rf_logspace_add(double logx, double logy); > double Rf_logspace_sub(double logx, double logy); > double Rf_log...
2009 Sep 22
0
(correction) snowfall+Rmpi: sfExport error
...-no-save $* /users/mvalle/snow/snow/inst/RMPISNOW: line 40: 22094 Terminated R --no-save $* --- script ------------------------------------ library('Rmpi') library('snowfall') sfInit(parallel=TRUE, cpus=3, type="MPI") for(i in 1:9) { n <- 20000 logx <- runif(n, 0.02, 0.54) sfExport("logx") } sfStop() -- Ing. Mario Valle Data Analysis and Visualization Group | http://www.cscs.ch/~mvalle Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 v. Cantonale Galleria 2, 6928 Manno, Switzerland | F...
2006 Jan 05
4
ylim problem in barplot
R Version 2.2.0 Platform: Windows When I use barplot but select a ylim value greater than zero, the graph is distorted. The bars extend below the bottom of the graph. For instance the command produces a problematic graph. barplot(c(200,300,250,350),ylim=c(150,400)) Any help would be appreciated. Paul [[alternative HTML version deleted]]
2008 Jun 11
1
Some problem with the OLS
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080611/2da35c97/attachment.pl>
2012 Oct 10
0
Network issue with multiple uplinks
...0 eth1 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 99.10.11.254 0.0.0.0 UG 100 0 0 eth2 0.0.0.0 100.10.10.254 0.0.0.0 UG 0 0 0 eth1 Any comments ? -- Stefano Buelow <stefano.buelow [at] logx.it> -- Il messaggio e' stato analizzato alla ricerca di virus o contenuti pericolosi da MailScanner, ed e' risultato non infetto.
2005 Apr 18
1
R-2.1.0 is released
.... o ISNAN now works even in C++ code that undefines the 'isnan' macro. o R_alloc's limit on 64-bit systems has been raised from just under 2^31 bytes (2Gb) to just under 2^34 (16Gb), and is now checked. o New math utility functions log1pmx(x), lgamma1p(x), logspace_add(logx, logy), and logspace_sub(logx, logy). DEPRECATED & DEFUNCT o The aqua module for MacOS X has been removed: --with-aqua now refers to the unbundled Cocoa GUI. o Capabilities "bzip2", "GNOME, "libz" and "PCRE" are defunct. o The undocumented us...