Displaying 20 results from an estimated 5000 matches similar to: "Displaying of Results"
2010 Aug 18
1
Displaying Results in Two Columns
Could I have some suggestions as to how (various ways) I can display my confidence interval results?
rm(list = ls())
set.seed(1)
func <- function(d,t,beta,lambda,alpha,p.gamma,delta,B){
d <- c(5,1,5,14,3,19,1,1,4,22)
t <- c(94.32,15.72,62.88,125.76,5.24,31.44,1.048,1.048,2.096,10.48)
post <- matrix(0, nrow = 11, ncol = B)
theta <- c(lambda,beta)
beta.hat <- 2.471546
for(j
2006 Nov 27
0
How to simulate data from copulas?
Dears,
I am writing sice having question about your R package "copula".
I am using this package to fit my data with some of the 22 copulas mentioned
in Nelsen 1999.
However, when trying random number generator I have got some difficulties.
For example when I have familie number A13 where cupola is equal to
C(u,v) = exp(1-((1-log(u))^theta+(1-log(v))^theta-1)^(1/theta))
devuv =
2006 Dec 01
2
Non central chi squared bug (PR#9406)
Full_Name: Alan Bain
Version: 2.4.0
OS: XP
Submission from: (NULL) (155.140.122.227)
Code for pnchisq contains following
if (tSml) {
if (x> f+ theta+ 5*sqrt(2*(f+2*theta) ))){
return 1.; /* better than 0 --- but definately FIXME */
}
}
This needs to check which tail has been requested; it is only correct if the
default lower_tail=1 has been requested; for upper tail should return 0
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
2004 Feb 17
0
A log on Bayesian statistics, stochastic cost frontier, montecarl o markov chains, bayesian P-values
Dear friends,
Over the past weeks, I have been asking a lot of questions about how to
use R in Bayesian analysis. I am brand new to R, but I am very pleased with
it. I started with winbugs but I found winbugs to be a limited software, not
bad but has several limitations. By contrast, R allows the analyst to tackle
any problem with a huge set of tools for any kind of analysis. I love R. In
2009 Aug 17
2
Newbie that don't understand R code
I got some R code that I don't understand.
Question as comment in code
//where is t comming from, what is phi inverse
rAC <- function(name, n, d, theta){
#generic function for Archimedean copula simulation
illegalpar <- switch(name,
clayton = (theta < 0),
gumbel = (theta < 1),
frank = (theta < 0),
BB9 = ((theta[1] < 1) | (theta[2] < 0)),
GIG = ((theta[2] < 0) |
2005 Mar 03
2
regression on a matrix
Hi -
I am doing a monte carlo experiment that requires to do a linear
regression of a matrix of vectors of dependent variables on a fixed
set of covariates (one regression per vector). I am wondering if
anyone has any idea of how to speed up the computations in R. The code
follows:
#regression function
#Linear regression code
qreg <- function(y,x) {
X=cbind(1,x)
m<-lm.fit(y=y,x=X)
2006 Sep 19
0
How to interpret these results from a simple gamma-frailty model
Dear R users,
I'm trying to fit a gamma-frailty model on a simulated dataset, with 6 covariates, and I'm running into some results I do not understand. I constructed an example from my simulation code, where I fit a coxph model without frailty (M1) and with frailty (M2) on a number of data samples with a varying degree of heterogeneity (I'm running R 2.3.1, running takes ~1 min).
2012 Mar 16
2
Elegant Code
Hi,
Can anyone help to write a more elegant version of my code? I am sure
this can be put into a loop but I am having trouble creating the
objects b1,b2,b3,...,etc.
b1 <- rigamma(50,1,1)
theta1 <- rgamma(50,0.5,(1/b1))
sim1 <- rpois(50,theta1)
b2 <- rigamma(50,1,1)
theta2 <- rgamma(50,0.5,(1/b2))
sim2 <- rpois(50,theta2)
b3 <- rigamma(50,1,1)
theta3 <-
2009 Dec 30
1
Fwd: Negbin Error Warnings
Dear Clara,
Thanks for the reply. I am forwarding your message to the list, ok.
When I wrote was a way of get further information to help the helpers.
happy holidays,
milton
---------- Forwarded message ----------
From: Clara Brück <clara_brueck@web.de>
Date: 2009/12/30
Subject: Re: [R] Negbin Error Warnings
To: milton ruser <milton.ruser@gmail.com>
Dear Milton,
Thanks for
2010 Apr 08
1
a small question about R with Winbugs
I try to do a test for dirichlet process for Multivariate normal, but Winbugs
always says "expected multivariate node", does that mean I miss something at
initialization? I will really appreciate the help to solve this problem
Here is the R code, and Winbugs code.
model
{
for(i in 1:N){
y[i,1:2] ~ dmnorm(mu[i,],tau[i,,])
S[i] ~ dcat(pi[])
mu[i,1:2] <- mu.star[S[i],]
2009 Jul 19
1
trouble using optim for maximalisation of 2-parameter function
Hello, I am having trouble using "optim".
I want to maximalise a function to its parameters [kind of like: univariate
maximum likelihood estimation, but i wrote the likelihood function myself
because of data issues ]
When I try to optimize a function for only one parameter there is no
problem:
llik.expo<-function(x,lam){(length(x)*log(lam))-(length(x)*log(1-exp(-1*lam*
2004 Nov 08
1
coxph models with frailty
Dear R users:
I'm generating the following survival data:
set.seed(123)
n=200 #sample size
x=rbinom(n,size=1,prob=.5) #binomial treatment
v=rgamma(n,shape=1,scale=1) #gamma frailty
w=rweibull(n,shape=1,scale=1) #Weibull deviates
b=-log(2) #treatment's slope
t=exp( -x*b -log(v) + log(w) ) #failure times
c=rep(1,n) #uncensored indicator
id=seq(1:n) #individual frailty indicator
2012 Nov 04
1
Struggeling with nlminb...
Hallo together,
I am trying to estimate parameters by means of QMLE using the nlminb
optimizer for a tree-structured GARCH model. I face two problems.
First, the optimizer returns error[8] false convergence if I estimate the
functions below. I have estimated the model at first with nlm without any
problems, but then I needed to add some constraints so i choose nlminb.
2009 Jun 18
3
Ultima Online - Kingdom Reborn
Ultima Online is currently beta testing a new release which will have a 3d client based on the Kingdom Reborn release.
In preparation, I am trying to load Kingdom Reborn to learn the client but it crashes in Wine when it hits the installation wizard. Has anyone worked through any tricks to make this install and run?
It crashes almost immediately after unpacking the archive and starting the
2010 Feb 03
1
legend help
i=1
for(rate in c(2,4) ){
for(shape in c(1,3,5) ){
curve(dgamma(x,rate,shape),xlim=c(0,3),ylab="",col=i,lty=i,add=T)
i=i+1
}
}
How can I add some legend to represent these lines?
i.e. the legend is displayed as
col=1 lty=1 lambda=2 theta=1
col=2 lty=2 lambda=2 theta=3
col=3 lty=3 lambda=2 theta=5
col=4 lty=4 lambda=4 theta=1
col=5 lty=5 lambda=4 theta=3
col=6 lty=6 lambda=4 theta=5
2000 Apr 14
1
rgamma with negative shape and scale parameters works?
Dear R people,
This is a possibly silly question, but the rgamma function takes the shape
and scale arguments and simulates gamma rvs corresponding to those values,
right? But the shape and scale parameters have to be positive, right?
However, rgamma quite happily returns to me values for negative values of
shape and scale, and in some cases returns negative values eg.
> rgamma(1, 1, -1)
[1]
2011 Mar 26
1
Solstice Reborn, it works! (almost)
I installed Solstice reborn on my Linux Mint LXDE. I already have .net framework 2.0 and mono installed as well as directx 9.0.
I overwrote mscore in wine libraries also.
Now when I start the game it opens and there is an error message. I minimize it and a terminal like screen appears chronicling the loading process of SR. The game window pops up, the mouse changes to the game mouse, the
2008 Nov 15
1
rgamma with rate as vector
Hi - I have a question about the following code from Bayesian
Computation with R (Jim Albert).
par(mfrow=c(2,2))
m = 500
alphas = c(5, 20, 80, 400)
for (j in 1:4) {
mu = rgamma(m, shape=10, rate=10)
lambda1 = rgamma(m, shape=alphas[j], rate=alphas[j]/mu)
lambda2 = rgamma(m, shape=alphas[j], rate=alphas[j]/mu)
plot(lambda1, lambda2)
title(main=paste('alpha=',
2007 Feb 17
1
Solve in maximum likelihood estimation
Hi,
I got the following problem.
I am doing a maximum likelihood estimation for a Kalman Filter.
For this purpose, I have to invert an error matrix Ffast of dimension
"no. parameters X no.parameters". The usualy optim methods often find only
local minima, so I decided to make the optimization using the SANN
algorithm, which is very slow already.
However, this becomes a real problem
2005 Feb 22
1
include C functions from nmath in my own C functions
Hi:
I am writing a C program which need a gamma random
number generator. I download the source file of R and
compile, make it myself. There is a "rgamma.c"
function in the installing directory of
R("/home/zhliu/Backup/R-2.0.1/src/nmath/rgamma.c"). My
question is how to call this function in my own
program which is in another directory. I can not copy
this "rgamma.c"