Displaying 12 results from an estimated 12 matches for "fitcopula".
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 = data, method = method,
start = start, : 'start' contains NA values
What could be going wrong?
[[alternative HTML version deleted]]
2018 Apr 21
0
Error : 'start' contains NA values when fitting frank copula
...t set the random seed, so
the data is different every time;
OTOH, yes, the following always gives an error)
> library(copula)
Slightly clearer showing what you are doing:
x <- runif(200)
data <- cbind(x, 2*x, 3*x)
> 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 = data, method = method,
> start = start, : 'start' contains NA values
> What could be going wrong?
Is this a homework question? [probably not, but ..]
The h...
2010 Jun 10
0
error message fitting tcopula
...<- optim(c(1,5), fn = loglik.marg, x = dat[, 1], control = ctrl)$par
b2hat <- optim(c(1,5), fn = loglik.marg, x = dat[, 2], control = ctrl)$par
udat <- cbind(pgamma(dat[, 1], shape = b1hat[1], scale = b1hat[2]),pgamma(dat[, 2], shape = b2hat[1], scale = b2hat[2]))
> fit.ifl <- fitCopula(myCop.t, udat, method="mpl", c(1,5,1,5,8),estimate.variance=TRUE)
Error in fitCopula.ml(data, copula, start, lower, upper, optim.control, :
The length of start and copula parameters do not match.
> fit.ifl <- fitCopula(udat, myMvd@copula, c(1,5,1,5,8))
Error in fitCopula(udat...
2010 Jun 10
0
error message in fitting tcopula
...optim(c(1,5), fn = loglik.marg, x = dat[, 1], control =
ctrl)$par
b2hat <- optim(c(1,5), fn = loglik.marg, x = dat[, 2], control =
ctrl)$par
udat <- cbind(pgamma(dat[, 1], shape = b1hat[1], scale =
b1hat[2]),pgamma(dat[, 2], shape = b2hat[1], scale = b2hat[2]))
> fit.ifl <- fitCopula(myCop.t, udat, method="mpl",
c(1,5,1,5,8),estimate.variance=TRUE)
Error in fitCopula.ml(data, copula, start, lower, upper, optim.control,
:
The length of start and copula parameters do not match.
> fit.ifl <- fitCopula(udat, myMvd@copula, c(1,5,1,5,8))
Error in fitCopula(...
2007 Jun 22
2
fitCopula
I am using R 2.5.0 on windows XP and trying to fit copula. I see the
following code works for some users, however my code crashes on the
chol. Any suggestions?
> mycop <- tCopula(param=0.5, dim=8, dispstr="ex", df=5)
> x <- rcopula(mycop, 1000)
> myfit <- fitCopula(x, mycop, c(0.6, 10), optim.control=list(trace=1),
method="Nelder-Mead")
Nelder-Mead direct search function minimizer
function value for initial parameters = -1747.582044
Scaled convergence tolerance is 2.6041e-05
Stepsize computed as 1.000000
Error in chol(x, pivot = FALSE) : t...
2006 Apr 24
3
the 'copula' package
Is anybody using the Copula package in R? The particular problem I'm
facing is that R is not acknowledging the fitCopula command/function
when I load the package and (try to) run something very simple:
fit1 <- fitCopula(x1 = list(u11,u12,u13,u14,u15,u16,u17,u18), tCopula,
optim.control = list(NULL), method = "BFGS")
Anybody also using it, successfully or unsuccessfully? I'd appreciate a
tip or t...
2007 Jan 18
0
fitCopula method in R
--
Hello,
I am attempting to fit monthly stock returns to possible copula functions using
the copula package in R. Below is my code (mat2 is a 2x119 matrix of the two
stock returns):
my.cop <- normalCopula(param=.3, dim = 2, dispstr = "un")
myfit <- fitCopula(mat2,my.cop, start=.65, optim.control= list(NULL), method =
"BFGS")
myfit
Unfortunately, I continue to receive this error:
Error in optim(start, loglikCopula, method = method, copula = copula, :
initial value in 'vmmin' is not finite
In addition: Warning message:
NaNs p...
2007 Jan 21
1
for loop problem
Hello R users,
A beginners question which I could not find the answer to in earler posts.
My thought process:
Here "z" is a 119 x 15 data matrix
Step 1: start at column one, bind every column with column 1
Step2: use the new matrix, "test", in the fitCopula package
Step3: store each result in myfit, bind each result to "answer"
Step4: return "answer"
copula_est <- function(z)
{
for(i in 1:length(z[1,]))
{
my.cop <- normalCopula(param = 0.5, dim = 2)
test <- cbind(z[,1],z[,i])
myfit[i] <- fitCopula(test,my.cop,...
2007 Mar 01
1
Fit Student Copula
...hat I do not manage to solve !
I will be very grateful if you can solve this !
I want to fit a t Copula with the copula package :
> student.cop <- ellipCopula("t", param = c(0.5, 0.6, 0.7), dim = 3, dispstr = "un",df=5)
> x<-rcopula(student.cop,1000)
> fit <- fitCopula(x, student.cop, c(0.5,0.5,0.5,5))
And there is an error for the optimization.
Thanks a lot if you respond to me !
Pierre.
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profit...
2007 Feb 01
0
traverse through many columns of a matrix in a function
Hello everyone,
Here is the setup.
z is a 119 x 15 matrix, m_index is a 119 x 5 matrix
What I am trying to do is return the results from fitCopula by sequentially
binding all 15 columns of z to the first column of m_index,
(cbind(z[,1],m_index[,1]),(cbind(z[,2],m_index[,1]), etc.
Unfortunately, my code below only binds z[,1] and m_index[,1] and return the
same result 14 times.
Any ideas on how to implement my idea would be greatly appreciat...
2012 May 16
1
fitting t copula with fixed dof
I need to fit a t copula with fixed degree of freedom let's say 4. I
do not want to estimate the dof together with correlation matrix
optimally. Instead fix the dof to 4 and only estimate the correlation
matrix in the optimization routine. Is anyone aware of such estimation
method in R.
The packages and functions that I know of can't do this estimation. I
searched online but
2007 Jun 24
2
matlab/gauss code in R
...ata For Analysis (Kevin E. Thorpe)
> 16. Re: Data consistency checks in functions (Kuhn, Max)
> 17. Re: vectorize a function (Christos Hatzis)
> 18. Re: extract index during execution of sapply (Ben Bolker)
> 19. Re: extract index during execution of sapply (Thomas Lumley)
> 20. fitCopula (Oden, Kevin)
> 21. how to ave this? (Weiwei Shi)
> 22. fitCopula (Oden, Kevin)
> 23. Re: how to ave this? (Weiwei Shi)
> 24. Re: Result depends on order of factors in unbalanced designs
> (lme, anova)? (Prof Brian Ripley)
> 25. Re: Tools For Preparing Data For Analysis...