Learn R Programming

FactorCopulaModel (version 0.1.1)

oblique_nllk: log-likelihood Gaussian oblique factor structure correlation matrix

Description

negative log-likelihood of the Gaussian oblique factor model for d variables and m groups,

Usage

oblique_nllk(theta, grsize, Robs, nsize=100)

Value

negative log-likelihood value of the oblique Gaussian factor modelwith fixed group size at MLE

Arguments

theta

vector of length d + m*(m-1)/2; d loading parameters followed by m*(m-1)/2 entries in correlation matrix of latent variables (lower triangle by row)

grsize

vector of group sizes (variables ordered by group)

Robs

dxd (empirical) correlation matrix of normal scores

nsize

sample size used to get Robs if available

Examples

Run this code
 rhpar = c(0.81,0.84,0.84, 0.54,0.57,0.49, 0.51,0.54,0.55,0.70, 0.53,0.56,0.53,0.67,0.70)
cormat = corvec2mat(rhpar)
print(cormat)
#    [,1] [,2] [,3] [,4] [,5] [,6]
#[1,] 1.00 0.81 0.84 0.54 0.51 0.53
#[2,] 0.81 1.00 0.84 0.57 0.54 0.56
#[3,] 0.84 0.84 1.00 0.49 0.55 0.53
#[4,] 0.54 0.57 0.49 1.00 0.70 0.67
#[5,] 0.51 0.54 0.55 0.70 1.00 0.70
#[6,] 0.53 0.56 0.53 0.67 0.70 1.00
grsize = c(3,3)
mgrp = length(grsize)
d = sum(grsize)
theta = c(rep(0.3,d+mgrp*(mgrp-1)/2))
ml_obl = oblique_nllk(theta=theta, grsize, Robs=cormat)
print(ml_obl)
# 806.7432

Run the code above in your browser using DataLab