[R] rv package

2007-04-20 Thread gsmatos1
Hi, 

Does anybody knows how to coerce an mcmc objetct to a rv object without 
loose the information about what parameters. was simulated I tried do it but 
it looks that this informatio was lost. 


Thank you very much for any information. 
Gilberto Matos. 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error in geweke.diag function of coda package

2007-04-18 Thread gsmatos1
Hi R users, 

Does anybody knows for the following erro after running 

geweke.diag(MCMC.sampled, frac1=0.1, frac2=0.5) 


Erro em glm.fit(x = X, y = Y, weights = weights, start = start, etastart = 
etastart,  : 
laço interno 1; não é possível corrigir o tamanho do passo 
Além disso: Warning messages: 
1: algoritmo não convergiu in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
2: algoritmo não convergiu in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
3: algoritmo não convergiu in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
4: algoritmo não convergiu in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
5: tamanho do passo truncado por causa de divergência 

Thanks for any help. 

Gilberto Matos. 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error to install fMultivar package

2006-12-14 Thread gsmatos1

 Hello, 

I tried the first issue of Dirk and it was all right: 

This would be quicker: 
 
 $ sudo apt-get install r-cran-fmulitvar 
 

(I've already had enabled the Universe repositories in 
/etc/apt/sources.list. ) 

I think it was realy related with some lib and packages dependencies. 

Thank's for all! 
Gilberto. 

Em (10:18:04), Dirk Eddelbuettel escreveu: 
On Wed, Dec 13, 2006 at 09:34:04AM -0300, gsmatos1 wrote: 
Content-Description: Mail message body 
 Hi, 
 
 I tried to install fMultivar package but an error occurs that I could not 
 understand. 
 (I've been worked with linux / Ubuntu 6.06 LTS) 
 
This would be quicker: 
 
 $ sudo apt-get install r-cran-fmulitvar 
 
(if you enabled the Universe repositories in /etc/apt/sources.list). 
 
  install.packages(fMultivar) 
... 
 trying URL 
 'http://lmq.esalq.usp.br/CRAN/src/contrib/fMultivar_221.10065.tar.gz' 
 Content type 'application/x-gzip' length 1152747 bytes 
 opened URL 
 == 
 downloaded 1125Kb 
 
 * Installing *source* package 'fMultivar' ... 
 ** libs 
 gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 
 -std=gnu99 -c 00A-randomF77.c -o 00A-randomF77.o 
 gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 
 -std=gnu99 -c 00B-GarchBEKK.c -o 00B-GarchBEKK.o 
 g77 -fpic -g -O2 -c 42A-1ReggressionModelling.f -o 
 42A-1ReggressionModelling.o 
 g77 -fpic -g -O2 -c 42A-2RegressionModelling.f -o 
 42A-2RegressionModelling.o 
 gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 
 -std=gnu99 -c 42A-3RegressionModelling.c -o 42A-3RegressionModelling.o 
 g77 -fpic -g -O2 -c 42B-RegressionTests.f -o 42B-RegressionTests.o 
 g77 -fpic -g -O2 -c 46A-VectorMatrixAddon.f -o 46A-VectorMatrixAddon.o 
 gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 
 -std=gnu99 -c 46B-MissingValues.c -o 46B-MissingValues.og77 -fpic -g 
-O2 
 -c 47B-MultivariateDistribution.f -o 47B-MultivariateDistribution.o 
 gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 
 -std=gnu99 -c runfunc.c -o runfunc.o 
 gcc -shared -o fMultivar.so 00A-randomF77.o 00B-GarchBEKK.o 
 42A-1ReggressionModelling.o 42A-2RegressionModelling.o 
 42A-3RegressionModelling.o 42B-RegressionTests.o 46A-VectorMatrixAddon.o 
 46B-MissingValues.o 47B-MultivariateDistribution.o runfunc.o -lblas-3 
-lg2c 
 -lm -lgcc_s -L/usr/lib/R/lib -lR 
 /usr/bin/ld: cannot find -lblas-3 
 collect2: ld returned 1 exit status 
 make: *** [fMultivar.so] Error 1 
 ERROR: compilation failed for package 'fMultivar' 
 ** Removing '/usr/local/lib/R/site-library/fMultivar' 
 
 The downloaded packages are in 
 /tmp/RtmpXxDoFd/downloaded_packages 
 Warning message: 
 installation of package 'fMultivar' had non-zero exit status in: 
 install.packages(fMultivar) 
 
It is a FAQ for Debian and Ubuntu -- you forgot to install 
r-base-dev which provides a fairly complete development emv. for R on 
Debian / Ubuntu, so do 
 
 $ sudo apt-get install r-base-dev 
 
Besides, given that there _is_ a source package, you could also use 
its information on Build-Dependencies: 
 
 $ sudo apt-get build-dep r-cran-fmultivar 
 
Hth, Dirk 
 
  
 
 Thanks in advance for any help! 
 Gilberto. 
 
 
 
 __ 
 R-help@stat.math.ethz.ch mailing list 
 https://stat.ethz.ch/mailman/listinfo/r-help 
 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html 
 and provide commented, minimal, self-contained, reproducible code. 
 
-- 
Hell, there are no rules here - we're trying to accomplish something. 
 -- Thomas A. Edison 
 
__ 
R-help@stat.math.ethz.ch mailing list 
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code. 
 
-- 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error to install fMultivar package

2006-12-13 Thread gsmatos1
Hi, 

I tried to install fMultivar package but an error occurs that I could not 
understand. 
(I've been worked with linux / Ubuntu 6.06 LTS) 

 install.packages(fMultivar) 
Warning in install.packages(fMultivar) : argument 'lib' is missing: using 
/usr /local/lib/R/site-library 
--- Please select a CRAN mirror for use in this session --- 
Loading Tcl/Tk interface ... done 
trying URL 
'http://lmq.esalq.usp.br/CRAN/src/contrib/fMultivar_221.10065.tar.gz' 
Content type 'application/x-gzip' length 1152747 bytes 
opened URL 
== 
downloaded 1125Kb 

* Installing *source* package 'fMultivar' ... 
** libs 
gcc -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 
-std=gnu99 -c 00A-randomF77.c -o 00A-randomF77.o 
gcc -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 
-std=gnu99 -c 00B-GarchBEKK.c -o 00B-GarchBEKK.o 
g77   -fpic  -g -O2 -c 42A-1ReggressionModelling.f -o 
42A-1ReggressionModelling.o 
g77   -fpic  -g -O2 -c 42A-2RegressionModelling.f -o 
42A-2RegressionModelling.o 
gcc -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 
-std=gnu99 -c 42A-3RegressionModelling.c -o 42A-3RegressionModelling.o 
g77   -fpic  -g -O2 -c 42B-RegressionTests.f -o 42B-RegressionTests.o 
g77   -fpic  -g -O2 -c 46A-VectorMatrixAddon.f -o 46A-VectorMatrixAddon.o 
gcc -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 
-std=gnu99 -c 46B-MissingValues.c -o 46B-MissingValues.og77   -fpic  -g -O2 
-c 47B-MultivariateDistribution.f -o 47B-MultivariateDistribution.o 
gcc -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 
-std=gnu99 -c runfunc.c -o runfunc.o 
gcc -shared  -o fMultivar.so 00A-randomF77.o 00B-GarchBEKK.o 
42A-1ReggressionModelling.o 42A-2RegressionModelling.o 
42A-3RegressionModelling.o 42B-RegressionTests.o 46A-VectorMatrixAddon.o 
46B-MissingValues.o 47B-MultivariateDistribution.o runfunc.o -lblas-3 -lg2c 
-lm -lgcc_s -L/usr/lib/R/lib -lR 
/usr/bin/ld: cannot find -lblas-3 
collect2: ld returned 1 exit status 
make: *** [fMultivar.so] Error 1 
ERROR: compilation failed for package 'fMultivar' 
** Removing '/usr/local/lib/R/site-library/fMultivar' 

The downloaded packages are in 
/tmp/RtmpXxDoFd/downloaded_packages 
Warning message: 
installation of package 'fMultivar' had non-zero exit status in: 
install.packages(fMultivar) 
 

Thanks in advance for any help! 
Gilberto. 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help to understand an Error using summary to an mcmc object

2006-12-07 Thread gsmatos1
Hi, 

I used the MCMCirtKd function of MCMCpack: 

posterior2 - MCMCirtKd(data, dimensions = 2, 
+burnin = 5000, mcmc = 5, thin = 10, 
+ verbose = 1, B0 = .25, store.item = TRUE, item.constraints = 
beta.constraints) 

And after apply the comand summary() I got some erros and warnings that I 
could not understand: 

summary.posterior2 - summary(posterior2) 

Error: NA/NaN/Inf in foreign function call (arg 1) 
In addition: Warning messages: 
1: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
2: step size truncated due to divergence 
Error: NA/NaN/Inf in foreign function call (arg 1) 
In addition: There were 42 warnings (use warnings() to see them) 
Error: NA/NaN/Inf in foreign function call (arg 1) 
In addition: There were 35 warnings (use warnings() to see them) 
Error in glm.fit(x = X, y = Y, weights = weights, start = start, etastart = 
etastart,  : 
inner loop 1; cannot correct step size 
In addition: There were 49 warnings (use warnings() to see them) 
Error: NA/NaN/Inf in foreign function call (arg 1) 
In addition: Warning messages: 
1: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
2: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
3: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
4: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
5: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
6: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
7: algorithm did not converge in: glm.fit(x = X, y = Y, weights = weights, 
start = start, etastart = etastart, 
8: step size truncated due to divergence 
Error: NA/NaN/Inf in foreign function call (arg 1) 
In addition: There were 29 warnings (use warnings() to see them) 

Thanks for any comment. 
Gilberto Matos. 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error in Calling C++ function from R!!!

2006-11-24 Thread gsmatos1
Hello, 

I tried to call an external function of R from the following code in C++: 

void prodgdot(double *x, double *y, int *n, double *output) 

{ 

int i; 

*output=0; 

for (i=0;i*n;i++) 

{ 

*output+=x[i]*y[i]; 

} 

} 

I compiled it using from my working directory in linux terminal and I think 
it's ok: 

[EMAIL PROTECTED]:~/mysrc/meus_testes_iniciais$ R CMD SHLIB codigoprova.cc 
# The output 
g++ -I/usr/share/R/include -I/usr/share/R/include  -fpic  -g -O2 -c 
codigoprova.cc -o codigoprova.o 
g++ -shared  -o codigoprova.so codigoprova.o   -L/usr/lib/R/lib -lR 

After, I tried to call R from my working directory an Error occurs: 

 x-c(1,4,6,2) 
 y-c(3,2.4,1,9) 
 dyn.load(codigoprova.so) 
 is.loaded(codigoprova.so) 
[1] FALSE 
 product-.C(prodgdot,myx=x,muy=y,myn=NROW(x),myoutput=as.double(0)) 
Error in .C(prodgdot, myx = x, muy = y, myn = NROW(x), myoutput = 
as.double(0)) : 
C symbol name prodgdot not in load table 
 

Does anyone know what is the problem? 

Thank's in advance! 
Gilberto. 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] About: Error in FUN(X[[1]], ...) : symbol print-name too long

2005-11-09 Thread gsmatos1
Hi, 

I´m trying to use the Win2BUGS package from R and I have a similar problem 
that reurns with the message: 

Error in FUN(X[[1]], ...) : symbol print-name too long 

But, there is no stray ` character in the file ( Sugestions given by: Duncan 
Temple Lang duncan 
Date: Mon, 26 Sep 2005 07:31:08 -0700 ) 

The progam in R is: 

library(R2WinBUGS) 
library(rbugs) 

dat - 
list(x=c(49,48,50,44,54,56,48,48,51,51,50,53,51,50,51,54,50,53,50,49,51,47,53,50,49,55,53,48,54,46),
 
y=c(50,49,57,52,47,52,58,45,55,54,51,54,56,53,52,47,51,54,50,47,46,44,54,55,52,57,52,48,48,51))
 

dat  - format4Bugs(dat, digits = 0) 
parm - c(lbda) 

bugs(dat, inits=list(NULL), parm, d2.bug, 
n.chains = 1, n.iter = 5000, n.burnin = floor(n.iter/2), 
n.thin = max(1, floor(n.chains * (n.iter - n.burnin)/1000)), 
bin = (n.iter - n.burnin) / n.thin, 
debug = TRUE, DIC = TRUE, digits = 5, codaPkg = FALSE, 
bugs.directory = C:/WinBUGS14/, 
working.directory = NULL, clearWD = FALSE) 

The objective of the program is to compare means of two independent 
samples 
that results 
in Beherens-Fisher posterior and in the model.file of WinBUGS d2.bug 
there is the following codes: 

  model 
{ 
   for( i in 1 : 30 ) { 
  x[i] ~ dnorm(mu1,sig1) 
   } 
   for( i in 1 : 30 ) { 
  y[i] ~ dnorm(mu2,sig2) 
   } 
   mu1 ~ dnorm(50,1.0E-6) 
   sig1 ~ dgamma(0.001,0.001) 
   mu2 ~ dnorm(50,1.0E-6) 
   sig2 ~ dgamma(0.001,0.001) 
   lbda - mu1 - mu2 
} 

  I´m a new user of WinBUGS and if someone detect error in the model codes 
too, I´m grateful. 

Thanks for help! 
Gilberto Matos. 
model
{
   for( i in 1 : 30 ) {
  x[i] ~ dnorm(mu1,sig1)
   }
   for( i in 1 : 30 ) {
  y[i] ~ dnorm(mu2,sig2)
   }
   mu1 ~ dnorm(50,1.0E-6)
   sig1 ~ dgamma(0.001,0.001)
   mu2 ~ dnorm(50,1.0E-6)
   sig2 ~ dgamma(0.001,0.001)
   lbda - mu1 - mu2
}
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html