Skip to content

Wishart PDF as prior for Covariance matrix  #975

Closed
@shawin2

Description

@shawin2

Iam trying to use the wishart PDF as prior on the covariance matrix , i used the code bellow

nu= degree of freedom and its = 8 ,
W= cov matrix ,
S represent scaler

    function f = WishartPDF(W,nu,S)
   N=size(W,1);
   Arg=[nu-N+1:nu];
   K=2^(nu*N/2)*pi^(N*(N-1)/4)*prod(gamma(Arg/2)); 
   f = 1/K * (det(S))^(-nu/2)*(det(W))^((nu-N-1)/2)*exp(-1/2*trace(inv(S)*W));

end

but iam receiving error ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions