Displaying 20 results from an estimated 300 matches similar to: "Generate random numbers with nested Archimedean Copula"
2013 Apr 09
0
[R-SIG-Finance] EM algorithm with R manually implemented?
Moved to R-help because there's no obvious financial content.
Michael
On Sat, Apr 6, 2013 at 10:56 AM, Stat Tistician
<statisticiangermany at gmail.com> wrote:
> Hi,
> I want to implement the EM algorithm manually, with my own loops and so.
> Afterwards, I want to compare it to the normalmixEM output of mixtools
> package.
>
> Since the notation is very advanced, I
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
2012 Aug 01
1
optim() for ordered logit model with parallel regression assumption
Dear R listers,
I am learning the MLE utility optim() in R to program ordered logit
models just as an exercise. See below I have three independent
variables, x1, x2, and x3. Y is coded as ordinal from 1 to 4. Y is not
yet a factor variable here. The ordered logit model satisfies the
parallel regression assumption. The following codes can run through,
but results were totally different from what I
2012 Jul 11
2
nls problem: singular gradient
Why fails nls with "singular gradient" here?
I post a minimal example on the bottom and would be very
happy if someone could help me.
Kind regards,
###########
# define some constants
smallc <- 0.0001
t <- seq(0,1,0.001)
t0 <- 0.5
tau1 <- 0.02
# generate yy(t)
yy <- 1/2 * ( 1- tanh((t - t0)/smallc) * exp(-t / tau1) ) + rnorm(length(t))*0.01
# show the curve
2008 Apr 04
1
Problems with Unit Root testing using ur.df function
Hi All,
I'm new to R and am trying to run a unit root test on the vector "y" (a time
series of inflation (i.e. changes in the Consumer Price Index quarter on
quarter)).
I've run the Augmented-Dickey-Fuller Test below (R's URCA package). It gives
me an error that it cannot find the function ur.df unless I comment out the
third last line of code (see below).
I try to call
2017 Jun 04
0
Hlep in analysis in RWinBugs
Hi R User,
I was trying to use R for WINBUGS using following model and data (example), but I am new with WINBUGS and don't know how we perform the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated.
Sincerely,
SN PANDIT
===
library(R2WinBUGS)
#Model
model{
#likelihood
for(i in 1:N){
a1[i] ~ dnorm(a11[i],tau)
2017 Jun 04
0
Help in analysis in RWinBugs
Hi R User,
I was trying to use R for WINBUGS using following model and data (example), but I am new with WINBUGS and don't know how we perform the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated.
Sincerely,
SN PANDIT
===
library(R2WinBUGS)
#Model
model{
#likelihood
for(i in 1:N){
a1[i] ~ dnorm(a11[i],tau)
2009 Nov 02
1
need help in using Hessian matrix
Hi
I need to find the Hessian matrix for a complicated function from a certain
kind of data but i keep getting this error
Error in f1 - f2 : non-numeric argument to binary operator
the data is given by
U<-runif(n)
Us<-sort(U)
tau1<- 2
F1tau<- pgamma((tau1/theta1),shape,1)
N1<-sum(Us<F1tau)
X1<- Us[1:N1]
2012 Feb 06
0
Goodness of Fit for Archimedean Copulas
Dear All,
I'm now looking for R-code on how to find the Goodness of Fits for
Archimedean Copulas. If anyone have a guide for this problems please lets
me know.
Your prompt action is much appreciated.
Regards,
Ummul
[[alternative HTML version deleted]]
2010 Nov 30
1
confidence interval for logistic joinpoint regression from package ljr
I?m trying to run a logistic joinpoint regression utilising the ljr package. I?ve been using the forward selection technique to get the number of knots for the analysis, but I?m uncertain as to my results and the interpretation. The documentation is rather brief ( in the package and the stats in medicine article is quite technical) and without any good examples. At the moment I?m thinking
1)find
2008 May 09
0
Log likelihood estimation using bivariate archimedean copula
Hi all,
I am trying to build a copula model using the Gumbel Copula and I have
two marginal distributions.I know the marginal parameters by using the
fitdistr() and optim().The problem is I dont know my copula parameter.
I am getting a bit confused of how shall I go about it.I read the
previous threads where the query was to estimate all the
parameters.How shall I define my log-likelihood
2009 Feb 21
0
density estimation for d>2 for the DPpackage
Dear List,
I am trying to estimate a 3 dimensional density through the DPpackage.
For example
# model
sigma <- matrix(c(0.1,0.05,0.05,0.05,0.1,0.05,0.05,0.05,0.1), ncol=3)
rnormm<- rmvnorm(n=100, mean=c(5,100,150), sigma=sigma)
sigma2 <- matrix(c(10,0.05,0.05,0.05,10,0.05,0.05,0.05,10), ncol=3)
rnormm2<- rmvnorm(n=100, mean=c(20,1,110), sigma=sigma)
rnormm<-rbind(rnormm,rnormm2)
2009 Nov 01
2
intigrate function and absolute error
Hi
Can we get the result of an intigration without the absolute error?
for example
f1<-function(x1){(1/gamma(alpha))*x1^(alpha-1)*exp(-x1)*log(x1)}
I1<-integrate(f1, 0, (max(cc)-tau1+(theta2/theta1)*tau1)/theta2)
I1
0.08007414 with absolute error < 7.2e-05
I need the answer 0.08007414 withou the other part(with absolute error
<7.2e-05)
how can we do that?
thank you and take care
2003 Jun 01
0
integrate
Im tryng to understand an error i get with integrate. this is 1.7.0 on
solaris 2.8.
##i am trying to approximate an integral of this function,
f<-function(b) exp(-(b-mu)^2/(2*tau2))/(p-exp(b))*10^6
##with
tau2 <- .005;mu <- 7.96;p <- 2000
##from -inf to different upper limits. using
integrate(f,-Inf,log(p-exp(1)))
##i get the following error:
##Error in integrate(f, -Inf, log(p -
2008 Mar 25
3
derivatives in R
Hi, I posted this message earlier in "Rmetrics" and I don't know whether I
posted in the wrong place, so I'm posting it again in Rhelp.
I have a function in x and y and let's call it f(x,y). I need to get the
Hessian matrix. i.e I need (d^2f/dx^2), (d^2f/dxdy), (d^2f/dydx),
(d^2f/dy^2).I can get these using the D function. now I need to evaluste the
hessian matrix for
2011 Dec 09
1
Goodness of Fit for Copula
Dear All,
I'm now working on Archimedean copulas and try to test the goodness of fit.
Which packages I should use?
I have Clayton copula with parameter (5.35) and Frank (19.5).
I found this build function wrote by Yan and Ivan via R Packages, but I'm
not sure the matrix for x? Please advice.
e.g
gofCopula(claytonCopula(1),x)
Thank you
Regards,
Fayyad
[[alternative HTML version
2009 Dec 04
1
z to r transformation within print.rma.uni and forest from the package metafor
Dear R community,
I'm using the ,metafor'-package by Wolfgang Viechtbauer (Version: 0.5-5) to
calculate random-effects meta-analyses using Correlations and Sample Sizes
as the raw data.
(By the way: Really a nice piece of work, Wolfgang! Thanks heaps.)
I specified the "rma.uni' function so that it looks like this:
MAergebnis<-rma.uni(ri=PosOutc, ni=N,
2010 Jun 23
1
A question about R2Winbugs
Dear R users:
I was trying to fit a HMM with mixture of Gaussian into the dataset, and I
tried to implement it by R2Winbugs. But I got the following errer.
*
Error in FUN(X[[1L]], ...) :
.C(..): 'type' must be "real" for this format*
Does anybody know what's the problem? Does R2Winbugs accept some matrix as
inits? I would really appreciate your help. Thank you very much.
1998 Apr 27
1
R-beta: vectors in dataframe?
I have a file:
x y z
0.025 0.025 1.65775
0.025 0.050 1.62602
0.025 0.075 1.63683
0.025 0.100 1.91847
0.025 0.125 2.00913
0.025 0.150 1.82222
0.025 0.175 1.70901
0.025 0.200 1.39759
0.025 0.225 1.39089
0.025 0.250 1.04762
If I read the file like this:
data<-read.table("file.dat")
How do I access the vectors x,y,z that are inside the dataframe data? I
studied Venables and
2012 Feb 03
1
A question on Unit Root Test using "urca" toolbox
Hello,
I have a question on unit root test with urca toolbox.
First, to run a unit root test with lags selected by BIC, I type:
> CPILD4UR<-ur.df(x1$CPILD4[5:nr1], type ="drift", lags=12, selectlags ="BIC")
> summary(CPILD4UR)
The results indicate that the optimal lags selected by BIC is 4.
Then I run the same unit root test with drift and 4 lags: