R/robustDA-internal.R

Defines functions .mlefun .eqfun

.eqfun <-
function(R,P,cls){
  K = ncol(P)
  C = max(cls)
  R = matrix(R,nrow=C,byrow=T)
  colSums(R)
}
.mlefun <-
function(R,P,cls){
# MLE function
  #cat('.')
	K = ncol(P)
	C = max(cls)
  R = matrix(R,nrow=C,byrow=T)
	f = 0
	for(i in 1:C){
		Ri = R[i,]
    ni = sum(cls==i)
		f = f + sum(log(P[cls==i,] * matrix(1,ni,1)%*%Ri));
	}
	f
}
.Random.seed <-
c(403L, 11L, -1540175763L, -2099002969L, 614552526L, 1669011752L, 
-196760789L, 938756425L, 741973592L, -1608347898L, 198662881L, 
1963855475L, -935995678L, -1419949484L, 2055312215L, 636884813L, 
-1329911068L, -1647004982L, 1218104117L, 662880655L, 236435094L, 
2101368384L, 1725230851L, -50288863L, -1364398064L, -1903466514L, 
-129562727L, 1122820139L, 1626961178L, -1899874340L, -1604937249L, 
2009152949L, 1630309196L, -388535902L, -878499587L, -948931081L, 
1234211614L, -69988904L, -1976637637L, -1932865319L, -1988658072L, 
1481687446L, -1215889135L, -1752845629L, 972966610L, -2060764316L, 
1996402343L, -1927702531L, -7089676L, 1658609370L, 352886821L, 
-192926401L, -186801466L, 521637712L, -1924427917L, 1537380753L, 
-1829256256L, -1275435618L, 1105794921L, 1233916827L, 1788287658L, 
-743246644L, 1223003535L, -2046858811L, 1232473468L, -332368430L, 
1859588429L, -901934073L, -358456338L, 1241475784L, 1713915339L, 
-1251909591L, 1989625464L, 1722516390L, 1771718081L, 1683423827L, 
486983938L, -632389580L, 1827453367L, 1449635245L, 1209755332L, 
-1055749398L, 1959062869L, 2112692975L, 1733083382L, 100114464L, 
-948657693L, -1886182783L, 1979469040L, 636519310L, 2038021369L, 
387647115L, 761804474L, -1497744964L, -1539577089L, -731115947L, 
-304572052L, 2005633474L, -1755569635L, 918583959L, 411456510L, 
732540856L, 122651547L, 1900317177L, 777869640L, -203676554L, 
-460623439L, 287973347L, 880786610L, 215765252L, 823892551L, 
-1178903267L, -130045036L, -311369926L, 34620293L, -1765902241L, 
770755302L, 85127536L, -1860429165L, -505396431L, -708238880L, 
418289278L, -1726112503L, 372895547L, -1616599286L, -605595924L, 
847594351L, -2139523931L, 1371317852L, 1887186482L, -574370515L, 
-1592001561L, -777290994L, 1726561512L, -455092501L, -1005996151L, 
1138066200L, 1850775110L, -1395292511L, -996259533L, -63231838L, 
672622484L, 427607575L, -342724083L, -462780636L, 1399603978L, 
-4092299L, -390435377L, 461215446L, 505125504L, -1891875645L, 
-188964255L, -2127840560L, 1966644270L, -1568165415L, -783143445L, 
2002888794L, 773155356L, -1770190049L, -1727955083L, -180181492L, 
-73629726L, -1778662211L, -609696969L, 2075487198L, 828647704L, 
60808315L, 583385625L, -1013964120L, 1096878166L, 793806033L, 
494895235L, -1792142574L, -520583516L, 1746743911L, -770692163L, 
1681229108L, -502202726L, 717016293L, -869175681L, 788527110L, 
1822964624L, 625034803L, -146680367L, -2031310976L, -949831074L, 
-284597847L, -1346023333L, -1457616790L, -322230004L, -1297980593L, 
439205893L, 1310432956L, 1479325586L, -253729651L, 690864839L, 
1569305518L, -1902776824L, 1990935051L, 256152297L, 1161207224L, 
-1074898330L, -1916459263L, -1769598573L, 306096706L, -1476051468L, 
2114815991L, 343014381L, -1810934652L, 2130201258L, 523083797L, 
-422623057L, 1198442166L, 1478038752L, 2102245411L, -1716639935L, 
422070832L, 822564942L, -266434375L, -261440309L, 692978042L, 
-1905148804L, -1701496641L, 1701088661L, -1804612180L, 1484162946L, 
894766429L, 1591182423L, 249996094L, 373460788L, -1458222446L, 
-115488416L, 2007259468L, 1612890080L, 1715185570L, -188846168L, 
-1491823732L, -259115332L, 894221170L, 480352496L, -1255624636L, 
-1078645416L, 308208698L, 866950000L, -1562055620L, -1139346668L, 
278389186L, -1715158816L, 687761276L, -53139760L, -1614235998L, 
590933032L, -1381052148L, 1729190844L, 468327730L, -612747328L, 
-106782156L, 1820523464L, 2089829562L, -732524656L, -136921620L, 
1378312276L, -1769533806L, -1085353184L, -772811316L, 551508960L, 
-1664775486L, 1837517352L, 1259775660L, 1196894908L, -1974568462L, 
-1606235856L, -1357931356L, -1402402120L, -2111278246L, 2125264272L, 
1763131772L, -303442668L, -105959102L, 578566912L, 1437744060L, 
831447888L, 1286461730L, 224279880L, -1115174900L, -1293434788L, 
736005330L, -32053248L, -2113053868L, -1276155416L, -350429190L, 
-2102944048L, -300829396L, -1693593356L, -1886382190L, 748633184L, 
1666592012L, -153641248L, -2098184862L, -1846512984L, 196774476L, 
-1902303364L, 1995176754L, -682563984L, -1430147772L, -528344104L, 
839368826L, -441371088L, -1964395844L, -7198892L, 1093210690L, 
-1375423584L, 346271932L, 1807296976L, -2077477534L, -1729405976L, 
1700102092L, -1903339780L, 479682546L, -855159680L, -286615308L, 
1597674632L, -999455430L, 1141924688L, 791055468L, 1607594132L, 
1189402962L, -857487648L, 1522147532L, -2078150496L, 291860866L, 
-635907864L, -543285012L, 842022972L, 545792114L, -1764800400L, 
1056823844L, -870440392L, -1455697382L, 1812723920L, -1180928452L, 
-200911724L, -1487002494L, -960041024L, 2057811260L, 889136784L, 
-1438434270L, 1387407368L, 614741132L, 1961486364L, 1551484050L, 
1710201984L, -1382532076L, -320687320L, -628126662L, -743424816L, 
1924369516L, 1764406964L, -512548846L, 196829152L, 680498124L, 
1402238432L, -2088461278L, -1204579032L, 1356185868L, 413310524L, 
-677784334L, 1492039920L, 223389508L, -1065648040L, -112444870L, 
277063920L, 44511932L, 1622110740L, -164246334L, -1488222624L, 
2142164348L, 1426599120L, -1288381406L, 1826261160L, 1865366924L, 
38578620L, -928499662L, -1202611392L, 1135437492L, 1322979656L, 
-82935110L, 2026559248L, -852891412L, 332453972L, -265359598L, 
-1268129376L, 954896332L, -702597280L, 1935357122L, 2134335016L, 
1726351788L, -228035780L, 1208390514L, 1741657904L, -694859740L, 
-956342728L, -2099924262L, -1387255920L, -1579979524L, -1211820652L, 
-152267966L, -1859409408L, 367527996L, -218305968L, -511983454L, 
183046984L, -1881521652L, 789369564L, -1820112814L, 460622976L, 
-1716670636L, 367976424L, 1203067642L, -654229680L, 1487295532L, 
158323060L, 94721682L, -1447224736L, -773678964L, -711890592L, 
124242146L, -1244494680L, -14852404L, 172804604L, -1962626126L, 
-288449552L, -1342535228L, -14906024L, 32733562L, 1371330992L, 
2096710076L, -178327980L, -1575470654L, -1663882464L, 1717107644L, 
-954904496L, -1389730846L, -1976907928L, 1037958988L, 629337852L, 
-1998942478L, -1181176576L, -2071501708L, 1798761992L, 246963642L, 
1811113424L, 437063660L, -417698924L, 1521193170L, -1358807968L, 
1431277824L, 169880041L, -470049701L, -55716180L, 1515708602L, 
-635569553L, -519165959L, 607856270L, -1025030308L, -950232115L, 
1321245495L, 76030400L, -2045053282L, -1332453525L, 1932224237L, 
696800090L, -491753448L, -1969889919L, -1661482189L, -1128531628L, 
-1107457182L, 718743543L, 1073514561L, 308337862L, 113531396L, 
-1467869771L, -1974293857L, 172542712L, 1479638742L, -214242461L, 
-1371921627L, 1415475394L, 253558192L, 36290009L, -1594016949L, 
648997308L, 962939370L, 1530514975L, 50875561L, -1769024450L, 
54537516L, 707106685L, -17836601L, 235442352L, -1047195954L, 
945771515L, 1230459997L, -1919218806L, -1817166936L, 1299724561L, 
1936609283L, -896838908L, 667021106L, -1192587897L, 827364305L, 
565701974L, -1853177036L, -1741275579L, -1981879665L, 1323279368L, 
-1766739930L, 633712851L, -641613259L, 931922322L, -672979616L, 
1711246537L, 1053241339L, -947974196L, -860192166L, 729284431L, 
-816337383L, -35419090L, -1880534468L, -1500155987L, -1595791273L, 
1325862304L, -661414146L, -1509950005L, -1634767923L, 1783963386L, 
-925231816L, -1175814431L, -387264109L, -2017510988L, 2034297538L, 
2128583383L, -386905311L, -1978504474L, -1582855196L, -1975866603L, 
-1123962049L, 666130136L, 1737691894L, 527838467L, 1046824517L, 
-773063070L, 2026034640L, -141483271L, -1736634325L, -1453858916L, 
-1977905206L, -724064065L, -124708343L, 873689886L, 383646412L, 
-1504939363L, -697213145L, -1320521392L, -1962770450L, 1885495451L, 
207080189L, 706327018L, -1386538360L, 1687972913L, -44818781L, 
-43356L, 657192786L, 849305255L, 1254597361L, -1534367178L, 1855153876L, 
-111343003L, 366872687L, 94628520L, -1000523770L, 623310131L, 
-485148267L, -1323989518L, 1606326848L, 530576297L, 636448283L, 
-529012756L, 257576954L, 515765295L, -997440455L, -1114360242L, 
1179403932L, 1886583821L, 1542733943L, -2014918528L, -1607266594L, 
2006476203L, 333625005L, -637367526L, 1244279768L, 2112122945L, 
-1903714573L, -924565228L, 511972514L, 2091159991L, 913347969L, 
-319102074L, 847557060L, 1079064821L, -322807457L, -404171848L, 
1259861654L, 1455407267L, 634071653L, 97173378L, 797889776L, 
1136536729L, -1188182901L, -612512388L, -1781826646L, -1880998945L, 
182628713L, -682009218L, -1484014228L, -1021884517L)

Try the robustDA package in your browser

Any scripts or data that you put into this service are public.

robustDA documentation built on May 2, 2019, 6:30 a.m.