GBNmle: Maximum likelihood estimator

Description Usage Arguments Value Examples

Description

This function computes the maximum likelihood estimator of the object GBN calculated according to the data.

The system to solve can be rewritten as : AW=b, where W is the weightmatrix of the GBN.

Usage

1
GBNmle(GBN, data, lambda = 0, sigmapre = rep(0, dim(data$x)[2]))

Arguments

GBN

An object of the class GBN.

data

data - Data is a format obtained by the function dataFormat.

lambda

logarithmic - coefficient of the penalty Ridge.

sigmapre

vector - In the algorithm MCMC.GBN, sigmapre is the variance of the GBN of the previous iteration. If there is no previous iteration, ie if the function is used alone, sigmapre is a null vector.

Value

GBN

The estimator of the initial GBN

A

A member of the equation AW = b solved by the function.

b

b member of the equation AW = b solved by the function.

y

centered observation (data$x).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Data creation

seed = 1990
n = 3000
p <- 10
m<-rep(0,10)
sigma<-rep(0.1,10) 

W <- 1*upper.tri(matrix(0,p,p))

data <- dataCreate(nbData = 2*p, p = 10,KO = list(1,9), nbKO = c(p,p), W = W , m = m,sigma = sigma, seed = seed)$data

# Initial Value

W1=1*upper.tri(matrix(0,p,p)) 
m1=rep(0,p)
s1=rep(10e-4,p)
colnames(W1)=names(m1)=names(s1)=rownames(W1)=paste("N",1:p,sep="")

firstGBN = new("GBNetwork",WeightMatrix=W1,resMean=m1,resSigma=s1)
firstGBN = GBNmle(firstGBN,data,lambda=10e10,sigmapre=rep(0.1,p))$GBN

andreamrau/GBNcausal documentation built on May 12, 2019, 3:34 a.m.