Displaying 20 results from an estimated 190 matches similar to: "Help with R Fitting an inverse Gamma"
2009 Oct 08
3
foreach loop - rejection method
Hi Everybody,
Thanks in advance for your help.
This is my first time using the foreach statement and I cant get it to work
properly so here is what i have
test<-function(){
repeat {
cand2[l-1]<-rinvgamma(1,phi,lambda[l-1])
q2<-dinvgamma(cand2[l-1],phi,lambda[l-1])
p2<-cand2[l-1]^-1.5*exp(-y[l]^2/(2*cand2[l-1]))*exp(-((log(cand2[l-1])-mu_t_cand[l-1])^2)/2*sigmasq)
2011 Jan 13
1
Fitting an Inverse Gamma Distribution
http://r.789695.n4.nabble.com/file/n3216865/Inverse_Gamma.png
Hello,
I am seeking help in estimating the parameters of an inverse gamma
distribution (from the 'actuar' package) using a function like 'fitdistr'.
Unfortunately I haven't found such a package using findFn('fit Inverse
Gamma') from the 'sos' package and was therefore hoping someone might be
aware
2007 Feb 13
0
Really need help here
Hi there,
I had a serious problem here . Consider the following Bayesian model(discretized variance gamma):
#Likelihood
J[i]<-lambda*G[i]+sigma*sqrt(G[i])*rnorm(0,1)
G[i]<-rgamma(1/nu,1/nu)
#Prior:
nu<-rinvgamma(m,M)
# Parameters
lambda=-.04 ; sigam=.38; nu=6.48; m=10,M=10 ; T=5000 (length of data)
An author claimed that he got posterior distribution
2010 Jan 12
1
Strange behavior when trying to piggyback off of "fitdistr"
Hello.
I am not certain even how to search the archives for this particular question, so if there is an obvious answer, please smack me with a large halibut and send me to the URLs.
I have been experimenting with fitting curves by using both maximum likelihood and maximum spacing estimation techniques. Originally, I have been writing distribution-specific functions in 'R' which work
2006 Mar 27
3
seq(2,5,-2) not an error but NULL
Hi,
This may belong more to r-develop, but general discussion may be useful
(for the how many-th time ?)
seq(2,5,-2)
seq(5,2,2)
both result in
Error in seq.default(2, 5, -2) : wrong sign in 'by' argument
But often, if not always, mathematicians and programmers want a
behaviour e.g. in for loops, where this statement results in an empty
statement, that is
for (ii in seq(2,5,-2))
2007 May 26
1
Why ?rmvnorm not working
Hi,
My R version is 2.4.1 and I installed the the packages MASS and run
command library("MASS"),
however when I type ?rmvnorm, no help topic found, it worked before.
I tried to ype ?rinvgamma from "MCMCpack" which works great.
Anybody have idea? I also reinstalled MASS package, but when I try to type
rmvnorm(), no functions found.
Pat
2011 Aug 25
7
How to safely embed JSON object in HTML document
Hi all,
I''m working on a Backbone.js single page app with Rails 3.1, and in an
attempt to save on HTTP requests, I want to embed initial data set in
a HTML document that is sent back to the browser after successful
login.
I was thinking I can simply convert my ruby object to JSON, then HTML
escape resulting string of JSON, and then use that as a value for
JavaScript variable. Something
2011 Aug 26
1
Sharp turn in cdf?
x = c(runif(1000, 0,2.5), runif(100, 2.5, 4))
plot(ecdf(x))
You will notice a sharp turn around x = 2.5
How do I get that value of x using R?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2007 Feb 11
0
problem with rinvgamma ?
Hi,
By rinvgamma(10000,1.33,2.33) , am I supposed to get a var=3 ? Tried it many times , not even close. Why is this?
thanks a lot .
best
2012 Jul 09
2
Read vector as multi-dimensional data in R by row
Dear R users
Say I wanted to read a vector into R as multi-dimensional array by row,
e.g.
a<-c(1:20)
> b<-array(a,dim=c(2,5,2))
> b
, , 1
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 5 7 9
[2,] 2 4 6 8 10
, , 2
[,1] [,2] [,3] [,4] [,5]
[1,] 11 13 15 17 19
[2,] 12 14 16 18 20
But actually I wanted...
[,1] [,2] [,3] [,4] [,5]
2009 Jul 27
0
help about package "reldist" (Relative Distribution)
Dear R users:
i try to use package "reldist" to measure wage distribution.
In package "reldist" :
y mean sample from comparison distribution
yo mean sample from reference distribution
but I would like to compare more than two years ( total of fifteen years,
from 1979, 1981, 1983..........to 2007)
how should i correct my programs, then i could compare fifteen year's
2009 Jul 30
0
package "reldist" version 1.5-5.1 : how to not just compare two years's wage distribution
Dear all users,
I read all R programs and texts in "Relative Distribution Methods" website,
but I encounter two problems when I used it.
then I used "Google" to try to find any solutions about the two
problems,but I got no useful hints.
1、
In package "reldist"
y mean sample from comparison distribution
yo mean sample from reference distribution
but I
2011 Mar 07
1
Array Help
Hi,
I have two 3 D arrays. Both are of this form
array_1<- array[n,n,k]
array_2<-array[m,m,k]
Lets say n=83 and m=80
Since n>m. I would like to add rows and columns to array_2 to make them
equal. I want to keep the size of the third dimension fixed i.e.. k.
i.e.
if (nrow(array_1)>nrow(array_2))
{
array_2[m:n,m:n,]<- 10^6
}
But this doesn't work. I tried abind and rbind but
2009 Jun 03
3
Samba+Ldap problems
I'm trying to trobuleshoot my previuos problem from the basics.
I've a box setup with Ubuntu, samba and ldap. I have a lot of problems with
user authentications.
I'm checking if LDAP and PAM ar working together. I've added an user to ldap
with smbldap-useradd command (as posix account) and I'm trying to use it to
login via ssh. This user cannot authenticate.
Here is the result
2007 Oct 11
1
problem installing MCMCpack
I'm completely new to R and am trying to install an add-on package for one
of our faculty members.
I've had no problems with most of them, but am completely stuck trying to
figure out why MCMCpack won't install..
any help is VERY much appreciated!!!
here's what I get when I try to install the package:
* Installing *source* package 'MCMCpack' ...
checking for C++ compiler
2006 Jun 01
1
package installation errors
I installed R-2.3.1 and ran make check without problem, but I am having
trouble installing several packages using gcc (GCC) 3.2.3 20030502 (Red
Hat Linux 3.2.3-53)
on Red Hat Enterprise Linux AS release 3 (Taroon Update 7) Kernel
2.4.21-40.ELsmp on an x86_64
Below are the messages from MCMCpack. Perhaps my systems are messed up?
Paul Gilbert
> install.packages("MCMCpack")
2011 Feb 09
1
Problem installing MCMCpack on SPARC Solaris 10
Hi list,
I tried to install MCMCpack to R-2.12.0, got the following error,
CC -m64 -library=stlport4 -I/apps/sparcv9/R-2.12.0/lib/R/include
-DSCYTHE_COMPILE_DIRECT -DSCYTHE_DEBUG=0 -DHAVE_TRUNC -DHAVE_IEEEFP_H
-I/opt/csw/include -KPIC -g -c MCMCSVDreg.cc -o MCMCSVDreg.o
"error.h", line 598: Error: The function "abort" must have a prototype.
2005 Sep 02
1
source package linking problem under linux
I'm having some problems in installing some source packages under linux.
As an example, MCMCpack. An error is raised when linking:
> install.packages("MCMCpack")
[...]
* Installing *source* package 'MCMCpack' ...
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking
2012 Mar 01
1
Parameterization of Inverse Wishart distribution available in MCMCpack and bayesm libraries
Hello Everyone
Both the MCMCpack and the bayesm libraries allow us to make draws from the
Inverse Wishart distribution.
But I wanted to find out how exactly is the Inverse Wishart distribution
parameterized in these libraries.
The reason I ask is the following:
Now its generally standard to express Inverse Wishart as IW(0.5 * DOF,0.5*
Scale). (DOF-> Degree of freedom, Scale -> Scale
2008 Oct 18
1
Fehler in x$terms : $ operator is invalid for atomic vectors
Dear All
I try to use your R package MCMCpack and I have encountered the following problem:
The following code works fine:
library(MCMCpack)
line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5))
posterior1 <- MCMCregress(X~Y, data=line)
summary(posterior1)
But as long as I try the following lines
library(MCMCpack)
line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5))