JuliaExtremes / IDFCurves.jl

MIT License
0 stars 0 forks source link

Fitting method not general #62

Closed AugustePaoli99 closed 6 months ago

AugustePaoli99 commented 6 months ago

For now the method fit_mle() written in dependentscalingmodel.jl is not general in the sense that the vector of parameters is supposed to be of length 7 (General Scaling for the marginal model, and Matern corrrelation strcutture). It should be reimplemented and tested.

AugustePaoli99 commented 6 months ago

In the same time I will make sure that the fitting method uses the hessian, and that it comes back to gradient-free optimization if no convergence.

AugustePaoli99 commented 6 months ago

Pour le moment on ne peut pas utiliser la copule de Student car il faut définir un nombre de degrés de liberté pour cette copule. J'imagine qu'on ne veut pas que ce soit un paramètre du modèle. Il va donc falloir que le nombre de degrés de liberté apparaisse lorsqu'on appelle le type de copule. Pour le moment je ne sais pas exactement comment faire ça.

AugustePaoli99 commented 6 months ago

Salut @jojal5, voici ce que je propose pour redéfinir le type StudentCopula :

struct StudentCopula{df} <: EllipticalCopula
    cormatrix::PDMat

    function StudentCopula{df}(cormatrix::AbstractMatrix{<:Real}) where df
        @assert df isa Integer
        new(PDMat(cormatrix))
    end

end

function dof(C::StudentCopula{df}) where df
    return df
end

function dof(Ctype::Type{StudentCopula{df}}) where df
    return df
end

On pourrait alors utiliser les méthodes d'estimation avec cette copule comme avec la copule gaussienne. Il faudra simplement spécifier le nombre de degrés de liberté dans le type. Exemple :

cop = StudentCopula{12}([1 0; 0 1])
cop_type = StudentCopula{7}
dof(cop) # renvoie 12
dof(cop_type) # renvoie 7

Qu'en penses-tu ? Est-ce que ça peut poser des problèmes ?