Displaying 12 results from an estimated 12 matches similar to: "Help with optim function in R, please?"
2010 Aug 02
2
Dealing with a lot of parameters in a function
Hi all,
I'm trying to define and log-likelihood function to work with MLE.
There will be parameters like mu_i, sigma_i, tau_i, ro_i, for i between
1 to 24. Instead of listing all the parameters, one by one in the
function definition, is there a neat way to do it in R ? The example is
as follows:
ll<- function(mu1=-0.5,b=1.2,tau_1=0.5,sigma_1=0.5,ro_1=0.7)
{ if (tau1>0 &&
2010 Mar 13
2
dmvnorm masked by emdbook
I am using curve3d in the emdbook package to graph a gaussian copula density
function generated via the copula package. Unfortunately, it appears that
emdbook masks dmvnorm from the package mvtnorm in a way that prohibits
copula from generating the gaussian copula. (Sounds very confusing!) For
example,
> library(copula)
> f<-function(x,y) dcopula(normalCopula(0),c(x,y))
>
2006 Oct 13
1
Copula in R 2.4.0
Dear R helper,
does anyone have an idea on why R.2.4.0 draws the surface for the two
command lines below and the next time it renders the error message below
for exactly the same command lines:
> norm.cop <- normalCopula(0.5)
> persp(norm.cop, dcopula)
Error in ceiling(length.out) : Non-numeric argument to mathematical
function.
I will appreciate any help from anyone
thanks,
Dominique
2006 Oct 10
2
copula
Dear R-helper,
Is there any thing that I am doing wrong in the following codes:
> norm.cop <- normalCopula(0.5)
> persp(norm.cop, dcopula)
The last command produces what follows
Error in persp(x, y, z, xlim, ylim, zlim, theta, phi, r, d, scale,
expand, :
invalid 'x' argument
In addition: Warning messages:
1: no non-missing arguments to min; returning Inf
2: no
2006 May 12
3
Maximum likelihood estimate of bivariate vonmises-weibulldistribution
Thanks Dimitris!!! That's much clearer now. Still have a lot of work to
do this weekend to understand every bit but your code will prove very
useful.
Cheers,
Aziz
-----Original Message-----
From: Dimitrios Rizopoulos [mailto:Dimitris.Rizopoulos at med.kuleuven.be]
Sent: May 12, 2006 4:35 PM
To: Chaouch, Aziz
Subject: RE: [R] Maximum likelihood estimate of bivariate
2018 Apr 21
2
Error : 'start' contains NA values when fitting frank copula
Hello!
I am trying to fit a copula to some data in R and I get the error mentioned
above. This is the code for a reproducible example -
library(copula)
data = matrix(data=runif(600),nrow=200,ncol=3)
data[,2] = 2*data[,1]
data[,3] = 3*data[,1]
fr_cop = frankCopula(dim=3)
fit_fr_cop = fitCopula(fr_cop,pobs(data),method = "mpl") #Error Here
The error says : Error in fitCopula.ml(copula, u
2018 Apr 21
0
Error : 'start' contains NA values when fitting frank copula
>>>>> Soumen Banerjee <soumen08 at gmail.com>
>>>>> on Sat, 21 Apr 2018 17:22:56 +0800 writes:
> Hello! I am trying to fit a copula to some data in R and
> I get the error mentioned above. This is the code for a
> reproducible example -
(not really reproducible: You did not set the random seed, so
the data is different every time;
2008 Jul 30
2
Sampling two exponentials
Hi all,
I am going to sample two variables from two exponential distributions, but I want to specify a covariance structure between these two variables. Is there any way to do it in R? Or is there a "Multivariate Exponential" thing corresponding to the multivariate normal? Thanks in advance.
Sincerely,
Yanwei Zhang
Department of Actuarial Research and Modeling
Munich Re America
Tel:
2012 Oct 19
1
quantile regression using copulas
Hi all,
Has anyone used the qua.regressCOP2 function from the copBasic package???
The default copula function used in this function is plackett copula and I
wanted to use archimedean copula. Attached below is my code:
mycop<-frankCopula
V=seq(0.001,0.99,by=0.000217)
R<-qua.regressCOP2(0.25,V,cop=mycop,para=c(3.504))
And this is the error I get:
Warning messages:
1: In
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
2023 Nov 07
1
Concordance and Kendall's tau in copula
Dear
I estimate a sample selection model using the Clayton copula and Burr
and Gaussian marginal. I need to derive ther Kendall'sw tau from the
concordance coefficient by integration. I came across a way to do that
in R long time ago but cannot find it again. Can somewone tell me what
to read and what to use? Thank you.
Steven Yen
2006 Oct 08
2
Generating bivariate or multivariate data with known parameter values
Greetings,
I'm interested in generating data from various bivariate or
mulitivariate distributions (e.g. gamma, t, etc), where I can specify
the parameter values, including the correlations among the variables. I
haven't been able to dig anything up on the faq, but I probably missed
something. A nudge in the right direction would be appreciated.
David
--