RandomFields/0000755000176200001440000000000013075245477012637 5ustar liggesusersRandomFields/inst/0000755000176200001440000000000013074763016013605 5ustar liggesusersRandomFields/inst/CITATION0000644000176200001440000000475013074763016014750 0ustar liggesuserscitHeader("To cite RandomFields in publications use:") year <- sub("-.*", "", meta$Date) note <- sprintf("R package version %s", meta$Version) bibentry(bibtype="Manual", header="For general purposes please refer to", footer="", title = "{RandomFields}: Simulation and Analysis of Random Fields", author = c(person("Martin", "Schlather", role=c("cre", "aut")), person("Alexander", "Malinowski", role="aut"), person("Marco", "Oesting", role="aut"), person("Daphne", "Boecker", role="aut"), person("Kirstin", "Strokorb", role="aut"), person("Sebastian", "Engelke", role="aut"), person("Johannes", "Martini", role="aut"), person("Felix", "Ballani", role="aut"), person("Olga", "Moreva", role="aut"), person("Jonas", "Auel", role="ctr"), person(given=c("Peter", "J"), family="Menck", role="ctr"), person("Sebastian", "Gross", role="ctb"), person("Ulrike", "Ober", role="ctb"), person("Christoph Berreth", role="ctr"), person("Katharina", "Burmeister", role="ctb"), person("Juliane", "Manitz", role="ctb"), person("Paulo", "Ribeiro", role="ctb"), person("Richard", "Singleton", role="ctb"), person("Ben", "Pfaff", role="ctb"), person("R Core Team", role="ctb") ), year = year, note = note, url = "https://cran.r-project.org/package=RandomFields" ) citEntry(entry = "Article", title = "Analysis, Simulation and Prediction of Multivariate Random Fields with Package {RandomFields}", author = personList(as.person("Martin Schlather"), as.person("Alexander Malinowski"), as.person("Peter J. Menck"), as.person("Marco Oesting"), as.person("Kirstin Strokorb")), journal = "Journal of Statistical Software", year = "2015", volume = "63", number = "8", pages = "1--25", url = "http://www.jstatsoft.org/v63/i08/", textVersion = paste("Martin Schlather, Alexander Malinowski, Peter J. Menck, Marco Oesting, Kirstin Strokorb (2015).", "Analysis, Simulation and Prediction of Multivariate Random Fields with Package RandomFields.", "Journal of Statistical Software, 63(8), 1-25.", "URL http://www.jstatsoft.org/v63/i08/.") ) RandomFields/inst/doc/0000755000176200001440000000000013074763016014352 5ustar liggesusersRandomFields/inst/doc/version2.pdf0000644000176200001440000065765313074763016016642 0ustar liggesusers%PDF-1.5 % 1 0 obj << /Type /ObjStm /Length 3853 /Filter /FlateDecode /N 78 /First 646 >> stream x[s8~-[+þڢXdrfć&_c1'XjH%pBA$(IcF$a@FB& Q IXH Be O " $)"xH!Ld$2!2aH$ #"E)vJ{IdIMD):H̓:GbBHcN"RHQ '0HA$a1KHrF/Ph GapL1pK`0 a a!Y*hM/"&4#aȶHBOdQDBu$`3P07WA yeY+2 0[BRb@0`"PP(z4T(, ( P V@Y%`*R&_NAVJ H#GY ro]3BbvA?U.gݴȃ yϡ! a_mق lmjVgGa>ϕmGvmNJGvbNlI,K =LryM#J&vDY>Chɨە LlZP4b>ӝ6,At3V\@Q'GY9[.F@ <+teb9:*Iw'U$?:3]s{sx@n¾ILBOu>9[GYjMGq> vz^(還Q?9*%h=^U؍UoLquUGHͮ;`A 0B96b^iIxr2"-L?M87-w8B|֡$.~硊I [fC_"ƶy u?;yRPϳoApQL')ݥ}N_W􀾦o!=}OO'3:d1ͨ&D8-/9=[FAMlJstBtO3:3?sԮ";LnͳE>ӯˬu2*tAKZf|4+q}e~E+Z].VM5_r2 [%FwwhG!w>{yY׏^lֽe0=^ZڢŘW!D ǧOZ>.nw wU)=8EnVWJ6C!ZӫSYVQqNu۠]l\} ޽[k/ct5R.zFzs y۹:/,>X\k@GSt]1MQh9|:_~l9KG_l٬`ΖEUgE.ڐ}]ͮFE:聨6AjAg ˒~etqwcjy 7͡\ŹGIm!]F x3Ft'O^=|6-gĹ TqaGb=Hh5 JwQ.cA|%pl B& |ƤR%k&jSm:]{-Tdey'Boә.Dw<5!m6Wx4H?1HT?u/N{P`H-{͟Ҷ6\+֎l :Eڶwށ0n>`McA*uXFV Y'TC }t\?t{蒎bH~ކCK2y]SjZ;| pRC XA&@ȁx[!:@PidDu2UU},UpߨbKor;|to~x C%giV&TP pWP(0!)p7E9;NނJ7IR&F UPz@O9-YW (kXĎEMaLxn3ql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dpN(j^kow b&dd,Yv#X0uV;w1x%Ox$tN0>0S1q4U}VßEm;):?+"IBlF uCp $YmaBY]QfunlVvj(vR0~T]D ${Zel'<17yh)U:B3WrRX 8^D>7 f=&)w@Rv=E]Slq K U9YglkúYjd˳RiPx``tۺٕe16PHe[q̘JJ^8 :ʜTD&DJuz;{Wkژ&F"FX6c>b8Fîg6sF.&@R :mSh!7E96k^{  -Jםsl įuWپⳡ_1Mw`XVkݟXG~r?LPCcendstream endobj 282 0 obj << /Filter /FlateDecode /Length 1205 >> stream xVn6>PmĊ>0 %YYJkPQ,SΜ93oWO<{g}ڴG^ٿ;iD#{AcDvL^WWt]\<+8x8MC DV9Td*BbBX/y yljXe no7>EyS+ 6_Qoo޼QςoL9MakE׫'~H넱A MQͺ3N 5yS+L\C7U׸gyf=;yVuOqǧZL-d5^4-ǗhϦ8Hc$3R^q48<:|oFZQcZe^Hd J)H4`&t:%tR7qU,IX(m@ tZw;_4XdbHpK##`KhA@I@`#?{cfѡ?WEC&Յ54Vce1`eP%qI+US .۱K$Q'vLy盛a\Ex:x1`| @A HcP^ Ք| eKrgNHpH GɛAy)^\U1$4A,17(x-evL>؈F97$ġii??=]mHendstream endobj 283 0 obj << /Filter /FlateDecode /Length 3136 >> stream xZKsNQB&"2/c]>88媔$H vGo{fARkr====_?Yʯ ׻?}o+vxg `R^=\hX*6Z*v7Lń%KY*Rݾlua9KIޔc?b91%16क़mt꬀) ,ӂ+ۤXwuX $C|Βu]7ʻa.9Z"d,ޕF(gɺ모@bmT4en+DYX.uaѲ7&dP7^EAjjuݕ7#˘9co ]97^Fyu]᱇A^p<4lFb_\t'Qew dCS켂[H$4Pgfd[sT"d<*d:l!q ?yׇm4aVr#cz2\rmAx(\gsZm ": RfdycV*̈́dYx`2n,2fnkV蠑(S re%zw;ArR%HjCss:rk@=_ +7o y1uEo 4W29O C/9 %ev$}Y6i@ޮH1fC~9ьlHCUvczWA.?-=`XƲ3?"$d}~!˰(Q9y NVG{=9 X 1@0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J};-7ﶾth7tނ|" r22Y𢫌4W*kغaN.\ bhaк%x ~^%ʏ 7#nڄ@Gu rendstream endobj 302 0 obj << /Filter /FlateDecode /Length 1253 >> stream xW[s6~W0N;3lg:LOv5 q:oFNf/mc]wx?ϬL앰{e=ZZ#+6О1Ғ^c;xlOG3;--g0A]_^J䇨/O 0M#2=4J`gn͝7 'y.X ߇6,g#ϝ5 '[8ȍCX 0R ID^/ۮE`I*1' (r:!!?z56-k%=v$FsGb8|gy=]ax'p̝/ts?3vvYq'15p$W k^sZ% Ew0?v9+9L@^D? mx5kva+'h{U9#0r#ƌY^]t3\u;]7+ sR8#t}iM8)Na#J6yg?IGpl/ӔߒP&Pw,F!Opv= ,xK4;sIV!'+׆u,-7pJG KA+I$gqw@ڽM7 9c:@uƠ0(thzV7 wv?ݳݡ2ɔ8ѱ+Vy1P]5$WӒ$낚k\^砮Ht797]i4R3-𦎮`C2 2 Yj?= d+?SR]CdRv mF Mte|Pd >A٨B)t(ڎ8=1Bnif ՋGw*! g #d/]fTɒV]}DF;HQ˫]I+{$&ilJvHoIuglyTdT "E耱 i/I MmdQӲO "LCq!j&f:)^]TL#(/) Np.7Cښ+WfqmJ&hյẸ[?>Mesץq\+GC!~!!P !i4dMU}GVZs_B3x%il'{XVg\Z߸yfX<1Cy# A[=*ҀX%۳y}C^OQ^}=2~? endstream endobj 303 0 obj << /Filter /FlateDecode /Length 1064 >> stream xVKoFWLZiKdRj.P:́W6|K6rVvQ E7߼xoژ0~^{n޸7H/4e[8'07;C*8cc 5!8p#sS ?@!V6T}Kq~}%cx3!3]urYY (-"mvHPH|[6AD";Y$WqGqlkm,̇'\# ū OO+yU)Iatx PʭXT3@[*p 8QpVTQX\Kw8`N OաV y{}m:H" +.As!,°FGs;)AQui ɱcC]".0=xW5[䞶&Y3oGN)^n+endstream endobj 304 0 obj << /Filter /FlateDecode /Length 1276 >> stream xV[s6~N:ŝXf Ћi'mA 9# vm7Ilw{@f_?'JKĬ[PLGk6ù m qi"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j 315 0 obj << /Filter /FlateDecode /Length 466 >> stream x}SM0+,2c㏪RE${@0Qذe,p ޼y~B0Dw^.}S'h^}*|?b$D 1dB"AK@R\P(FWꦩ#)uFpwƓytzX|d5F)DjPqJ`EyJQUݞqs_vv9P~/> stream x[Kso&~\m\Ivl-+9ZHHQ&M~~ozf1\{Vl/תpq7}Fn_HiEo㲐T"U__/ZdCF7 92bb|q3|P^s #@, o?ӺlIG^l~G^Ujط?a&=[wϳFacI֩I ,HjZaGv\§jM E$nmRM,ЦZA$V5FNpKЂ0J5|!jNs |Ud֩D"-$J)FTB`PnTrW-o˫CV#J2*;ӯ C5Zzyvrn 2wP"; UneLߪu=#n$ dZ܏U>ওg%9HOZYmW`+elN͜l؜lйNO,y*bD-/! !0\q!3e%H+"Lk@1o\vw>;k/nF몃'q㹓0%a!?6Ê0oUSIMMd19tGI+gX q4׉ɡh5u/D4#N|g|ߺi?ٱmc?K|`zo=vzS0 Z[V-kP9m)bL3Wץ4 %Y 3/yA?endstream endobj 317 0 obj << /Filter /FlateDecode /Length 353 >> stream xRMK@c _}{U+((T"ƶbM}I,IH[$%dfޛRۜqJ ]^y`Խ=TAKK]J-& XxBfsqdF Sd_MQnL WڀPnI`@]ƚ> /W [ 1 3 1 ] /Info 3 0 R /Root 2 0 R /Size 319 /ID [<5922040cef93ae8072b587d3af9c0e44>] >> stream x푿+Eapr^I.eaFX HBP+1Ȣjt r^$8ߏ|> +q8tߗ侕JeFP>pZO%6mb8!fsbFL_RmŚ6QmLZ~&KƊXE&1,=5g龂E}CMG\}S\gf ݼ/ ' 6Wѿ#&yՎ 3.1 a:SeK~/D":<oKeV9;5%;: endstream endobj startxref 220506 %%EOF RandomFields/inst/doc/multivariate_jss.pdf0000644000176200001440000244334513074763016020451 0ustar liggesusers%PDF-1.5 % 39 0 obj << /Length 1909 /Filter /FlateDecode >> stream xXKs6WHD|vq@D7w_CV3mA&.vQ E$o/^_iSe 3J;4QN/:l- ~j 6-HR[mqx] My@>-~o#>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>8QvJxwt&!Q5&_4v5|t汅 cF6Gw.qߵbl]x67hr+s~_Cvv47.XY0sV+jm|^`”vJHT1fSFG3 1ν1CʔE|dcw^ :5%VTNhs J^Iϲn֐`(R[Q `1Mm KFe9DڈSmĄF_s*…@]>ϪQ]{ U4!c-s!GUu#+X<(JTŋ&D>.]Eo758zm &g63 xJHbX '*@H!hsњ!/GϟdA*.|9L4eQ.榥:%HgC^Q Z%z/pOX!6ݑG+U 3$ \G=V+ww{".R*%u7ܴIpP]K6Դ's+xyr߾vLO~W#oKvlD͡J"Z_g g('؉!QMj)V wod P0<'\[D"*7NycPݢpO%ӀPTA")y*#R=P)J!s2sjH~XYcXD4;:AQ!P%T `\ddbCCHWp o\8(yc M#c7]Zsggd7.嫨QFdހ6i(Cq"L7ŕЍ=0q!Z[ݍiJ n𬝃  ~h x\chn^ t{q{zw=Ol.\.O5Έ-,F{v8kaV  ߲E! #AQ~tX=\]:#xkk+IiK 1)%5*8pD3`,*؁x޺I /7JҠXTڵ|A?8кqú`\ iFAIwn$gV-oܱ @PQ4(@tjă݋lN7N 7Vz=xHQ ATpˆm x]"c,;Zf~9dT/HF<]Nޜj521TM*~"IܣLE  >)WC ;|S&NXl`T"KƇU狼>;'#?Ds[@[O"Ƕfst)C4*Nsv45l ].$~ #_w-Ʌ ˝r#,Ȟᯖ8͝s;˪/ ߝ~o?- endstream endobj 241 0 obj << /Type /XObject /Subtype /Image /Width 342 /Height 240 /BitsPerComponent 8 /Length 14555 /ColorSpace /DeviceRGB /Filter /DCTDecode >> stream JFIF<<C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222V" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ($r*0!Ax}7^k RB#7_.-zcs+=0k$\};`6=2@ n-lhc8q@ cs>f:%nsqƥMT'mŧZı3qSI-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j5#t_,IMƻT 5uE@ϥa^*9*?Jqo@  vZ1 :H%=S}Ϫ۲>OOj[,T&+Q\uט:Mj1ܺ>ߙ~mnʑ$jA9p3>՟}{W;F[3y:rxS`85p}1VG uţEOdQz˒mj\1 <XX*:sZӳf.sMijwȉqN+U#*J@$١wxH@ryj/U@ozY.`-k}3ޮ0Ũbդ[g2:ItWS*:7?*kSՓR:\pd5ر8]I8Ңm=B9sXj&qF=~b{ZzS/~_QEzQEi3jê^Xd }jʟ>Ed>+Ȯ (Us # c知]Ӭu&v+\dqVh 6|Mѳne0Ie0J}v~s{*GoJʘBHƟ򯸿oWV 91lULam0??R: =M$:Udx/n>db-}Tt)=_xƎ-g]_j6&'V?/?;Guoh}3rx+Ҍ>]⩣p?鼟U^Լ-CkylZF*KۏOSUeA9@'L>vɦnAVuohԼ-5N Ug |7F>%BZ -fԼ-\O2qʁ 0gߚ%N&WʣCAȶiF`_}ȟi>i2gus5Ep|*”/(B(((VcP[񝻔UxsiF{崹' ߈ǽo\>!1f& | H\m%vCUu 1h`/G3\7Ux+Z<6VS!_$;.a`c8" piaRCFfe NAJ@U }f\?rE|~;qժ> stream xڍTKo0 W("Y-bM!u ۩KRr= dOGʒd7ULbJ /bՒ\XgYiKe՜/VfZNsǟhCEۻ`]4`#=m]5B/[E@ܖN !:[W?彊蟣cϪ.ntn'Se< yIdux_WA2zQY*9%9Jd0pܹA=hK3Ji+,#E14ِk '$$4*8a"p0T=qq>͜ -R[.ilϊ:[?F?; NߠDރGUguMM h@0Ե7 'P>jDr{KJLQ V!RialZ C0`RܣEСv\t-AfR8N= o q=]!F*_ǫcRS su9c_2i{ f`o]U|I$ endstream endobj 253 0 obj << /Type /XObject /Subtype /Image /Width 342 /Height 240 /BitsPerComponent 8 /Length 14239 /ColorSpace /DeviceRGB /Filter /DCTDecode >> stream JFIF<<C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222V" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJST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=Tu7MQu4TUƱJqxqa֛HS.PohEi3>1j D_/iQZ RfaÇK/z.%-+/ w3/߈i>}-^rdHnQeGjsXI uukѪ@n)\ |d~;DoGr,Đ{Dz.HP;X;a DZ,?J<}ivzlr4f'RF|edyQ6 4:XӥJ)L$tڦcI }i^k Ys/:XԖ PQKu=؀u,BDd: Q{ :&5ucI{ѽ#4+Lb,u^ϋwu)Г"C"ЖB] G62o}>.ĽHHFf^|>Qw yIyc9{k '8x!^~ωo/ endstream endobj 317 0 obj << /Type /XObject /Subtype /Image /Width 342 /Height 240 /BitsPerComponent 8 /Length 16769 /ColorSpace /DeviceRGB /Filter /DCTDecode >> stream JFIF<<C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222V" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ( ( 5  w,یy1Dwִ׼+{iok*^Q WBN #8ҵմ{-F84'T65nY%x`HEf$)$퓏SRP\ռ /m`!zkPu;#g4atMq.'[N# d[];ڭb1n6lu9Z;imT(@6$X9n`1Ka'hes[Si2I5𻝭WX|E[.ĞA۠ ;X:9 ovTmtjn﵈͸ٰ<5z0[_XM..wXV]ۉ8oW=g6(ե,v +?X4ګ rsy su+!I,3uw 988-QԑSۧ\=CcA*Ӝݠ x-;LG DVuVr{*Q޶+^Ye 1,72Ȓ 6GPs+x EQEQEQEQEs?ukO]yrlVeE<0#=bWSgo (#F:'".{}V[Ywddq͟Ƽ:-2ͮIh?VomMvpteT~O/.{?KUis[7Q)·W]4'%ۜ^oZmnV(F{ss_OI%H{[`ϭ{5ྶil4c92g۟ƭWk#ݒ/^*-,Řg)-;񪇍 GZ Bm,"sٍ>Z!Pנy#iI!-[jq¨*f?ůy2^ =;[0a9wq{yZ0q-$DXټ^UK1~ur9l]?煯C̗K[2fIwA{Z;hufRF[ɵX#O/W6k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#5EGooRO$(g }%PEPEPEPEPEPY`Z]^\N[˷U.B|̣dӬ[EMUwVw-YC 2r I+b03#&3ʁ#9[4jQ -4$YU$@S s. -HјfX84*]JYgt,LiAf<D#X]E 4F(19ȵAU673[V y#knFr:fe2S-貨Basq*k_ g˧Ũ_,3 DLh]`YTNhQg4C閫-聮%lf2p$qEt,my\#qNa8((( endstream endobj 361 0 obj << /Type /XObject /Subtype /Image /Width 491 /Height 575 /BitsPerComponent 8 /Length 59557 /ColorSpace /DeviceRGB /Filter /DCTDecode >> stream JFIF<<C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222?" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ( ( (]i֯m 6ClG(6?tlh[d#wHT9$E AuKceA3.븓Ѥ^xgSiV4M|RC`tڀ:Z*aZRF9=*QEQEQEQEQEQEQEG%+ɒR?6 3i/̘0;u+ %Pe ) ݸow'N}Ju7[ii 2G4B;NPpppqZtQEQEQEQEQ^'.me^;ATCp\sƺ1GTe{Qvj0|0,5BqڛyH|RPvk3.Q-wݿ :+3.ڏTeQ-iYwݿ.ڏTEfe{QvjnC E|ʟ;jMLp@zFԶIrdG^$BO5nvq٫dPE25"^PjC ȫה?A5Ӽ́a>2 SGwdիx#(Ӓ4vUK'өޖATuoO{EJTu{{=fʬt=/U;i^QU/m?o *G5j'jRz?WP}FhE-'<E!ۿB'<CηxI4.=u [<z|RQԗF_MEW}dh 5ZB l'Ms69H}1֍ĝuX2>jNE‘ L*2BRI8}V d޳4O J{[Nq'&>Ai&_[,d0\)z0G 5V^-"zg~*K[IuR8 ~5gK=-v5TtO[sٚ w’?UTmuEUIǹO΀[4A5z??O:Wأ~– 5D~\'c "ѵ܋g!"L=ӹ;ail#]-$ry'ۥVM{1f(VV (S_5E#y}O9$ض$H^GTA՘ ͟F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zZn'Q=2#8[8H(aS[m;9YQEВfVmFSĊNۃ, *H8Tfi\\@>-B4P,ⴔ4f +aE\yrIM$AitJH_Aqn;>mDS3C =N5 *݌EkHt JEBnɦ`RQt [eEL_qз"('ѡ1y/8ΗmՋO{ # {Ts>g )*+Â}JÖܜ^CΪdΞ.F/?! qM␅fs罹bE'!@jllYs SeR*OpIF@ hnL ŎC'.&azך`dZ(AYZE93*lH|u0]PrHLf}$ZbiiyVڣ9deגl &Lx8}W endstream endobj 411 0 obj << /Type /XObject /Subtype /Image /Width 342 /Height 240 /BitsPerComponent 8 /Length 13908 /ColorSpace /DeviceRGB /Filter /DCTDecode >> stream JFIF<<C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222V" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( (#hVH]Ϡ&[?{V,C q_'ʹXa:Ql5hDW$adeI}s w6mRTؑb?N A^h Lm}AL rm;Ow+| d 뒟O%Cq_>zM!Mpw3 hTO&m[jzӪAqZiaY cP{:P>/_6FHuo&]nS ev1aL Lm}AL rm;Ow+| d [i?dRi⸎l]S<ۦc!aN3L, y,Ԃ'i lùn[EP-R=y4~8̓@'JӮ.KCqq| 7(BW/PxiwzΒl/њE244J2;Uׄno, /f}{v<,hd>[Xrx qxז@YtQ]yf"20ٷ¸ݻk6k٥m|3ccw+soV@ez4 e&89jNzVfkOŔQ,OIr2GPy@>4+ K9/-*&FYGː9f^[/g%Eutf vӡ;Cq}yLn)kF/ Z`6ity_2պoEQEdUlKNb }yXf$cճ<0쀰8 J4}Hk r%&ʑ`dg W>='Havx H A?[(_D;/ݱg QoBO#+^k33z-{WS2 px:VQEs>%?& iʙȎ-ysGSIMIbey 6^e`A zQEsI&幏L.~m$YXF 'w ,W.Pn#+nGhwV_:C$K&ݻG dncހ/QEQEUmN.Zٯ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g5B'z a&'( ?N =f܅yxr6"J!L>I\;gPMX $CG۞m׬"lOt))ot{jϔ^kOL4 endstream endobj 563 0 obj << /Type /XRef /Index [0 564] /Size 564 /W [1 3 1] /Root 561 0 R /Info 562 0 R /ID [<133013ABBE3466C0110388D43DF9AD29> <133013ABBE3466C0110388D43DF9AD29>] /Length 1384 /Filter /FlateDecode >> stream x%KlUURPZP P-eS<[J˳P8rȄD&DIL4l04Q6180 k;>{ZZffJ!@:DJ0kCDu\cmQʳͬ rXUֶh=KXa#Z/k9lsY;.<0,-Bhօ/ tlfbY.K2jtN@&o[V >`'_%BRS%[UPyt0hPQ8  `-'փ UBDbu@6J@IA^~}4N8 }&,ϞpwY12G3G)?`]Fc#0lv~tccc##=mV.sD;*gh ;:::oh5D?mv{l?ǽu iH>cb@ ԁzP,~mwoPp!dmtVYQS}" Z "c86Z~ ,LĔJ<(1 a;ȀWX~^LcDb'9yADhu3;w5Z _\_d.+٣}wJo4NGw]^+Z:F7f%%-ID6310jE:q 'Ip V'; &8px\V>ڔ{a{hţW5i.!\Bp %ɬx#m]D͓(w܉rZ_.Oxp# iD6N+>(Y"%i̊/^iJd(\ @J9Ht4HNRrzh걨ԓ6}_f3\gwϴVok +~l[?+XVvLQ~*=+j'XIEMVEs_nj뇊Yu'Ez E ~}_B>T"պZ^!b}8j(j魏N(c{cE7,=*q #include //#include #include "RF.h" // z coordinate run the fastest in values, x the slowest #define TOOLS_MEMORYERROR 1 #define TOOLS_XERROR 2 #define TOOLS_BIN_ERROR 3 #define TOOLS_METHOD 4 #define NEARBY 1e15 #define METHOD_CROSS 0 #define METHOD_PSEUDO 1 #define METHOD_COVARIANCE 2 #define METHOD_PSEUDOMADOGRAM 3 #define METHOD_CROSSMADOGRAM 4 // naechste Zeile nur notwendig, weil atan2 in Windows nicht // ordentlich programmiert ist #define NEARBYINT(x) (FLOOR((x) * (NEARBY) + 0.5) / (NEARBY)) // #define NEARBYINT(x) x SEXP empvarioXT(SEXP Xsexp, SEXP Tsexp, SEXP Lx, SEXP Values, SEXP Repet, SEXP Grid, SEXP Bin, SEXP Nbin, SEXP Phi, // vector of a real and an integer SEXP Theta, // vector of a real and an integer SEXP DT, // in grid units, smallest positive value, for // the temporal lag of the emp. variogram // stepT * nstepT is the greatest time span SEXP Vdim, SEXP Method) /* X : matrix of coordinates, ### rows define points * lx : length of x,y, and z * values : (univariate) data for the points * repet : number of repetitions (the calculated emprical variogram will * be an overall average, see also EmpiricalVariogram in empvario.R) * grid : (boolean) if true lx must be 3 [ x==c(start,end,step) ] * bin : specification of the bins * sequence is checked whether it is strictly isotone * nbin : number of bins. i.e. length(bin)-1 * sum : empirical variogram * n : number of pairs for each bin * vdim : dimension of data * Method : 0 cross-variogram, 1 pseudo-variogram, 2 covariance */ { long rep; int i, halfnbin,gridpoints[4], err, totalbins, totalspatialbins, twoNphi, twoNphiNbin, Ntheta, nbinNphiNtheta, maxi[4], mini[4], ix, iy, iz, it, endX, startX, endY, startY, endZ, startZ, endT, low, cur, up, totaln, ktheta, kphi, nstepTstepT, vec[4], deltaT, x, y, z, t, j, stepT, nstepT; double *xx[4], *BinSq, maxbinsquare, step[4], delta[4], psq[4], dx[4], startphi, invsegphi, starttheta, invsegtheta, thetadata, phidata, zylinderradius, *sumhead = NULL, *sumtail = NULL; SEXP Res; // turning SEXP to c++ variable int lx = INTEGER(Lx)[0], repet = INTEGER(Repet)[0], grid = INTEGER(Grid)[0], nbin = INTEGER(Nbin)[0], *dT = INTEGER(DT), vdim = INTEGER(Vdim)[0], method = INTEGER(Method)[0]; double *X = REAL(Xsexp), *T = REAL(Tsexp), *values = REAL(Values), *bin = REAL(Bin), *phi = REAL(Phi), *theta = REAL(Theta), *res = NULL; stepT = dT[0]; nstepT = dT[1]; nstepTstepT = stepT * nstepT; twoNphi = phi[1]==0 ? 1 : (2 * (int) phi[1]); twoNphiNbin = twoNphi * nbin; Ntheta = theta[1]==0 ? 1 : (int) theta[1]; startphi = phi[0] - PI / (double) twoNphi; // [0, 2 pi] invsegphi = phi[1] / PI; // note that phi[1] can be zero! //starttheta = theta[0] - PIHALF / (double) Ntheta; // [0, pi] starttheta = theta[0] - PIHALF; // [0, pi] invsegtheta = theta[1] / PI; // note that theta[1] can be zero nbinNphiNtheta = twoNphiNbin * Ntheta; BinSq = NULL; for (rep=i=0; i<3; i++, rep+= lx) xx[i]=&(X[rep]); xx[3] = T; if (xx[0]==NULL) {err=TOOLS_XERROR; goto ErrorHandling;} for (i=0; i< nbin;i++) { if (bin[i]>=bin[i+1]) {err=TOOLS_BIN_ERROR; goto ErrorHandling;} } if(vdim == 1) { if(method == METHOD_CROSS) method = METHOD_PSEUDO; if(method == METHOD_CROSSMADOGRAM) method = METHOD_PSEUDOMADOGRAM; } halfnbin = nbin / 2; if ((BinSq = (double *) MALLOC(sizeof(double)* (nbin + 1)))==NULL) { err=TOOLS_MEMORYERROR; goto ErrorHandling; } totalspatialbins = twoNphiNbin * Ntheta; totalbins = totalspatialbins * (nstepT + 1); totaln = totalbins * vdim * vdim; if(method == METHOD_COVARIANCE) { if( (sumhead = (double *) CALLOC(totaln, sizeof(double))) == NULL) { err = TOOLS_MEMORYERROR; goto ErrorHandling; } if( (sumtail = (double *) CALLOC(totaln, sizeof(double))) == NULL) { err = TOOLS_MEMORYERROR; goto ErrorHandling; } } // res contains the variogram, sd and n.bin (res gets returned to function) // first column is of res is the variogram // second column is the sd and the third n.bin (number of data per bin) PROTECT(Res = allocMatrix(REALSXP, totaln, 3)); res = REAL(Res); //printf("total %d %d %d %d \n", nstepT, twoNphi, *nbin, Ntheta); for(i = 0; i < totaln * 3; res[i++] = 0); for (i=0; i<= nbin; i++){if (bin[i]>0) BinSq[i]=bin[i] * bin[i]; else BinSq[i]=bin[i]; } assert(NEARBYINT(atan2(-1.0, 0.0) + PIHALF) == 0.0); assert(atan2(0.0, 0.0) == 0.0); maxbinsquare = BinSq[nbin]; //////////////////////////////////// GRID //////////////////////////////////// if (grid) { int segmentbase[6]; long totalpoints = 1; segmentbase[0]=1; // here x runs the fastest; for (i=0; i<=3; i++) { step[i] = xx[i][XSTEP]; gridpoints[i] = (int) xx[i][XLENGTH]; totalpoints *= (gridpoints[i] > 0) ? gridpoints[i] : 1; maxi[i] = (int) (SQRT(maxbinsquare) / step[i] + 0.1); if (maxi[i] >= gridpoints[i]) maxi[i] = gridpoints[i] - 1; mini[i] = -maxi[i]; // if (maxi[i]==0) maxi[i] = 1; wrong 22.11.03 segmentbase[i+1] = segmentbase[i] * gridpoints[i]; } segmentbase[4] *= vdim; segmentbase[5] = segmentbase[4] * repet; //printf("\n"); //for(int i=totalpoints;i<2*totalpoints;i+=100){ // printf("%f ", values[i]); //} //printf("\n"); // sementbase: [0] : 1, [1] : length(x), [2] : length(x) * l(y), // [3] : l(x) * l(y) * l(z), [4] : l(x) * l(y) * l(z) * l(T) // [5] : l(x) * l(y) * l(z) * l(T) * repet // define needed so there is no if needed before each calculation (grid) #define FOR(DO) \ for (ix=mini[0]; ix <= maxi[0]; ix++) { \ delta[0] = ix * step[0]; \ if ((psq[0] = delta[0] * delta[0]) > maxbinsquare) continue; \ \ vec[0] = ix; \ if (ix>=0) { \ endX = gridpoints[0] - ix; \ startX = 0; \ } else { \ endX = gridpoints[0]; \ startX = -ix; \ } \ for (iy= mini[1]; iy <= maxi[1]; iy++) { \ delta[1] = iy * step[1]; \ if ((psq[1] = delta[1] * delta[1] + psq[0]) > maxbinsquare) continue; \ vec[1] = vec[0] + iy * segmentbase[1]; \ \ /* angles */ \ phidata = NEARBYINT(atan2(delta[1], delta[0]) - startphi); \ while (phidata < 0) phidata += TWOPI; \ while (phidata >= TWOPI) phidata -= TWOPI; \ kphi = nbin * (int) (phidata * invsegphi); \ \ \ for (iz=mini[2]; iz <= maxi[2]; iz++) { \ delta[2] = iz * step[2]; \ if ((psq[2] = delta[2] * delta[2] + psq[1]) > maxbinsquare) continue; \ vec[2] = vec[1] + iz * segmentbase[2]; \ \ { \ low=0; up= nbin; /* */ cur= halfnbin; \ while(low!=up){ \ if (psq[2] > BinSq[cur]) {low=cur;} else {up=cur-1;}/*( . ; . ]*/ \ cur=(up+low+1)/2; \ } \ } /* low*/ \ \ /* angles*/ \ thetadata = NEARBYINT(atan2(delta[2], SQRT(psq[1])) - starttheta); \ while (thetadata < 0) thetadata += PI; \ while (thetadata >= PI) thetadata -= PI; \ ktheta = (int) (thetadata * invsegtheta); \ \ low += kphi + ktheta * twoNphiNbin; \ \ for (deltaT=0, it=low; deltaT<=nstepTstepT; \ deltaT+=stepT, it+=nbinNphiNtheta) { \ vec[3] = vec[2] + deltaT * segmentbase[3]; \ \ assert(startX>=0); \ for (x=startX; x=0) { \ endY = gridpoints[1] * segmentbase[1] - vec[1]; \ startY = x; \ } else { \ endY = gridpoints[1] * segmentbase[1]; \ startY = x - iy * segmentbase[1]; \ } \ assert(startY>=0); \ for (y=startY; y=0) { \ endZ = gridpoints[2] * segmentbase[2] - vec[2]; \ startZ = y; \ } else { \ endZ = gridpoints[2] * segmentbase[2]; \ startZ = y - iz * segmentbase[2]; \ } \ assert(startZ>=0); \ for (z=startZ; z=0); \ /* inserts calculation from switch below */ \ DO; \ res[curbin] += x2; \ res[curbin + totaln] += x2 * x2; \ res[curbin + 2*totaln]++; \ } \ } \ } /* repeat*/ \ } /* t */ \ } /* z */ \ } /* y */ \ } /* x */ \ } /* deltaT */ \ } /* iz */ \ } /* iy */ \ } /* ix */ // checks which method shoud be used (gets inserted above) switch(method) { case(METHOD_PSEUDO): // pseudo variogram FOR(double x2 = values[rep + totalpoints * row] - values[rv + totalpoints * col]; x2 *= x2); break; case(METHOD_CROSS): // cross variogram FOR(double x2 = (values[rep + totalpoints * row] - values[rv + totalpoints * row]) * (values[rep + totalpoints * col] - values[rv + totalpoints * col])); break; case(METHOD_COVARIANCE): FOR(double x2 = (values[rep + totalpoints * row] * values[rv + totalpoints * col]); sumhead[curbin] += values[rep + totalpoints * row]; sumtail[curbin] += values[rv + totalpoints * col]); break; case(METHOD_PSEUDOMADOGRAM): // pseudo madogram FOR(double x2 = FABS(values[rep + totalpoints * row] - values[rv + totalpoints * col])); break; case(METHOD_CROSSMADOGRAM): // cross madogram FOR(double x2 = FABS(values[rep + totalpoints * row] - values[rv + totalpoints * row]) * FABS(values[rep + totalpoints * col] - values[rv + totalpoints * col]); x2 = SQRT(x2)); break; default: err = TOOLS_METHOD; goto ErrorHandling; } } else { //////////////////////////////////// ARBITRARY ///////////////////////////// // rows : x, columns : T long totalpoints, totalpointsrepetvdim, totalpointsvdim, spatial, jj; spatial = lx; i = 3; step[i] = xx[i][XSTEP]; gridpoints[i] = (int) xx[i][XLENGTH]; totalpoints = spatial * gridpoints[i]; totalpointsvdim = totalpoints * vdim; totalpointsrepetvdim = totalpoints * repet; // define needed so there is no if needed before each calculation (arbitrary) #define FORARB(DO) \ for (i=0;iBinSq[0]) && (distSq<=BinSq[nbin])) { \ low=0; up=nbin; cur=halfnbin; \ while (low!=up) { \ if (distSq> BinSq[cur]) {low=cur;} else {up=cur-1;} /* ( * ; * ]*/ \ cur=(up+low+1)/2; \ } \ \ /* angles */ \ phidata = NEARBYINT(atan2(dx[1], dx[0]) - startphi); \ while (phidata < 0) phidata += TWOPI; \ while (phidata >= TWOPI) phidata -= TWOPI; \ kphi = nbin * (int) (phidata * invsegphi); \ \ thetadata = NEARBYINT(atan2(dx[2], zylinderradius) - starttheta); \ while (thetadata < 0) thetadata += PI; \ while (thetadata >= PI) thetadata -= PI; \ ktheta = (int) (thetadata * invsegtheta); \ \ low += kphi + twoNphiNbin * ktheta; \ assert(low>=0 && low #include //#include #include "RF.h" #include "Operator.h" #define SPECTRAL_LINES (COMMON_GAUSS + 1) #define SPECTRAL_GRID (COMMON_GAUSS + 2) #define SPECTRAL_METRO_FACTOR (COMMON_GAUSS + 3) #define SPECTRAL_SIGMA (COMMON_GAUSS + 4) int check_spectral(cov_model *cov) { #define nsel 4 cov_model *next=cov->sub[0], *key =cov->key, *sub = key==NULL ? next : key; int err, dim = cov->tsdim; // taken[MAX DIM], spectral_param *gp = &(GLOBAL.spectral); ASSERT_CARTESIAN; ROLE_ASSERT(ROLE_GAUSS); if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; kdefault(cov, SPECTRAL_LINES, gp->lines[dim]); // ok kdefault(cov, SPECTRAL_GRID, (int) gp->grid); //ok kdefault(cov, SPECTRAL_METRO_FACTOR, gp->prop_factor); kdefault(cov, SPECTRAL_SIGMA, gp->sigma); // ok if ((err = checkkappas(cov, false)) != NOERROR) return err; // APMI(cov); // printf("\n\ncheck_spectral %d %s %d\n", key==NULL, NICK(sub), cov->role); if (key == NULL) { #define loops 3 int i, err2[loops], iso[loops] = {ISOTROPIC, SPACEISOTROPIC, ZEROSPACEISO}; // for (i=0; irole)) == NOERROR) break; //PMI(cov); // printf("fhler hier %d\n", cov->role); } if (i >= loops) return err2[0]; if (cov->role != ROLE_BASE && sub->pref[SpectralTBM] == PREF_NONE) return ERRORPREFNONE; } else { // key != NULL // falls hier gelandet, so ruft SPECTRAL SPECTRALINTERN auf!! // eventuell mit dazwischenliegenden RMS's //PMI(cov, "here"); if ((err = CHECK(sub, dim, dim, ProcessType, XONLY, CARTESIAN_COORD, SUBMODEL_DEP, ROLE_GAUSS)) != NOERROR) { return err; } } // APMI(cov); //printf("spectral role=%d %d\n", cov->role, ROLE_BASE); setbackward(cov, sub); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov)) != NOERROR) return err; return NOERROR; } void range_spectral(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { GAUSS_COMMON_RANGE; range->min[SPECTRAL_LINES] = 1; range->max[SPECTRAL_LINES] = RF_INF; range->pmin[SPECTRAL_LINES] = 1; range->pmax[SPECTRAL_LINES] = 1000; range->openmin[SPECTRAL_LINES] = false; range->openmax[SPECTRAL_LINES] = true; range->min[SPECTRAL_GRID] = 0; range->max[SPECTRAL_GRID] = 1; range->pmin[SPECTRAL_GRID] = 0; range->pmax[SPECTRAL_GRID] = 1; range->openmin[SPECTRAL_GRID] = false; range->openmax[SPECTRAL_GRID] = false; range->min[SPECTRAL_METRO_FACTOR] = 0; range->max[SPECTRAL_METRO_FACTOR] = RF_INF; range->pmin[SPECTRAL_METRO_FACTOR] = 0; range->pmax[SPECTRAL_METRO_FACTOR] = 1e-5; range->openmin[SPECTRAL_METRO_FACTOR] = false; range->openmax[SPECTRAL_METRO_FACTOR] = true; range->min[SPECTRAL_SIGMA] = 0; range->max[SPECTRAL_SIGMA] = RF_INF; range->pmin[SPECTRAL_SIGMA] = 0; range->pmax[SPECTRAL_SIGMA] = 1e-5; range->openmin[SPECTRAL_SIGMA] = false; range->openmax[SPECTRAL_SIGMA] = true; } int struct_spectral(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel) { if (cov->sub[0]->pref[SpectralTBM] == PREF_NONE) { return ERRORPREFNONE; } ROLE_ASSERT_GAUSS; return NOERROR; } int init_spectral(cov_model *cov, gen_storage *S){ cov_model *next = cov->sub[0], *key =cov->key, *sub = key == NULL ? next : key; int err=NOERROR; spec_properties *s = &(S->spec); location_type *loc = Loc(cov); // if ((meth->S=MALLOC(sizeof(spectral_storage)))==0){ // err=ERRORMEMORYALLOCATION; goto ErrorHandling; // } // s = (spectral_storage*)meth->S; // assert(false); printf("\n\nsdrfsjfd\n"); if (cov->role == ROLE_COV) { return NOERROR; } ROLE_ASSERT_GAUSS; cov->method = SpectralTBM; if (loc->distances) return ERRORFAILED; if (cov->tsdim > MAXTBMSPDIM) { err=ERRORMAXDIMMETH; goto ErrorHandling; } S->Sspectral.prop_factor = P0(SPECTRAL_METRO_FACTOR); s->sigma = P0(SPECTRAL_SIGMA); s->nmetro = 0; s->density = NULL; // 13.10. the following does not seem to be necessary, // since subsequently it checked for reduceddim<=2; // if (key->Time) {err=ERRORTIME NOTALLOWED; goto ErrorHandling;} if (cov->tsdim >= 4) { err = ERRORWRONGDIM; goto ErrorHandling; } if (cov->vdim[0] > 1) { err = ERRORNOMULTIVARIATE; goto ErrorHandling; } //if (key == NULL) APMI(cov->calling); if ((err = INIT(sub, 0, S)) != NOERROR) goto ErrorHandling; err = FieldReturn(cov); ErrorHandling: cov->simu.active = err == NOERROR; return err; } void E1(spectral_storage *s, double A, double *e) { // ignore grid if (s->grid) warning("in 1d no spectral grid implemented yet"); e[0] = A * ((double) (UNIFORM_RANDOM < 0.5) * 2.0 - 1.0); } void E2(spectral_storage *s, double A, double *e) { double phi; if (s->grid) { phi = s->phi2d += s->phistep2d; } else { phi = TWOPI*UNIFORM_RANDOM; } // print("A=%f\n", A); // print("%f\n",phi); //print("%f\n", e[1]); e[0] = A * COS(phi); e[1] = A * SIN(phi); // print("phi=%f A=%f grid=%d step=%f phi2d=%f %f %f\n", // phi, A, (int) s->grid, // s->phistep2d, s->phi2d, // e[0], e[1]); } void E12(spectral_storage *s, int dim, double A, double *e) { if (dim==2) E2(s, A, e); else { double e1[2]; E2(s, A, e1); e[0]=e1[0]; } } void E3(spectral_storage *s, double A, double *e) { // ignore grid if (s->grid) warning("in 3d no spectral grid implemented yet"); double phi, psi, Asinpsi; phi = TWOPI*UNIFORM_RANDOM; psi = PI*UNIFORM_RANDOM; Asinpsi = A * SIN(psi); e[0] = A * COS(psi); e[1] = Asinpsi * COS(phi); e[2] = Asinpsi * SIN(phi); } void E(int dim, spectral_storage *s, double A, double *e) { switch (dim) { case 1 : E1(s, A, e); break; case 2 : E2(s, A, e); break; case 3 : E3(s, A, e); break; default: BUG; } } void do_spectral(cov_model *cov, gen_storage *S) // in two dimensions only! { // gauss_param *dp = &(gp->gauss); double exact = GLOBAL.general.exactness; cov_model *next = cov->sub[0]; cov_fct *C = CovList + next->nr; // nicht gatternr location_type *loc = Loc(cov); //PMI(cov->calling->calling); assert(S != NULL); spec_properties *cs = &(S->spec); spectral_storage *s = &(S->Sspectral); int d, n, gridlenx, gridleny, gridlenz, gridlent, ntot = P0INT(SPECTRAL_LINES), origdim = loc->timespacedim, spatialdim = loc->spatialdim, every = GLOBAL.general.every, nthreshold = (every>0) ? every : MAXINT, deltathresh = nthreshold; double inct, *x = loc->x, oldE[MAXTBMSPDIM] = { 0 }, E[MAXTBMSPDIM], // must always be of full dimension, even // if lower dimension is simulated -- simulation algorithm for e // might use higher dimensional components inc[MAXTBMSPDIM], VV, *res = cov->rf; long nt, nx, total = loc->totalpoints, spatialpoints = loc->spatialtotalpoints; SAVE_GAUSS_TRAFO; s->grid = P0INT(SPECTRAL_GRID); s->phistep2d = TWOPI/ (double) ntot; s->phi2d = s->phistep2d * UNIFORM_RANDOM; // print("%d %f %f\n", s->grid, s->phistep2d, s->phi2d); assert(false); for (d=0; dgrid) { switch (origdim) { case 4 : gridlent = (int) loc->xgr[3][XLENGTH]; // no break; case 3 : gridlenz = (int) loc->xgr[2][XLENGTH]; // no break; case 2 : gridleny = (int) loc->xgr[1][XLENGTH]; // no break; case 1 : gridlenx = (int) loc->xgr[0][XLENGTH]; break; default: BUG; } } for (n=0; nspectral(next, S, E); if (PL > 6) PRINTF("spect: %d %f %f %d %d sigma=%f nmetro=%d\n", n, E[0], E[1], loc->grid, loc->caniso != NULL, cs->sigma, cs->nmetro); //assert(n < 3); // if (meth->cscale != 1.0) { // double invscale = 1.0 / meth->cscale; // for (d=0; dtsdim; d++) E[d] *= invscale; //} if (loc->caniso != NULL) { double *A = loc->caniso; int m, k, j, nrow = origdim; for (d=0; dtsdim; d++) { oldE[d] = E[d]; E[d] = 0.0; } for (d=0, k=0; dtsdim; j+=nrow, m++) { E[d] += oldE[m] * A[j]; } } } // print("spect %d %f %f %d %d %f\n", // n, E[0], E[1], loc->grid, meth->caniso != NULL, meth->cscale); VV = TWOPI * UNIFORM_RANDOM; if (loc->grid) { for (d = 0; d < origdim; d++) { // VV += meth->grani[d][XSTART] * E[d]; inc[d] = loc->xgr[d][XSTEP] * E[d]; // print("E[%d]=%f, inc=%f\n", d, E[d], inc[d]); } if (!ISNA(exact) && !exact) { double incx, incy, incz, segz, segy, segx; int ny, nz; long zaehler; incx = inc[0]; incy = inc[1]; incz = inc[2]; inct = inc[3]; zaehler = 0; for (nt=0; nt < gridlent; nt++) { for (segz = VV, nz = 0; nz < gridlenz; nz++) { for (segy = segz, ny = 0; ny < gridleny; ny++) { for (segx = segy, nx = 0; nx < gridlenx; nx++) { // print("zaehler=%d %f res=%f %f\n", zaehler, segx, res[zaehler], COS(segx) ); res[zaehler++] += (double) COS(segx); segx += incx; } segy += incy; } segz += incz; } VV += inct; } } else { // ! DECISION_PARAM.exactness double cix, ciy, six, siy, ciz, siz, cit, sit, ct, st, cz, sz, cy, sy, cx, sx, dummy; int ny, nz; long zaehler; cix = COS(inc[0]); six = SIN(inc[0]); ciy = COS(inc[1]); siy = SIN(inc[1]); ciz = COS(inc[2]); siz = SIN(inc[2]); cit = COS(inc[3]); sit = SIN(inc[3]); ct = COS(VV); st = SIN(VV); zaehler = 0; for (nt=0; nt < gridlent; nt++) { for (cz=ct, sz=st, nz = 0; nz < gridlenz; nz++) { for (cy=cz, sy=sz, ny = 0; ny < gridleny; ny++) { for (cx=cy, sx=sy, nx = 0; nx < gridlenx; nx++) { //print("zaehler=%d res=%f %f\n", zaehler, res[zaehler], cx ); res[zaehler++] += (double) cx; dummy = cx * cix - sx * six; sx = cx * six + sx * cix; cx = dummy; } dummy = cy * ciy - sy * siy; sy = cy * siy + sy * ciy; cy = dummy; } dummy = cz * ciz - sz * siz; sz = cz * siz + sz * ciz; cz = dummy; } dummy = ct * cit - st * sit; st = ct * sit + st * cit; // 1.9.07: sz ct = dummy; // 1.9.07: cz } // COS(a + b) = COS(a) COS(b) - SIN(a) SIN(b) // SIN(a + b) = COS(a) SIN(b) + COS(b) SIN(a) } } else { // no grid double psi, cit, sit; if (loc->Time) { int j; inct = loc->T[XSTEP] * E[spatialdim]; cit = COS(inct); sit = SIN(inct); for (j=nx=0; nx= nthreshold) { /* PRINTF("\b\b\b\b%d%%", (int) (n * 100 / ntot)); */ PRINTF("%7d %3d%%\n", n, (int) (n * 100 / ntot)); nthreshold += deltathresh; } R_CheckUserInterrupt(); } // for k #include //#include #include "RF.h" #include "shape_processes.h" #include "Coordinate_systems.h" #include #include #include // MULT /*********************************************************************/ /* CIRCULANT EMBEDDING METHOD (1994) ALGORITHM */ /* (it will always be refered to the paper of Wood & Chan 1994) */ /*********************************************************************/ int fastfourier(double *data, int *m, int dim, bool first, bool inverse, FFT_storage *FFT) /* this function is taken from the fft function by Robert Gentleman and Ross Ihaka, in R */ { long int inv, nseg, n,nspn,i; int maxf, maxp, err; bool ok; if (first) { int maxmaxf,maxmaxp; nseg = maxmaxf = maxmaxp = 1; /* do whole loop just for err checking and maxmax[fp] .. */ for (i = 0; i 1) { fft_factor(m[i], &maxf, &maxp); if (maxf == 0) {GERR("fft factorization failed")} if (maxf > maxmaxf) maxmaxf = maxf; if (maxp > maxmaxp) maxmaxp = maxp; nseg *= m[i]; } } FREE(FFT->work); FREE(FFT->iwork); if ((FFT->work = (double*) MALLOC(4 * maxmaxf * sizeof(double)))==NULL || (FFT->iwork = (int*) MALLOC(maxmaxp * sizeof(int)))==NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } FFT->nseg = nseg; // nseg = leng th(z); see loop above } inv = (inverse) ? 2 : -2; n = 1; nspn = 1; nseg = FFT->nseg; for (i = 0; i < dim; i++) { if (m[i] > 1) { nspn *= n; n = m[i]; nseg /= n; fft_factor(n, &maxf, &maxp); ok = (bool) fft_work(&(data[0]), &(data[1]), nseg, n, nspn, inv, FFT->work, FFT->iwork); if (!ok) GERR("error within Fourier transform"); } } return NOERROR; ErrorHandling: FFT_destruct(FFT); return err; } int fastfourier(double *data, int *m, int dim, bool first, FFT_storage *FFT){ return fastfourier(data, m, dim, first, !first, FFT); } #define LOCPROC_DIAM (CE_LAST + 1)// parameter p #define LOCPROC_A (CE_LAST + 2) // always last of LOCPROC_* #define LOCPROC_R LOCPROC_A // always last of LOCPROC_* int init_circ_embed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S){ int err=NOERROR; if (!Getgrid(cov)) SERR("circ embed requires a grid"); // cov_model *prev = cov; // while (prev->calling != NULL) prev = prev->calling; PMI(prev); int d, *sum = NULL, index[MAXCEDIM], dummy, j, l, *mm=NULL, *cumm=NULL, *halfm=NULL; // MULT added vars j,l; double hx[MAXCEDIM], realmtot, steps[MAXCEDIM], **c = NULL, // For multivariate *c->**c **Lambda = NULL, *tmp = NULL, *rwork=NULL, *tmpLambda=NULL, *smallest=NULL; complex optim_lwork, *R = NULL, *work=NULL; long int i,k,twoi,twoi_plus1, mtot, hilfsm[MAXCEDIM], *idx = NULL; bool cur_crit; ce_storage *s = NULL; cov_model *next = cov->sub[0]; location_type *loc = Loc(cov); double maxGB = P0(CE_MAXGB), tolRe = P0(CE_TOLRE), tolIm = P0(CE_TOLIM), *caniso = loc->caniso, *mmin = P(CE_MMIN); int dim = cov->tsdim, vdim = cov->vdim[0], cani_ncol = loc->cani_ncol, cani_nrow = loc->cani_nrow, lenmmin = cov->nrow[CE_MMIN], vdimSQ = vdim * vdim, // PM 12/12/2008 maxmem = P0INT(CE_MAXMEM), trials = GLOBAL.internal.examples_reduced ? 1 : P0INT(CE_TRIALS), strategy = P0INT(CE_STRATEGY); bool isaniso = loc->caniso != NULL, force = (bool) P0INT(CE_FORCE), useprimes = (bool) P0INT(CE_USEPRIMES), dependent = (bool) P0INT(CE_DEPENDENT); ROLE_ASSERT_GAUSS; assert(cov->vdim[0] == cov->vdim[1]); cov->method = CircEmbed; if (loc->distances) return ERRORFAILED; NEW_STORAGE(ce); s = cov->Sce; if (dim > MAXCEDIM) { err=ERRORMAXDIMMETH ; goto ErrorHandling; } for (d=0; dnn[d]=(int) loc->xgr[d][XLENGTH]; steps[d]=loc->xgr[d][XSTEP]; } s->vdim = vdim; // PM 12/12/2008 // in case of multiple calls: possible to use imaginary part of // field generated in preceding run. If s->dependent is set, fields // are read off in the following order: // 1. real field 1st square // 2. imag field 1st square // 3. real field 2nd square // 4. imag field 2nd square // ... // 2k+1. real field (2k+1)th square // 2k+2. imag field (2k+1)th square // // i.e. read off imag fields in even calls. Generate new ones in // odd calls resp. read off real squares if s->dependent==1 s->cur_call_odd = 0; // first one is set to be odd at beginning of // do_circ_embed if( (tmp = (double *) MALLOC(vdimSQ * sizeof(double))) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } mtot=0; mm = s->m; halfm= s->halfm; cumm = s->cumm; if (PL>=PL_STRUCTURE) { LPRINT("calculating the Fourier transform\n"); } /* cumm[i+1]=\prod_{j=0}^i m[j] cumm is used for fast transforming the matrix indices into an index of the vector (the way the matrix is stored) corresponding to the matrix */ /* calculate the dimensions of the matrix C, eq. (2.2) in W&C */ // ("CE missing strategy for matrix entension in case of anisotropic fields %d\n) // for (i=0;ivdim[0] > 1; assert(cov->vdim[0] == cov->vdim[1]); // multivariate = !true; // checken !! for (i=0;i 10000.0) { GERR1("maximimal modulus of mmin is 10000. Got %f", mmin[i % lenmmin]); } hilfsm_d = (double) s->nn[i]; if (mmin[i % lenmmin]>0.0) { if (hilfsm_d > (1 + (int) CEIL(mmin[i % lenmmin])) / 2) { // plus 1 since // mmin might be odd; so the next even number should be used GERR3("Minimum size in direction %d is %f. Got %f\n", (int) i, hilfsm_d, CEIL(mmin[i % lenmmin])); } hilfsm_d = (double) ( (1 + (int) CEIL(mmin[i % lenmmin])) / 2); } else if (mmin[i % lenmmin] < 0.0) { assert(mmin[i % lenmmin] <= -1.0); hilfsm_d = CEIL((double) hilfsm_d * - mmin[i % lenmmin]); } if (hilfsm_d >= MAXINT) return ERRORMEMORYALLOCATION; if (useprimes) { // Note! algorithm fails if hilfsm_d is not a multiple of 2 // 2 may not be put into NiceFFTNumber since it does not // guarantee that the result is even even if the input is even ! hilfsm_d = 2.0 * NiceFFTNumber((int) hilfsm_d); } else { hilfsm_d =ROUND(multivariate ? POW(3.0, 1.0 + CEIL(LOG(hilfsm_d) / LOG3 - EPSILON1000)) : POW(2.0, 1.0 + CEIL(LOG(hilfsm_d) *INVLOG2-EPSILON1000)) ); } if (hilfsm_d >= MAXINT) return ERRORMEMORYALLOCATION; hilfsm[i] = (int) hilfsm_d; } s->positivedefinite = false; /* Eq. (3.12) shows that only j\in I(m) [cf. (3.2)] is needed, so only the first two rows of (3.9) (without the taking the modulus of h in the first row) The following variable 'index' corresponds to h(l) in the following way: index[l]=h[l] if 0<=h[l]<=mm[l]/2 index[l]=h[l]-mm[l] if mm[l]/2+1<=h[l]<=mm[l]-1 Then h[l]=(index[l]+mm[l]) % mm[l] !! */ /* The algorithm below is as follows: while (!s->positivedefinite && (s->trialstrials)++; calculate the covariance values "c" according to the given "m" fastfourier(c) if (!force || (s->trialspositivedefinite && (s->trialstrials=0; // print("trials %d strat=%d force=%d prim=%d dep=%d max=%f re=%f im=%f\n", // trials, strategy, force, useprimes, dependent, // maxmem, tol_re, tol_im); while (!s->positivedefinite && (s->trials < trials)) { // print("trials %d %d\n", trials, s->trials); (s->trials)++; cumm[0]=1; realmtot = 1.0; for(i=0; imtot = mtot = cumm[dim]; if (PL>=PL_BRANCHING) { LPRINT("Memory need for "); for (i=0;i 0) PRINTF(" x "); PRINTF("%d", mm[i]); } PRINTF(" %s is 2 x %ld complex numbers.\n", dim == 1 ? "locations" : "grid", mtot * vdimSQ); } if ( (maxmem != NA_INTEGER && realmtot * vdimSQ > maxmem)) GERR4("total real numbers needed=%.0f > '%s'=%d -- increase '%s'", realmtot * vdimSQ, CE[CE_MAXMEM - COMMON_GAUSS - 1], maxmem, CE[CE_MAXMEM - COMMON_GAUSS - 1]) else if (R_FINITE(maxGB) && realmtot * vdimSQ * 32e-9 > maxGB) GERR4("total memory needed=%4.4f GB > '%s'=%4.4f GB -- increase '%s'", realmtot* vdimSQ * 32e-9, CE[CE_MAXGB - COMMON_GAUSS - 1], maxGB, CE[CE_MAXGB - COMMON_GAUSS - 1]); if (c != NULL) { for(l=0; l= mm[k])) { index[k]=0; k++; } assert( (k=j) { //// martin 29.12. // just compute FFT for upper right triangle first = (l==0); if (PL>=PL_STRUCTURE) { LPRINT("FFT..."); } if ((err=fastfourier(c[l], mm, dim, first, &(s->FFT))) != NOERROR) goto ErrorHandling; } if (false) { int ii; for (ii =0; ii=PL_STRUCTURE) { LPRINT("finished\n"); } // here the A(k) have been constructed; A(k) = c[0][k], c[1][k], ..., c[p-1][k] // c[p][k], ... c[2p-1][k] // ... ... // c[(p-1)*p][k], ..., c[p*p-1][k] // NOTE: only the upper triangular part of A(k) has actually been filled; A is Hermitian. // Now: // A(k) is placed into R (cf W&C 1999) // application of zheev puts eigenvectors // of A(k) into R if(Lambda!=NULL) { for(l = 0; lpositivedefinite = true; if (vdim==1) { // in case vdim==1, the eigenvalues we need are already contained in c[0] for(i = 0; ipositivedefinite &= FABS(c[0][2*i+1]) <= tolIm; c[0][2*i] = 1.0; c[0][2*i+1] = 0.0; } } else { int index1, index2, Sign; for(i = 0; i=k) { index2=index1; Sign=1; s->positivedefinite &= k!=l || FABS(c[index2][twoi_plus1])<=tolIm; // c[index2][twoi_plus1].r = 0.0; ?!!! } // obtain lower triangular bit of c as well with else{ index2= vdim * l + k; Sign=-1;} // (-1) times imaginary part of upper triangular bit R[index1].r = c[index2][twoi]; R[index1].i = Sign*c[index2][twoi_plus1]; /// if (i < 5) //print("%d %f %f; vdim=%d\n", index1, R[index1].r, R[index1].i, vdim); } } // if (i < 5) // print("2 : i=%d mtot=%d k=%d l=%d vdim=%d \n ", i, mtot, k, l, vdim); //for(k=1; k<2; k++) R[k].r = R[k].i = 7.0; // diagonalize R via Fortran call zheev // initialization if(i==0) { lwork = -1; // for initialization call to get optimal size of array 'work' F77_CALL(zheev)("V", "U", &vdim, R, // complex &vdim, // integer tmpLambda, // double &optim_lwork, // complex &lwork, rwork, &info); //// martin 29.12.: nur einmal aufrufen] //// ganz weit vorne, oder haengt //// optim_lwork.r von den Werten der Matrix ab ?? lwork = (int) optim_lwork.r; FREE(work); if( (work = (complex *) CALLOC(lwork, sizeof(complex))) == NULL ) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } } F77_CALL(zheev)("V", "U", &vdim, R, &vdim, tmpLambda, work, &lwork, rwork, &info); for(l=0;l= 0 (non-negative definiteness) // and do check this within this loop... in case of some lambda <0 there is no point in going // on diagonalizing if there are free trial... or not? Hmm. } } FREE(R); FREE(rwork); FREE(work); FREE(tmpLambda); // check if positive definite. If not: enlarge and restart if (!force || (s->trials 0: l=0; while( (lpositivedefinite &= Lambda[l][i]>=tolRe) ) // eigenvalues ARE real: drop former line {l++;} // s->positivedefinite = (lambda.real>=cepar->tol_re) && (lambda.imag<=cepar->tol_im) if ( !s->positivedefinite) { if (PL>=PL_BRANCHING) { if (Lambda[l][i] < 0.0) { LPRINT("There are complex eigenvalues\n"); } else if (vdim==1) { LPRINT("non-positive eigenvalue: Lambda[%ld]=%e.\n", i, Lambda[l][i]); } else { LPRINT("non-pos. eigenvalue in dim %d: Lambda[%ld][%d]=%e.\n", l, i, l, Lambda[l][i]); } } if (PL>=PL_ERRORS) { // just for printing the smallest // eigenvalue (min(c)) if( (sum = (int *) CALLOC(vdim, sizeof(int))) == NULL || (smallest = (double *)CALLOC(vdim, sizeof(double))) == NULL || (idx = (long int *) CALLOC(vdim, sizeof(long int))) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } char percent[]="%"; for(j=i; jpositivedefinite, s->trials, trials, force); if (!s->positivedefinite && (s->trialsFFT)); switch (strategy) { case 0 : for (i=0; i2) { LPRINT("%d cc=%e (%e)",i,cc,hx[i]); } if (cc>maxcc) { maxcc = cc; maxi = i; } hx[i] = 0.0; } assert(maxi>=0); hilfsm[maxi] *= multivariate ? 3 : 2; break; default: ERR("unknown strategy for circulant embedding"); } } } else {if (PL>=PL_BRANCHING) {LPRINT("forced.\n");} } R_CheckUserInterrupt(); // printf("trials=%d %d %d\n", s->trials, trials, s->positivedefinite); } // while (!s->positivedefinite && (s->trials0); if (s->positivedefinite || force) { // correct theoretically impossible values, that are still within // tolerance CIRCEMBED.tol_re/CIRCEMBED.tol_im double r; r = Lambda[0][0]; // MULT for(i=0,twoi=0;i 0.0) Lambda[l][i] = SQRT(Lambda[l][i]); else { if(Lambda[l][i] < r) r = Lambda[l][i]; Lambda[l][i] = 0; } } // now compute R[i]*Lambda^(1/2)[i] for(j=0;j=PL_BRANCHING) { if (r < -GENERAL_PRECISION) { LPRINT("using approximating circulant embedding:\n"); LPRINT("\tsmallest real part has been %e \n", r); } } s->smallestRe = (r > 0.0) ? RF_NA : r; s->largestAbsIm = 0.0; // REMOVE THIS } else { //printf("FEHLER\n"); GERR("embedded matrix has (repeatedly) negative eigenvalues and approximation is not allowed (force=FALSE)"); } if (PL >= PL_SUBDETAILS) { for (i=0; i < 2 * mtot; i++) for (l=0; ldependent = dependent; s->new_simulation_next = true; for(i=0; icur_square[i] = 0; s->max_squares[i] = hilfsm[i] / s->nn[i]; s->square_seg[i] = cumm[i] * (s->nn[i] + (hilfsm[i] - s->max_squares[i] * s->nn[i]) / s->max_squares[i]); } if ( (s->d=(double **) CALLOC(vdim, sizeof(double *))) == NULL ) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } for(l=0; ld[l] = (double *) CALLOC(2 * mtot, sizeof(double))) == NULL) { err=ERRORMEMORYALLOCATION;goto ErrorHandling; } } if ((s->gauss1 = (complex *) MALLOC(sizeof(complex) * vdim)) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((s->gauss2 = (complex *) MALLOC(sizeof(complex) * vdim)) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } s->c = c; err = FieldReturn(cov); ErrorHandling: if (Lambda != NULL) { for(l = 0; lc = c; else if (c!=NULL) { for(l=0;lsimu.active = err == NOERROR; // printf("error =%d\n", err); return err; } void kappa_ce(int i, cov_model *cov, int *nr, int *nc){ // printf("kappa_ce %d %d %d\n", i , CE_MMIN, cov->tsdim); kappaGProc(i, cov, nr, nc); if (i == CE_MMIN) *nr = 0; } int check_ce_basic(cov_model *cov) { // auf co/stein ebene ! // cov_model *next=cov->sub[0]; // location_type *loc = Loc(cov); int i, //err, dim = cov->tsdim ; // taken[MAX DIM], ce_param *gp = &(GLOBAL.ce); // ok ROLE_ASSERT(ROLE_GAUSS); ASSERT_CARTESIAN; if(cov->tsdim != cov->xdimprev) { SERR2("time-space dimension (%d) differs from dimension of locations (%d)", cov->tsdim, cov->xdimown); } kdefault(cov, CE_FORCE, (int) gp->force); if (PisNULL(CE_MMIN)) { PALLOC(CE_MMIN, dim, 1); for (i=0; immin[i]; } } kdefault(cov, CE_STRATEGY, (int) gp->strategy); kdefault(cov, CE_MAXGB, gp->maxGB); kdefault(cov, CE_MAXMEM, (int) gp->maxmem); kdefault(cov, CE_TOLIM, gp->tol_im); kdefault(cov, CE_TOLRE, gp->tol_re); kdefault(cov, CE_TRIALS, gp->trials); kdefault(cov, CE_USEPRIMES, (int) gp->useprimes); kdefault(cov, CE_DEPENDENT, (int) gp->dependent); kdefault(cov, CE_APPROXSTEP, gp->approx_grid_step); kdefault(cov, CE_APPROXMAXGRID, gp->maxgridsize); return NOERROR; } int check_ce(cov_model *cov) { cov_model *next=cov->sub[0]; location_type *loc = Loc(cov); int err, dim = cov->tsdim; // taken[MAX DIM], if ((err = check_ce_basic(cov)) != NOERROR) return err; if ((err = checkkappas(cov, false)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if ((loc->timespacedim > MAXCEDIM) | (cov->xdimown > MAXCEDIM)) return ERRORDIM; // printf("here X\n"); if (cov->key != NULL) { if ((err = CHECK(cov->key, loc->timespacedim, cov->xdimown, ProcessType, XONLY, CARTESIAN_COORD, cov->vdim, ROLE_GAUSS)) != NOERROR) { //PMI(cov->key); XERR(err); //printf("specific ok\n"); // crash(); return err; } } else { if ((err = CHECK(next, dim, dim, PosDefType, XONLY, SYMMETRIC, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { // APMI(cov); // XERR(err); APMI(cov); if ((err = CHECK(next, dim, dim, VariogramType, XONLY, SYMMETRIC, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { return err; } } if (next->pref[CircEmbed] == PREF_NONE) { //PMI(cov); // assert(false); return ERRORPREFNONE; } if (!isPosDef(next->typus)) SERR("only covariance functions allowed."); } setbackward(cov, next); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov, true)) != NOERROR) return err; return NOERROR; } void range_ce(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ GAUSS_COMMON_RANGE; range->min[CE_FORCE] = 0; range->max[CE_FORCE] = 1; range->pmin[CE_FORCE] = 0; range->pmax[CE_FORCE] = 1; range->openmin[CE_FORCE] = false; range->openmax[CE_FORCE] = false; range->min[CE_MMIN] = RF_NEGINF; range->max[CE_MMIN] = RF_INF; range->pmin[CE_MMIN] = -3; range->pmax[CE_MMIN] = 10000; range->openmin[CE_MMIN] = true; range->openmax[CE_MMIN] = true; range->min[CE_STRATEGY] = 0; range->max[CE_STRATEGY] = 1; range->pmin[CE_STRATEGY] = 0; range->pmax[CE_STRATEGY] = 1; range->openmin[CE_STRATEGY] = false; range->openmax[CE_STRATEGY] = false; range->min[CE_MAXGB] = 0; range->max[CE_MAXGB] = RF_INF; range->pmin[CE_MAXGB] = 0; range->pmax[CE_MAXGB] = 10; range->openmin[CE_MAXGB] = false; range->openmax[CE_MAXGB] = false; range->min[CE_MAXMEM] = 0; range->max[CE_MAXMEM] = MAXINT; range->pmin[CE_MAXMEM] = 0; range->pmax[CE_MAXMEM] = 50000000; range->openmin[CE_MAXMEM] = false; range->openmax[CE_MAXMEM] = false; range->min[CE_TOLIM] = 0.0; range->max[CE_TOLIM] = RF_INF; range->pmin[CE_TOLIM] = 0.0; range->pmax[CE_TOLIM] = 1e-2; range->openmin[CE_TOLIM] = false; range->openmax[CE_TOLIM] = false; range->min[CE_TOLRE] = RF_NEGINF; range->max[CE_TOLRE] = RF_INF; range->pmin[CE_TOLRE] = 1e-2; range->pmax[CE_TOLRE] = 0; range->openmin[CE_TOLRE] = false; range->openmax[CE_TOLRE] = false; range->min[CE_TRIALS] = 1; range->max[CE_TRIALS] = 10; range->pmin[CE_TRIALS] = 1; range->pmax[CE_TRIALS] = 3; range->openmin[CE_TRIALS] = false; range->openmax[CE_TRIALS] = true; range->min[CE_USEPRIMES] = 0; range->max[CE_USEPRIMES] = 1; range->pmin[CE_USEPRIMES] = 0; range->pmax[CE_USEPRIMES] = 1; range->openmin[CE_USEPRIMES] = false; range->openmax[CE_USEPRIMES] = false; range->min[CE_DEPENDENT] = 0; range->max[CE_DEPENDENT] = 1; range->pmin[CE_DEPENDENT] = 0; range->pmax[CE_DEPENDENT] = 1; range->openmin[CE_DEPENDENT] = false; range->openmax[CE_DEPENDENT] = false; range->min[CE_APPROXSTEP] = 0.0; range->max[CE_APPROXSTEP] = RF_INF; range->pmin[CE_APPROXSTEP] = 1e-4; range->pmax[CE_APPROXSTEP] = 1e4; range->openmin[CE_APPROXSTEP] = true; range->openmax[CE_APPROXSTEP] = true; range->min[CE_APPROXMAXGRID] = 1; range->max[CE_APPROXMAXGRID] = RF_INF; range->pmin[CE_APPROXMAXGRID] = 100; range->pmax[CE_APPROXMAXGRID] = 5e7; range->openmin[CE_APPROXMAXGRID] = false; range->openmax[CE_APPROXMAXGRID] = false; } void do_circ_embed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S){ assert(cov != NULL); assert(Getgrid(cov)); SAVE_GAUSS_TRAFO; int i, j, k, l, pos,HalfMp1[MAXCEDIM], HalfMaM[2][MAXCEDIM], index[MAXCEDIM], dim, *mm, *cumm, *halfm, // MULT added vars l, pos vdim; double invsqrtmtot, **c=NULL, **d=NULL, *dd=NULL, *res = cov->rf; // MULT *c->**c bool vfree[MAXCEDIM+1], noexception; // MULT varname free->vfree long mtot, start[MAXCEDIM], end[MAXCEDIM]; ce_storage *s = cov->Sce; location_type *loc = Loc(cov); complex *gauss1 = s->gauss1, *gauss2 = s->gauss2; if (s->stop) XERR(ERRORNOTINITIALIZED); /* implemented here only for rotationsinvariant covariance functions for arbitrary dimensions; (so it works only for even covariance functions in the sense of Wood and Chan,p. 415, although they have suggested a more general algorithm;) */ dim = cov->tsdim; mm = s->m; cumm = s->cumm; halfm = s->halfm; c = s->c; d = s->d; mtot= s->mtot; vdim = s->vdim; // so p=vdim for (i=0; i=PL_STRUCTURE) { LPRINT("Creating Gaussian variables... \n"); } /* now the Gaussian r.v. have to defined and multiplied with SQRT(FFT(c))*/ for (i=0; icur_call_odd = !(s->cur_call_odd); //printf("%d \n", (int) s->new_simulation_next); // printf("%d\n", (int) s->cur_call_odd); s->new_simulation_next = (s->new_simulation_next && s->cur_call_odd); if (s->new_simulation_next) { // MULT // martin: 13.12. check //for(k=0; k=10) { LPRINT("cumm..."); } i <<= 1; // since we have to index imaginary numbers j <<= 1; // print("ij %d %d (%d)\n", i, j, noexception); if (noexception) { // case 3 in prop 3 of W&C for(k=0; k endfor==mm[] */ k=0; if (++index[k]>HalfMaM[vfree[k]][k]) { // in case k increases the number of indices that run over 0..m increases vfree[k] = true; index[k]= 0; k++; while((kHalfMaM[vfree[k]][k])) { vfree[k] = true; index[k]= 0; k++; } if (k>=dim) break; // except the very last (new) number is halfm and the next index is // restricted to 0..halfm // then k decreases as long as the index[k] is 0 or halfm if (!vfree[k] && (index[k]==halfm[k])){//index restricted to 0..halfm? // first: index[k] is halfm? (test on ==0 is superfluent) k--; while ( (k>=0) && ((index[k]==0) || (index[k]==halfm[k]))) { // second and following: index[k] is 0 or halfm? vfree[k] = false; k--; } } } } // MULT for(k=0; kFFT)); } } // if ** simulate ** /* now we correct the result of the fastfourier transformation by the factor 1/SQRT(mtot) and read the relevant matrix out of the large vector c */ for(i=0; icur_square[i] * s->square_seg[i]; end[i] = start[i] + cumm[i] * s->nn[i]; // print("%d start=%d end=%d cur=%d max=%d seq=%d cumm=%d, nn=%d\n", // i, (int) start[i], (int) end[i], // s->cur_square[i], s->max_squares[i], // (int) s->square_seg[i], cumm[i], s->nn[i]); } long L, totpts = loc->totalpoints; // MULT /* for(l=0; lcur_call_odd)] * invsqrtmtot; res[i] += d[l][2 * j] * invsqrtmtot; for(k=0; (k= end[k]); k++) { index[k]=start[k]; } } } */ // for(k=0; kcur_call_odd)] * invsqrtmtot); } for(k=0; (k= end[k]); k++) { index[k]=start[k]; } } s->new_simulation_next = true; if (s->dependent && !(s->cur_call_odd)) { //if (s->dependent) { // if MaxStableRF calls Cutoff, c and look uninitialised k=0; while(kcur_square[k]) >= s->max_squares[k])) { s->cur_square[k++]=0; } s->new_simulation_next = k == dim; } // // print("dep=%d odd=%d squ=%d %d\n", s->dependent, s->cur_call_odd, // s->cur_square[0],s->cur_square[1]); s->stop |= s->new_simulation_next && s->d == NULL; BOXCOX_INVERSE; } int GetOrthogonalUnitExtensions(double * aniso, int dim, double *grid_ext) { int k,i,j,l,m, job=01, err, dimsq, ev0, jump, endfor; double *s=NULL, G[MAXCEDIM+1], e[MAXCEDIM], D[MAXCEDIM], *V=NULL; dimsq = dim * dim; assert(aniso != NULL); s = (double*) MALLOC(dimsq * sizeof(double)); V = (double*) MALLOC(dimsq * sizeof(double)); for (k=0; k aniso_k // s = aniso %*% aniso_k // s hat somit mindestens Eigenwert der 0 ist. //der zugeheorige EVektor wird miit der k-ten Spalte von aniso multipliziert // und ergibt dann den Korrekturfaktor for (i=0; itsdim, err=NOERROR; cov_model *key = cov->key, *next = cov->sub[0], *sub = key != NULL ? key : next; location_type *loc = Loc(cov); bool cutoff = cov->nr == CE_CUTOFFPROC_USER || cov->nr==CE_CUTOFFPROC_INTERN; if (!cutoff && cov->nr!=CE_INTRINPROC_USER && cov->nr!=CE_INTRINPROC_INTERN) BUG; // print("entering check local from %d:%s\n", cov->calling->nr, // CovList[cov->calling->nr].name); // PMI(cov); if ((err = check_ce_basic(cov)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if ((loc->timespacedim > MAXCEDIM) | (cov->xdimown > MAXCEDIM)) return ERRORDIM; if (key != NULL) { // falls nicht intern muessen die parameter runter und rauf kopiert // werden, ansonsten sind die kdefaults leer. // falls hier gelandet, wird RP*INTERN von RP* aufgerufen. // oder RP*INTERN wird Circulant aufrufen cov_model *intern = cov, *RMintrinsic = key->sub[0]; while (intern != NULL && intern->nr != CE_INTRINPROC_INTERN && intern->nr != CE_CUTOFFPROC_INTERN) { // normalerweise ->key, aber bei $ ist es ->sub[0] intern = intern->key == NULL ? intern->sub[0] : intern->key; } if (intern == NULL) { BUG; } else if (intern != cov) // cov not intern, ie user paramcpy(intern, cov, true, true, false, false, false); // i.e. INTERN else if (key->nr == CE_INTRINPROC_INTERN || key->nr == CE_CUTOFFPROC_INTERN) { // 2x intern hintereinander, d.h. es wird eine approximation durchgefuehrt paramcpy(key, cov, true, true, false, false, false); } else { //if (RMintrinsic->nr == GAUSSPROC) RMintrinsic = RMintrinsic->sub[0]; if (RMintrinsic->nr != CUTOFF && RMintrinsic->nr != STEIN) { BUG; } if (!PisNULL(LOCPROC_DIAM)) kdefault(RMintrinsic, pLOC_DIAM, P0(LOCPROC_DIAM)); if (!PisNULL(LOCPROC_R)) kdefault(RMintrinsic, pLOC_DIAM, P0(LOCPROC_R)); } if ((err = CHECK(sub, dim, dim, ProcessType, KERNEL, CARTESIAN_COORD, SUBMODEL_DEP, ROLE_GAUSS)) != NOERROR) { return err; } if (intern == cov) { // all the other parameters are not needed on the // upper levels if (PisNULL(LOCPROC_DIAM)) kdefault(cov, LOCPROC_DIAM, PARAM0(RMintrinsic, pLOC_DIAM)); } } else { if ((err = CHECK(sub, dim, 1, cutoff ? PosDefType : VariogramType, XONLY, ISOTROPIC, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { if (isDollar(next) && PARAM(next, DANISO) != NULL) { // if aniso is given then xdimprev 1 does not make sense err = CHECK(sub, dim, dim, cutoff ? PosDefType : VariogramType, XONLY, ISOTROPIC, SUBMODEL_DEP, ROLE_COV); } // if (err != NOERROR) return err; // PMI(cov, "out"); //assert(false); } } //printf("check intern end\n"); // no setbackward ?! setbackward(cov, sub); cov->vdim[0] = cov->vdim[1] = sub->vdim[0]; if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; return NOERROR; } int init_circ_embed_local(cov_model *cov, gen_storage *S){ // being here, leadin $ have already been put away // so a new $ is included below cov_model //*dummy = NULL, *key = cov->key; location_type *loc = Loc(cov); // simu_type *simu = &(cov->simu); int instance, i, d, timespacedim = loc->timespacedim, cncol = cov->tsdim, rowcol = timespacedim * cncol, err = NOERROR; localCE_storage *s=NULL; double grid_ext[MAXCEDIM], old_mmin[MAXCEDIM]; int first_instance; double *mmin = P(CE_MMIN); double sqrt2a2; bool is_cutoff = cov->nr == CE_CUTOFFPROC_INTERN; // APMI(cov); // printf("init_circ_embed_local\n");assert(false); // static pref_type pref = // {5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // CE CO CI TBM Sp di sq Ma av n mpp Hy - any ROLE_ASSERT_GAUSS; cov->method = is_cutoff ? CircEmbedCutoff : CircEmbedIntrinsic; if (loc->distances) return ERRORFAILED; NEW_STORAGE(localCE); s = cov->SlocalCE; if (loc->caniso != NULL) { if (loc->cani_ncol != loc->cani_nrow || loc->cani_ncol != timespacedim) return ERRORDIM; err = GetOrthogonalUnitExtensions(loc->caniso, timespacedim, grid_ext); if (err != NOERROR) goto ErrorHandling; } else { for (i=0; isub[0], LOCPROC_R)) kdefault(key, pLOC_DIAM, P0(LOCPROC_R)); kdefault(key, CE_FORCE, P0INT(CE_FORCE)); PARAMFREE(key, CE_MMIN); PARAMALLOC(key, CE_MMIN, cov->tsdim, 1); PCOPY(key, cov, CE_MMIN); kdefault(key, CE_STRATEGY, P0INT(CE_STRATEGY)); kdefault(key, CE_MAXGB, P0(CE_MAXGB)); kdefault(key, CE_MAXMEM, P0INT(CE_MAXMEM)); kdefault(key, CE_TOLIM, P0(CE_TOLIM)); kdefault(key, CE_TOLRE, P0(CE_TOLRE)); kdefault(key, CE_TRIALS, P0INT(CE_TRIALS)); kdefault(key, CE_USEPRIMES, P0INT(CE_USEPRIMES)); kdefault(key, CE_DEPENDENT, P0INT(CE_DEPENDENT)); // APMI(key); assert(cov->vdim[0] == cov->vdim[1]); err = CHECK(key, cov->tsdim, cov->xdimprev, GaussMethodType, cov->domown, cov->isoown, SUBMODEL_DEP, ROLE_GAUSS); if ((err < MSGLOCAL_OK && err != NOERROR) || err >=MSGLOCAL_ENDOFLIST // 30.5.13 : neu ) { // PMI(cov);AERR(err); goto ErrorHandling; } first_instance = err != NOERROR; for (d=0; dsub[0], *local; local = key->sub[0]; q = local->q; assert(err == NOERROR); for (instance = first_instance; instance < 2; instance++) { //printf("lcoal start err =%d %d\n", err, instance); //printf("model =%s instance %d %d err=%d %f %d\n", CovList[model->nr].name, // instance, first_instance, err, q[LOCAL_MSG], MSGLOCAL_OK); if (instance == 1) { if (q[LOCAL_MSG] != MSGLOCAL_OK) { if (!CovList[local->nr].alternative(local)) break; } else { if (first_instance == 0 && err != NOERROR) goto ErrorHandling; else BUG; } } else assert(instance == 0); for (d=0; dxgr[d][XLENGTH] - 1.0) * loc->xgr[d][XSTEP]); if (mmin[d] > -1.0) mmin[d] = -1.0; } } if ((err = init_circ_embed(key, S)) == NOERROR) break; } // printf("local err = %d\n", err); if (err != NOERROR) goto ErrorHandling; //printf("A end local err %d\n", err); if (cov->nr == CE_INTRINPROC_INTERN) { sqrt2a2 = SQRT(2.0 * q[INTRINSIC_A2]); // see Stein (2002) timespacedim * cncol if (loc->caniso == NULL) { if ((s->correction = MALLOC(sizeof(double)))==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } ((double *) s->correction)[0] = sqrt2a2; } else { if ((s->correction = MALLOC(sizeof(double) * rowcol))==NULL){ err = ERRORMEMORYALLOCATION; goto ErrorHandling; } double *stein_aniso = (double*) s->correction; for (i=0; icaniso[i]); stein_aniso[i] = sqrt2a2 * loc->caniso[i]; } } } else { assert(cov->nr == CE_CUTOFFPROC_INTERN); } if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) !=NOERROR) goto ErrorHandling; assert(err == NOERROR); ErrorHandling: // printf("X end local err %d\n", err); for (d=0; dfieldreturn = true; cov->origrf = false; cov->rf = cov->key->rf; cov->simu.active = err == NOERROR; return err; } int struct_ce_local(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel) { cov_model *next = cov->sub[0]; int err; bool cutoff = cov->nr == CE_CUTOFFPROC_INTERN; if (cov->role != ROLE_GAUSS) BUG; if (next->pref[cutoff ? CircEmbedCutoff : CircEmbedIntrinsic] == PREF_NONE) { return ERRORPREFNONE; } if (cov->key != NULL) COV_DELETE(&(cov->key)); if ((err = covCpy(&(cov->key), next)) != NOERROR) return err; addModel(&(cov->key), cutoff ? CUTOFF : STEIN); addModel(&(cov->key), CIRCEMBED); // crash(cov); // da durch init die relevanten dinge gesetzt werden, sollte // erst danach bzw. innerhalb von init der check zum ersten Mal //APMI(cov); return NOERROR; } void do_circ_embed_cutoff(cov_model *cov, gen_storage *S) { double *res = cov->rf; cov_model *sub = cov; for (int i=0; i<2; i++) sub = sub->key != NULL ? sub->key : sub->sub[0]; // long index[MAXCEDIM], r; location_type *loc = Loc(cov); int // k, row = loc->timespacedim, vdim =cov->vdim[0]; long totpts = loc->totalpoints; // printf("--- \n \n do_circ_embed_cutoff \n \n ---"); //PMI(sub); localCE_storage *s = sub->SlocalCE; // PMI(sub); /* printf( "\n s->is_multivariate_cutoff = %d \n", s->is_multivariate_cutoff);// printf("\n ------------- s->q[0][CUTOFF_CONSTANT] = %f, C12 = %f, C22 =%f \n ", s->q[0][CUTOFF_CONSTANT] , c12, c22);// printf("\n ------------- C11*C22 - C12*C12 = %f, \n ", c11*c22 - c12*c12);// printf("\n ------------- x[0] = %f, x[1] =%f \n ", x[0], x[1]);// printf("\n ------------- s->q[0][CUTOFF_R] = %f \n ", s->q[0][CUTOFF_R] );// */ do_circ_embed(cov->key, S); if (s->is_bivariate_cutoff) { double normal1 = GAUSS_RANDOM(1.0), normal2 = GAUSS_RANDOM(1.0), c11 = s->q[0][CUTOFF_CONSTANT], c12 = s->q[1][CUTOFF_CONSTANT], c22 = s->q[3][CUTOFF_CONSTANT], x[2]; if (c22*c11 - c12*c12 < 0 ) ERR("\n Cannot simulate field with cutoff, matrix of constants is not pos def \n "); x[0] = SQRT( -c11)*normal1 ; x[1] = -c12/SQRT(-c11)*normal1 + SQRT(-c22 + c12*c12/c11 )*normal2; if (GLOBAL.general.vdim_close_together) { //one location two values for (int i = 0; i < totpts; i++) { for (int j = 0; j < vdim; j++) { res[i*vdim + j] += x[j]; } } } else { // the first field, the second field for (int j = 0; j < vdim; j++) { for (int i = 0; i < totpts; i++) { res[i+j*totpts] += x[j]; } } } } } void kappa_localproc(int i, cov_model *cov, int *nr, int *nc){ kappaGProc(i, cov, nr, nc); if (i == CE_MMIN) *nr = 0; // $(proj=1) ->intrinsicinternal as $ copies the parameters // to intrinsicinternal and at the same time proj=1 reduces // the tsdim } void range_co_proc(cov_model *cov, range_type *range){ range_ce(cov, range); range->min[LOCPROC_DIAM] = 0.0; // CUTOFF_DIAM range->max[LOCPROC_DIAM] = RF_INF; range->pmin[LOCPROC_DIAM] = 1e-10; range->pmax[LOCPROC_DIAM] = 1e10; range->openmin[LOCPROC_DIAM] = true; range->openmax[LOCPROC_DIAM] = true; range->min[LOCPROC_A] = 0.0; // cutoff_a range->max[LOCPROC_A] = RF_INF; range->pmin[LOCPROC_A] = 0.5; range->pmax[LOCPROC_A] = 2.0; range->openmin[LOCPROC_A] = true; range->openmax[LOCPROC_A] = true; } void range_intrinCE(cov_model *cov, range_type *range) { range_ce(cov, range); range->min[LOCPROC_DIAM] = 0.0; // CUTOFF_DIAM range->max[LOCPROC_DIAM] = RF_INF; range->pmin[LOCPROC_DIAM] = 0.01; range->pmax[LOCPROC_DIAM] = 100; range->openmin[LOCPROC_DIAM] = true; range->openmax[LOCPROC_DIAM] = true; range->min[LOCPROC_R] = 1.0; // stein_r range->max[LOCPROC_R] = RF_INF; range->pmin[LOCPROC_R] = 1.0; range->pmax[LOCPROC_R] = 20.0; range->openmin[LOCPROC_R] = false; range->openmax[LOCPROC_R] = true; } void do_circ_embed_intr(cov_model *cov, gen_storage *S) { cov_model *key = cov->key; assert(key != NULL); location_type *loc = Loc(cov); double x[MAXCEDIM], dx[MAXCEDIM], *res = cov->rf; long index[MAXCEDIM], r; int i, l, k, row = loc->timespacedim, col = cov->tsdim, rowcol = row * col; localCE_storage *s = cov->SlocalCE; SAVE_GAUSS_TRAFO; do_circ_embed(key, S); for (k=0; kcorrection; if (loc->caniso == NULL) { for (l=0; lxgr[k][XSTEP]; for(r=0; ; ) { for (k=0; k=loc->xgr[k][XLENGTH])) { index[k]=0; x[k] = 0.0; k++; } if (k>=row) break; x[k] += dx[k]; } BOXCOX_INVERSE; } int struct_ce_approx(cov_model *cov, cov_model **newmodel) { assert(cov->nr==CE_CUTOFFPROC_INTERN || cov->nr==CE_INTRINPROC_INTERN || cov->nr==CIRCEMBED); cov_model *next = cov->sub[0]; bool cutoff = cov->nr == CE_CUTOFFPROC_INTERN; if (next->pref[cov->nr==CIRCEMBED ? CircEmbed : cutoff ? CircEmbedCutoff : CircEmbedIntrinsic] == PREF_NONE) { return ERRORPREFNONE; } //PMI(cov); if (cov->role != ROLE_GAUSS) BUG; // assert(!Getgrid(cov)); if (!Getgrid(cov)) { ASSERT_NEWMODEL_NULL; location_type *loc = Loc(cov); double max[MAXCEDIM], min[MAXCEDIM], centre[MAXCEDIM], x[3 * MAXCEDIM], approx_gridstep = P0(CE_APPROXSTEP); int k, d, len, err, maxgridsize = P0INT(CE_APPROXMAXGRID), spatialdim = loc->spatialdim; if (approx_gridstep < 0) SERR("approx_step < 0 forbids approximative circulant embedding"); if (cov->xdimown != loc->timespacedim) SERR("the dimensions of the coordinates and those of the process differ"); GetDiameter(loc, min, max, centre); if (loc->Time) { if (loc->T[XLENGTH] > maxgridsize) SERR("temporal grid too long"); maxgridsize /= loc->T[XLENGTH]; } if (ISNA(approx_gridstep)) { // hier assert(false); double size = loc->spatialtotalpoints * 3; if (size > maxgridsize) size = maxgridsize; for (k=d=0; d maxgridsize) SERR("userdefined, approximate grid is too large"); } if (cov->key!=NULL) COV_DELETE(&(cov->key)); err = covCpy(&(cov->key), cov, x, loc->T, spatialdim, spatialdim, 3, loc->Time, true, false); if (err != NOERROR) return err; cov->key->calling = cov; if ((err = CHECK(cov, cov->tsdim, cov->xdimprev, cov->typus, cov->domprev, cov->isoprev, cov->vdim[0], cov->role) ) != NOERROR) return err; } if (cov->nr == CIRCEMBED) return NOERROR; else return struct_ce_local(Getgrid(cov) ? cov : cov->key, newmodel); } int init_ce_approx(cov_model *cov, gen_storage *S) { // printf("\ninit_ce_approx : %d %d\n", Getgrid(cov), cov->nr==CIRCEMBED); if (Getgrid(cov)) { int ans = cov->nr==CIRCEMBED ? init_circ_embed(cov, S) : init_circ_embed_local(cov, S); // printf("ans = %d\n", ans); BUG; return ans; } ROLE_ASSERT_GAUSS; location_type *loc = Loc(cov), *keyloc = Loc(cov->key); assert(cov->key != NULL && keyloc != NULL); long i, cumgridlen[MAXCEDIM], totspatialpts = loc->spatialtotalpoints; int d, err, // maxgridsize = P0INT(CE_APPROXMAXGRID), spatialdim = loc->spatialdim, tsdim = loc->timespacedim; if (cov->xdimown != tsdim) SERR("dimensions of the coordinates and those of the process differ"); cov->method = cov->nr==CIRCEMBED ? CircEmbed : cov->nr== CE_CUTOFFPROC_INTERN ? CircEmbedCutoff : CircEmbedIntrinsic; if (loc->distances) return ERRORFAILED; NEW_STORAGE(approxCE); ALLOC_NEWINT(SapproxCE, idx, totspatialpts, idx); cumgridlen[0] = 1; for (d=1; dxgr[d-1][XLENGTH]; } double *xx = loc->x; for (i=0; ixgr[d][XSTART]) / keyloc->xgr[d][XSTEP]); } idx[i] = dummy; assert(dummy >= 0); } if ((err = cov->nr==CIRCEMBED ? init_circ_embed(cov->key, S) : init_circ_embed_local(cov->key, S)) != NOERROR) return err; if ((err = FieldReturn(cov)) != NOERROR) return err; cov->key->initialised = cov->simu.active = err == NOERROR; return NOERROR; } void do_ce_approx(cov_model *cov, gen_storage *S){ if (Getgrid(cov)) { if (cov->nr==CIRCEMBED) do_circ_embed(cov, S); else if (cov->nr== CE_CUTOFFPROC_INTERN) do_circ_embed_cutoff(cov, S); else do_circ_embed_intr(cov, S); return; } // PMI(cov); cov_model *key=cov->key; location_type *loc = Loc(cov); approxCE_storage *s = cov->SapproxCE; //cov_model *cov = meth->cov; long i; int vdim = cov->vdim[0], *idx = s->idx; double *res = cov->rf, *internalres = key->rf; // APMI(key); DO(key, S); location_type *key_loc = Loc(key); if (key_loc->Time) { // time separately given long t, j = 0, instances = (long) loc->T[XLENGTH], totspatialpts = loc->spatialtotalpoints, gridpoints = Loc(key)->spatialtotalpoints; for (int v=0; vtotalpoints; int j = 0, totalkey = Loc(key)->totalpoints; for (int v=0; vx[i], idx[i]); // print(" %d %d %f %f", i, idx[i], loc->x[i*2], loc->x[i*2 +1]); // print(" %f\n", internalres[idx[i]]); res[j++] = internalres[idx[i]]; } } } } RandomFields/src/startGetNset.cc0000644000176200001440000015462713074763020016367 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de (library for simulation of random fields) Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. RO This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include //#include #include #include #include "RF.h" #include "primitive.h" #include "Operator.h" #include "variogramAndCo.h" void addkappa(int i, const char *n, SEXPTYPE t) { cov_fct *C = CovList + currentNrCov - 1; // if (ParamType != 7) printf("%s %s %d\n", C->name, n, ParamType); assert(n[0] != '\0' && (n[0] != ONEARGUMENT_NAME || n[1] != '\0') // reserved for standard parameter names && (n[0] != DEFAULT_SUBNAME || (n[1] != '\0' && (n[1] < '1' || n[1] > '9'))) // reserved for standard submodel names ); assert(i < C->kappas); // assert(STRCMP(n, ELEMENT) || C->check == checkfix || C->check == checkmixed); strcopyN(C->kappanames[i], n, PARAMMAXCHAR); C->kappatype[i] = t; assert(STRCMP(n, FREEVARIABLE) || C->internal); // if (t >= LISTOF) assert(STRCMP(C->kappanames[0], ELEMENT) == 0 // || C->check == checkselect // ); } void kappanames(const char* n1, SEXPTYPE t1) { assert({cov_fct *C = CovList + currentNrCov - 1; C->kappas == 1;}); addkappa(0, n1, t1); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2) { assert({cov_fct *C = CovList + currentNrCov - 1; C->kappas == 2;}); addkappa(0, n1, t1); addkappa(1, n2, t2); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3) { assert({cov_fct *C = CovList + currentNrCov - 1; C->kappas == 3;}); addkappa(0, n1, t1); addkappa(1, n2, t2); addkappa(2, n3, t3); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 4;}); addkappa(0, n1, t1); addkappa(1, n2, t2); addkappa(2, n3, t3); addkappa(3, n4, t4); } void kappanamesX(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5) { addkappa(0, n1, t1); addkappa(1, n2, t2); addkappa(2, n3, t3); addkappa(3, n4, t4); addkappa(4, n5, t5); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 5;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 6;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); addkappa(5, n6, t6); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7) { assert({ cov_fct *C = CovList + currentNrCov - 1; C->kappas == 7;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); addkappa(5, n6, t6); addkappa(6, n7, t7); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 8;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); addkappa(5, n6, t6); addkappa(6, n7, t7); addkappa(7, n8, t8); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 9;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); addkappa(5, n6, t6); addkappa(6, n7, t7); addkappa(7, n8, t8); addkappa(8, n9, t9); } void kappanamesX(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10) { kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5); addkappa(5, n6, t6); addkappa(6, n7, t7); addkappa(7, n8, t8); addkappa(8, n9, t9); addkappa(9, n10, t10); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 10;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11) { assert({ cov_fct *C = CovList + currentNrCov - 1; C->kappas == 11;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); addkappa(10, n11, t11); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 12;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); addkappa(10, n11, t11); addkappa(11, n12, t12); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12, const char* n13, SEXPTYPE t13) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 13;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); addkappa(10, n11, t11); addkappa(11, n12, t12); addkappa(12, n13, t13); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12, const char* n13, SEXPTYPE t13, const char* n14, SEXPTYPE t14) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 14;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); addkappa(10, n11, t11); addkappa(11, n12, t12); addkappa(12, n13, t13); addkappa(13, n14, t14); } void kappanamesX(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12, const char* n13, SEXPTYPE t13, const char* n14, SEXPTYPE t14, const char* n15, SEXPTYPE t15) { kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10); addkappa(10, n11, t11); addkappa(11, n12, t12); addkappa(12, n13, t13); addkappa(13, n14, t14); addkappa(14, n15, t15); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12, const char* n13, SEXPTYPE t13, const char* n14, SEXPTYPE t14, const char* n15, SEXPTYPE t15) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 15;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10, n11, t11, n12, t12, n13, t13, n14, t14, n15, t15); } void kappanames(const char* n1, SEXPTYPE t1, const char* n2, SEXPTYPE t2, const char* n3, SEXPTYPE t3, const char* n4, SEXPTYPE t4, const char* n5, SEXPTYPE t5, const char* n6, SEXPTYPE t6, const char* n7, SEXPTYPE t7, const char* n8, SEXPTYPE t8, const char* n9, SEXPTYPE t9, const char* n10, SEXPTYPE t10, const char* n11, SEXPTYPE t11, const char* n12, SEXPTYPE t12, const char* n13, SEXPTYPE t13, const char* n14, SEXPTYPE t14, const char* n15, SEXPTYPE t15, const char* n16, SEXPTYPE t16) { assert({ cov_fct *C = CovList + currentNrCov - 1;C->kappas == 16;}); kappanamesX(n1, t1, n2, t2, n3, t3, n4, t4, n5, t5, n6, t6, n7, t7, n8, t8, n9, t9, n10, t10, n11, t11, n12, t12, n13, t13, n14, t14, n15, t15); addkappa(15, n16, t16); } sortsofparam SortOf(cov_model *cov,int k, int row, int col) { cov_fct *C = CovList + cov->nr; if (C->sortof != NULL) return C->sortof(k, row, col); // for MLE // k non-negative: k-th parameter // k negative: (i-1)th submodel if (k >= C->kappas) BUG; return k<0 ? VARPARAM : C->sortof_tab[k]; // k<0: varparam used to indicate that variance is allowed for submodel, // see recursive call getnaposition; E.g. not allowed for second submodel // of nsst: the variance parameter is something between scale and variance } void change_sortof(int i, sortsofparam sort) { cov_fct *C = CovList + currentNrCov - 1; assert(i >= 0 && i < C->kappas); C->sortof_tab[i] = sort; } void change_typeof(int i, Types type) { cov_fct *C = CovList + currentNrCov - 1; assert(i >= 0 && i < C->kappas); assert(type == RandomType || // parameter might be random type == ShapeType || // parameter must be determinist type == RandomOrShapeType || (type >= NN1 && type <= NN4)); C->kappaParamType[i] = type; } void add_sortof(sortof_fct sortof) { cov_fct *C = CovList + currentNrCov - 1; C->sortof = sortof; } void addsub(int i, const char *n) { cov_fct *C = CovList + currentNrCov - 1; int j; assert(n[0] != ONEARGUMENT_NAME && n[0] != DEFAULT_SUBNAME); assert(i < MAXSUB); strcopyN(C->subnames[i], n, PARAMMAXCHAR); C->subintern[i] = false; for (j=0; jkappas; j++) { if (C->kappanames[j] == NULL) ERR("give all names for the parameters first"); if ((C->subintern[i] = STRCMP(C->kappanames[j], C->subnames[i]) == 0)) break; } } void subnames(const char* n1) { addsub(0, n1); } void subnames(const char* n1, const char* n2) { addsub(0, n1); addsub(1, n2); } void subnames(const char* n1, const char* n2, const char* n3) { addsub(0, n1); addsub(1, n2); addsub(2, n3); } void subnames(const char* n1, const char* n2, const char* n3, const char* n4) { addsub(0, n1); addsub(1, n2); addsub(2, n3); addsub(3, n4); } void subnames(const char* n1, const char* n2, const char* n3, const char* n4, const char* n5) { addsub(0, n1); addsub(1, n2); addsub(2, n3); addsub(3, n4); addsub(4, n5); } void subnames(const char* n1, const char* n2, const char* n3, const char* n4, const char* n5, const char* n6) { addsub(0, n1); addsub(1, n2); addsub(2, n3); addsub(3, n4); addsub(4, n5); addsub(5, n6); } int xxx(int x) {return (int) POW(10, (double) x);} void crash() { #ifdef SCHLATHERS_MACHINE // int i;PRINTF("%d\n", i);char m[1];m[i] = m[i-9] + 4; if (m[0]) i++; else i--; PRINTF("%s\n", m); // not MEMCOPY // int *x = (int*) MALLOC(1000000); f ree(x); f ree(x); x[100] = 100; #else BUG; #endif } void ErrCovX(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double VARIABLE_IS_NOT_USED *v, const char *name) { // PRINTF("\nErr%s %s [%d] gatter=%d:\n", name, NICK(cov), cov->nr, cov->gatternr); // ok if (PL >= PL_ERRORS){ PMI(cov);// crash(); } ERR("unallowed or undefined call of function"); } void ErrCov(double *x, cov_model *cov, double *v) { ErrCovX(x, cov, v, "Cov");} void ErrD(double *x, cov_model *cov, double *v) { ErrCovX(x, cov, v, "D");} void ErrRnd(double *x, cov_model *cov, double *v) { ErrCovX(x, cov, v, "Rnd");} void ErrLogCov(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double VARIABLE_IS_NOT_USED *v, double VARIABLE_IS_NOT_USED *Sign) { // PRINTF("\nErrlogCov %s:\n", NICK(cov)); if (PL >= PL_ERRORS) { PMI(cov);// crash(); } ERR("unallowed or undefined call of function (log)"); } void ErrCovNonstat(double VARIABLE_IS_NOT_USED *x, double VARIABLE_IS_NOT_USED *y, cov_model *cov, double VARIABLE_IS_NOT_USED *v) { PRINTF("\nErrCovNonstat %s: (%d)\n", NICK(cov), cov->nr); // APMI(cov->calling); if (PL >= PL_ERRORS) { PMI(cov->calling); // crash(); } ERR1("unallowed or undefined call of '%s' as a kernel", NAME(cov)); } void ErrLogCovNonstat(double VARIABLE_IS_NOT_USED *x, double VARIABLE_IS_NOT_USED *y, cov_model *cov, double VARIABLE_IS_NOT_USED *v, double VARIABLE_IS_NOT_USED *Sign) { PRINTF("\nErrlogCovNonstat %s: (%d)\n", NICK(cov), cov->nr); if (PL >= PL_ERRORS) { PMI(cov->calling);// crash(); } ERR1("unallowed or undefined call of '%s' (log) as a kernel", NAME(cov)); } void Errspectral(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s, double VARIABLE_IS_NOT_USED *e) { PRINTF("\nErrlogCovNonstat %s: (%d)\n", NICK(cov), cov->nr); if (PL >= PL_ERRORS) { PMI(cov->calling);// crash(); } ERR("unallowed or undefined call of spectral function"); } void ErrInverseNonstat(double VARIABLE_IS_NOT_USED *v, cov_model *cov, double *x, double *y) { x[0] = y[0] = RF_NAN; return; PRINTF("\nErrCovNonstat %s: (%d)\n", NICK(cov), cov->nr); // APMI(cov->calling); if (PL >= PL_ERRORS) { PMI(cov->calling); // crash(); } ERR("unallowed or undefined call of non-domain function (inverse)"); } void ErrInverse(double VARIABLE_IS_NOT_USED *v, cov_model VARIABLE_IS_NOT_USED *cov, double *x) { x[0] = RF_NAN; return; } char InternalName[]="-"; void kappasize1(int VARIABLE_IS_NOT_USED i, cov_model VARIABLE_IS_NOT_USED *cov, int *nrow, int *ncol) { *nrow = *ncol = 1; } void rangeOK(cov_model VARIABLE_IS_NOT_USED *cov, range_type VARIABLE_IS_NOT_USED *range) { // printf("rangeOK %s\n", NAME(cov)); assert(CovList[cov->nr].kappas == 0); } int structOK(cov_model VARIABLE_IS_NOT_USED *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){ return NOERROR;} int struct_statiso(cov_model *cov, cov_model **newmodel) { cov_fct *C = CovList + cov->nr; // printf("struct_statiso %s role=%s\n", NICK(cov), ROLENAMES[cov->role]); ASSERT_NEWMODEL_NOT_NULL; if (hasAnyShapeRole(cov)) { int i, vdim = cov->vdim[0]; for (i=0; impp.maxheights[i] = 1.0; } switch (cov->role) { case ROLE_POISSON_GAUSS : SERR1("Unexpected call of 'struct' by '%s'", NICK(cov)); break; case ROLE_POISSON : if (C->finiterange == true) { return addUnifModel(cov, 1.0, newmodel); } else SERR2("The function '%s' has inifinite support use '%s' to truncate the support.", NICK(cov), CovList[TRUNCSUPPORT].nick); break; // case MAX_STABLE : to do: numerisch die Funktion integrieren default : ILLEGAL_ROLE_STRUCT; } return NOERROR; } int struct_failed(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel) { // PMI(cov); // printf("%ld %ld %ld\n", CovList[cov->nr].Struct, CovList[DISTRIBUTION].Struct, struct_failed); crash(); SERR4("initialization failed -- model '%s' (%d) does not fit (yet) the properties required by '%s'. %s", NICK(cov), cov->nr, cov->calling == NULL ? "" : NICK(cov->calling), cov->secondarygatternr == MISMATCH ? "" : "NOTE THAT THE ERROR CAN ALSO BE CAUSED BY COORDINATE TRANSFORMATION\n" ); } int initOK(cov_model *cov, gen_storage *s) { cov_fct *C = CovList + cov->nr; // nicht gatternr int i, err = NOERROR, nk = C->kappas; bool random = false; for (i=0; ikappasub[i]; if (ks != NULL) { if (isRandom((Types) C->kappaParamType[i])) { random = true; if ((err = INIT(ks, cov->mpp.moments, s)) != NOERROR) return err; } else { SERR2("%s : parameter %s is not of random type", NICK(cov), C->kappanames[i]); } } } if (random) SERR("'initOK' not programmed yet for 'random'"); return err; } int init_failed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { if (PL >= PL_ERRORS) PRINTF("init failed cov=%s:\n", NICK(cov)); SERR("Init failed. Compound Poisson fields are essentially only programmed for simple and isotropic shape functions (not kernels)"); return ERRORFAILED; } int init_statiso(cov_model *cov, gen_storage *s) { // only domain and isotropic models cov_fct *C = CovList + cov->nr; // nicht gatternr int err; if (cov->finiterange == true) { if (C->finiterange == true) { // ?? to do ?? // cov->mpp.refradius = 1.0; // jetzt ueber Inverse abgefangen } } if ((err = initOK(cov, s)) == NOERROR) return err; if (cov->role == ROLE_POISSON) { return NOERROR; } if (PL >= PL_ERRORS) PRINTF("init failed cov=%s:\n", NICK(cov)); // PMI(cov); SERR("Call of init: Compound Poisson fields are essentially only programmed for domain and isotropic functions"); return NOERROR; } void doOK(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s){ } void do_failed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { //PMI(cov->calling); if (PL >= PL_ERRORS) PRINTF("do failed for %s:\n", NICK(cov)); ERR("call of do: compound Poisson fields are essentially only programmed for isotropic shape functions (not kernels)"); } void do_random_failed(cov_model *cov, double VARIABLE_IS_NOT_USED *v) { if (PL >= PL_ERRORS) PRINTF("do_random failed for %s:\n", NICK(cov)); ERR("Call of do: Compound Poisson fields are essentially only programmed for isotropic shape functions (not kernels)"); } void do_random_ok(cov_model VARIABLE_IS_NOT_USED *cov, double VARIABLE_IS_NOT_USED *v) { } void do_statiso(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { if (cov->role == ROLE_POISSON || cov->role == ROLE_MAXSTABLE) return; if (PL >= PL_ERRORS) { // PMI(cov); PRINTF("do_statosp failed for '%s' and role='%s':\n", NICK(cov), ROLENAMES[cov->role]); if (PL >= PL_ERRORS) ERR("Call of do_statiso: compound Poisson fields are essentially only programmed for isotropic shape functions (not kernels)"); } } static int badname = -1; void nickname(const char *name, int nr, int type) { char dummy[MAXCHAR]; cov_fct *C = CovList + nr; // nicht gatternr int sl = STRLEN(CAT_TYPENAMES[type]); strcopyN(dummy, name, MAXCHAR-sl); //printf("%s %s\n", CAT_TYPENAMES[type], dummy); SPRINTF(C->nick, "%s%s", CAT_TYPENAMES[type], dummy); STRCPY(CovNickNames[nr], C->nick); if ((int) STRLEN(name) >= (int) MAXCHAR - sl) { badname = nr; } else { if (badname >= 0 && badname != nr) PRINTF("Warning! Nick name is truncated to '%s'.\n", CovList[badname].nick); badname = -1; } } void insert_name(int curNrCov, const char *name, int type) { cov_fct *C = CovList + curNrCov; char dummy[MAXCHAR]; strcopyN(dummy, name, MAXCHAR); STRCPY(CovNames[curNrCov], dummy); STRCPY(C->name, dummy); if (STRLEN(name)>=MAXCHAR) { PRINTF("Warning! Covariance name is truncated to '%s'.\n", C->name); } assert(STRCMP(InternalName, name)); nickname(name, curNrCov, type); } void StandardCovariance(cov_model *cov, double *v){ CovVario(cov, true, false, v); } void StandardCovMatrix(cov_model *cov, double *v) { CovarianceMatrix(cov, v); } void StandardInverseCovMatrix(cov_model *cov, double *inverse, double *det) { InverseCovMatrix(cov, inverse, det); } void StandardVariogram(cov_model *cov, double *v) { //assert(false); CovVario(cov, false, false, v); } void StandardPseudoVariogram(cov_model *cov, double *v) { CovVario(cov, false, true, v); } void StandardInverseNonstat(double *v, cov_model *cov, double *left, double *right) { assert(CovList[cov->nr].inverse != NULL); double x; int d, dim = cov->tsdim; // !! und nicht cov->xdimown, xdimprev !! INVERSE(v, cov, &x); for (d=0; dnr].inverse != NULL); double x, w = EXP(*v); int d, dim = cov->tsdim; // PMI(cov); printf("%d %d\n", dim, cov->tsdim); INVERSE(&w, cov, &x); for (d=0; d 1, just take the first component. // Of course also mea over all components might be passible as well #define step 2.0 #define tol 1e-8 #define max_it 30 if (cov->vdim[0] != cov->vdim[1]) BUG; int vdim = cov->vdim[0], vdimSq = vdim * vdim; if (cov->Sinv == NULL) NEW_STORAGE(inv); ALLOC_NEW(Sinv, v, vdimSq, v); ALLOC_NEW(Sinv, wert, vdimSq, wert); double left, right, middle, leftinverse, x = 0.0, u = *U; bool greater; int i; COV(&x, cov, v); greater = *v > u; *wert = *v; x = step; for (i=0; i= u)) break; x *= step; } if (i >= max_it) { *inverse = FABS(*v - u) <= FABS(*wert - u) ? 0.0 : RF_INF; return; } *inverse = *wert; right = x; left = x == step ? 0 : x / step; for (i=0; i= u)) { right = middle; } else { left = middle; leftinverse = *wert; } } *inverse = leftinverse == u ? left : right; // if (PL > 1) {PMI(cov); PRINTF("inverse: %f -> %f\n", u, *inverse);} } void InverseIsoMon(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double VARIABLE_IS_NOT_USED *v){ searchInverse(CovList[cov->nr].cov, cov, 1.0, *x, 0.001); } void createmodel(const char *name, Types type, int kappas, size_fct kappasize, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, int vdim, pref_shorttype pref, int maxdim, ext_bool finiterange, int monotone) { cov_fct *C = CovList + currentNrCov; bool stat_iso = domain == XONLY && isotropy == ISOTROPIC; assert(domain >= 0 && isotropy >= 0); if (currentNrCov==-1) InitModelList(); assert(CovList!=NULL); assert(currentNrCov>=0); if (currentNrCov>=MAXNRCOVFCTS) { char msg[150]; SPRINTF(msg, "maximum number of covariance models reached. Last included model is '%s'.", CovList[MAXNRCOVFCTS-1].name); ERR(msg); } if (PL >= PL_DETAILS) PRINTF("%d %s vdim=%d statiso=%d iso=%d\n", currentNrCov, name, vdim, stat_iso, isotropy); C->TypeFct = NULL; assert(type >=0 && type <= OtherType); assert((isotropy >= 0 && (isotropy != ISO_MISMATCH || type == RandomType)) || type == MathDefinition); C->Typi[0] = type; // ganz vorne // printf("%d %s vdim=%d statiso=%d iso=%d\n", currentNrCov, name, vdim, stat_iso, isotropy); // printf("type = %d\n", type); C->Isotropy[0] = isotropy; C->variants = 1; if ((finiterange == true && isPosDef(type) && vdim == SCALAR) || monotone == COMPLETELY_MON) { C->Isotropy[C->variants] = SPHERICAL_ISOTROPIC; C->Typi[C->variants] = PosDefType; C->variants++; //printf("name %s\n", name); } insert_name(currentNrCov, name, type); //if (domain == PARAM_DEP) printf("%s\n", C->nick); // nachfolgendes unbedingt lassen, da sonst vor Aufruf von Interface // reduzierende Gatter gesetzt werden koennten assert(type != InterfaceType || (domain == XONLY && isotropy==UNREDUCED)); C->kappas = kappas; assert(kappas >= 0 && kappas <= MAXPARAM); C->minsub = C->maxsub = 0; C->domain = domain; C->vdim = vdim; assert(vdim != MISMATCH); // if (vdim == SUBMODEL_DEP) printf("SUBMODELDEP %s\n", name); // if (vdim == PREVMODEL_DEP) printf("prevMODELDEP %s\n", name); C->maxdim = maxdim; C->maxmoments = 0; assert(maxdim != MISMATCH); for (int i=0; ikappanames[i], "%c%d", ONEARGUMENT_NAME, i); // default (repeated twice) C->kappatype[i] = REALSXP; } C->kappasize = (kappasize == NULL) ? kappasize1 : kappasize; C->sortof = NULL; if (isProcess(type)) { // UNBEDEINGT BIS ZUM SCHLUSS LAUFEN LASSEN, DA VERDECKTE PARAMTER for (int i=0; isortof_tab[i] = FORBIDDENPARAM; } else { for (int i=0; isortof_tab[i] = ANYPARAM; } if (type == MathDefinition) for (int i=0; ikappaParamType[i] = ShapeType; else for (int i=0; ikappaParamType[i] = RandomType; if (kappas==0) { assert(range == NULL); C->range=rangeOK; } else { assert(range != NULL); C->range= range; } C->check = check; assert(check != NULL); for (int i=0; iimplemented[i++] = NOT_IMPLEMENTED); C->internal = false; C->Specific = MISMATCH; assert(finiterange != MISMATCH); assert(finiterange != PARAM_DEP || check==checktbmop); C->finiterange = finiterange; assert(monotone != MISMATCH || (monotone == MISMATCH && (type==RandomType || type== PointShapeType || type== InterfaceType || type== GaussMethodType || type== BrMethodType || type==ProcessType))); // assert(monotone != PARAM_DEP); C->Monotone = monotone; C->ptwise_definite = !isShape(type) && type != MathDefinition ? pt_mismatch : isTcf(type) || isBernstein(monotone) || (isVariogram(type) && isMonotone(monotone) && C->vdim == 1) ? pt_posdef : pt_unknown; MEMCOPY(C->pref, pref, sizeof(pref_shorttype)); C->cov = ErrCov; C->logD = C->D = C->D2 = C->D3 = C->D4 =C->tbm2 = C->nabla = C->hess = ErrD; C->random = ErrRnd; C->inverse = finiterange == true ? InverseFiniteRange : stat_iso ? InverseIsotropic : ErrInverse; C->nonstat_inverse = C->nonstat_loginverse = C->nonstat_inverse_D = ErrInverseNonstat; C->density = MISMATCH; C->log = ErrLogCov; C->F_derivs = C->RS_derivs = isProcess(type) ? 0 : MISMATCH; C->nonstat_cov = C->nonstat_D = C->nonstat_random = ErrCovNonstat; C->nonstatlog = ErrLogCovNonstat; C->aux_cov = NULL; C->coinit = C->ieinit = NULL; C->alternative = NULL; C->spectral=Errspectral; C->drawmix = NULL; C->logmixdens = NULL; // if (isVariogram(type) || isShape(type) || // type == MathDefinition) C->logD = standard_likelihood; C->Struct = stat_iso ? struct_statiso : struct_failed; C->Init = stat_iso ? init_statiso : init_failed; // !!!! see isDummyInit below // printf("%s failed=%d\n", C->nick, !stat_iso); C->Do = stat_iso ? do_statiso : do_failed; C->DoRandom = do_random_failed; C->minmaxeigenvalue = NULL; C->hyperplane=NULL; C->primitive = true; C->covariance = StandardCovariance; C->covmatrix = StandardCovMatrix; C->inversecovmatrix = StandardInverseCovMatrix; C->variogram = StandardVariogram; C->pseudovariogram = StandardPseudoVariogram; C->is_covariance=C->is_covmatrix=C->is_inversecovmatrix=C->is_variogram = C->is_pseudovariogram = isFalse; C->TaylorN = C->TailN = MISMATCH; // printf("%s %s (%s)\n", C->name, TYPENAMES[C->Typi[0]], TYPENAMES[type]); currentNrCov++; } bool isDummyInit(initfct Init) { return Init == init_statiso || Init == init_failed; } int CopyModel(const char *name, int which) { MEMCOPYX(CovList + currentNrCov, CovList + which, sizeof(cov_fct)); int type = CovList[which].Typi[0]; assert(type <= OtherType); insert_name(currentNrCov, name, type); currentNrCov++; return currentNrCov - 1; } int CopyModel(const char *name, int which, Types type) { CopyModel(name, which); int nr = currentNrCov - 1; assert(CovList[nr].variants == 1); CovList[nr].Typi[0] = type; return nr; } int CopyModel(const char *name, int which, checkfct check) { CopyModel(name, which); int nr = currentNrCov - 1; CovList[nr].check = check; return nr; } /* int CopyModel(const char *name, int which, checkfct check) { CopyModel(name, which); int nr = currentNrCov - 1; CovList[nr].check = check; } */ void nickname(const char *name) { int nr = currentNrCov - 1; int type = CovList[nr].Typi[0]; assert(type <= MathDefinition); nickname(name, nr, type); } int IncludePrim(const char *name, Types type, int kappas, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, NULL, domain, isotropy, check, range, SCALAR, PREF_ALL, maxdim, finiterange, monotonicity); return currentNrCov - 1; } int IncludePrim(const char *name,Types type, int kappas, size_fct kappasize, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, kappasize, domain, isotropy, check, range, SCALAR, PREF_ALL, maxdim, finiterange, monotonicity); return currentNrCov - 1; } int IncludePrim(const char *name, Types type, int kappas, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, int vdim, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, NULL, domain, isotropy, check, range, vdim, PREF_ALL, maxdim, finiterange, monotonicity); return currentNrCov - 1; } int IncludePrim(const char *name,Types type, int kappas, size_fct kappasize, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, int vdim, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, kappasize, domain, isotropy, check, range, vdim, PREF_ALL, maxdim, finiterange, monotonicity); return currentNrCov - 1; } int IncludePrim(const char *name,Types type, int kappas, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, pref_type pref, int vdim, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, NULL, domain, isotropy, check, range, vdim, pref, maxdim, finiterange, monotonicity); return currentNrCov - 1; } int IncludePrim(const char *name,Types type, int kappas, size_fct kappasize, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, pref_type pref, int vdim, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, kappasize, domain, isotropy, check, range, vdim, pref, maxdim, finiterange, monotonicity); return currentNrCov - 1; } void make_internal() { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr C->internal = true; } // extern ?! int IncludeModel(const char *name, Types type, int minsub, int maxsub, int kappas, size_fct kappasize, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, pref_type pref, int internal, int vdim, int maxdim, ext_bool finiterange, int monotonicity) { createmodel(name, type, kappas, kappasize, domain, isotropy, check, range, vdim, pref, maxdim, finiterange, monotonicity); // assert(maxsub > 0); // check deleted 25. nov 2008 due to nugget // printf("name = %s\n", name); assert(isotropy != PREVMODELI || maxsub != 0 || type == MathDefinition || STRCMP("trend", name) == 0 || STRCMP("U", name) == 0 || STRCMP("whittle", name) == 0 || STRCMP("matern", name) == 0 || STRCMP("idcoord", name) == 0 || STRCMP("constant", name) == 0); assert(maxsub >= minsub && maxsub <= MAXSUB); assert(check != checkOK || maxsub==0); int i, nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr C->minsub = minsub; C->maxsub = maxsub; /* if (maxsub == 0) printf("not primitive: %s \n", name); // not primitive: biWM not primitive: constant not primitive: epsC not primitive: matern not primitive: nugget not primitive: trend not primitive: whittle (and others?) */ assert(minsub <= maxsub); if (PL>=PL_SUBDETAILS && maxsub == 0) PRINTF("note: %s has no submodels\n", C->name); C->primitive = false; // muss falls sein, sonst wird kappacheck // aufgerufen C->internal = internal; // if (internal) printf("internal: %s %s\n", C->nick, C->name); if (maxsub <= 2) { if (maxsub >= 1) { addsub(0, "phi"); if (maxsub >= 2) { addsub(1, "psi"); } } } else { for (i=0; isubnames[i], "C%d", i); // default (repeated twice) C->subintern[i] = false; } } return nr; } int IncludeModel(const char *name, Types type, int minsub, int maxsub, int kappas, domain_type domain, isotropy_type isotropy, checkfct check, rangefct range, pref_type pref, int maxdim, ext_bool finiterange, int monotonicity) { return IncludeModel(name, type, minsub, maxsub, kappas, NULL, domain, isotropy, check, range, pref, false, SCALAR, maxdim, finiterange, monotonicity); } bool addvariantOK(Types type, isotropy_type iso) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr if (C->variants >= MAXVARIANTS) return false; // printf("A %s\n", C->name); if (C->Isotropy[0] == PREVMODELI || iso == PREVMODELI) if (C->check != checkconstant && C->Typi[0] != MathDefinition && C->check != checkcovariate && C->check != checkMatern && C->check != checkWM ) return false; // printf("B\n"); if (equal_coordinate_system(C->Isotropy[C->variants - 1], iso, true)) { if (C->Isotropy[C->variants - 1] > iso && C->check != checkpower) return false; // see check2x if ((C->Isotropy[C->variants - 1] != iso || // see check2x TypeConsistency(type, C->Typi[C->variants - 1]))) return false; } // printf("C\n"); if (C->Typi[0] > VariogramType && C->Typi[0] != type && C->Typi[0] != ShapeType && C->Typi[0] != MathDefinition && C->check != checktrend) return false;// see also // e.g. newmodel _cov cpy in getNset.cc // printf("D\n"); if (iso== SPHERICAL_ISOTROPIC && ((C->finiterange == true && isPosDef(type) && C->vdim == SCALAR) || C->Monotone == COMPLETELY_MON)) return false; return true; } void AddVariant(Types type, isotropy_type iso) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert(addvariantOK(type, iso)); C->Typi[C->variants] = type; C->Isotropy[C->variants] = iso; C->variants++; } #define IMPLEMENTED_SEQUENTIAL C->vdim <= 1 && \ (C->domain == PREVMODELD || \ ((is_any(isPosDef, C) || is_any(UndefinedType, C)) && C->domain == XONLY)) #define IMPLEMENTED_CE \ (((is_any(isPosDef, C) || is_any(UndefinedType, C)) && C->domain == XONLY) \ || C->domain == PREVMODELD) void addCov(int F_derivs, covfct cf, covfct D, covfct D2, covfct inverse, nonstat_inv nonstat_inverse) { int nr = currentNrCov - 1; assert(nr>=0 && nrdomain == XONLY && C->Isotropy[0] == ISOTROPIC; C->cov = cf; if (C->RS_derivs < 0) C->RS_derivs = 0; assert(C->nonstat_cov == ErrCovNonstat); if (D != NULL) { assert(cf != NULL); if (C->cov!=NULL && C->RS_derivs < 1) C->RS_derivs = 1; C->D=D; assert(C->Isotropy[0] == ISOTROPIC || C->Isotropy[0] == SPACEISOTROPIC || C->Isotropy[0] == PREVMODELI || C->Isotropy[0] == PARAM_DEP); // C->implemented[TBM2] = NUM_APPROX; C->implemented[TBM] = true; } if (D2 != NULL) { assert(D != NULL); C->D2 = D2; if (C->cov!=NULL && C->D != NULL && C->RS_derivs < 2) C->RS_derivs = 2; } if (inverse != NULL) C->inverse = inverse; else if (isMonotone(C->Monotone) && C->Isotropy[0] == ISOTROPIC && C->inverse==ErrCov) C->inverse = InverseIsoMon; if (stat_iso && C->inverse != ErrInverse) C->nonstat_loginverse = StandardLogInverseNonstat; // if (nonstat_inverse != NULL) printf("nonstat %s\n", C->nick); C->nonstat_inverse = nonstat_inverse!=NULL ? nonstat_inverse : stat_iso && inverse != NULL ? StandardInverseNonstat : ErrInverseNonstat; C->implemented[Direct] = cf != NULL; C->implemented[CircEmbed] = cf != NULL && IMPLEMENTED_CE; // printf("%s %d %d\n", C->nick, C->implemented[CircEmbed], C->pref[CircEmbed]); C->implemented[Sequential] = IMPLEMENTED_SEQUENTIAL; C->F_derivs = F_derivs >= 0 ? F_derivs : C->RS_derivs; assert(C->F_derivs <= C->RS_derivs); } void addCov(covfct cf, covfct D, covfct D2, covfct inverse) { addCov(MISMATCH, cf, D, D2, inverse, NULL); } void addCov(covfct cf, covfct D, covfct D2, nonstat_inv inverse) { addCov(MISMATCH, cf, D, D2, NULL, inverse); } void addCov(covfct cf, covfct D, covfct D2, covfct inverse, nonstat_inv nonstat_inverse) { addCov(MISMATCH, cf, D, D2, inverse, nonstat_inverse); } void addCov(int F_derivs, covfct cf, covfct D, covfct inverse) { addCov(F_derivs, cf, D, NULL, inverse, NULL); } void addCov(covfct cf, covfct D, covfct inverse) { addCov(MISMATCH, cf, D, inverse); } void addCov(int F_derivs, covfct cf, covfct D, covfct D2, covfct D3, covfct D4, covfct inverse, nonstat_inv nonstat_inverse) { int nr = currentNrCov - 1; assert(nr>=0 && nrD3 = D3; assert(C->RS_derivs == 2 && D3 != NULL); if (D4 == NULL) { C->RS_derivs = 3; } else { C->RS_derivs = 4; C->D4 = D4; } C->F_derivs = F_derivs >= 0 ? F_derivs : C->RS_derivs; assert(C->F_derivs <= C->RS_derivs); } void addCov(covfct cf, covfct D, covfct D2, covfct D3, covfct D4, covfct inverse) { addCov(-1, cf, D, D2, D3, D4, inverse, NULL); } void addCov(covfct cf, covfct D, covfct D2, covfct D3, covfct D4, covfct inverse, nonstat_inv nonstat_inverse) { addCov(-1, cf, D, D2, D3, D4, inverse, nonstat_inverse); } void addCov(int F_derivs, nonstat_covfct cf) { int nr = currentNrCov - 1; assert((nr>=0) && (nrnonstat_cov = cf; C->implemented[Direct] = true; C->implemented[CircEmbed] = IMPLEMENTED_CE; C->implemented[Sequential] = IMPLEMENTED_SEQUENTIAL; if (C->RS_derivs < 0) { C->RS_derivs = 0; C->F_derivs = F_derivs >= 0 ? F_derivs : C->RS_derivs; assert(C->F_derivs <= C->RS_derivs); } } void addCov(nonstat_covfct cf) { addCov(-1, cf); } void addCov(aux_covfct auxcf){ int nr = currentNrCov - 1; assert((nr>=0) && (nrcov == ErrCov && C->nonstat_cov==ErrCovNonstat); C->aux_cov = auxcf; } void addCov(covfct distrD, covfct logdistrD, nonstat_inv Dinverse, covfct distrP, nonstat_covfct distrP2sided, covfct distrQ, covfct distrR, nonstat_covfct distrR2sided) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert(nr>=0 && nrdomain == DOMAIN_MISMATCH); assert(C->Isotropy[0] == ISO_MISMATCH); assert(distrD != NULL && logdistrD!=NULL && Dinverse != NULL && distrP != NULL && distrQ != NULL && distrR != NULL); assert(C->Struct != struct_failed && C->Init !=init_failed); C->RS_derivs = 1; C->F_derivs = 0; C->cov = distrP; C->D = distrD; C->logD = logdistrD; C->nonstat_inverse_D = Dinverse; C->inverse = distrQ; C->random = distrR; if (distrP2sided != NULL || distrR2sided !=NULL) { assert(distrP2sided != NULL && distrR2sided !=NULL); C->nonstat_cov = distrP2sided; C->nonstat_random = distrR2sided; C->domain = PREVMODELD; } else { assert(distrP2sided == NULL && distrR2sided ==NULL); C->domain = XONLY; } C->Isotropy[0] = CARTESIAN_COORD; } void addlogD(covfct logdistrD) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert(nr>=0 && nrTypi[0])); assert(C->domain == XONLY); assert(C->Isotropy[0] == UNREDUCED); assert(logdistrD!=NULL); assert(C->Struct != struct_failed); assert( C->Init !=init_failed); C->RS_derivs = 1; C->F_derivs = 0; C->logD = logdistrD; C->D = StandardNonLogDistrD; } /* void addlogD(covfct logD) { int nr = currentNrCov - 1; assert((nr>=0) && (nrlogD = logD; } */ void addlogCov(logfct log, nonstat_logfct nonstatlog, nonstat_inv nonstat_loginverse) { int nr = currentNrCov - 1; assert((nr>=0) && (nrlog = log; else assert(nonstatlog != NULL); if (nonstatlog != NULL) C->nonstatlog = nonstatlog; if (nonstat_loginverse!=NULL) C->nonstat_loginverse = nonstat_loginverse; } void addlogCov(logfct log) { addlogCov(log, NULL, NULL); } void addlogCov(nonstat_logfct nonstatlog) { addlogCov(NULL, nonstatlog, NULL); } int addFurtherCov(int F_derivs, covfct cf, covfct D, covfct D2) { assert(currentNrCov > 0); cov_fct *C = CovList + currentNrCov; MEMCOPY(C, C - 1, sizeof(cov_fct)); assert(C->vdim == SCALAR || C->vdim == SUBMODEL_DEP || C->vdim == PARAM_DEP || D == NULL); strcopyN(CovNames[currentNrCov], InternalName, MAXCHAR); C->name[0] = InternalName[0]; strcopyN(C->name + 1, CovList[currentNrCov-1].name, MAXCHAR - 1); if (cf != NULL) { C->cov = cf; C->RS_derivs = 0; } if (D != NULL) { assert(cf != NULL); C->D = D; C->RS_derivs = 1; assert(C->Isotropy[0] == ISOTROPIC || C->Isotropy[0] == SPACEISOTROPIC || C->Isotropy[0] == ZEROSPACEISO || C->Isotropy[0] == PREVMODELI); //C->implemented[TBM2] = NUM_APPROX; C->implemented[TBM] = IMPLEMENTED; } if (D2 != NULL) { assert(D != NULL); C->D2 = D2; C->RS_derivs = 2; } C->F_derivs = F_derivs >= 0 ? F_derivs : C->RS_derivs; assert(C->F_derivs <= C->RS_derivs); C->internal = true; // addCov is used without previous call of IncludeModel currentNrCov++; return currentNrCov - 1; } int addFurtherCov(covfct cf, covfct D, covfct D2) { return addFurtherCov(-1, cf, D, D2); } int addFurtherCov(covfct cf, covfct D) { return addFurtherCov(cf, D, NULL); } int addFurtherCov(int F_derivs, covfct cf, covfct D) { return addFurtherCov(F_derivs, cf, D, NULL); } int addFurtherCov(int F_derivs, nonstat_covfct cf) { assert(currentNrCov > 0); cov_fct *C = CovList + currentNrCov; MEMCOPY(C, C - 1, sizeof(cov_fct)); strcopyN(CovNames[currentNrCov], InternalName, MAXCHAR); C->name[0] = InternalName[0]; strcopyN(C->name + 1, CovList[currentNrCov-1].name, MAXCHAR - 1); C->RS_derivs = -1; if (cf != NULL) { C->nonstat_cov = cf; C->RS_derivs = 0; } C->F_derivs = F_derivs >= 0 ? F_derivs : C->RS_derivs; assert(C->F_derivs <= C->RS_derivs); C->D = ErrCov; C->internal = true; // addCov is used without previous call of IncludeModel currentNrCov++; return currentNrCov - 1; } int addFurtherCov(nonstat_covfct cf) { return addFurtherCov(-1, cf); } void addTypeFct(type_fct TypeFct) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr C->TypeFct = TypeFct; } //int addFurtherCov(nonstat_covfct cf, covfct D, covfct D2) { // return addFurtherCov(-1, cf, D, D2); //} void nablahess(covfct nabla, covfct hess) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert((nr>=0) && (nrvdim == SCALAR || C->vdim == SUBMODEL_DEP || C->vdim == PARAM_DEP || nabla==NULL); assert(C->cov != NULL && nabla!=NULL && hess != NULL); C->nabla=nabla; C->hess = hess; } void addLocal(getlocalparam coinit, getlocalparam ieinit) { int nr = currentNrCov - 1; assert(nr>=0 && nr < currentNrCov) ; cov_fct *C = CovList + nr; // nicht gatternr int *pref = C->pref; assert(C->D!=ErrCov); if ((C->implemented[CircEmbedIntrinsic] = ieinit != NULL)) { assert(C->D2 != NULL); C->ieinit = ieinit; if (pref[CircEmbedIntrinsic] == PREF_NONE) pref[CircEmbedIntrinsic] = PREF_BEST; } if ((C->implemented[CircEmbedCutoff] = coinit != NULL)) { C->coinit = coinit; if (pref[CircEmbedCutoff] == PREF_NONE) pref[CircEmbedCutoff] = PREF_BEST; if (pref[CircEmbedIntrinsic] > 2) pref[CircEmbedIntrinsic] = 2; } } void addCallLocal(altlocalparam alt) { int nr = currentNrCov - 1; assert(nr>=0 && nr < currentNrCov) ; cov_fct *C = CovList + nr; // nicht gatternr C->alternative = alt; } #define ASSERT_TBM \ assert(C->domain == PREVMODELD || \ ((is_any(isPosDef, C) || is_any(isUndefined, C)) \ && C->domain == XONLY)); \ assert(C->vdim == SCALAR || C->vdim == SUBMODEL_DEP || \ C->vdim == PARAM_DEP) int addTBM(covfct tbm2) { // must be called always AFTER addCov !!!! int nr = currentNrCov - 1; assert((nr>=0) && (nrtbm2=tbm2; if (tbm2 != NULL) { // addTBM is called from the other addTBM's -- so tbm2 might // be NULL assert(C->Isotropy[0]==ISOTROPIC || C->Isotropy[0]==SPACEISOTROPIC || C->Isotropy[0]==PREVMODELI); assert(C->D != ErrCov); C->implemented[TBM] = IMPLEMENTED; if (C->pref[TBM] == PREF_NONE) C->pref[TBM] = PREF_BEST; } // IMPLEMENTED must imply the NUM_APPROX to simplify the choice // between TBM2 and Tbm2Num return nr; } void addTBM(covfct tbm2, initfct Init, spectral_do spectralDo) { int nr = addTBM(tbm2); cov_fct *C = CovList + nr; // nicht gatternr ASSERT_TBM; C->spectral=spectralDo; C->Init=Init; C->implemented[SpectralTBM] = true; if (C->pref[SpectralTBM] == PREF_NONE) C->pref[SpectralTBM] = PREF_BEST; } void addTBM(initfct Init, spectral_do spectralDo) { addTBM((covfct) NULL, Init, spectralDo); } void addSpecific(int cov) { int nr = currentNrCov - 1; assert((nr>=0) && (nrname, CovList[nr].Typi[0], ProcessType, CovList[nr].kappas, X->kappas); assert((CovList[nr].Typi[0] == ProcessType && CovList[nr].kappas == X->kappas) || ( X->check == checkmal && CovList[nr].check==checkmultproc)); // to do ... und die namen sollten auch gleich sein... while (true) { assert(X->Specific == MISMATCH); X->Specific = nr; if (X->pref[Specific] == PREF_NONE) X->pref[Specific] = PREF_BEST; X->implemented[Specific] = IMPLEMENTED; X++; if (X->name[0] != InternalName[0]) break; } // assert(false); } void addHyper(hyper_pp_fct hyper_pp) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert((nr>=0) && (nrhyperplane=hyper_pp; C->implemented[Hyperplane] = hyper_pp!=NULL; if (C->pref[Hyperplane] == PREF_NONE) C->pref[Hyperplane] = PREF_BEST; } //void addSpecialMeth(initstandard initspecial, dometh special) { /// int nr = currentNrCov - 1; // cov_fct *C = CovList + nr; // nicht gatternr // C->initspecial=initspecial; // C->special=special; // if ((special!=NULL) || (initspecial!=NULL)) // assert((special!=NULL) && (initspecial!=NULL)); // C->implemented[Special] = true; //} void RandomShape(int maxmoments, structfct Struct, initfct Init, dofct Do, do_random_fct DoRandom, bool average, bool randomcoin, bool specific){ // rein auf shape-Function bezogen, ohne Kenntnis von irgendeinem // Kovarianzmodell // // init and do der elementaren shape-Funktion // insbesondere notwendig wenn die elementare shape-Function zufaellig ist. // Erst dann koennen werte abgefragt werden int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert(Init != NULL && Do != NULL && DoRandom != NULL && Struct!=NULL); C->maxmoments = maxmoments; C->Struct = Struct; C->Do = Do; C->DoRandom = DoRandom; C->Init = Init; C->implemented[Average] = average; C->implemented[RandomCoin] = randomcoin; C->implemented[Specific] = specific; } void RandomShape(int maxmoments, structfct Struct, initfct Init, dofct Do, bool average, bool randomcoin, bool specific){ RandomShape(maxmoments, Struct, Init, Do, do_random_failed, average, randomcoin, specific); } void RandomShape(int maxmoments, structfct Struct, initfct Init, dofct Do){ RandomShape(maxmoments, Struct, Init, Do, do_random_failed, false, false, false); } void RandomShape(int maxmoments, structfct Struct, initfct Init, do_random_fct DoRandom){ RandomShape(maxmoments, Struct, Init, do_failed, DoRandom, false, false, false); } void RandomShape(int maxmoments, initfct Init, dofct Do, bool average){ RandomShape(maxmoments, structOK, Init, Do, do_random_failed, average, !average, false); } void RandomShape(int maxmoments, initfct init, dofct Do){ RandomShape(maxmoments, structOK, init, Do, do_random_failed, false, true, false); } void RandomShape(structfct Struct, bool average){ RandomShape(-1, Struct, initOK, doOK, do_random_failed, average, !average, false); } void RandomShape(structfct Struct){ RandomShape(-1, Struct, initOK, doOK, do_random_failed, false, true, false); } void addSpecial(minmaxfct minmaxeigen){ int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr C->minmaxeigenvalue = minmaxeigen; } void addGaussMixture(draw_random drawmix, log_mixdens logmixdens) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr assert(drawmix != NULL && logmixdens != NULL); C->drawmix = drawmix; C->logmixdens = logmixdens; } void addReturns(return_fct Covariance, ext_bool_ret_fct isCovariance, return_covmat CovMatrix, ext_bool_ret_fct isCovMatrix, tworeturns_fct InverseCovMatrix, ext_bool_ret_fct isInverseCovMatrix, return_fct Variogram, ext_bool_ret_fct isVariogram, return_fct PseudoVariogram, ext_bool_ret_fct isPseudoVariogram) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr if (Covariance!=NULL) { C->covariance=Covariance; C->is_covariance = isCovariance==NULL ? isTrue : isCovariance; } else assert(isCovariance==NULL); if (CovMatrix!=NULL) { C->covmatrix=CovMatrix; C->is_covmatrix = isCovMatrix==NULL ? isTrue : isCovMatrix; } else assert(isCovMatrix==NULL); if (InverseCovMatrix!=NULL) { C->inversecovmatrix=InverseCovMatrix; C->is_inversecovmatrix = isInverseCovMatrix==NULL ? isTrue : isInverseCovMatrix; } else assert(isInverseCovMatrix==NULL); if (Variogram!=NULL) { C->variogram=Variogram; C->is_variogram = isVariogram==NULL ? isTrue : isVariogram; } else assert(isVariogram==NULL); if (PseudoVariogram!=NULL) { C->pseudovariogram=PseudoVariogram; C->is_pseudovariogram = isPseudoVariogram==NULL ? isTrue : isPseudoVariogram; } else assert(isPseudoVariogram==NULL); } void Taylor(double c, double pow) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr C->TaylorN = 0; if (isPosDef(C->Typi[0]) || isUndefined(C->Typi[0])) { assert(pow != 0.0); C->Taylor[C->TaylorN][TaylorConst] = 1.0; C->Taylor[C->TaylorN][TaylorPow] = 0.0; C->TaylorN++; } C->Taylor[C->TaylorN][TaylorConst] = c; C->Taylor[C->TaylorN][TaylorPow] = pow; C->TaylorN++; assert(C->TaylorN <= MAXTAYLOR); if (C->finiterange == true) TailTaylor(0, 0, 0, 0); } void Taylor(double c, double pow, double c1, double pow1) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr Taylor(c, pow); C->Taylor[C->TaylorN][TaylorConst] = c1; C->Taylor[C->TaylorN][TaylorPow] = pow1; C->TaylorN++; assert(C->TaylorN <= MAXTAYLOR); } void Taylor(double c, double pow, double c1, double pow1, double c2, double pow2) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr Taylor(c, pow, c1, pow1); C->Taylor[C->TaylorN][TaylorConst] = c2; C->Taylor[C->TaylorN][TaylorPow] = pow2; C->TaylorN++; assert(C->TaylorN <= MAXTAYLOR); } void TailTaylor(double t, double tpow, double texpc, double texppow) { int nr = currentNrCov - 1; cov_fct *C = CovList + nr; // nicht gatternr if (C->finiterange == true) { assert(t == 0 && tpow==0 && texpc==0 && texppow==0); } C->TailN = 0; C->Tail[C->TailN][TaylorConst] = t; C->Tail[C->TailN][TaylorPow] = tpow; C->Tail[C->TailN][TaylorExpConst] = texpc; C->Tail[C->TailN][TaylorExpPow] = texppow; C->TailN++; assert(C->TailN <= MAXTAYLOR); } void setptwise(ptwise_type pt) { int nr = currentNrCov - 1; CovList[nr].ptwise_definite = pt; } RandomFields/src/operator.cc0000644000176200001440000040620013074763020015556 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Definition of correlation functions and derivatives of hypermodels Copyright (C) 2005 -- 2017 Martin Schlather 2015-2017 Olga Moreva (cutoff, modified) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "RF.h" #include "Operator.h" #include "variogramAndCo.h" #include "cubicsolver.h" #define BINARY_P 0 #define BINARY_CORR 1 #define BINARY_CENTRED 2 /* Felix' integral + trafo v = (1-r) / (1+r) + taylor + GR 2.211/2 V ~ 25 : Grenze zur Asymptoic GR 8.357 fctn = function(rho, t) EXP(-t^2 / (1+rho)) / SQRT(1.0-rho^2) C = function(r, t) (2*pi)^(-1) * integrate(fctn, 0, r, t=t)$value fctn1 = function(rho, t) EXP(-t^2 * rho / 2) / SQRT(rho) / (1 + rho) C1 = function(r, t) EXP(-t^2 / 2) / (2*pi) * integrate(fctn1, (1-r)/(1+r), 1, t=t)$value deltaC = function(r, t) C(r,t) - C1(r,t) deltaC(0.5, 0.5) for (r in seq(0, 1, len=10)) for (t in seq(0.1, 2, len=10)) print(deltaC(r,t))# // for (r in seq(0.1, 1, len=10)) for (t in seq(0.1, 2, len=10)) { print(deltaC(r,t))# // a = t^2 /2 n = 10 d = 0:n fak = c(1, cumprod(d[-1])) s = cumsum(a^d / fak) v = (1-r) / (1+r) (U = 2 * SQRT(v) * sum((-v)^d / (2 * d + 1) * s)) v = 1 (O = 2 * SQRT(v) * sum((-v)^d / (2 * d + 1) * s)) (O - U) / (2 * pi) C(r, t) v = (1-r) / (1+r) (U = 2 * ATAN(SQRT(v)) + 2 * SQRT(v) * sum((-v)^d / (2 * d + 1) * (EXP(-a) * s - 1)) ) v = 1 (O = 2 * ATAN(SQRT(v)) + 2 * SQRT(v) * sum((-v)^d / (2 * d + 1) * (EXP(-a) * s - 1)) ) (O - U) / (2 * pi) C(r, t) print( (O - U) / (2 * pi) - C1(r,t))# // model = RM e x p() x = seq(0.1, 1, len=10) t = 1.67 for (r in x) print(C1(r,t=t))# // RFcov(model, LOG(x)) RFcov(RMbernoulli(model, t=t), LOG(x)) for (r in x) print(C1(r,t=t)) # // */ #define Binary_Eps 1e-13 void binary(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double a, var, V, r, expMa, Vd, s, Oned, sum, sumOne, summand, summandOne, d, factor, t = P0(BINARY_P), p = pnorm(t, 0, 1.0, true, false); COV(ZERO, next, &var); COV(x, next, &r); if (t == 0.0) { *v = ((M_1_PI * ASIN(r / var) + 0.5) - p) * p; } else { a = 0.5 * t * t / var; expMa = EXP(-a); r /= var; // als BA-Arbeit if (r < -0.9) ERR("correlation of submodel must be >= -0.9 for numerical reasons"); V = (1 - r) / (1 + r); double ad = expMa; d = 0.0; sum = sumOne = 0.0; Vd = 1; Oned = 1; s = ad; factor = (s - 1.0) / (2.0 * d + 1.0); summand = Vd * factor; summandOne = Oned * factor; while (FABS(summand) > Binary_Eps || FABS(summandOne) > Binary_Eps) { sum += summand; sumOne += summandOne; d += 1.0; ad *= a / d; s += ad; Vd *= -V; Oned *= -1; factor = (s - 1.0) / (2.0 * d + 1.0); summand = Vd * factor; summandOne = Oned * factor; } sum += summand; sumOne += summandOne; // 0.25 = 2 ATAN(SQRT(1.0)) / 2pi *v = 0.25 + INVPI * (sumOne - (ATAN(SQRT(V)) + SQRT(V) * sum)); } if (!P0INT(BINARY_CENTRED)) { *v += p * p; } if (P0INT(BINARY_CORR)) { *v /= p; } } int checkbinary(cov_model *cov) { // to do extend to multivariate WARN_NEWDEFINITIONS; cov_model *next = cov->sub[0]; double v; int i, vdim = cov->vdim[0], err = NOERROR; if (cov->vdim[0] != cov->vdim[1]) BUG; kdefault(cov, BINARY_P, 0.0); // if (P0(BINARY_P) != 0.0) SERR("currently only threshold=0 is possible");//todo kdefault(cov, BINARY_CORR, 1); kdefault(cov, BINARY_CENTRED, 1); if ((err = CHECK(next, cov->tsdim, cov->xdimprev, PosDefType, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; setbackward(cov, next); for (i=0; impp.maxheights[i] = 1.0; COV(ZERO, next, &v); return NOERROR; } void rangebinary(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[BINARY_P] = RF_NEGINF; range->max[BINARY_P] = RF_INF; range->pmin[BINARY_P] = -4.0; range->pmax[BINARY_P] = 4.0; range->openmin[BINARY_P] = false; range->openmax[BINARY_P] = false; range->min[BINARY_CORR] = 0; range->max[BINARY_CORR] = 1; range->pmin[BINARY_CORR] = 0; range->pmax[BINARY_CORR] = 1; range->openmin[BINARY_CORR] = false; range->openmax[BINARY_CORR] = false; range->min[BINARY_CENTRED] = 0; range->max[BINARY_CENTRED] = 1; range->pmin[BINARY_CENTRED] = 0; range->pmax[BINARY_CENTRED] = 1; range->openmin[BINARY_CENTRED] = false; range->openmax[BINARY_CENTRED] = false; } ////////////////////////////////////////////////////////////////////// // extremal gaussian void extrgauss(double *x, cov_model *cov, double *v) { // BrownResnick to binary Gaussian cov_model *next = cov->sub[0]; double var, z; COV(ZERO, next, &var); COV(x, next, &z); *v = 1.0 - SQRT(0.5 * (1.0 - z / var)); } int check_extrgauss(cov_model *cov) { // to do extend to multivariate cov_model *next = cov->sub[0]; double v; int i, vdim = cov->vdim[0], err = NOERROR; if (cov->vdim[0] != cov->vdim[1]) BUG; if ((err = CHECK(next, cov->tsdim, cov->xdimprev, PosDefType, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; setbackward(cov, next); for (i=0; impp.maxheights[i] = 1.0; COV(ZERO, next, &v); if (v != 1.0) SERR("only correlation functions allowed"); return NOERROR; } ////////////////////////////////////////////////////////////////////// // Brown Resnick #define BR_FACTOR 0.25 // KSH: '/ 4' #define BR_SEMI_FACTOR (2 * BR_FACTOR) // hier Semi-Variogram void brownresnick(double *x, cov_model *cov, double *v) { // BrownResnick to binary Gaussian cov_model *next = cov->sub[0]; double z; assert(cov->role == ROLE_COV); COV(ZERO, next, &z); COV(x, next, v); *v = 2.0 * pnorm(SQRT((z - *v) * BR_SEMI_FACTOR), 0.0, 1.0, false, false); } void Dbrownresnick(double *x, cov_model *cov, double *v) { // b = BR_SEMI_FACTOR // gamma(h) = C(0) - C(h) // varphi(SQRT(gamma * b)) * (b C') / SQRT(gamma * b) // varphi density standard normal // BrownResnick to binary Gaussian cov_model *next = cov->sub[0]; double z, abl, s; // if ((cov->role != ROLE_COV && cov->role != ROLE_MAXSTABLE) || cov->taylorN <= 1) BUG; if (cov->taylor[1][TaylorPow] == 0.0) { // const?? *v = 0.0; return; } if (*x != 0.0) { COV(ZERO, next, &z); COV(x, next, v); assert(CovList[next->gatternr].D != NULL); assert(CovList[next->gatternr].D != ErrCov); Abl1(x, next, &abl); // Vorsicht: abl = -\gamma' abl *= BR_SEMI_FACTOR; s = SQRT((z - *v) * BR_SEMI_FACTOR); // SQRT(c * gamma) *v = dnorm(s, 0.0, 1.0, false) * abl / s; // -\varphi * \gamma' / sqrt\gamma // =-2 \varphi * (-C') / (2 sqrt\gamma) // mit C= c_0 -\gamma assert(*v <= 0); } else { if (cov->taylor[1][TaylorPow] < 1.0) { *v = RF_NEGINF; } else if (cov->taylor[1][TaylorPow] == 1.0) { *v = FABS(cov->taylor[1][TaylorConst]); assert(*v > 0.0); } else BUG; } // 2 * c * varphi(s) * gamma' / s } void DDbrownresnick(double *x, cov_model *cov, double *v) { // D = \varphi * b C' / SQRT(\gamma b) // b = BR_SEMI_FACTOR // gamma(h) = C(0) - C(h) // varphi(SQRT(gamma * b)) [(b C')^2 / [2 sqrt (gamma * b)] // +(b C'') / sqrt (gamma * b) // +1/2 * (b C')^2 / sqrt (gamma * b)^3 ] // varphi density standard normal cov_model *next = cov->sub[0]; double z, abl, abl2, s0, s; if (cov->role != ROLE_COV && cov->role != ROLE_MAXSTABLE) BUG; if (cov->taylor[1][TaylorPow] == 0.0) { *v = 0.0; return; } if (*x != 0.0) { COV(ZERO, next, &z); COV(x, next, v); Abl1(x, next, &abl); Abl2(x, next, &abl2); s0 = (z - *v) * BR_SEMI_FACTOR; s = SQRT(s0); // SQRT(c * gamma) abl *= BR_SEMI_FACTOR; abl2 *= BR_SEMI_FACTOR; *v = dnorm(s, 0.0, 1.0, false) / s * (abl2 + abl * abl * 0.5 * (1/s0 + 1)); assert(*v >= 0); } else { *v = cov->taylor[1][TaylorPow]==1 ? 0.0 : RF_INF; } } void D3brownresnick(double *x, cov_model *cov, double *v) { // D = \varphi * b C' / SQRT(\gamma b) // b = BR_SEMI_FACTOR // gamma(h) = C(0) - C(h) // varphi(SQRT(gamma * b)) [(b C')^3 / [4 sqrt (gamma * b)] // +3 (b C') (b C'')/ [2 sqrt (gamma * b)] // + (b C''') / [sqrt (gamma * b)] // + (b C')^2 / [2 sqrt (gamma * b)] // +3(b C') (b C'') / [2 sqrt (gamma * b)^3] // +3(b C')^3 / [4 sqrt (gamma * b)^5] cov_model *next = cov->sub[0]; double z, abl, abl2, abl3, s0, s; if (cov->role != ROLE_COV && cov->role != ROLE_MAXSTABLE) BUG; if (cov->taylor[1][TaylorPow] == 0.0) { *v = 0.0; return; } if (*x != 0.0) { COV(ZERO, next, &z); COV(x, next, v); Abl1(x, next, &abl); Abl2(x, next, &abl2); Abl3(x, next, &abl3); s0 = (z - *v) * BR_SEMI_FACTOR; s = SQRT(s0); // SQRT(c * gamma) abl *= BR_SEMI_FACTOR; abl2 *= BR_SEMI_FACTOR; abl3 *= BR_SEMI_FACTOR; *v = dnorm(s, 0.0, 1.0, false) / s * (abl3 + 1.5 * abl2 * abl * (1/s0 + 1) + abl * abl * abl * (0.25 + 0.5 / s0 + 0.75 / (s0 * s0))); // printf("br x=%f v=%e s=%f abl=%f s0=%f abl2=%f\n", *x, *v, s, abl, s0, abl2); // assert(*v >= 0); } else { *v = cov->taylor[1][TaylorPow]==1 ? 0.0 : RF_NEGINF; // da zweite Ableitung im Ursprung Pol +\infty hat. } } int TaylorBrownresnick(cov_model *cov) { cov_model *next = cov->sub[0]; int idx = isPosDef(next->typus); // Taylorentw. in 2 Glieder falls pos def. assert(idx == 0); // assert(!idx); if (next->taylor[idx][TaylorPow] >= 2.0) {//for pos/neg def only == 2 possible cov->full_derivs = 1; } else cov->full_derivs = 0; cov->rese_derivs = next->rese_derivs; if (cov->rese_derivs > 3) cov->rese_derivs = 3; // else if (next->taylor[idx][TaylorPow] == 2) { // if (next->taylorN < 2 + idx) cov->rese_derivs = 0; // else if (cov->rese_derivs > 2) cov->rese_derivs = 2; // } if (next->taylorN >= 1 + idx && next->taylor[idx][TaylorConst] < 0.0) { // 2 \Phi(SQRT(gamma * br_f)) = //1+ 2 * phi(0) * SQRT(gamma * br_f) - 2 phi(0) / 6 *SQRT(gamma*br_f)^3 //sei gamma(x) = c x^alpha + d x^beta, beta > alpha. Dann gilt // also 2 \Phi(SQRT(gamma * br_f)) ~ // 1 + 2 * phi(0) * SQRT((c x^alpha + d x^beta)* br_f) // - 2 * phi(0) / 6 * SQRT((c x^alpha + d x^beta) *br_f)^3 // = 1 + 2 * phi(0)[ (c f x^a)^{1/2} (1 + 0.5 d / c * x^{b-a}) // (c f x^a)^{3/2} (1 + 1.5 d / c * x^{b-a}) ] // ~ 1 + 2 * phi(0) (c f x^a)^{1/2} // + phi(0)(c f)^{1/2} d / c * x^{b - a/2}) (*) // + 2 * phi(0) (c f x^a)^{3/2} (**) // // // da a <= 2 und b > a gilt: // 1. Abltg ~ phi(0) (c f)^{1/2} x^{a/2 - 1} // + phi(0) (c f)^{1/2} d / c * (b - a/2) x^{b - a/2 - 1} // + 3 phi(0 (c f)^{3/2} a x^{3/2 * a - 1} // 2. Abltg ~ phi(0) (c f)^{1/2} (a/2 - 1) x^{a/2 - 2} ~ infty, a != 2 // und fuer a=2 gilt folgendes: da gamma neg def ist e^{-\gamma} pos def // und mit sasvari folgt aus der Taylor entwicklung dass (a=2) < b <= 4). // Andererseits dominiert x{3/2 a} den Term x^{b - a/2} falls // 3/2 a < b - a/2 <=> b > 2a = 4. // Also ist b=4 ein Grenzfall, wo beide (*) und (**) eine Rolle spielen. // Ansonsten nur (*). // assert(next->taylor[idx][TaylorConst] <= 0.0); cov->taylorN = 2; cov->taylor[0][TaylorConst] = 1.0; cov->taylor[0][TaylorPow] = 0.0; double next_taylor_const = - next->taylor[idx][TaylorConst], g = SQRT(next_taylor_const * BR_SEMI_FACTOR * 0.5 / M_PI); cov->taylor[1][TaylorConst] = - 2 * g; cov->taylor[1][TaylorPow] = 0.5 * next->taylor[idx][TaylorPow]; if (next->taylor[idx][TaylorPow] == 2) { if (next->taylorN >= 2 + idx) { cov->taylorN = 3; if (next->taylor[idx + 1][TaylorConst] != 0) { cov->taylor[2][TaylorConst] = g * next->taylor[idx + 1][TaylorConst] / next_taylor_const; cov->taylor[2][TaylorPow] = next->taylor[idx + 1][TaylorPow] - 0.5*next->taylor[idx][TaylorPow]; } else { // Spezialfall:L fractionelle BR cov->taylor[2][TaylorConst] = 0.0; cov->taylor[2][TaylorPow] = 4.0; } if (next->taylor[idx + 1][TaylorPow] == 4) { cov->taylor[1][TaylorConst] += 2 * g * next_taylor_const * BR_SEMI_FACTOR; } } else cov->taylorN = 0; } } else cov->taylorN = 0; if (next->tailN >= 1) { cov->tailN = 1; cov->tail[0][TaylorPow] = -0.5 * next->tail[0][TaylorPow]; if (next->tail[0][TaylorPow] > 0) { assert( next->tail[0][TaylorConst] < 0.0); double next_tail_const = - next->tail[0][TaylorConst]; cov->tail[0][TaylorConst] = 2.0 / SQRT(2.0 * M_PI * BR_SEMI_FACTOR * next_tail_const); cov->tail[0][TaylorExpConst] = 0.5 * BR_SEMI_FACTOR * next_tail_const; cov->tail[0][TaylorExpPow] = next->tail[0][TaylorPow]; } else { cov->tail[0][TaylorConst] = 2.0 / SQRT(2.0 * M_PI * BR_SEMI_FACTOR * next->tail[0][TaylorConst]) * EXP(-0.5 * BR_SEMI_FACTOR * next->tail[0][TaylorConst]); cov->tail[0][TaylorPow] = cov->tail[0][TaylorExpConst] = cov->tail[0][TaylorExpPow] = 0.0; } } else cov->tailN = 0; if (cov->taylorN < 1) cov->rese_derivs = 0; return NOERROR; } int checkbrownresnick(cov_model *cov) { // to do extend to multivariate cov_model *next = cov->sub[0]; int i, err, vdim = cov->vdim[0], dim = cov->tsdim; if (cov->vdim[0] != cov->vdim[1]) BUG; if ((err = CHECK(next, dim, dim, VariogramType, cov->domown, cov->isoown, SUBMODEL_DEP, hasMaxStableRole(cov) ? ROLE_MAXSTABLE : ROLE_COV)) != NOERROR) { return err; } setbackward(cov, next); cov->monotone = isBernstein(next) ? GNEITING_MON : isMonotone(next) ? MONOTONE : NOT_MONOTONE; if ((err = TaylorBrownresnick(cov)) != NOERROR) return err; for (i=0; impp.maxheights[i] = 1.0; MEMCOPY(cov->pref, CovList[cov->nr].pref, sizeof(pref_shorttype)); return NOERROR; } int struct_brownresnick(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel) { cov_model *next = cov->sub[0]; if (cov->role == ROLE_SMITH) { if (1 > next->taylorN || 1 > next->tailN) SERR2("role '%s' not possible for submodel '%s'", ROLENAMES[cov->role], NICK(next)); BUG; // shape ist somit die Ableitung, falls d=1 und i.w. die // zweifache Ableitung, falls d=3 // hier ist auch Taylor zu setztn fuer den neuen Shape } else ILLEGAL_ROLE; return NOERROR; } int init_brownresnick(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s) { int err; // cov_model *next = cov->sub[0]; if ((err = TaylorBrownresnick(cov)) != NOERROR) return err; return NOERROR; } void do_brownresnick(cov_model *cov, gen_storage *s) { cov_model *next = cov->sub[0]; DO(next, s); // nicht gatternr } void BR2EG(double *x, cov_model *cov, double *v) { // BrownResnick to binary Gaussian cov_model *next = cov->sub[0]; double z; COV(ZERO, next, &z); COV(x, next, v); z = 2.0 * pnorm(SQRT( (z - *v) * BR_SEMI_FACTOR), 0.0, 1.0, true, false) -1.0; *v = 1.0 - 2.0 * z * z; } int check_BR2EG(cov_model *cov) { // to do extend to multivariate cov_model *next = cov->sub[0]; double v, t, alpha; int err, i, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SCALAR, cov->role)) != NOERROR) return err; setbackward(cov, next); for (i=0; impp.maxheights[i] = 1.0; if (next->pref[Nothing] == PREF_NONE) return ERRORPREFNONECOV; // Erfc(x) = 2(1 - Phi(x * SQRT(2))) // Erf(x) = 2 Phi(x * SQRT(2)) - 1 // Erf^{-1}(x) = Phi^{-1}( (y + 1) / 2 ) / SQRT(2) // Sei c = 1-2 * Erf(SQRT(semivario / 4))^2 . // Also c = 1 - 2 [ 2 Phi(SQRT(semivario / 2)) - 1]^2 // Umgekehrt semivario = 4 * { Erf^{-1} (sqrt[0.5 (1 - c)]) } ^2 // mit c = 0 folgt SQRT(0.5 (1-c)) = 1 / SQRT(2) // semivario = 2 * {Phi^{-1}( (1 / SQRT(2) + 1) / 2 ) } ^2 alpha = 0.0; COV(ZERO, next, &v); t = qnorm(0.5 * (1.0 + INVSQRTTWO), 0.0, 1.0, true, false); t *= t / (BR_SEMI_FACTOR * (1.0 - alpha)); // 1/2 wegen Erf->qnorm if (v > t) SERR2("variance equals %f, but must be at most 4(Erf^{-1}(1/2))^2 = %f", v, t); return NOERROR; } void BR2BG(double *x, cov_model *cov, double *v) { // BrownResnick to binary Gaussian cov_model *next = cov->sub[0]; double z; COV(ZERO, next, &z); COV(x, next, v); z = 2.0 * pnorm(SQRT( (z - *v) * BR_SEMI_FACTOR), 0.0, 1.0, true, false) -1; *v = COS(M_PI * z); } int check_BR2BG(cov_model *cov) { // to do extend to multivariate cov_model *next = cov->sub[0]; double v, t, alpha; int err, i, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SCALAR, cov->role)) != NOERROR) return err; setbackward(cov, next); for (i=0; impp.maxheights[i] = 1.0; if (next->pref[Nothing] == PREF_NONE) return ERRORPREFNONECOV; // Erfc(x) = 2(1 - Phi(x * SQRT(2))) // Erf(x) = 2 Phi(x * SQRT(2)) - 1 // Erf^{-1}(x) = Phi^{-1}( (y + 1) / 2 ) / SQRT(2) // Sei c = COS(pi * Erf(SQRT(semivario / 4))) . // Also c = COS(pi * [2 * Phi(SQRT(semivario / 2)) - 1] ) // Umgekehrt semivario = 2 * { Phi^{-1}(0.5 * [arcCOS( c ) / pi + 1]) }^2 // mit c = 0 folgt arcCOS(c)/ pi + 1 = 3/2 // semivario = 2 * { Phi^{-1}( 3 / 4) }^2 COV(ZERO, next, &v); alpha = 0.0; // to do t = qnorm(0.75, 0.0, 1.0, false, false); t *= t / (BR_SEMI_FACTOR * (1.0 - alpha)); // 1/2 wegen Erf->qnorm if (v > t) { SERR2("variance equals %f, but must be at most 4(Erf^{-1}(1 / 2))^2 = %f", v, t); } return NOERROR; } // #define UNIF_LOGREFAREA dim #define SIGN_P 0 void randomSign(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; assert(next != NULL); COV(x, next, v); (*v) *= cov->q[0]; // printf("%f ", cov->q[0]); } void lograndomSign(double *x, cov_model *cov, double *v, double *Sign) { cov_model *next = cov->sub[0]; assert(next != NULL); LOGCOV(x, next, v, Sign); (*Sign) *= cov->q[0]; } void randomSignInverse(double *v, cov_model *cov, double *x){ cov_model *next = cov->sub[0]; INVERSE(v, next, x); } void randomSignNonstatInverse(double *v, cov_model *cov, double *x, double *y){ cov_model *next = cov->sub[0]; NONSTATINVERSE(v, next, x, y); } int check_randomSign(cov_model *cov) { cov_model *next = cov->sub[0]; int err, size = 1; if (cov->q == NULL) QALLOC(size); kdefault(cov, 0, 0.5); if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, cov->tsdim, cov->xdimown, ShapeType, cov->domown, cov->isoown, SCALAR, cov->role)) != NOERROR) return err; setbackward(cov, next); return NOERROR; } void range_randomSign(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[SIGN_P] = 0; range->max[SIGN_P] = 1; range->pmin[SIGN_P] = 0.0001; range->pmax[SIGN_P] = 0.9999; range->openmin[SIGN_P] = false; range->openmax[SIGN_P] = false; } int init_randomSign(cov_model *cov, gen_storage *s) { cov_model *next = cov->sub[0]; int err; double Eminus; assert(next != NULL); if ((err=INIT(next, cov->mpp.moments, s))!= NOERROR) return err; if (next->fieldreturn && next->loggiven) SERR("log return is incompatible with random Sign"); if (cov->mpp.moments >= 1) { cov->mpp.mM[0] = next->mpp.mM[0]; cov->mpp.mMplus[0] = next->mpp.mMplus[0]; Eminus = cov->mpp.mMplus[1] - cov->mpp.mM[1]; cov->mpp.mMplus[1] = P(SIGN_P)[0] * (cov->mpp.mMplus[1] - Eminus) + Eminus; cov->mpp.mM[1] = 0.0; } cov->mpp.maxheights[0] = next->mpp.maxheights[0]; cov->fieldreturn = next->fieldreturn; cov->origrf = false; cov->rf = next->rf; // assert(cov->mpp.maxheights[0] == 1.00); return err; } void do_randomSign(cov_model *cov, gen_storage *s) { cov_model *next = cov->sub[0]; assert(next != NULL); DO(next, s); // nicht gatternr cov->q[0] = 2.0 * (UNIFORM_RANDOM <= P0(SIGN_P)) - 1.0; if (cov->q[0] != 1.0 && next->fieldreturn) { assert(cov->q[0] == -1.0); if (next->loggiven) ERR("log return is incompatible with random Sign"); int i, endfor = Loc(next)->totalpoints; double *rf = cov->rf; for (i=0; irole == ROLE_GAUSS || hasPoissonRole(cov)) { int err = STRUCT(cov->sub[0], newmodel); // assert(cov->sub[0]->mpp.maxheights[0] == 1.0); return err; } SERR1("'%s' not allowed in this context.", NICK(cov)); } #define MASTEIN_NU 0 #define MASTEIN_DELTA 1 void MaStein(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double nuG, gammas, v1, v2, nu = P0(MASTEIN_NU), delta = P0(MASTEIN_DELTA); COV(ZERO, next, &v1); COV(x + 1, next, &v2); nuG = nu + v1 - v2; if (nuG >= 80.0) { ERR("Whittle Matern function cannot be evaluated with parameter value b+g(t) greater than 80."); } gammas = lgammafn(nu + delta) - lgammafn(nu) -lgammafn(nuG + delta); double s = *x; *v = (s==0.0) ? EXP(lgammafn(nuG) + gammas) : 2.0 * EXP(nuG * LOG(0.5 * s) + gammas + LOG(bessel_k(s, nuG, 2.0)) - s); } int check_MaStein(cov_model *cov) { cov_model *next = cov->sub[0]; int err; if (cov->xdimown != 2) SERR("reduced dimension must be 2"); if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, 1, 1, VariogramType, XONLY, SYMMETRIC, SCALAR, ROLE_COV)) != NOERROR) return err; if (cov->ncol[MASTEIN_NU] != 1 || cov->nrow[MASTEIN_NU] != 1) SERR("nu not scalar"); if (cov->ncol[MASTEIN_DELTA] != 1 || cov->nrow[MASTEIN_DELTA] != 1) SERR("d not scalar"); // no setbackward cov->maxdim = next->maxdim; return NOERROR; // no setbackward ! } void range_MaStein(cov_model *cov, range_type *range){ range->min[MASTEIN_NU] = 0.0; // range->max[MASTEIN_NU] = RF_INF; range->pmin[MASTEIN_NU] = 1e-2; range->pmax[MASTEIN_NU] = 10.0; range->openmin[MASTEIN_NU] = true; range->openmax[MASTEIN_NU] = true; range->min[MASTEIN_DELTA] = 0.5 * (double) (cov->tsdim - 1); // d range->max[MASTEIN_DELTA] = RF_INF; range->pmin[MASTEIN_DELTA] = range->min[MASTEIN_DELTA]; range->pmax[MASTEIN_DELTA] = 10; range->openmin[MASTEIN_DELTA] = false; range->openmax[MASTEIN_DELTA] = true; } /* bivariate shift model */ #define SHIFT_DELAY 0 void kappashift(int i, cov_model *cov, int *nr, int *nc){ *nc = 0; *nr = i < CovList[cov->nr].kappas ? cov->tsdim : -1; } void shift(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double y[ShiftMaxDim], z[ShiftMaxDim] = { RF_NAN }, *jh, *ih, *pv = v, *h = P(SHIFT_DELAY); int i, j, d, tsdim = cov->tsdim, vdim = cov->vdim[0], vdimM1 = vdim - 1, vdimSq = vdim * vdim, vdimP1 = vdim + 1; COV(x, next, v); for (i=vdimP1; i= 0) for (d=0; dsub[0]; int err, dim = cov->tsdim; if (cov->xdimown > ShiftMaxDim) SERR2("For technical reasons max. dimension for ave is %d. Got %d.", StpMaxDim, cov->xdimown); if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, dim, dim, PosDefType, XONLY, (dim > 1) ? SYMMETRIC : ISOTROPIC, SCALAR, ROLE_COV)) != NOERROR) return err; setbackward(cov, next); cov->vdim[0] = cov->vdim[1] = cov->ncol[SHIFT_DELAY] + 1; return NOERROR; } void rangeshift(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[SHIFT_DELAY] = RF_NEGINF; range->max[SHIFT_DELAY] = RF_INF; range->pmin[SHIFT_DELAY] = -1000; range->pmax[SHIFT_DELAY] = 1000; range->openmin[SHIFT_DELAY] = true; range->openmax[SHIFT_DELAY] = true; } /* Vector - Delta Delta^T */ #define VECTOR_A 0 #define VECTOR_D 1 void vector(double *x, cov_model *cov, double *v) { /* r = \| x\| d/d x_i f(r) = f'(r) x_i / r d^2/d x_i^2 f(r) = f''(r) x_i^2/r^2 + f'(r) (r^2 - x_i^2) / r^3 d^2/d x_i x_j f(r) = f''(r) x_i x_j/r^2 + f'(r) (- x_i x_j) / r^3 r = 0: d/d x_i f(r) |_0 = 0 d^2/d x_i^2 f(r) |_0 = f''(0) d^2/d x_i x_j f(r) = 0 Vector (n = dimension of spatial field) r=0 L = n * f''(0) operator: -0.5 * (a + 1) laplace + a * hessian, a in [-1,1]; a=1 */ cov_model *next = cov->sub[0]; double norm[2], normSq0, normL2, normT2, D, D2, diag, a = P0(VECTOR_A), b = - 0.5 * (1.0 + a); int i, td = cov->tsdim, dim = P0INT(VECTOR_D), dimP1 = dim + 1, dimsq = dim * dim; normL2 = normT2 = 0.0; for (i=0; iisoown == ISOTROPIC) { normSq0 = normL2 + normT2; } else { normSq0 = normL2; norm[1] = SQRT(normT2); } norm[0] = SQRT(normSq0); Abl1(norm, next, &D); Abl2(norm, next, &D2); if (normSq0 == 0.0) { diag = (b * dim + a) * D2; for (i=0; isub[0]; double laplace, a = P0(VECTOR_A), b = - 0.5 * (1.0 + a); int i, j, k, endfor, dim = P0INT(VECTOR_D), dimP1 = dim + 1, dimsq = dim * dim, tsxdim = cov->tsdim, xdimsq = tsxdim * tsxdim, xdimP1 = tsxdim + 1, dimxdim = dim * tsxdim; ALLOC_EXTRA(D, xdimsq); // should pass back the hessian HESSE(x, next, D); laplace = 0.0; // print("return matrix %d\n", xdimsq); // for (i=0; i> %d %d %f %f %f\n", k, j, D[j], a, laplace ); v[k++] = D[j] * a; } } for (i=0; isub[0]; int err, i, dim = cov->tsdim; isotropy_type isotropy = cov->domown; kdefault(cov, VECTOR_A, 0.5); // a kdefault(cov, VECTOR_D, (isotropy==SPACEISOTROPIC || isotropy==ZEROSPACEISO) ? dim - 1 : dim); // Dspace if ((err = checkkappas(cov)) != NOERROR) return err; if ( (isotropy==SPACEISOTROPIC || isotropy==ZEROSPACEISO) && P0INT(VECTOR_D) != dim - 1) { SERR1("for spatiotemporal submodels '%s' must be applied to spatial part", NICK(cov)); } if (cov->tsdim != cov->xdimown || cov->tsdim != cov->xdimprev) return ERRORDIM; cov->nr = VECTOR; // wegen nr++ unten; if ((err = CHECK(next, dim, 1, PosDefType, cov->domown, ISOTROPIC, SCALAR, ROLE_COV)) != NOERROR) { // print("err=%d\n", err); if ((err = CHECK(next, dim, dim, PosDefType, cov->domown, ZEROSPACEISO, SCALAR, ROLE_COV)) != NOERROR) { // print("err2=%d\n", err); if ((err = CHECK(next, dim, dim, PosDefType, cov->domown, SYMMETRIC, SCALAR, ROLE_COV)) != NOERROR) { // print("err3=%d\n", err); return err; } } } setbackward(cov, next); int diffpref = MIN(2, PREF_BEST - cov->pref[CircEmbed]); if (diffpref > 0) cov->pref[CircEmbed] += diffpref; for (i=0; impp.maxheights[i] = RF_NA; if (next->full_derivs < 2 && !next->hess) { // print("%s (%d): full_derivs %d %d\n", NICK(to), // next->nr, next->full_derivs, CovList[next->nr].F_derivs); // PMI(next); SERR("2nd derivative of submodel not defined (for the given paramters)"); } isotropy = next->isoown; if (isotropy != ISOTROPIC && isotropy != SPACEISOTROPIC) { if (!next->hess) SERR("hess matrix not defined"); cov->nr++; } cov->vdim[0] = cov->vdim[1] = P0INT(VECTOR_D); next->delflag = DEL_COV; EXTRA_STORAGE; return NOERROR; } void rangevector(cov_model *cov, range_type *range){ range->min[VECTOR_A] = -1.0; range->max[VECTOR_A] = 1.0; range->pmin[VECTOR_A] = -1.0; range->pmax[VECTOR_A] = 1.0; range->openmin[VECTOR_A] = false; range->openmax[VECTOR_A] = false; range->min[VECTOR_D] = 1.0; range->max[VECTOR_D] = cov->tsdim; range->pmin[VECTOR_D] = 1.0; range->pmax[VECTOR_D] = cov->tsdim; range->openmin[VECTOR_D] = false; range->openmax[VECTOR_D] = false; } int zzz=0; void kappadivcurl(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc){ *nc = 1; *nr = i == 0 ? SIZE_NOT_DETERMINED : -1; } /* Rot - Delta Delta^T */ void curl(double *x, cov_model *cov, double *v) { /* r = \| x\| d/d x_i f(r) = f'(r) x_i / r d^2/d x_i^2 f(r) = f''(r) x_i^2/r^2 + f'(r) (r^2 - x_i^2) / r^3 d^2/d x_i x_j f(r) = f''(r) x_i x_j/r^2 + f'(r) (- x_i x_j) / r^3 r = 0: d/d x_i f(r) |_0 = 0 d^2/d x_i^2 f(r) |_0 = f''(0) d^2/d x_i x_j f(r) = 0 Rot (n = dimension of spatial field) r=0 L = n * f''(0) operator: -0.5 * (a + 1) rot + a * hessian, a in [-1,1]; a=1/2 */ cov_model *next = cov->sub[0]; cov_fct *N = CovList + next->nr; // !!! nicht gatternr !!!! double norm[2], normSq0, normL2, normT2, D, D2, D3, diag, a = -1.0, // curl free b = - 0.5 * (1.0 + a); int i, td = cov->tsdim, dim = td, // currently no space-time allowed -> BA thesis dimP1 = dim + 1, dimP2 = dim + 2, dimP3 = dim + 3, dimP2sqM1 = dimP2 * dimP2 -1; // for three dimensions much // more complicated normL2 = normT2 = 0.0; for (i=0; iisoown == ISOTROPIC) { normSq0 = normL2 + normT2; } else { normSq0 = normL2; norm[1] = SQRT(normT2); } norm[0] = SQRT(normSq0); N->D(norm, next, &D); N->D2(norm, next, &D2); // printf("next %s\n", N->name); N->D3(norm, next, &D3); if (normSq0 == 0.0) { for (i=0; i<=dimP2sqM1; i++) v[i] = 0.0; N->cov(norm, next, v); // v[0] diag = (b * dim + a) * D2; for (i=dimP3; iD2(norm, next, v + dimP1); v[dimP1] *= 2.0; v[dimP2 * dimP1] = v[dimP1]; N->D4(norm, next, v + dimP2sqM1); v[dimP2sqM1] *= (8.0 / 3.0); } else { double zz[2], D2nsq = D2 / normSq0, D1n = D / norm[0], D3n = D3 / norm[0], D1n3 = D / (norm[0] * normSq0), delta = a * (D2nsq - D1n3), div = b * ((D2nsq - D1n3) * normL2 + dim * D1n); int k,l; N->cov(norm, next, v); // v[0] zz[0] = x[0]; zz[1] = x[1]; for (i=1; i<=dim; i++) { // kante links und oben v[i] = -(v[i * dimP2] = zz[i-1] * D1n); } diag = div + a * D1n; for (i= dimP3, k=0; kD4(norm, next, v + dimP2sqM1); // rechts unten v[dimP2sqM1] += 2.0 * D3n - D2nsq + D1n3; } // for (i=0; i<=15; i++) { // if (i!=15) v[i] = 0.0; // } } #define DIVCURL_WHICH 0 /* Div - Delta Delta^T */ void diverge(double *x, cov_model *cov, double *w) { // div -free !! /* r = \| x\| d/d x_i f(r) = f'(r) x_i / r d^2/d x_i^2 f(r) = f''(r) x_i^2/r^2 + f'(r) (r^2 - x_i^2) / r^3 d^2/d x_i x_j f(r) = f''(r) x_i x_j/r^2 + f'(r) (- x_i x_j) / r^3 r = 0: d/d x_i f(r) |_0 = 0 d^2/d x_i^2 f(r) |_0 = f''(0) d^2/d x_i x_j f(r) = 0 Div (n = dimension of spatial field) r=0 L = n * f''(0) operator: -0.5 * (a + 1) div + a * hessian, a in [-1,1]; a=1 */ cov_model *next = cov->sub[0]; cov_fct *N = CovList + next->nr; // gatter oder keine gatter?? double norm[2], normSq0, normL2, normT2, D, D2, D3, diag, a = 1.0, // divergenz free b = - 0.5 * (1.0 + a); int i, td = cov->tsdim, dim = td, // currently no space-time allowed -> BA thesis dimP1 = dim + 1, dimP2 = dim + 2, dimP3 = dim + 3, dimP2sqM1 = dimP2 * dimP2 -1; // for three dimensions much // more complicated double *v = PisNULL(DIVCURL_WHICH) ? w : cov->Sextra->a; normL2 = normT2 = 0.0; for (i=0; iisoown == ISOTROPIC) { normSq0 = normL2 + normT2; } else { normSq0 = normL2; norm[1] = SQRT(normT2); } norm[0] = SQRT(normSq0); N->D(norm, next, &D); N->D2(norm, next, &D2); N->D3(norm, next, &D3); if (normSq0 == 0.0) { for (i=0; i<=dimP2sqM1; i++) v[i] = 0.0; N->cov(norm, next, v); // v[0] diag = (b * dim + a) * D2; for (i=dimP3; iD2(norm, next, v + dimP1); v[dimP1] *= 2.0; v[dimP2 * dimP1] = v[dimP1]; N->D4(norm, next, v + dimP2sqM1); // printf("%s %f\n", N->name,v[dimP2sqM1]); v[dimP2sqM1] *= (8.0 / 3.0); } else { double zz[2], D2nsq = D2 / normSq0, D1n = D / norm[0], D3n = D3 / norm[0], D1n3 = D / (norm[0] * normSq0), delta = a * (D2nsq - D1n3), div = b * ((D2nsq - D1n3) * normL2 + dim * D1n); int k,l; N->cov(norm, next, v); // v[0] zz[0] = -x[1]; zz[1] = x[0]; for (i=1; i<=dim; i++) { // kante links und oben v[i] = -(v[i * dimP2] = zz[i-1] * D1n); } diag = div + a * D1n; for (i= dimP3, k=0; kD4(norm, next, v + dimP2sqM1); // rechts unten v[dimP2sqM1] += 2.0 * D3n - D2nsq + D1n3; } if (!PisNULL(DIVCURL_WHICH)) { int len = NROW(DIVCURL_WHICH), size = (int) cov->q[0]; for (i=0; isub[0]; // been programmed yet int err, i, dim = cov->tsdim, spacedim; isotropy_type isotropy; // statt STATIONARY : VARIOGRAM ?? s. Paper mit Scheuerer if ((err = CHECK(next, dim, 1, PosDefType, cov->domown, ISOTROPIC, SCALAR, ROLE_COV)) != NOERROR) { if ((err = CHECK(next, dim, 1, PosDefType, cov->domown, SPACEISOTROPIC, SCALAR, ROLE_COV)) != NOERROR) return err; } // PMI(next); if (next->full_derivs < 4) SERR("4th derivative of submodel not defined"); if (cov->tsdim != 2) SERR("currently coded only for dim=2"); isotropy = next->isoown; spacedim = dim - (isotropy == SPACEISOTROPIC); if (isotropy != ISOTROPIC && isotropy != SPACEISOTROPIC) SERR("submodel must be spaceisotropic"); if (spacedim != 2) SERR("model currently only defined for the plane"); setbackward(cov, next); int diffpref = MIN(2, PREF_BEST - cov->pref[CircEmbed]); if (diffpref > 0) cov->pref[CircEmbed] += diffpref; int components = spacedim + 2; // only correct for spacedim == 2!!! int nwhich = NROW(DIVCURL_WHICH); if (nwhich > 0) { for (i=0; i components) SERR4("value %s[%d]=%d outside range 1,...,%d.", KNAME(i), i, PINT(DIVCURL_WHICH)[i], components); } EXTRA_STORAGE; ALLOC_EXTRA(a, components * components); } else { nwhich = components; } for (i=0; impp.maxheights[i] = RF_NA; cov->vdim[0] = cov->vdim[1] = nwhich; assert(spacedim == 2); next->delflag = DEL_COV; if (cov->q == NULL) { QALLOC(1); cov->q[0] = components; } return NOERROR; } void rangedivcurl(cov_model *cov, range_type *range){ cov_model *next = cov->sub[0]; int dim = cov->tsdim, spacedim = dim - (next->isoown == SPACEISOTROPIC), max = spacedim + 2; if (spacedim != 2) ERR("div and curl currently programmed only for spatial dimension 2."); range->min[DIVCURL_WHICH] = 1; range->max[DIVCURL_WHICH] = max; range->pmin[DIVCURL_WHICH] = 1; range->pmax[DIVCURL_WHICH] = max; range->openmin[DIVCURL_WHICH] = false; range->openmax[DIVCURL_WHICH] = false; } /* #define LP_P 0 void lp(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double z, p = P0(LP_P); int d, dim = cov->tsdim; for (z=0.0, d=0; dsub[0]; int err; kdefault(cov, 0, 1.0); if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, cov->tsdim + 1, 1, PosDefType, XONLY,ISOTROPIC, SCALAR, ROLE_COV)) != NOERROR) return err; next->delflag = DEL_COV; // no setbackward double p =P0(LP_P); if (p==1) { cov->maxdim = next->maxdim - 1; // true for p==1 if (cov->maxdim == 0) cov->maxdim = 1; } else if (p==2) { cov->maxdim = next->maxdim; } else if (!skipchecks) SERR("p must be 1 or 2."); cov->monotone = next->monotone; cov->semiseparatelast = false; updatepref(cov, next); assert(false); // nicht verwendete Fkt return NOERROR; } void rangelp(cov_model *cov, range_type *range){ range->min[LP_P] = 0.0; range->max[LP_P] = 2.0; range->pmin[LP_P] = 0.01; range->pmax[LP_P] = 2.0; range->openmin[LP_P] = true; range->openmax[LP_P] = false; } */ #define MA1_ALPHA 0 #define MA1_BETA 1 void ma1(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double z, alpha = P0(MA1_ALPHA), theta = P0(MA1_BETA); COV(x, next, &z); *v = POW(theta / (1 - (1-theta) * z), alpha); } int checkma1(cov_model *cov) { // bool skipchecks = GLOBAL.general.skipchecks; cov_model *next = cov->sub[0]; // double p; int err; kdefault(cov, 0, 1.0); kdefault(cov, 1, 0.5); if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; //cov->semiseparatelast = cov->separatelast =false; cov->logspeed = 0.0; // updatepref(cov, next); setbackward(cov, next); cov->mpp.maxheights[0] = 1.0; return NOERROR; } void rangema1(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[MA1_ALPHA] = 0.0; range->max[MA1_ALPHA] = RF_INF; range->pmin[MA1_ALPHA] = 0.01; range->pmax[MA1_ALPHA] = 10; range->openmin[MA1_ALPHA] = true; range->openmax[MA1_ALPHA] = true; range->min[MA1_BETA] = 0.0; range->max[MA1_BETA] = 1.0; range->pmin[MA1_BETA] = 0.0; range->pmax[MA1_BETA] = 1.0; range->openmin[MA1_BETA] = true; range->openmax[MA1_BETA] = true; } void ma2(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double z, z0; COV(ZERO, next, &z0); COV(x, next, &z); z = z0 - z; *v = (z == 0) ? 1.0 : (1.0 - EXP(-z)) / z; } int checkma2(cov_model *cov) { // bool skipchecks = GLOBAL.general.skipchecks; cov_model *next = cov->sub[0]; // double p; int err; if ((err = checkkappas(cov)) != NOERROR) return err; if ((err = CHECK(next, cov->tsdim, cov->xdimown, VariogramType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; // cov->semiseparatelast = cov->separatelast =false; cov->logspeed = 0.0; // updatepref(cov, next); setbackward(cov, next); cov->mpp.maxheights[0] = 1.0; return NOERROR; } #define M_M 0 void kappaM(int i, cov_model *cov, int *nr, int *nc){ *nc = SIZE_NOT_DETERMINED; *nr = i < CovList[cov->nr].kappas ? SIZE_NOT_DETERMINED : -1; } void M(cov_model *cov, double *Z, double *V) { // M C M^t cov_model *next = cov->sub[0]; int *ncol = cov->ncol, *nrow = cov->nrow; double alpha = 1.0, beta = 0.0, *M = P(M_M); // SUBROUTINE DGEMM(TRANSA,TRANSB,M,N,K, ALPHA,A,LDA,B,LDB, BETA,C,LDC) // C := alpha*op( A )*op( B ) + beta*C, // M : rows of op(A) // N : cols of op(B) // K : cols of op(A)= rows of op(B) // LD-X : first dimension of X \command{\link{RMflat}} \tab constant in space \cr if (next->vdim[0] == 1) { F77_CALL(dgemm)("N", "T", nrow, nrow, ncol, Z, M, nrow, M, nrow, &beta, V, nrow); } else { ALLOC_EXTRA2(MZ,*nrow * *ncol); F77_CALL(dgemm)("N", "N", nrow, ncol, ncol, &alpha, M, nrow, Z, ncol, &beta, MZ, nrow); F77_CALL(dgemm)("N", "T", nrow, nrow, ncol, &alpha, MZ, nrow, M, nrow, &beta, V, nrow); } } void Mstat(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; int ncol = cov->ncol[M_M]; assert(cov->Sextra != NULL); ALLOC_EXTRA(z, ncol * ncol); COV(x, next, z); M(cov, z, v); } void Mnonstat(double *x, double *y, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; int ncol = cov->ncol[M_M]; ALLOC_EXTRA(z, ncol * ncol); NONSTATCOV(x, y, next, z); M(cov, z, v); } int checkM(cov_model *cov) { cov_model *next = cov->sub[0]; int err, i, nrow = cov->ncol[M_M]; if (nrow > MAXMPPVDIM) SERR2("the maximum multivariate dimension is %d, but %d is given by the user", MAXMPPVDIM, nrow); if ((err = checkkappas(cov)) != NOERROR) return err; cov->vdim[0] = cov->vdim[1] = cov->nrow[M_M]; // zwingend vor C-HECK if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, cov->ncol[M_M], ROLE_COV)) != NOERROR) { // MERR(err); printf("x"); return err; } setbackward(cov, next); for (i=0; impp.maxheights[i] = RF_NA; EXTRA_STORAGE; return NOERROR; } sortsofparam sortof_M(int k, int row, int col) { return k<0 ? VARPARAM : (row==col) ? SDPARAM : SIGNEDSDPARAM; } void rangeM(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[M_M] = RF_NEGINF; range->max[M_M] = RF_INF; range->pmin[M_M] = -1e5; range->pmax[M_M] = 1e5; range->openmin[M_M] = true; range->openmax[M_M] = true; } #define SCATTER_STEP 0 #define SCATTER_MAX 1 void kappaScatter(int i, cov_model *cov, int *nr, int *nc){ *nc = 1; *nr = i < CovList[cov->nr].kappas ? 0 : -1; } void Scatter(double *xx, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double *xmin = cov->Sscatter->xmin; int i, d, vdim = cov->vdim[0] * cov->vdim[1], tsxdim = cov->xdimown; scatter_storage *s = cov->Sscatter; for (i=0; ixmin[d] = (double) s->min[d] * s->step[d] + xx[d]; } } int *nx = s->nx, *start = s->min, *end = s->max; double *x = s->x, *xstart = xmin, *inc = s->step; for (d=0; dvalue); for (i=0; ivalue[i]; STANDARDINKREMENT; } } int checkScatter(cov_model *cov) { cov_model *next = cov->sub[0]; mpp_param *gp = &(GLOBAL.mpp); int d, nr, err, dim = cov->xdimown, vdim = cov->vdim[0] * cov->vdim[1]; if (PisNULL(SCATTER_MAX)) { PALLOC(SCATTER_MAX, dim, 1); for (d=0; dscatter_max[d]; } else if ((nr = cov->nrow[SCATTER_MAX]) < dim) { int j, *m = PINT(SCATTER_MAX); assert(nr > 0); PtoNULL(SCATTER_MAX); PALLOC(SCATTER_MAX, dim, 1); for (j=d=0; dscatter_step[d]; } else if ((nr = cov->nrow[SCATTER_STEP]) < dim) { int j; double *m = P(SCATTER_STEP); assert(nr > 0); PtoNULL(SCATTER_MAX); PALLOC(SCATTER_MAX, dim, 1); for (j=d=0; dtsdim, cov->xdimown, ShapeType, cov->domown, cov->isoown, cov->vdim[0], cov->vdim[1], cov->role)) != NOERROR) return err; setbackward(cov, next); if (cov->Sscatter == NULL || cov->Sscatter->dim != dim || cov->Sscatter->vdim != vdim) { NEW_STORAGE(scatter); cov->Sscatter->vdim = vdim; cov->Sscatter->dim = dim; ALLOC_NEWINT(Sscatter, nx, dim, nx); ALLOC_NEWINT(Sscatter, min, dim, min); ALLOC_NEWINT(Sscatter, max, dim, max); ALLOC_NEW(Sscatter, x, dim, x); ALLOC_NEW(Sscatter, step, dim, step); ALLOC_NEW(Sscatter, xmin, dim, xmin); ALLOC_NEW(Sscatter, value, vdim, value); location_type *loc = Loc(cov); for (d=0; dgrid) { step[d] = loc->xgr[d][XSTEP]; } else SERR1("non-positive '%s' only allowed for grids", KNAME(SCATTER_STEP)); } else { step[d] = P(SCATTER_STEP)[d]; } if (P(SCATTER_MAX)[d] < 0) { if (P(SCATTER_STEP)[d] > 0) { NONSTATINVERSE(&(GLOBAL.mpp.about_zero), next, xmin, x); } else { min[0] = 0; max[d] = loc->xgr[d][XLENGTH]; } } else { if (P(SCATTER_STEP)[d] > 0) { min[d] = -(max[d] = P(SCATTER_MAX)[d]); } else { min[d] = max[d] = NA_INTEGER; } } max[d]++; // da auf '<' getestet wird xmin[d] = (double) min[d] * step[d]; } } cov->taylorN = cov->tailN = MISMATCH; return NOERROR; } void rangeScatter(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[SCATTER_STEP] = RF_NEGINF; range->max[SCATTER_STEP] = RF_INF; range->pmin[SCATTER_STEP] = 1e-5; range->pmax[SCATTER_STEP] = 1e5; range->openmin[SCATTER_STEP] = true; range->openmax[SCATTER_STEP] = true; range->min[SCATTER_MAX] = -1; range->max[SCATTER_MAX] = MAXINT; range->pmin[SCATTER_MAX] = 0; range->pmax[SCATTER_MAX] = 999; range->openmin[SCATTER_MAX] = false; range->openmax[SCATTER_MAX] = true; } int struct_scatter(cov_model VARIABLE_IS_NOT_USED *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){ return NOERROR; } int init_scatter(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { int t, i; //vdim = cov->vdim[0]; cov_model *next = cov->sub[0]; if (cov->vdim[1] != 1) SERR("matrix-valued shape functions cannot be initialised"); if (hasAnyShapeRole(cov)) { for (i=0; i<=cov->mpp.moments; i++) cov->mpp.mM[i] = cov->mpp.mMplus[i] = RF_NA; Scatter(ZERO, cov, cov->mpp.maxheights); if (next->taylor[0][TaylorPow] < 0.0) { cov->taylorN = next->taylorN; for (i=0; i < next->taylorN; i++) for (t=TaylorConst; t <= TaylorPow; t++) cov->taylor[i][t] = next->taylor[i][t]; } else { cov->taylorN = 1; cov->taylor[0][TaylorConst] = cov->mpp.maxheights[0]; cov->taylor[0][TaylorPow] = 0.0; } cov->tailN = next->tailN; for (i=0; i < next->tailN; i++) for (t=TaylorConst; t <= TaylorExpPow; t++) cov->tail[i][t] = next->tail[i][t]; } else ILLEGAL_ROLE; return NOERROR; } #define SCHUR_M 0 #define SCHUR_DIAG 1 #define SCHUR_RED 2 void kappaSchur(int i, cov_model *cov, int *nr, int *nc){ double *M = P(SCHUR_M); int vdim = cov->nrow[M != NULL ? SCHUR_M : SCHUR_DIAG]; *nc = i == SCHUR_M ? vdim : 1; *nr = i == SCHUR_RED ? vdim * (vdim-1) / 2 : i < CovList[cov->nr].kappas ? vdim : -1; } void SchurMult(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double *v){ double *M = P(SCHUR_M); int i, vdim = cov->vdim[0]; if (!PisNULL(SCHUR_M)) { int nrow2 = cov->nrow[SCHUR_M] * cov->nrow[SCHUR_M]; for (i=0; iq, *diag=P(SCHUR_DIAG), *red=P(SCHUR_RED); for (i=0; isub[0]; COV(x, next, v); SchurMult(x, cov, v); } void DSchur(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl1(x, next, v); SchurMult(x, cov, v); } void D2Schur(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl2(x, next, v); SchurMult(x, cov, v); } void D3Schur(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl3(x, next, v); SchurMult(x, cov, v); } void D4Schur(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl4(x, next, v); SchurMult(x, cov, v); } void Schurnonstat(double *x, double *y, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; NONSTATCOV(x, y, next, v); SchurMult(x, cov, v); } int checkSchur(cov_model *cov) { cov_model *next = cov->sub[0]; double *C, *M=P(SCHUR_M), *diag=P(SCHUR_DIAG), *red=P(SCHUR_RED); int i,j, k, l, err = NOERROR, vdim = cov->nrow[M != NULL ? SCHUR_M : SCHUR_DIAG], vdimP1 = vdim + 1, bytes = vdim * vdim * sizeof(double), *nrow = cov->nrow, *ncol = cov->ncol; cov->vdim[0] = cov->vdim[1] = vdim; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, nrow[SCHUR_M], ROLE_COV)) != NOERROR) return err; setbackward(cov, next); if (M == NULL) { if (diag == NULL || red == NULL) SERR3("either '%s' and '%s' or '%s' must be given", KNAME(SCHUR_DIAG), KNAME(SCHUR_RED), KNAME(SCHUR_M)); for (i=0; impp.maxheights[i] = 1.0; /* Check symmetry?? for (vdiag = i=0; imin[SCHUR_M] = RF_NEGINF; range->max[SCHUR_M] = RF_INF; range->pmin[SCHUR_M] = -1e5; range->pmax[SCHUR_M] = 1e5; range->openmin[SCHUR_M] = true; range->openmax[SCHUR_M] = true; range->min[SCHUR_DIAG] = 0; range->max[SCHUR_DIAG] = RF_INF; range->pmin[SCHUR_DIAG] = 0; range->pmax[SCHUR_DIAG] = 1e5; range->openmin[SCHUR_DIAG] = false; range->openmax[SCHUR_DIAG] = true; range->min[SCHUR_RED] = 0; range->max[SCHUR_RED] = 1; range->pmin[SCHUR_RED] = 0; range->pmax[SCHUR_RED] = 1; range->openmin[SCHUR_RED] = false; range->openmax[SCHUR_RED] = false; } #define ID_VDIM 0 void IdStat(double *x, cov_model *cov, double *v) { // cov_model // *key = cov->key; // if (key != NULL) CovList[key->nr].cov(x, key, v); // else { cov_model *next = cov->sub[0]; COV(x, next, v); // } } void IdNonStat(double *x, double *y, cov_model *cov, double *v){ // cov_model // *key = cov->key; // if (key != NULL) CovList[key->nr].nonstat_cov(x, y, key, v); // else { cov_model *next = cov->sub[0]; NONSTATCOV(x, y, next, v); // } } int checkId(cov_model *cov) { cov_model *next = cov->sub[0]; int err; cov->vdim[0] = cov->vdim[1] = !PisNULL(ID_VDIM) ? P0INT(ID_VDIM) : SUBMODEL_DEP; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, cov->vdim, cov->role)) !=NOERROR) return err; if (cov->vdim[0] == SUBMODEL_DEP) { cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; } cov->logspeed = next->logspeed; setbackward(cov, next); return NOERROR; } void DId(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl1(x, next, v); } void DDId(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; Abl2(x, next, v); } void TBM2Id(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; TBM2CALL(x, next, v) } void IdInverse(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; INVERSE(x, next, v); } int initId(cov_model *cov, gen_storage *S) { cov_model *next = cov->sub[0]; return INIT(next, cov->mpp.moments, S); } void spectralId(cov_model *cov, gen_storage *S, double *e) { // spectral_storage *s = &(S->Sspectral); cov_model *next = cov->sub[0]; SPECTRAL(next, S, e); // nicht nr } void coinitId(cov_model *cov, localinfotype *li) { cov_model *next = cov->sub[0]; CovList[next->nr].coinit(next, li); // nicht nr } void ieinitId(cov_model *cov, localinfotype *li) { cov_model *next = cov->sub[0]; CovList[next->nr].ieinit(next, li); // nicht nr } void rangeId(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[ID_VDIM] = 1.0; range->max[ID_VDIM] = RF_INF; range->pmin[ID_VDIM] = 1.0; range->pmax[ID_VDIM] = 10; range->openmin[ID_VDIM] = false; range->openmax[ID_VDIM] = true; } #define EXP_N 0 #define EXP_STANDARDISED 1 void Exp(double *x, cov_model *cov, double *v, int n, bool standardize){ double v0, s = 0.0, w = 1.0; cov_model *next = cov->sub[0]; int k, vdim = cov->vdim[0], vdimq = vdim * vdim; COV(x, next, v); if (vdim == 1) { for (k=0; k<=n; k++) { s += w; w *= *v / (double) (k+1); } *v = EXP(*v) - s; if (standardize) { Exp(ZERO, cov, &v0, n, false); *v /= v0; } } else { int i; BUG; // fehlt die multiplication von links und rechts mit C(0)^{-1/2} for (i=0; isub[0]; double v0, s = 0.0, w = 1.0; int k, vdim = cov->vdim[0], vdimq = vdim * vdim; NONSTATCOV(x, y, next, v); if (vdim == 1) { for (k=0; k<=n; k++) { s += w; w *= *v / (double) (k+1); } *v = EXP(*v) - s; if (standardised) { nonstatExp(ZERO, ZERO, cov, &v0, n, false); *v /= v0; } } else { int i; BUG; // fehlt die multiplication von links und rechts mit C(0)^{-1/2} for (i=0; isub[0]; int n = P0(EXP_N); assert(cov->vdim[0] == 1); Abl1(x, next, &D); Exp(x, cov, v, n - 1, false); *v *= -D; if (P0INT(EXP_STANDARDISED)) { double v0; Exp(ZERO, cov, &v0, n, false); *v /= v0; } } // Hier fehlt die multidim variante (Hesse matrix) void DDExp(double *x, cov_model *cov, double *v){ double D, Abl2, w; cov_model *next = cov->sub[0]; int n = P0INT(EXP_N); assert(cov->vdim[0] == 1); Abl1(x, next, &D); Abl2(x, next, &Abl2); Exp(x, cov, v, n - 2, false); Exp(x, cov, &w, n - 1, false); *v = D * D * *v + Abl2 * w; // Achtung + D2 nicht - D2, da D2 Ableitung einer Cov. if (P0INT(EXP_STANDARDISED)) { double v0; Exp(ZERO, cov, &v0, n, false); *v /= v0; } } int checkExp(cov_model *cov) { cov_model *next = cov->sub[0]; int err, i, vdim = cov->vdim[0]; kdefault(cov, EXP_N, -1); if (!isPosDef(next->typus) && P0INT(EXP_N) != -1) SERR("for variograms only n=-1 allowed"); kdefault(cov, EXP_STANDARDISED, 1); if ((err = CHECKPD2ND(next, cov->tsdim, cov->xdimown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; next->delflag = DEL_COV - 10; setbackward(cov, next); if (cov->vdim[0] > 1 && P0INT(EXP_N) != -1) SERR1("'%s' must be '-1' in the multivariate case", KNAME(EXP_N)); if (cov->vdim[0] > 1) SERR("multivariate case not programmed yet"); if (next->domown == XONLY) { cov_fct *C = CovList + cov->nr; cov->pref[CircEmbed] = C->pref[CircEmbed]; cov->pref[Direct] = C->pref[Direct]; cov->pref[Sequential] = C->pref[Sequential]; if (!isVariogram(cov->typus)) SERR1("negative definite function expected -- got '%s'", TYPENAMES[cov->typus]); } else { if (!isPosDef(cov)) SERR1("positive definite function expected -- got '%s'", TYPENAMES[cov->typus]); } double height= isVariogram(next->typus) && !isPosDef(next->typus) ? 1.0 : RF_NA; for (i=0; impp.maxheights[i] = height; cov->monotone = (isBernstein(next)) ? NORMAL_MIXTURE : isMonotone(next->monotone) ? MONOTONE : NOT_MONOTONE; cov->logspeed = 0.0; return NOERROR; } void rangeExp(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[EXP_N] = -1; range->max[EXP_N] = RF_INF; range->pmin[EXP_N] = -1; range->pmax[EXP_N] = 5; range->openmin[EXP_N] = false; range->openmax[EXP_N] = true; range->min[EXP_STANDARDISED] = 0; range->max[EXP_STANDARDISED] = 1; range->pmin[EXP_STANDARDISED] = 0; range->pmax[EXP_STANDARDISED] = 1; range->openmin[EXP_STANDARDISED] = false; range->openmax[EXP_STANDARDISED] = false; } void Pow(double *x, cov_model *cov, double *v){ double v0, v1, alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; COV(ZERO, next, &v0); COV(x, next, &v1); *v = POW(v0, alpha) - POW(v0 - v1, alpha); // print("Pow %f %f %f v=%f\n", v0, v1, alpha, *v); } void DPow(double *x, cov_model *cov, double *v){ double v0, v1, gamma, alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; Abl1(x, next, v); if (alpha == 1.0) return; COV(ZERO, next, &v0); COV(x, next, &v1); gamma = v0 - v1; *v *= - alpha * POW(gamma, alpha -1.0); // Achtung "-" , da covarianzfunktion angenommen } void DDPow(double *x, cov_model *cov, double *v){ double D, v0, v1, gamma, alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; Abl2(x, next, v); if (alpha == 1.0) return; Abl1(x, next, &D); COV(ZERO, next, &v0); COV(x, next, &v1); gamma = v0 - v1; *v *= - alpha * POW(gamma, alpha - 2.0) * ((alpha - 1.0) * D + gamma * (*v)); // Achtung "-" , da covarianzfunktion angenommen } void InversePow(double *x, cov_model *cov, double *v) { // invPow only defined for submodel having variance 1 !!!! cov_model *next = cov->sub[0]; double v0, alpha = P0(POW_ALPHA); COV(ZERO, next, &v0); v0 = v0 - POW(POW(v0, alpha) - *x, 1 / alpha); INVERSE(&v0, next, v); /* COV(x, next, v); double y = v0 - *v; if (y < 0.0 || y > 1.0) { if (y > -1e-14 && y < 0.0) y=0.0; else if (y < 1.0 + 1e-14) y=1.0; else { //PRINTF("covariance value %e (1 - %e = %e) at %e\n", *v, *v, 1.0-*v, *x); ERR("invPow valid only for non-negative covariance models with variance 1"); } } *v = 1.0 - POW(y, 1.0 / alpha); // print("%f %f %f\n", y, *v, P0(POW_ALPHA)); // print("Inv %f %f %f v=%f\n", *x, P0(POW_ALPHA),y, *v); */ } int checkPow(cov_model *cov) { cov_model *next = cov->sub[0]; int err; //Types type; //print("OK %d %d\n", cov->domown, cov->isoown); if ((err = checkkappas(cov)) != NOERROR) return err; if (cov->domown != XONLY) return ERRORSTATVARIO; cov->nr = isVariogram(cov) ? POW : SHAPEPOW; if ((err = CHECK(next, cov->tsdim, cov->xdimown, cov->typus, //PosDefType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR){ // print("OK %d\n",err); return err; } // print("xOK %d\n",err); setbackward(cov, next); assert(cov->vdim[0] == 1); cov->mpp.maxheights[0] = RF_NA; cov->monotone = isMonotone(next->monotone) && P0(POW_ALPHA) > 0 ? MONOTONE : NOT_MONOTONE; return NOERROR; } void rangePow(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ if (isVariogram(cov)) { range->min[POW_ALPHA] = 0.0; range->max[POW_ALPHA] = 1.0; range->pmin[POW_ALPHA] = 0.01; range->pmax[POW_ALPHA] = 1.0; range->openmin[POW_ALPHA] = true; range->openmax[POW_ALPHA] = false; } else { range->min[POW_ALPHA] = RF_NEGINF; range->max[POW_ALPHA] = RF_INF; range->pmin[POW_ALPHA] = -10; range->pmax[POW_ALPHA] = 10; range->openmin[POW_ALPHA] = true; range->openmax[POW_ALPHA] = true; } } //////////////////////////////////////////////////////////////////// void shapePow(double *x, cov_model *cov, double *v){ double alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; COV(x, next, v); *v = POW(*v, alpha); // print("Pow %f %f %f v=%f\n", v0, v1, alpha, *v); } void DshapePow(double *x, cov_model *cov, double *v){ double v0, alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; Abl1(x, next, v); if (alpha == 1.0) return; COV(ZERO, next, &v0); *v *= - alpha * POW(v0, alpha -1.0); // Achtung "-" , da covarianzfunktion angenommen } void DDshapePow(double *x, cov_model *cov, double *v){ double D, v0, alpha = P0(POW_ALPHA); cov_model *next = cov->sub[0]; Abl2(x, next, v); if (alpha == 1.0) return; Abl1(x, next, &D); COV(x, next, &v0); *v *= alpha * POW(v0, alpha - 2.0) * ((alpha - 1.0) * D + v0 * (*v)); // Achtung "-" , da covarianzfunktion angenommen } void InverseShapePow(double *x, cov_model *cov, double *v) { // invPow only defined for submodel having variance 1 !!!! cov_model *next = cov->sub[0]; double alpha = P0(POW_ALPHA); INVERSE(x, next, v); *v = POW(*v, 1.0 / alpha); // print("%f %f %f\n", y, *v, P0(POW_ALPHA)); // print("Inv %f %f %f v=%f\n", *x, P0(POW_ALPHA),y, *v); } //////////////////////////////////////////////////////////////////// /* qam */ void kappaqam(int i, cov_model *cov, int *nr, int *nc){ *nc = 1; *nr = i < CovList[cov->nr].kappas ? cov->nsub-1 : -1; } void qam(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; int i, nsub = cov->nsub; double sum, s, w, *theta = P(QAM_THETA); sum = 0.0; for (i=1; isub[i]; COV(x, sub, &s); INVERSE(&s, next, &w); sum += theta[i - 1] * w * w; } sum = SQRT(sum); COV(&sum, next, v); } int checkqam(cov_model *cov) { cov_model *next = cov->sub[0], *sub; int i, err, nsub = cov->nsub, nsubM1 = nsub - 1; double v, sum; if ((err = checkkappas(cov)) != NOERROR) return err; // cov->monotone = NORMAL_MIXTURE; sum = 0.0; for (i=0; i 1e-14) SERR("theta must sum up to 1"); if ((err = CHECK(next, 1, 1, PosDefType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; if (!isNormalMixture(next->monotone)) SERR("phi is not a normal mixture"); for (i=1; isub[i]; if ((err = CHECK(sub, cov->tsdim, cov->tsdim, PosDefType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; COV(ZERO, sub, &v); if (v != 1.0) SERR("unit variance required"); setbackward(cov, sub); } INVERSE(ZERO, next, &v); if (ISNAN(v)) SERR1("inverse function of '%s' unknown", NICK(next)); cov->logspeed = 0.0; return NOERROR; } void rangeqam(cov_model *cov, range_type *range){ double pmax = 2.0 / (double) (cov->nsub-1); range->min[QAM_THETA] = 0.0; range->max[QAM_THETA] = 1.0; range->pmin[QAM_THETA] = 0.0; range->pmax[QAM_THETA] = pmax; range->openmin[QAM_THETA] = false; range->openmax[QAM_THETA] = false; } /* mqam */ void kappamqam(int i, cov_model *cov, int *nr, int *nc) { int nsub = cov->nsub - 1; *nc = (i==QAM_THETA) ? 1 : -1; *nr = i == QAM_THETA ? nsub : -1; // print("kappa %d nsub=%d %d %d\n", i, nsub, *nc, *nr); } void mqam(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; int i, j, k, l, vdim = cov->vdim[0], vdimP1 = vdim + 1; double s0, *theta = P(QAM_THETA), s[MAXSUB]; for (i=0; isub[i+1]; COV(x, sub, &s0); INVERSE(&s0, next, s + i); s[i] *= theta[i] * s[i]; } for (j=0; jnsub, vdim = nsub - 1; // NotProgrammedYet(""); if ((err = checkqam(cov)) != NOERROR) return err; cov->vdim[0] = cov->vdim[1] = vdim; return NOERROR; } void rangemqam(cov_model *cov, range_type *range){ //double pmax = 2.0 / (double) (cov->nsub-1); rangeqam(cov, range); } /////////////// NATSC void natsc(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double invscale, y; INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); y = *x * invscale; // letzteres darf nur passieren wenn dim = 1!! COV(&y, next, v); } void Dnatsc(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim; double invscale, y; assert(CovList[next->nr].inverse != NULL); INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); y = *x * invscale; Abl1(&y, next, v); for (i=0; isub[0]; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim; double invscale, y, invScSq; assert(CovList[next->nr].inverse != NULL); INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); y = *x * invscale; invScSq = invscale * invscale; Abl2(&y, next, v); for (i=0; isub[0]; double invscale, modelinv; assert(CovList[next->nr].inverse != NULL); INVERSE(x, next, &modelinv); INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); *v = modelinv / invscale; } int checknatsc(cov_model *cov) { cov_model *next = cov->sub[0]; int err; assert(isNatsc(cov)); if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { return err; } if (next->domown == cov->domown && next->isoown == cov->isoown) { next->delflag = DEL_COV - 12; } if (CovList[next->nr].inverse == NULL) { SPRINTF(ERRORSTRING, "natural scaling is not defined for %s", NICK(next)); return ERRORFAILED; } double invscale; INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); if (invscale == RF_NAN) SERR1("inverse function of '%s' unknown", NICK(next)); cov->logspeed = 0.0; setbackward(cov, next); cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; return NOERROR; } int initnatsc(cov_model *cov, gen_storage *s){ // location_type *loc = Loc(cov); if (cov->role == ROLE_GAUSS) { cov_model *next = cov->sub[0]; return INIT(next, cov->mpp.moments, s); } else if (cov->role == ROLE_BROWNRESNICK || cov->role == ROLE_SMITH || cov->role == ROLE_SCHLATHER || cov->role == ROLE_POISSON || cov->role == ROLE_POISSON_GAUSS) { SERR("natsc for max-stable processes and poisson process not programmed yet"); } else ILLEGAL_ROLE; return NOERROR; } void donatsc(cov_model *cov, gen_storage *s){ cov_model *next = cov->sub[0]; DO(next, s); } void spectralnatsc(cov_model *cov, gen_storage *S, double *e) { // spectral_storage *s = &(S->Sspectral); cov_model *next = cov->sub[0]; int d, dim = cov->tsdim; double invscale; INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); SPECTRAL(next, S, e); for (d=0; dsub[0]; cov_fct *C = CovList + next->nr; // not gatternr if ( C->coinit == NULL) ERR("# cannot find coinit -- please inform author"); C->coinit(next, li); // not gatternr } void ieinitnatsc(cov_model *cov, localinfotype *li) { cov_model *next = cov->sub[0]; cov_fct *C = CovList + next->nr; // not gatternr if ( C->ieinit == NULL) // not gatternr ERR("# cannot find ieinit -- please inform author"); C->ieinit(next, li); // not gatternr } void tbm2natsc(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; double invscale, y; INVERSE(&GLOBAL.gauss.approx_zero, next, &invscale); y = x[0] * invscale; TBM2CALL(&y, next, v) } ////////////////////////////////////// void truncsupport(double *x, cov_model *cov, double *v){ // truncsupport erwartet dass vorher $ kommt, sofern skalenmischung cov_model *next = cov->sub[0]; int xdimown = cov->xdimown; double dist, radius = P0(TRUNC_RADIUS); // default -1 if (xdimown > 1) { int i; dist = 0.0; for (i=0; i=0 && dist > radius) { *v=0.0; return; } FCTN(x, next, v); // printf("ts %f %f\n", x, v); } int checktruncsupport(cov_model *cov) { cov_model *next=cov->sub[0]; int err, dim = cov->tsdim; // taken[MAX DIM], cov->maxdim=INFDIM; cov->monotone = isMonotone(next->monotone) ? MONOTONE : NOT_MONOTONE; if (cov->tsdim != cov->xdimown || cov->tsdim != cov->xdimprev) return ERRORDIM; if ((err = CHECK(next, dim, dim, ShapeType, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) { // print("error !!\n"); return err; } next->delflag = DEL_COV - 20; setbackward(cov, next); return NOERROR; } void truncsupportInverse(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double *v){ *v = P0(TRUNC_RADIUS); } void rangetruncsupport(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { range->min[TRUNC_RADIUS] = 0; // < 0 : unset range->max[TRUNC_RADIUS] = RF_INF; range->pmin[TRUNC_RADIUS] = 0.00001; range->pmax[TRUNC_RADIUS] = 100.0; range->openmin[TRUNC_RADIUS] = true; range->openmax[TRUNC_RADIUS] = true; } int struct_truncsupport(cov_model *cov, cov_model **newmodel) { int err; ASSERT_NEWMODEL_NOT_NULL; if (hasPoissonRole(cov) || hasMaxStableRole(cov)) { if ((err = addUnifModel(cov, P0(TRUNC_RADIUS), newmodel)) != NOERROR) return err; } else ILLEGAL_ROLE_STRUCT; switch (cov->role) { case ROLE_POISSON_GAUSS : BUG; // was denn das da? double invscale; addModel(newmodel, GAUSS); addModel(newmodel, DOLLAR); kdefault(*newmodel, DSCALE, INVSQRTTWO); addModel(newmodel, TRUNCSUPPORT); InverseGauss(&GLOBAL.mpp.about_zero, cov, &invscale); kdefault(*newmodel, TRUNC_RADIUS, invscale); break; case ROLE_POISSON : // optimierte density return addUnifModel(cov, 1.0, newmodel); case ROLE_MAXSTABLE : case ROLE_SMITH : return addUnifModel(cov, 1.0, newmodel); default : ILLEGAL_ROLE_STRUCT; } return NOERROR; } int init_truncsupport(cov_model *cov, gen_storage *s) { int i, err, vdim = cov->vdim[0]; assert(cov->vdim[0] == cov->vdim[1]); if (cov->role == ROLE_BROWNRESNICK || cov->role == ROLE_SMITH || cov->role == ROLE_SCHLATHER || cov->role == ROLE_POISSON || cov->role == ROLE_POISSON_GAUSS) { cov_model *next = cov->sub[0]; // double // radius = P0(TRUNC_RADIUS); // default -1 if ((err = INIT(next, cov->mpp.moments, s)) != NOERROR) return err; // if (radius>=0 && radius < cov->mpp.refradius) cov->mpp.refradius = radius; // Eplus, M2 are assumed to be still precise !! for (i=0; impp.maxheights[i] = next->mpp.maxheights[i]; return NOERROR; } else ILLEGAL_ROLE; } void do_truncsupport(cov_model *cov, gen_storage *s) { // mppinfotype *info = &(s->mppinfo); cov_model *next = cov->sub[0]; int i, vdim = cov->vdim[0]; // double // radius = P0(TRUNC_RADIUS); // default -1 assert(cov->vdim[0] == cov->vdim[1]); DO(next, s); for (i=0; impp.maxheights[i] = next->mpp.maxheights[i]; // if (radius>=0 && radius < info->radius) info->radius = radius; } void tbm3(double *x, cov_model *cov, double *v, double tbmdim){ cov_model *next = cov->sub[TBMOP_COV]; int i, vdim = cov->vdim[0], vdimsq = vdim * vdim; assert(cov->vdim[0] == cov->vdim[1]); double v1[MAXTBMVDIM * MAXTBMVDIM]; COV(x, next, v); // x has dim 2, if turning planes // print(" cov=%4.4f %f %f %f %f\n ", x[0], v[0], v[1], v[2], v[3]); if (x[0] != 0.0) { //I(next); Abl1(x, next, v1); // print(" D=%4.4f ", v1); for (i=0; icov; double *x = info->x; for (i=0; isub[TBMOP_COV]; int fulldim = P0INT(TBMOP_FULLDIM), tbmdim = P0INT(TBMOP_TBMDIM); //vdimsq = cov->vdim * cov->vdim; // print("x=%4.4f t=%4.4f ", x[0], x[1]); if (cov->role != ROLE_COV) COV(x, next, v) else if (fulldim == tbmdim + 2) tbm3(x, cov, v, (double) tbmdim); else if (fulldim == 2 && tbmdim == 1) { if (CovList[next->nr].tbm2 != NULL) TBM2CALL(x, next, v) else tbm2num(x, cov, v); } else XERR(ERRORTBMCOMBI); } void Dtbm(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[TBMOP_COV]; int i, fulldim = P0INT(TBMOP_FULLDIM), vdim = cov->vdim[0], vdimsq = vdim * vdim; assert(cov->vdim[0] == cov->vdim[1]); double v1[MAXTBMVDIM * MAXTBMVDIM], tbmdim = (double) P0INT(TBMOP_TBMDIM), f = 1.0 + 1.0 / tbmdim; BUG;// to do : Taylor-Entwicklung im Ursprung if (fulldim == tbmdim + 2) { Abl1(x, next, v); // x has dim 2, if turning planes Abl2(x, next, v1); for (i=0; isub[TBMOP_COV]; tbm_param *gp = &(GLOBAL.tbm); int err; // printf("here\n"); kdefault(cov, TBMOP_FULLDIM, PisNULL(TBMOP_TBMDIM) || gp->tbmdim >= 0 ? gp->fulldim : P0INT(TBMOP_TBMDIM) - gp->tbmdim); kdefault(cov, TBMOP_TBMDIM, gp->tbmdim > 0 ? gp->tbmdim : P0INT(TBMOP_FULLDIM) + gp->tbmdim); kdefault(cov, TBMOP_LAYERS, gp->layers); if ((err = checkkappas(cov)) != NOERROR) return err; int tbmdim = P0INT(TBMOP_TBMDIM), fulldim = P0INT(TBMOP_FULLDIM), vdim = cov->vdim[0]; double storedlayer = P0(TBMOP_LAYERS); bool layers = !ISNAN(storedlayer) ? storedlayer : cov->xdimown == tbmdim + 1 && cov->isoown == SPACEISOTROPIC; if(cov->vdim[0] != cov->vdim[1]) BUG; if (tbmdim >= fulldim) SERR4("'%s' (=%d) must be less than '%s' (=%d)", KNAME(TBMOP_TBMDIM), tbmdim, KNAME(TBMOP_FULLDIM), fulldim); if (cov->tsdim > fulldim + layers) return ERRORWRONGDIM; //printf("%d %d %d %d\n",cov->xdimown,tbmdim,layers, cov->isoown); if (cov->xdimown > tbmdim + layers) { SERR("dimension of coordinates does not match reduced dimension of tbm"); } if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { return err; } if (next->pref[TBM] == PREF_NONE) return ERRORPREFNONE; if (cov->isoown != ISOTROPIC && cov->isoown != SPACEISOTROPIC) { return ERRORANISO; } if (!isVariogram(cov->typus) || cov->domown != XONLY) { return ERRORSTATVARIO; } cov->maxdim = 0; setbackward(cov, next); cov->monotone=NOT_MONOTONE; cov->maxdim = fulldim + layers; cov->rese_derivs = next->rese_derivs - 1; cov->finiterange = ((fulldim - tbmdim) % 2 == 0) && next->finiterange == true; if (vdim > MAXTBMVDIM) SERR2("vdim (%d) exceeds max. value of vdim in tbm3 (%d)", vdim,MAXTBMVDIM); // only after being sure that the subsequent model does not cause // problems. So the time dimension should be fixed. // This is not absolutely safe programming, but should be OK. // But difficult to get around for MLE calls that do not allow // for NAs values in integer variables. P(TBMOP_LAYERS)[0] = layers; return NOERROR; } void rangetbm_common(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range, bool tbmop ){ int TBMDIM = tbmop ? TBMOP_TBMDIM : TBM_TBMDIM, FULLDIM = tbmop ? TBMOP_FULLDIM : TBM_FULLDIM, LAYERS = tbmop ? TBMOP_LAYERS : TBM_LAYERS; range->min[FULLDIM] = 1.0; range->max[FULLDIM] = RF_INF; range->pmin[FULLDIM] = 1.0; range->pmax[FULLDIM] = 100; range->openmin[FULLDIM] = false; range->openmax[FULLDIM] = true; range->min[TBMDIM] = RF_NEGINF; range->max[TBMDIM] = RF_INF; range->pmin[TBMDIM] = RF_NEGINF; range->pmax[TBMDIM] = 100; range->openmin[TBMDIM] = false; range->openmax[TBMDIM] = true; range->min[LAYERS] = 0.0; range->max[LAYERS] = 1.0; range->pmin[LAYERS] = 0.0; range->pmax[LAYERS] = 1.0; range->openmin[LAYERS] = false; range->openmax[LAYERS] = false; } void rangetbmop(cov_model *cov, range_type *range){ rangetbm_common(cov, range, true); } int set_stein_q(cov_model *next, double r, double d, double *q) { double C0, phi0, phi1, phi2, zero = 0.0, rP1 = r + 1.0, rM1 = r - 1.0, dsq = d * d; COV(&zero, next, &C0); COV(&d, next, &phi0); Abl1(&d, next, &phi1); // derivative of phi1 *= d; // scaled fctn at 1 Abl2(&d, next, &phi2); // 2nd derivative of phi2 *= dsq; // scaled fctn at 1 q[LOCAL_R] = r * d; q[INTRINSIC_A2] = (phi2 - phi1) / (3.0 * r * rP1) ; q[INTRINSIC_B] = (r == 1.0) ? 0.0 : q[INTRINSIC_A2] / (rM1 * dsq); q[INTRINSIC_A2] = (q[INTRINSIC_A2] - phi1 / 3.0 - phi2 / 6.0) / dsq; q[INTRINSIC_A0] = 0.5 * rM1 / rP1 * phi2 + phi1 / rP1 - phi0; //print("check: %f %e r=%f intr:%f %f %f\n", // phi2, phi1, r, q[INTRINSIC_B], q[INTRINSIC_A0], q[INTRINSIC_A2]); // assert(false); // printf("%f %f %f+%f \n", q[INTRINSIC_B], q[INTRINSIC_A2], q[INTRINSIC_A0], C0); if ((q[INTRINSIC_B] < 0.0) || (q[INTRINSIC_A2] < 0.0) || (q[INTRINSIC_A0] + C0 < 0.0)) { // printf("%f %f %f+%f \n", q[INTRINSIC_B], q[INTRINSIC_A2], q[INTRINSIC_A0], C0); return MSGLOCAL_INITINTRINSIC; } return NOERROR; } int set_cutoff_q2variate(cov_model *cov, double VARIABLE_IS_NOT_USED a, double d, double VARIABLE_IS_NOT_USED *q) { // auf modell ebene, d.h. co->sub[0] oder stein->sub[0] double aa, bb, cc, //coefficients for cubic polynomial phi0[4], phi1[4], phi2[4], phi3[4], phi4[4], radius = MAXINT; double roots[3][2]; int n, m, l; //printf("\n ------------ set_cutoff_q2variate ---------------- \n "); assert(cov->calling->SlocalCE != NULL); localCE_storage *s = cov->calling->SlocalCE; COV(&d, cov, phi0); // COV(&d, cov->sub[0], &phi01); Abl1(&d, cov, phi1); Abl2(&d, cov, phi2); Abl3(&d, cov, phi3); Abl4(&d, cov, phi4); /* printf("\n\n ---------------- \n\n");// printf("d = %f\n", d);// printf("phi0[0] = %f\n", phi0[0]);// printf("phi1[0] = %f\n", phi1[0]);// printf("phi2[0] = %f\n", phi2[0]);// printf("phi3[0] = %f\n", phi3[0]);// printf("phi4[0] = %f\n", phi4[0]);// printf("\n\n ---------------- \n\n");// */ //bivariate Whittle Cauchy Stable n = 5; m = 6; l = 7; //assert(false); s->is_bivariate_cutoff = true; if (cov->vdim[0] > 2 || cov->vdim[1] > 2) BUG; if (phi1[1] != phi1[2] || phi2[1] != phi2[2] || phi3[1] != phi3[2] || phi4[1] != phi4[2]) return MSGLOCAL_NOTSYMMETRICMULTIVARIATE; for (int j = 0; j < 4; j++) { radius = MAXINT; s->q[j][CUTOFF_CUBE_N] = n; s->q[j][CUTOFF_CUBE_M] = m; s->q[j][CUTOFF_CUBE_L] = l; cubicsolver( phi4[j], (n+m+l-6)*phi3[j], (n*m + n*l + m*l - 3*(n+m+l) + 7)*phi2[j], (n-1)*(m-1)*(l-1)*phi1[j] , roots); //find a positive root of the cubic polynomial for (int i = 0; i < 3; i++) { if (roots[i][1] == 0 && roots[i][0] < radius && roots[i][0] >= 0) { radius= roots[i][0]; } } //if no positive root, cannot do anything //printf("\n ::::::::::: set_cutoff_q2variate ::::::::::::: radius[%d] = %f, d = %f\n", j, radius + d, d); if ( radius == MAXINT) return MSGLOCAL_NOPOSITIVEROOT; aa = -(phi3[j]*radius*radius + phi2[j]*(m + l - 3)*radius + phi1[j]*(m-1)*(l-1))/(n*(m - n)*(l - n) * POW(radius, n - 1)); bb = -(phi3[j]*radius*radius + phi2[j]*(n + l - 3)*radius + phi1[j]*(n-1)*(l-1))/(m*(n - m)*(l - m) * POW(radius, m - 1)); cc = -(phi3[j]*radius*radius + phi2[j]*(m + n - 3)*radius + phi1[j]*(m-1)*(n-1))/(l*(m - l)*(n - l) * POW(radius, l - 1)); s->q[j][CUTOFF_CONSTANT] = - phi0[j] + aa * POW(radius, n) + bb * POW(radius, m) + cc * POW(radius, l); // printf("\n ::::::::::: set_cutoff_q2variate ::::::::::::: C[%d] = %f, \n", j, s->q[j][CUTOFF_CONSTANT]); // printf("\n ::::::::::::::: set_cutoff_q2variate::::::::::::::, cov->calling->SlocalCE->q[%d][CUTOFF_CONSTANT] = %f \n ", // j, cov->calling->SlocalCE->q[j][CUTOFF_CONSTANT]); if (s->q[j][CUTOFF_CONSTANT] < -1) return MSGLOCAL_SIGNPHI; radius = radius + d; //j*5 is very bad s->q[j][CUTOFF_R] = radius; s->q[j][CUTOFF_CUBE_A] = aa; s->q[j][CUTOFF_CUBE_B] = bb; s->q[j][CUTOFF_CUBE_C] = cc; } if (s->q[1][CUTOFF_R] > s->q[0][CUTOFF_R] || s->q[1][CUTOFF_R] > s->q[3][CUTOFF_R] ) return MSGLOCAL_WRONGRADII; //PMI(cov); //printf("\n ::::::::::: set_cutoff_q2variate ::::::::::::: end \n"); return NOERROR; } //TO DO: choose epsilon properly #define EPSILON_C 0.1 int set_cutoff_q(cov_model *cov, double a, double d, double *q) { assert(cov->vdim[0] > 0 && cov->vdim[0] < 3); if (cov->vdim[0] > 1) return set_cutoff_q2variate(cov, a, d, q); // auf modell ebene, d.h. co->sub[0] oder stein->sub[0] double aa, bb, cc, //coefficients for cubic polynomial phi0, phi1, phi2 = RF_NA, phi3 = RF_NA, phi4 = RF_NA, a2 = a * a, // d2 = d*d, radius = -1; int n, m, l; // if ((err = covcpy(&neu, cov)) != NOERROR) return err; // CovList[cov->gatternr].cov(&d, neu, &phi0); // CovList[cov->gatternr].D(&d, neu, &phi1); //FREE(neu); COV(&d, cov, &phi0); Abl1(&d, cov, &phi1); cov->calling->SlocalCE->is_bivariate_cutoff = FALSE; //If it is a variogram, then we must determine a constant such that Const - Variogram is a valied covariance // The constant depends on a and d // cov->calling->typus if (cov->typus == VariogramType) { if (a == 0.5) { COV(&d, cov, &q[CUTOFF_CONSTANT]); q[CUTOFF_CONSTANT] = -q[CUTOFF_CONSTANT]; q[CUTOFF_B] = -2*phi1*SQRT(d); q[CUTOFF_THEOR] = POW(1.0 - 0.5* (q[CUTOFF_CONSTANT] + phi0) / phi1 /d, 1/a); q[LOCAL_R] = d * q[CUTOFF_THEOR]; q[CUTOFF_ASQRTR] = POW(q[LOCAL_R], a); } else if (a == 1 ) { //second derivative Abl2(&d, cov, &phi2); if (phi2 <= 0) { return MSGLOCAL_SIGNPHISND; } //if second derivative is positive at d, then q[CUTOFF_CONSTANT] = -phi0+phi1*phi1/(2*phi2) + EPSILON_C; q[CUTOFF_B] = 0.25*phi1*phi1/(q[CUTOFF_CONSTANT] + phi0); q[CUTOFF_THEOR] = POW(1.0 - 2 * ( q[CUTOFF_CONSTANT] + phi0) / phi1 /d, 1/a); q[LOCAL_R] = d * q[CUTOFF_THEOR]; q[CUTOFF_ASQRTR] = POW(q[LOCAL_R], a); } else if (a == CUTOFF_THIRD_CONDITION) { Abl2(&d, cov, &phi2); Abl3(&d, cov, &phi3); Abl4(&d, cov, &phi4); double roots[3][2]; //de Wijsian model n = 4; m = 6; l = 7; cubicsolver( phi4, (n+m+l-6)*phi3, (n*m + n*l + m*l - 3*(n+m+l) + 7)*phi2, (n-1)*(m-1)*(l-1)*phi1 , roots); //find a positive root of the cubic polynomial for (int i = 0; i < 3; i++) { if (roots[i][1] == 0 && roots[i][0] > radius ) { radius = roots[i][0]; } } //if no positive root, cannot do anything if (radius <= 0.0) return MSGLOCAL_NOPOSITIVEROOT; aa = -(phi3*radius*radius + phi2*(m + l - 3)*radius + phi1*(m-1)*(l-1))/(n*(m - n)*(l - n) * POW(radius, n - 1)); bb = -(phi3*radius*radius + phi2*(n + l - 3)*radius + phi1*(n-1)*(l-1))/(m*(n - m)*(l - m) * POW(radius, m - 1)); cc = -(phi3*radius*radius + phi2*(m + n - 3)*radius + phi1*(m-1)*(n-1))/(l*(m - l)*(n - l) * POW(radius, l - 1)); q[CUTOFF_CONSTANT] = -phi0 + aa * POW(radius, n) + bb * POW(radius, m) + cc * POW(radius, l); if (q[CUTOFF_CONSTANT] <= 0.0) return MSGLOCAL_SIGNPHI; radius = radius + d; q[LOCAL_R] = radius; q[CUTOFF_ASQRTR] = radius; q[CUTOFF_CUBE_A] = aa; q[CUTOFF_CUBE_B] = bb; q[CUTOFF_CUBE_C] = cc; q[CUTOFF_CUBE_N] = n; q[CUTOFF_CUBE_M] = m; q[CUTOFF_CUBE_L] = l; } else BUG; // olga } else { //now we are in a positive definite function case if (phi0 <= 0.0) return MSGLOCAL_SIGNPHI; if (phi1 >= 0.0) return MSGLOCAL_SIGNPHIFST; //find parameters of the method if (a != CUTOFF_THIRD_CONDITION) { phi1 *= d; if (phi1 >= 0.0) return MSGLOCAL_SIGNPHIFST; q[CUTOFF_B] =//sound qconstant even if variance of submodel is not 1 POW(-phi1 / (2.0 * a2 * phi0), 2.0 * a) * phi0 / POW(d, 2.0 * a2); // assert(false); q[CUTOFF_THEOR] = POW(1.0 - 2.0 * a2 * phi0 / phi1, 1.0 / a); q[LOCAL_R] = d * q[CUTOFF_THEOR]; q[CUTOFF_ASQRTR] = POW(q[LOCAL_R], a); } else if (a == CUTOFF_THIRD_CONDITION){ //a = CUTOFF_THIRD_CONDITION Abl2(&d, cov, &phi2); Abl3(&d, cov, &phi3); Abl4(&d, cov, &phi4); double roots[3][2]; //Whittle model n = 5; m = 6; l = 7; cubicsolver( phi4, (n+m+l-6)*phi3, (n*m + n*l + m*l - 3*(n+m-l) + 7)*phi2, (n-1)*(m-1)*(l-1)*phi1 , roots); //find a positive root of the cubic polynomial for (int i = 0; i < 3; i++) { if (roots[i][1] == 0 && roots[i][0] > radius ) { radius = roots[i][0]; } } //if no positive root, cannot do anything if (radius <= 0.0) return MSGLOCAL_NOPOSITIVEROOT; aa = -(phi3*radius*radius + phi2*(m + l - 3)*radius + phi1*(m-1)*(l-1))/(n*(m - n)*(l - n) * POW(radius, n - 1)); bb = -(phi3*radius*radius + phi2*(n + l - 3)*radius + phi1*(n-1)*(l-1))/(m*(n - m)*(l - m) * POW(radius, m - 1)); cc = -(phi3*radius*radius + phi2*(m + n - 3)*radius + phi1*(m-1)*(n-1))/(l*(m - l)*(n - l) * POW(radius, l - 1)); q[CUTOFF_CONSTANT] = 1 - phi0 + aa * POW(radius, n) + bb * POW(radius, m) + cc * POW(radius, l); if (q[CUTOFF_CONSTANT] <= 0.0) return MSGLOCAL_SIGNPHI; radius = radius + d; q[LOCAL_R] = radius; q[CUTOFF_CUBE_A] = aa; q[CUTOFF_CUBE_B] = bb; q[CUTOFF_CUBE_C] = cc; q[CUTOFF_CUBE_N] = n; q[CUTOFF_CUBE_M] = m; q[CUTOFF_CUBE_L] = l; } else BUG; } return NOERROR; // olga } int check_local(cov_model *cov, Methods method, int maxq, getlocalparam init, // next->coinit set_local_q_type set_local) { location_type *loc = Loc(cov); int i, msg, dim = cov->tsdim, err=NOERROR; //dim = cov->tsdim; // timespacedim -- needed ?; double *q, q2[LOCAL_MAX], d=RF_NA; cov_model *next = cov->sub[0]; localinfotype li; //ce_param *gp = &(GLOBAL.localce); // ok //print("\n \n entering check local from %d:%s\n", cov->calling->nr, //CovList[cov->calling->nr].name); int vdim = SUBMODEL_DEP; if ((err = CHECK(next, dim, 1, method == CircEmbedCutoff ? PosDefType : VariogramType, cov->domown, cov->isoown, vdim, ROLE_COV)) != NOERROR) { // print("\n \n \n ::: checl_local :: if ::: dim = %d --- next->vdim[0] = %d::: \n \n \n", dim, next->vdim[0]); if ( method != CircEmbedCutoff || (err = CHECK(next, dim, 1, VariogramType, cov->domown, cov->isoown, vdim, ROLE_COV)) != NOERROR) return err; } if (vdim > 2) SERR("vdim of submodel must be less than 3") // no setbackward ?! setbackward(cov, next); if (next->pref[method] == PREF_NONE) return ERRORPREFNONE; if (init == NULL){ return ERRORUNKNOWNMETHOD; } // no changing in pref by submodel !! if (cov->q != NULL) { FREE(cov->q); cov->q = NULL; // ERR("q not NULL in check_local -- ask author"); } QALLOC(maxq); q = cov->q; for (i = 0; i < maxq; i++) q2[i] = RF_NA; // q2 will be copied to cov->q; // {int i; print("%d %f\n", cov->qlen); for(i=0;i<9;i++)print("%f ", cov->q[i]); print("\n"); assert(false);} if (PisNULL(pLOC_DIAM)) { double diameter = GetDiameter(loc); if (PL>=PL_DETAILS) { LPRINT("diameter %f\n", diameter); } kdefault(cov, pLOC_DIAM, diameter); } else { d = P0(pLOC_DIAM); } if (PisNULL(pLOC_A)) { if (CovList[next->nr].implemented[method]) { assert(init != NULL); init(next, &li); if (li.instances == 0) { SERR("parameter values do not allow for finding second parameter"); } q[LOCAL_R] = RF_INF; // print("%f\n", d); assert(false); msg = MSGLOCAL_FAILED; for (i=0; iq[LOCAL_MSG] = msg; if (msg == MSGLOCAL_FAILED) SERR2("'%s' did not work out correctly. Likely, invalid parameter values have been chosen for '%s'", NICK(cov), NICK(next)); } else { SERR("2nd parameter is neither given nor can be found automatically"); } } else { if (cov->ncol[pLOC_A] != 1 || cov->nrow[pLOC_A] != 1) SERR1("'%s' must be a scale", KNAME(pLOC_A)); err = set_local(next, P0(pLOC_A), d, q2); MEMCOPY(q, q2, sizeof(double) * maxq); } cov->pref[CircEmbed] = 5; return err; } void co(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double y=*x, *q=cov->q, diameter = P0(pLOC_DIAM), a = P0(pLOC_A); assert(cov->role == ROLE_COV); //cov->vdim[0] or next->vdim[0]? //if ( cov->SlocalCE->is_multivariate_cutoff == true ) { if ( cov->SlocalCE->is_bivariate_cutoff ) { if (y <= diameter) { COV(x, next, v); for (int i = 0; i <4; i++) { v[i] += cov->SlocalCE->q[i][CUTOFF_CONSTANT]; } } else { for (int i = 0; i < 4; i++) { v[i] = (y >= cov->SlocalCE->q[i][CUTOFF_R]) ? 0.0 : cov->SlocalCE->q[i][CUTOFF_CUBE_A]* POW((cov->SlocalCE->q[i][CUTOFF_R] - y), cov->SlocalCE->q[i][CUTOFF_CUBE_N]) + cov->SlocalCE->q[i][CUTOFF_CUBE_B]* POW((cov->SlocalCE->q[i][CUTOFF_R] - y), cov->SlocalCE->q[i][CUTOFF_CUBE_M]) + cov->SlocalCE->q[i][CUTOFF_CUBE_C]* POW((cov->SlocalCE->q[i][CUTOFF_R] - y), cov->SlocalCE->q[i][CUTOFF_CUBE_L]); } } } else { if (y <= diameter) { //If it is a variogram (actually -variogram), add a constant. If it is positive definite, go below if (cov->sub[0]->typus == VariogramType ) { COV(x, next, v); *v = *v+q[CUTOFF_CONSTANT]; } else { COV(x, next, v) } } else { if (a != CUTOFF_THIRD_CONDITION) { *v = (y >= q[LOCAL_R]) ? 0.0 : q[CUTOFF_B] * POW(q[CUTOFF_ASQRTR] - POW(y, a), 2.0 * a); } else { *v = (y >= q[LOCAL_R]) ? 0.0 : q[CUTOFF_CUBE_A] * POW((q[LOCAL_R] - y), q[CUTOFF_CUBE_N]) + q[CUTOFF_CUBE_B] * POW((q[LOCAL_R] - y), q[CUTOFF_CUBE_M]) + q[CUTOFF_CUBE_C] * POW((q[LOCAL_R] - y), q[CUTOFF_CUBE_L]); //BUG; } } } } int check_co(cov_model *cov) { cov_model *next = cov->sub[0]; int err; NEW_STORAGE(localCE); assert(cov->SlocalCE != NULL); // 1 ? 2? More than 2? or inside set_cutoff_q2variate //PMI(cov);assert(next->vdim[0]>0); // printf("\n ----------- check_co ----------- \n "); // printf("\n ----------- next->vdim[0] = %d ----------- \n ", next->vdim[0]); err = check_local(cov, CircEmbedCutoff, CUTOFF_MAX, CovList[next->nr].coinit, set_cutoff_q); //printf("\n\n ------ check_co = %d ------ \n\n", next->SlocalCE->is_bivariate_cutoff); // printf("\n\n ------ check_co err = %d ------ \n\n", err); if (err != NOERROR ) return err; return NOERROR; /* return check_local(cov, CircEmbedCutoff, CUTOFF_MAX, CovList[next->nr].coinit, set_cutoff_q); */ } bool alternativeparam_co(cov_model VARIABLE_IS_NOT_USED *cov){ return false; } void range_co(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[pLOC_DIAM] = 0.0; // CUTOFF_DIAM range->max[pLOC_DIAM] = RF_INF; range->pmin[pLOC_DIAM] = 1e-10; range->pmax[pLOC_DIAM] = 1e10; range->openmin[pLOC_DIAM] = true; range->openmax[pLOC_DIAM] = true; range->min[pLOC_A] = 0.0; // cutoff_a range->max[pLOC_A] = RF_INF; range->pmin[pLOC_A] = 0.5; range->pmax[pLOC_A] = 2.0; range->openmin[pLOC_A] = true; range->openmax[pLOC_A] = true; } void Stein(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double y=*x, z, *q=cov->q, diameter = P0(pLOC_DIAM); // printf("diameter %f\n", diameter); assert(cov->role == ROLE_COV); if (y <= diameter) { COV(x, next, v); *v += q[INTRINSIC_A0] + q[INTRINSIC_A2] * y * y; // print("%f %f %f %f %d %d \n ", // y, v[0], q[INTRINSIC_A0], q[INTRINSIC_A2], INTRINSIC_A0, INTRINSIC_A2); } else { z = q[LOCAL_R] - y; *v = (z <= 0.0) ? 0.0 : q[INTRINSIC_B] * z * z * z / y; } } int check_Stein(cov_model *cov) { cov_model *next = cov->sub[0]; // dito return check_local(cov, CircEmbedIntrinsic, INTRINSIC_MAX, CovList[next->nr].ieinit, set_stein_q); } bool alternativeparam_Stein(cov_model *cov) { P(pLOC_A)[0] *= 2.0; return true; } void range_Stein(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { range->min[pLOC_DIAM] = 0.0; range->max[pLOC_DIAM] = RF_INF; range->pmin[pLOC_DIAM] = 0.01; range->pmax[pLOC_DIAM] = 100; range->openmin[pLOC_DIAM] = true; range->openmax[pLOC_DIAM] = true; range->min[pLOC_R] = 1.0; // stein_r range->max[pLOC_R] = RF_INF; range->pmin[pLOC_R] = 1.0; range->pmax[pLOC_R] = 20.0; range->openmin[pLOC_R] = false; range->openmax[pLOC_R] = true; } void strokorb(double *x, cov_model *cov, double *v) { // BrownResnick to strokorb Gaussian cov_model *next = cov->sub[0]; int dim = cov->tsdim; double u; int idx = 0; u = 2 * *x; switch (dim) { case 1 : Abl1(&u, next, v); *v = - *v; //printf("u=%f %e\n", u, *v); break; case 3 : if (*x == 0.0) { while (idx < next->taylorN && (next->taylor[idx][TaylorPow] ==0.0 || next->taylor[idx][TaylorPow] ==1.0)) idx++; if (idx >= next->taylorN) BUG; double p = next->taylor[idx][TaylorPow]; if (p > 3.0) BUG; // > 3 ist mathematisch vermutlich nicht moeglich, da bei strokorb // das submodel die entwicklung 1 - c x (oder rauher) hat *v = p < 3.0 ? RF_INF : next->taylor[idx][TaylorConst] * p * (p - 1) * POW(2, p-2)/ M_PI;//3.0 } else { Abl2(&u, next, v); *v /= (M_PI * *x); } break; default: BUG; } if (*v<0) { BUG; } assert(*v >= 0); assert(*x >= 0); // assert(false); } int checkstrokorb(cov_model *cov) { cov_model *next = cov->sub[0]; int dim = cov->tsdim, err = NOERROR; if ((err = CHECK(next, cov->tsdim, cov->xdimprev, TcfType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; if (!next->deterministic) SERR("only deterministic submodels allowed"); if (!isGneiting(next)) SERR("member of the Gneiting-Schaback class as submodel needed"); switch(dim) { case 1: if (next->rese_derivs < 1) SERR("submodel must be once differentiable"); break; case 3: if (next->rese_derivs < 2) SERR("submodel must be twice differentiable"); break; default: SERR("only dimensions 1 and 3 are allowed"); } if (!(hasMaxStableRole(cov) || hasNoRole(cov) || hasDistrRole(cov))) { SERR1("'%s' may be used only as a shape function with max-stable field simulation", NICK(cov)); } if (next->tailN < 1) SERR2("%d members of the Taylor expansion at infinity of '%s', but at least order 1 required.", next->tailN, NICK(next)); cov->taylorN = cov->tailN = 1; cov->tail[0][TaylorExpConst] = next->tail[0][TaylorExpConst]; cov->tail[0][TaylorExpPow] = next->tail[0][TaylorExpPow]; switch(dim) { case 1 : cov->taylor[0][TaylorConst] = -next->taylor[1][TaylorConst] * next->taylor[1][TaylorPow]; cov->taylor[0][TaylorPow] = next->taylor[1][TaylorPow] - 1.0; if (next->tail[0][TaylorExpPow] != 0.0) { if (next->tail[0][TaylorExpConst] == 0.0) BUG; cov->tail[0][TaylorConst] = next->tail[0][TaylorConst] * next->tail[0][TaylorExpConst] * next->tail[0][TaylorExpPow]; cov->tail[0][TaylorPow] = next->tail[0][TaylorPow] + next->tail[0][TaylorExpPow] - 1; } else { if (next->tail[0][TaylorExpConst] != 0.0) BUG; if (next->tail[0][TaylorPow] >= 0) { if (next->tail[0][TaylorConst] == 0) SERR("trivial submodel"); SERR1("'%s' is not integrable", NICK(next)); } cov->tail[0][TaylorConst] = - next->tail[0][TaylorConst] * next->tail[0][TaylorPow]; cov->tail[0][TaylorPow] = next->tail[0][TaylorPow] - 1.0; } break; case 3 : int idx; idx = 1; if (next->taylorN <= 1) SERR2("%d members of the Taylor expansion of '%s' known, but at least 2 members required.", next->taylorN, NICK(next)); if (next->taylor[idx][TaylorPow] == 1.0) { if (next->taylorN <= idx + 1) SERR3("%d members of the Taylor expansion of '%s' known, but at least %d members required.", next->taylorN, NICK(next), idx + 1); idx++; } else assert(next->taylor[idx][TaylorPow] < 1.0); cov->taylor[0][TaylorPow] = (next->taylor[idx][TaylorPow] - 2.0) - 1.0; cov->taylor[0][TaylorConst] = next->taylor[idx][TaylorConst] / M_PI * next->taylor[idx][TaylorPow] * (next->taylor[idx][TaylorPow] - 1) * POW(2.0, cov->taylor[0][TaylorPow]); // if (next->tail[0][TaylorExpPow] != 0.0) { if (next->tail[0][TaylorExpConst] == 0.0) BUG; // Achtung ! Reihenfolge der Berechnung! double f = next->tail[0][TaylorExpConst] * next->tail[0][TaylorExpPow]; cov->tail[0][TaylorPow] = next->tail[0][TaylorPow] + 2.0 * (next->tail[0][TaylorExpPow] - 1.0); cov->tail[0][TaylorConst]= next->tail[0][TaylorConst] * f * f * POW(2.0, cov->tail[0][TaylorPow]); cov->tail[0][TaylorPow] -= 1.0; cov->tail[0][TaylorExpConst] *= POW(2.0, cov->tail[0][TaylorExpPow]); } else { // Achtung ! Reihenfolge der Berechnung! if (next->tail[0][TaylorExpConst] != 0.0) BUG; cov->tail[0][TaylorPow] = next->tail[0][TaylorPow] - 2.0; cov->tail[0][TaylorConst] = next->tail[0][TaylorConst] / M_PI * next->tail[0][TaylorPow] * (next->tail[0][TaylorPow] - 1.0) * POW(2.0, next->tail[0][TaylorPow] - 2.0); cov->tail[0][TaylorPow] -= 1.0; } break; default: BUG; } setbackward(cov, next); return NOERROR; } int init_strokorb(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { if (cov->role == ROLE_MAXSTABLE || hasNoRole(cov) || hasDistrRole(cov)) { //cov_model *next = cov->sub[0]; // double // radius = P(TRUNC_RADIUS)[0]; // default -1 // if ((err = INIT(next, 0, s)) != NOERROR) return err; //if (radius>=0 && radius < cov->mpp.refradius) cov->mpp.refradius = radius; // Eplus, M2 are assumed to be still precise !! assert(cov->vdim[0] == 1 && cov->vdim[1] == 1); cov->mpp.maxheights[0] = RF_NA; } else ILLEGAL_ROLE; /* if ((err = CHECK(cov->sub[0], cov->tsdim, cov->xdimprev, ShapeType, // cov->domown, cov->isoown, SCALAR, ROLE_MAXSTABLE// otherwise do will fail )) != NOERROR) return err; */ cov->mpp.maxheights[0] = 1.0; // all with be covered by pgs if (cov->mpp.moments >= 1) { cov->mpp.mM[1] = cov->mpp.mMplus[1] = 1; } return NOERROR; } void do_strokorb(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s) { BUG; } ////////////////// strokorbBall #define STROKORBBALL_DIM 0 // Inner int checkstrokorbBall(cov_model *cov) { cov_model //*key = cov->key, *next = cov->sub[0]; int dim = cov->tsdim, err = NOERROR; assert(cov->key == NULL); if ((err = CHECK(next, dim, cov->xdimprev, TcfType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; if (!isGneiting(next)) SERR("member of the Gneiting-Schaback class as submodel needed"); switch(dim) { case 1: if (next->rese_derivs < 2) SERR("submodel must be twice differentiable"); break; case 3: if (next->rese_derivs < 3) SERR("submodel must be three times differentiable"); break; default: SERR("only dimensions 1 and 3 are allowed"); } if (!(hasMaxStableRole(cov) || hasNoRole(cov) || hasDistrRole(cov))) SERR1("'%s' may be used only as a shape function with max-stable field simulation", NICK(cov)); if (next->tailN < 1) SERR2("%d members of the Taylor expansion at infinity of '%s' found, but at least 1 is required.", next->tailN, NICK(next)); if (next->taylorN < 2) SERR2("%d members of the Taylor expansion of '%s' found, but at least 2 is required.", next->taylorN, NICK(next)); setbackward(cov, next); return NOERROR; } void ScaleToVar(cov_model *local, cov_model *remote, int VARIABLE_IS_NOT_USED variant) { // ACHTUNG!! from and to sind hier vertauscht!! assert(local->nr==POWER_DOLLAR && remote->nr==LOC); // int dim = local->tsdim; double scale = PARAM0(local, POWSCALE); // scale im entfernten model setzen PARAM(remote, LOC_SCALE)[0] = scale; remote->deterministic = false; } int struct_strokorbBall(cov_model *cov, cov_model **newmodel) { int err, dim = cov->tsdim; ASSERT_NEWMODEL_NOT_NULL; if (cov->role == ROLE_MAXSTABLE) { addModel(newmodel, BALL, cov); addModel(newmodel, POWER_DOLLAR); kdefault(*newmodel, POWSCALE, 1.0); kdefault(*newmodel, POWPOWER, -dim); kdefault(*newmodel, POWVAR, 1.0 / VolumeBall(dim, BALL_RADIUS)); cov_model *pts=NULL, *scale=NULL; if ((err = covCpy(&pts, *newmodel)) != NOERROR) return err; if (CovList[cov->nr].kappas < 2) { if ((err = covCpy(&scale, cov)) != NOERROR) return err; // !! inverse scale gegenueber paper scale->nr = STROKORB_BALL_INNER; kdefault(scale, STROKORBBALL_DIM, dim); addModel(&scale, RECTANGULAR, *newmodel); kdefault(scale, RECT_APPROX, false); kdefault(scale, RECT_ONESIDED, true); (*newmodel)->kappasub[POWSCALE] = scale; } else { // for testing only addModelKappa(*newmodel, POWSCALE, UNIF); kdefault((*newmodel)->kappasub[POWSCALE], UNIF_MIN, P0(0)); kdefault((*newmodel)->kappasub[POWSCALE], UNIF_MAX, P0(1)); } addModel(&pts, RECTANGULAR); addModel(&pts, LOC); kdefault(pts, LOC_SCALE, 1.0); kdefault(pts, LOC_POWER, -dim); addModelKappa(pts, LOC_SCALE, NULL_MODEL); kdefault(pts->kappasub[LOC_SCALE], NULL_TYPE, RandomType); addSetParam(newmodel, pts, ScaleToVar, true, 0); addModel(newmodel, PTS_GIVEN_SHAPE); // to do : unif better ?! (*newmodel)->sub[PGS_LOC] = pts; pts->calling = *newmodel; } else ILLEGAL_ROLE_STRUCT; return NOERROR; } void rangestrokorbball(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[0] = RF_NEGINF; range->max[0] = RF_INF; range->pmin[0] = -4.0; range->pmax[0] = 4.0; range->openmin[0] = false; range->openmax[0] = false; range->min[1] = RF_NEGINF; range->max[1] = RF_INF; range->pmin[1] = -4.0; range->pmax[1] = 4.0; range->openmin[1] = false; range->openmax[1] = false; } /* int init_strokorbBall(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { if (cov->role == ROLE_MAXSTABLE) { //cov_model *next = cov->sub[0]; // double // radius = P(TRUNC_RADIUS)[0]; // default -1 // if ((err = INIT(next, 0, s)) != NOERROR) return err; //if (radius>=0 && radius < cov->mpp.refradius) cov->mpp.refradius = radius; // Eplus, M2 are assumed to be still precise !! cov->mpp.maxheight = RF_NA; } else ILLEGAL_ROLE; cov->mpp.maxheight = 1.0; // all with be covered by pgs if (cov->mpp.moments >= 1) { cov->mpp.mM[1] = cov->mpp.mMplus[1] = 1; } return NOERROR; } void do_strokorbBall(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VA// RIABLE_IS_NOT_USED *s) { // assert(false); // } // */ void strokorbBallInner(double *x, cov_model *cov, double *v) { // only proportional to a density !!! cov_model *next = cov->sub[0]; int dim = cov->nr != STROKORB_BALL_INNER || PisNULL(STROKORBBALL_DIM) ? cov->tsdim : P0INT(STROKORBBALL_DIM); if (*x <= 0) { *v = 0.0; return; } double y = 2 * *x; switch (dim) { case 1 : // \chi''(s)*s [ diameter ] -> 4\chi''(2 s)*s Abl2(&y, next, v); *v *= 2.0 * y; //printf("u=%f %e\n", u, *v); break; case 3 : double w; //[chi''(s)-chi'''(s) * s] * s/3 //printf("y=%f\n", y); Abl2(&y, next, v); Abl3(&y, next, &w); *v = 2.0 * (*v - w * y) * y / 3.0; break; default: BUG; } if (*v<0) { BUG; } // assert(*v >= 0); } int check_strokorbBallInner(cov_model *cov) { cov_model *next = cov->sub[0]; int err; ROLE_ASSERT(ROLE_DISTR); if ((err = checkkappas(cov)) != NOERROR) return err; if (cov->tsdim != 1) SERR("only dimension 1 allowed"); if ((err = checkstrokorbBall(cov)) != NOERROR) return err; switch(P0INT(STROKORBBALL_DIM)) { case 1: if (next->rese_derivs < 2) SERR("submodel must be twice differentiable"); break; case 3: if (next->rese_derivs < 3) SERR("submodel must be three times differentiable"); break; default: SERR("only dimensions 1 and 3 are allowed"); } if (next->tailN < 1 || next->taylorN < 2) SERR1("taylor expansions of '%s' not programmed yet", NICK(next)); double tep = next->tail[0][TaylorExpPow], tp = next->tail[0][TaylorPow]; cov->taylorN = cov->tailN = 1; cov->tail[0][TaylorExpConst] = POW(2.0, tep) * next->tail[0][TaylorExpConst]; cov->tail[0][TaylorExpPow] = tep; int idx = 1; if (next->taylor[1][TaylorPow] == (int) next->taylor[1][TaylorPow]) { assert(next->taylor[1][TaylorPow] == 1.0); // 2 sollte nie auftreten, laeuft aber gleich if (next->taylorN >= 3) idx++; else SERR1("%s does not have a long enough taylor development programmed", NICK(next)); } double TP = next->taylor[idx][TaylorPow]; switch(P0INT(STROKORBBALL_DIM)) { case 1 : if (tep != 0.0) { cov->tail[0][TaylorPow] = tp + 2.0 * (tep - 1.0) + 1.0;// !! +1, da noch ein x drauf-multipliziert wird cov->tail[0][TaylorConst] = next->tail[0][TaylorExpConst] * tep; cov->tail[0][TaylorConst] *= cov->tail[0][TaylorConst]; } else { cov->tail[0][TaylorConst] = tp * (tp -1.0); cov->tail[0][TaylorPow] = tp - 1.0; // !! nicht -2.0, da noch ein x drauf-multipliziert wird } cov->taylor[0][TaylorConst] = TP * (TP - 1.0); cov->taylor[0][TaylorPow] = TP - 1.0; break; case 3 : if (tep != 0.0) { double dummy = next->tail[0][TaylorExpConst] * tep; cov->tail[0][TaylorConst] = dummy * dummy * dummy / 3.0; cov->tail[0][TaylorPow] = tp + 3 * tep - 1.0; } else { cov->tail[0][TaylorConst] = tp * (tp - 1.0) * (3.0 - tp) / 3.0; cov->tail[0][TaylorPow] = tp - 1.0; // !! nicht -2.0, da noch ein x drauf-multipliziert wird } cov->taylor[0][TaylorConst] = TP * (TP - 1.0) * (3.0 - TP) / 3.0; cov->taylor[0][TaylorPow] = TP - 2.0; break; default: BUG; } cov->tail[0][TaylorConst] *= 2.0 * next->tail[0][TaylorConst] * POW(2.0, cov->tail[0][TaylorPow]); cov->taylor[0][TaylorConst] *= 2.0 * next->taylor[idx][TaylorConst] * POW(2.0, cov->taylor[0][TaylorPow]); return NOERROR; } int init_strokorbBallInner(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s) { // cov_model *next = cov->sub[0]; // int err, // dim = cov->tsdim; //printf("ball inner\n"); /* if ((err = CHECK(cov->sub[0], dim, cov->xdimprev, ShapeType, cov->domown, cov->isoown, SCALAR, ROLE_MAXSTABLE )) != NOERROR) return err; */ if (!next->deterministic) SERR("only deterministic submodels allowed"); // u.a. Taylor fehlt assert(cov->vdim[0] == 1 && cov->vdim[1] == 1); cov->mpp.maxheights[0] = 1.0; cov->mpp.mM[0] = cov->mpp.mMplus[0] = 1; if (cov->mpp.moments >= 1) { cov->mpp.mM[1] = cov->mpp.mMplus[1] = 1; } return NOERROR; } void do_strokorbBallInner(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s) { //cov_model *next = cov->sub[0]; //DO(next, s); // nicht gatternr } void range_strokorbBallInner(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[STROKORBBALL_DIM] = 1; range->max[STROKORBBALL_DIM] = 3; range->pmin[STROKORBBALL_DIM] = 1; range->pmax[STROKORBBALL_DIM] = 3; range->openmin[STROKORBBALL_DIM] = false; range->openmax[STROKORBBALL_DIM] = false; } void strokorbPoly(double *x, cov_model *cov, double *v) { // only proportional to a density !!! cov_model *next = cov->sub[0]; COV(x, next, v); } int checkstrokorbPoly(cov_model *cov) { cov_model // *key = cov->key, *next = cov->sub[0]; int dim = cov->tsdim, err = NOERROR; assert(cov->key == NULL); if ((err = CHECK(next, dim, cov->xdimprev, TcfType, cov->domown, cov->isoown, SCALAR, ROLE_COV)) != NOERROR) return err; if (!isGneiting(next)) SERR("member of the Gneiting-Schaback class as submodel needed"); if (dim != 2) SERR("only dimension 2 currently programmed"); if (!(hasMaxStableRole(cov) || hasNoRole(cov))) { SERR1("'%s' may be used only as a shape function with max-stable field simulation", NICK(cov)); } setbackward(cov, next); return NOERROR; } void poly2unif(cov_model *local, cov_model *remote, int VARIABLE_IS_NOT_USED variant) { assert(local->nr==POLYGON && remote->nr==UNIF && local->Spolygon != NULL && local->Spolygon->P != NULL); polygon *P = local->Spolygon->P; assert(P->e != NULL); int d, dim = local->tsdim; assert(dim == 2); for (d=0; dbox0[d], P->box1[d], (long int) P); PARAM(remote, UNIF_MIN)[d] = P->box0[d]; PARAM(remote, UNIF_MAX)[d] = P->box1[d]; } remote->deterministic = false; } int struct_strokorbPoly(cov_model *cov, cov_model **newmodel) { cov_model *sub = cov->sub[0]; int dim = cov->tsdim; double var = 1.0; cov_model *pts=NULL, *shape=NULL; ASSERT_NEWMODEL_NOT_NULL; if (cov->role == ROLE_MAXSTABLE) { if (sub->nr != BROWNRESNICK) SERR1("only tcf '%s' allowed", CovList[BROWNRESNICK].nick); sub = sub->sub[0]; if (isDollar(sub)) { var = PARAM0(sub, DVAR); sub = sub->sub[0]; } if (sub->nr != BROWNIAN || PARAM0(sub, BROWN_ALPHA) != 1.0) { SERR2("Numerical inverse Laplace transform has not been implemented yet. Currently, only '%s' with parameter %s=1 is a valid submodel", CovList[BROWNIAN].nick, CovList[BROWNIAN].kappanames[BROWN_ALPHA]); } addModel(&pts, UNIF, NULL, true); kdefault(pts, UNIF_NORMED, (int) false); PARAMALLOC(pts, UNIF_MIN, dim, 1); PARAMALLOC(pts, UNIF_MAX, dim, 1); addModel(&shape, POLYGON, NULL, true); addModelKappa(shape, POLYGON_BETA, ARCSQRT_DISTR); kdefault(shape->kappasub[POLYGON_BETA], ARCSQRT_SCALE, 1.0 / var); addSetParam(&shape, pts, poly2unif, true, 0); addModel(newmodel, PTS_GIVEN_SHAPE); kdefault(*newmodel, PGS_NORMED, false); kdefault(*newmodel, PGS_ISOTROPIC, false); shape->calling = *newmodel; pts->calling = *newmodel; (*newmodel)->sub[PGS_LOC] = pts; (*newmodel)->sub[PGS_FCT] = shape; } else ILLEGAL_ROLE_STRUCT; return NOERROR; } void mult_inverse(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; FCTN(x, next, v); *v = 1.0 / *v; } void mult_inverseNonstat(double *x, double *y, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; NONSTATCOV(x, y, next, v); *v = 1.0 / *v; } int checkmult_inverse(cov_model *cov) { cov_model *next = cov->sub[0]; assert(cov->vdim[0] == 1 && cov->vdim[1] == 1 ); int err = NOERROR; if ((err = CHECK(next, cov->tsdim, cov->xdimprev, ShapeType, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; setbackward(cov, next); cov->mpp.maxheights[0] = RF_NA; return NOERROR; } //////////////////// void addSetParam(cov_model **newmodel, cov_model* remote, param_set_fct set, bool performdo, int variant, int nr) { set_storage *S; assert(SETPARAM_LOCAL == 0); addModel(newmodel, nr); kdefault(*newmodel, SET_PERFORMDO, performdo); NEW_COV_STORAGE(*newmodel, set); S = (*newmodel)->Sset; // S->from wird unten gesetzt ! S->remote = remote; S->set = set; S->variant = variant; } void addSetParam(cov_model **newmodel, cov_model * remote, param_set_fct set, bool performdo, int variant) { addSetParam(newmodel, remote, set, performdo, variant, SETPARAM); } void addSetDistr(cov_model **newmodel, cov_model * remote, param_set_fct set, bool performdo, int variant) { addSetParam(newmodel, remote, set, performdo, variant, SET_DISTR); } void setparamStat(double *x, cov_model *cov, double *v){ COV(x, cov->sub[SETPARAM_LOCAL], v); } void setparamNonStat(double *x, double *y, cov_model *cov, double *v){ NONSTATCOV(x, y, cov->sub[SETPARAM_LOCAL], v); } void Dsetparam(double *x, cov_model *cov, double *v){ Abl1(x, cov->sub[SETPARAM_LOCAL], v); } void DDsetparam(double *x, cov_model *cov, double *v){ Abl2(x, cov->sub[SETPARAM_LOCAL], v); } void D3setparam(double *x, cov_model *cov, double *v){ Abl3(x, cov->sub[SETPARAM_LOCAL], v); } void D4setparam(double *x, cov_model *cov, double *v){ Abl4(x, cov->sub[SETPARAM_LOCAL], v); } void Inverse_setparam(double *v, cov_model *cov, double *x){ cov_model *next = cov->sub[SETPARAM_LOCAL]; INVERSE(v, next, x); } void NonstatInverse_setparam(double *v, cov_model *cov, double *x, double *y){ cov_model *next = cov->sub[SETPARAM_LOCAL]; NONSTATINVERSE(v, next, x, y); // printf("nonstatinvere %f %f\n", x[0], y[0]); } void LogNonstatInverse_setparam(double *v, cov_model *cov, double *x, double *y){ cov_model *next = cov->sub[SETPARAM_LOCAL]; NONSTATLOGINVERSE(v, next, x, y); // printf("nonstatinvere %f %f\n", x[0], y[0]); } int checksetparam(cov_model *cov) { cov_model *next = cov->sub[SETPARAM_LOCAL]; int err, dim = cov->tsdim, xdim = cov->xdimown, role = cov->role; Types type = cov->typus; domain_type dom = cov->domown; isotropy_type iso = cov->isoown; kdefault(cov, SET_PERFORMDO, true); if (type == RandomType || next->typus== RandomType) { BUG; } if ((err = CHECK(next, dim, xdim, type, dom, iso, SUBMODEL_DEP, role)) != NOERROR) return err; setbackward(cov, next); cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; cov->deterministic = false; TaylorCopy(cov, next); //if (cov->xdimown == 1) crash(); // ACHTUNG ! weder SETPARAM_FROM (da nur link) noch SETPARAM_SET (da // i.a. keine echten Modelle) werden ueberprueft! return NOERROR; } bool Typesetparam(Types required, cov_model *cov, int depth) { return TypeConsistency(required, cov->sub[SETPARAM_LOCAL], depth-1); } void spectralsetparam(cov_model *cov, gen_storage *s, double *e){ SPECTRAL(cov->sub[SETPARAM_LOCAL], s, e); // nicht gatternr } int initsetparam(cov_model *cov, gen_storage *s){ cov_model *next= cov->sub[SETPARAM_LOCAL]; set_storage *X = cov->Sset; assert(X != NULL); int err, i, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; if ((err = INIT(next, cov->mpp.moments, s)) != NOERROR) return err; if (X->remote != NULL) { assert(X->set != NULL); X->set(cov->sub[0], X->remote, X->variant); } TaylorCopy(cov, next); for (i=0; impp.maxheights[i] = next->mpp.maxheights[i]; return NOERROR; } void dosetparam(cov_model *cov, gen_storage *s) { bool performDo = P0INT(SET_PERFORMDO); if (performDo) DO(cov->sub[SETPARAM_LOCAL], s); } void covmatrix_setparam(cov_model *cov, double *v) { cov_model *next = cov->sub[SETPARAM_LOCAL]; CovList[next->nr].covmatrix(next, v); } char iscovmatrix_setparam(cov_model *cov) { cov_model *next = cov->sub[SETPARAM_LOCAL]; return CovList[next->nr].is_covmatrix(next); } void range_setparam(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[SET_PERFORMDO] = 0; range->max[SET_PERFORMDO] = 1; range->pmin[SET_PERFORMDO] = 0; range->pmax[SET_PERFORMDO] = 1; range->openmin[SET_PERFORMDO] = false; range->openmax[SET_PERFORMDO] = false; } void trafo(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; assert(next != NULL); COV(x, next, v); } void logtrafo(double *x, cov_model *cov, double *v, double *Sign){ cov_model *next = cov->sub[0]; assert(next != NULL); LOGCOV(x, next, v, Sign); assert(P0INT(TRAFO_ISO) == next->isoown); } void nonstattrafo(double *x, double *y, cov_model *cov, double *v){ cov_model *next = cov->sub[0]; assert(next != NULL); // printf("%f %f; %f %f\n", x[0], x[1], y[0], y[1]); NONSTATCOV(x, y, next, v); } void lognonstattrafo(double *x, double *y, cov_model *cov, double *v, double *Sign){ cov_model *next = cov->sub[0]; assert(P0INT(TRAFO_ISO) == next->isoown); assert(next != NULL); LOGNONSTATCOV(x, y, next, v, Sign); } int checktrafo(cov_model *cov){ if (PisNULL(TRAFO_ISO)) SERR("parameter not given"); // kdefault(cov, TRAFO_ISO, ISOTROPIC); // if (cov->nsub == 0) addModel(cov, 0, IDCOORD); assert(cov->nsub == 1); cov_model *next = cov->sub[0]; int err = NOERROR; if (!equal_coordinate_system(cov->isoown, P0INT(TRAFO_ISO))) { if (cov->isoown != EARTH_COORDS && cov->isoown != EARTH_SYMMETRIC) { return ERRORWRONGISO; // trafo nicht (mehr) schaffbar } } if ((next->nr == IDCOORD && equal_coordinate_system(cov->isoown, P0INT(TRAFO_ISO)) && cov->isoown != P0INT(TRAFO_ISO)) || (next->nr != IDCOORD && equal_coordinate_system(cov->isoown, P0INT(TRAFO_ISO)) && cov->isoown != P0INT(TRAFO_ISO) && UpgradeToCoordinateSystem(cov->isoown) != P0INT(TRAFO_ISO) ) ) { SERR2("offered system ('%s') does not match the required one ('%s')", ISONAMES[cov->isoown], ISONAMES[P0INT(TRAFO_ISO)]); } if ((err = CHECK(next, cov->tsdim, cov->xdimown, cov->typus, cov->domown, P0INT(TRAFO_ISO), -1, ROLE_COV)) != NOERROR){ return err; } if (!atleastSpecialised(next->isoown, P0INT(TRAFO_ISO))) { SERR2("offered system ('%s') does not match the required one ('%s')", ISONAMES[next->isoown], ISONAMES[P0INT(TRAFO_ISO)]); } cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; return NOERROR; } bool Typetrafo(Types required, cov_model *cov, int depth) { if (cov->sub[0] == NULL) return required==ShapeType; return TypeConsistency(required, cov->sub[0], depth-1); } void rangetrafo(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[TRAFO_ISO] = ISOTROPIC; range->max[TRAFO_ISO] = UNREDUCED; range->pmin[TRAFO_ISO] = ISOTROPIC; range->pmax[TRAFO_ISO] = UNREDUCED; range->openmin[TRAFO_ISO] = false; range->openmax[TRAFO_ISO] = false; } int checktrafoproc(cov_model *cov) { // auch fuer TrendEval cov_model *next = cov->sub[0], *key = cov->key; location_type *loc = Loc(cov); int err; ROLE_ASSERT_GAUSS; assert(cov->nsub == 1); if (cov->key != NULL) { if ((err = CHECK(key, 3 + loc->Time, 3, ProcessType, XONLY, CARTESIAN_COORD, SUBMODEL_DEP, cov->role == ROLE_BASE ? ROLE_BASE : ROLE_GAUSS)) != NOERROR) return err; } else { if ((err = CHECK(next, cov->tsdim, cov->xdimown, cov->typus, cov->domown, P0INT(TRAFO_ISO), -1, ROLE_COV)) != NOERROR){ return err; } if (!TypeConsistency(VariogramType, cov, MAXINT)) SERR("definite function needed"); } cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; return NOERROR; } int structtrafoproc(cov_model VARIABLE_IS_NOT_USED *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){// auch fuer TrendEval cov_model *sub = cov->sub[0]; int i, k, err; ROLE_ASSERT_GAUSS; if (P0INT(TRAFO_ISO) != CARTESIAN_COORD || cov->calling == NULL || cov->calling->isoown != EARTH_COORDS) SERR("currently only earth-to-cartesian allowed"); if (cov->key != NULL) BUG; // ACHTUNG In der Reihenfolge, da (i) Loc einzuverwendet ist // (ii) umgehaengt werden muss da Trafo ownloc verwendet, ownloc // aber durch die Erdtrafo ueberschreiben wird. Somit muss // ownloc gesichert werden. Wird eingehaengt, so dass bei Fehlern // ownloc dennoch zum Schluss geloescht wird. TransformLoc(cov, true, true, false); SetLoc2NewLoc(sub, PLoc(cov)); // passt das? location_type *loc = Loc(cov); if (loc->len != 1) SERR("trafo currently only possible for a single data set"); int spatialdim = loc->spatialdim, xdimprev = cov->xdimprev, newdim = spatialdim == 2 || spatialdim == 3 ? 3 : NA_INTEGER, spatialpts = loc->spatialtotalpoints; bool Time = loc->Time; double aequ, pol, X[4], T[3], *x = loc->x, *y = (double *) MALLOC(sizeof(double) * newdim * spatialpts), *yy = y; if (Time) MEMCOPY(T, loc->T, sizeof(double) * 3); if (STRCMP(GLOBAL.coords.newunits[0], UNITS_NAMES[units_km]) == 0) { aequ = 6378.1; pol = 6356.8; } else { aequ = 3963.17; pol = 3949.93; } if (loc->grid) BUG; loc->Time = false; cov->xdimprev = spatialdim; for (i=0; iTime = Time; cov->xdimprev = xdimprev; //pmi(cov, 0); printf("\n"); PrintLoc(1, loc, true); PMI(cov); assert(!loc->grid); loc_set(y, NULL, T, 3, 3, spatialpts, 0, Time, false, false, cov); if ((err = covCpy(&(cov->key), sub)) == NOERROR) { if (cov->key != NULL) COV_DELETE(&(cov->key)); goto ErrorHandling; } addModel(&(cov->key), GAUSSPROC); if ((err = CHECK(cov->key, 3 + loc->Time, 3, ProcessType, XONLY, CARTESIAN_COORD, SUBMODEL_DEP, cov->role == ROLE_BASE ? ROLE_BASE : ROLE_GAUSS)) != NOERROR) goto ErrorHandling; ErrorHandling : FREE(y); return err; } int inittrafoproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){// auch fuer TrendEval cov_model *key = cov->key; int err; if (cov->vdim[0] != 1) NotProgrammedYet(""); if ((err = INIT(key, 0, s)) != NOERROR) return err; cov->fieldreturn = true; cov->origrf = false; cov->rf = key->rf; cov->simu.active = true; return NOERROR; } void dotrafoproc(cov_model *cov, gen_storage *s){ cov_model *key = cov->key; DO(key, s); } void nonstatprod(double *x, double *y, cov_model *cov, double *v){ location_type *loc = Loc(cov); cov_model *next = cov->sub[0]; int dummy = loc->i_row, rows = next->vdim[0], cols = next->vdim[1], vdimsq = rows * cols; ALLOC_EXTRA(w, vdimsq); loc->i_row = loc->i_col; FCTN(y, next, w); loc->i_row = dummy; if (vdimsq == 1) { FCTN(x, next, v); *v *= *w; } else { ALLOC_EXTRA(u, vdimsq); FCTN(x, next, u); matmulttransposed(u, w, v, cols, rows, cols); } } int checkprod(cov_model *cov) { // location_type *loc = Loc(cov); if (cov->sub[0] == NULL) { addModel(cov, 0, IDCOORD); } cov_model *next = cov->sub[0]; int err; isotropy_type iso = UpgradeToCoordinateSystem(cov->isoown); if (iso == ISO_MISMATCH) return ERRORFAILED; //if (cov->isoown != EARTH_COORD) return ERRORFAILED; printf("loeschen\n"); // STOPAFTER(cov->isoown == EARTH_COORD,APMI(cov)); if ((err = CHECK(next, cov->tsdim, cov->xdimown, ShapeType, XONLY, iso, SUBMODEL_DEP, ROLE_BASE )) != NOERROR) return err; setbackward(cov, next); cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; EXTRA_STORAGE; cov->pref[Direct] = 1; cov->pref[Specific] = cov->pref[Nothing]= 5; return NOERROR; } int checkprodproc(cov_model *cov) { // auch fuer TrendEval int err; if ((err = checkprod(cov))) return err; if (cov->vdim[0] != 1) NotProgrammedYet(""); return NOERROR; } int structprodproc(cov_model VARIABLE_IS_NOT_USED *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){// auch fuer TrendEval return NOERROR; } int initprodproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){// auch fuer TrendEval int err; if (cov->vdim[0] != 1) NotProgrammedYet(""); if ((err = check_fctn(cov)) != NOERROR) return err; ROLE_ASSERT_GAUSS; err = FieldReturn(cov); cov->simu.active = err == NOERROR; if (PL>= PL_STRUCTURE) PRINTF("\n'%s' is now initialized.\n", NAME(cov)); return err; } void doprodproc(cov_model *cov, gen_storage *s){ location_type *loc = Loc(cov); long i, vdim = cov->vdim[0], totvdim = loc->totalpoints * vdim; double *res = cov->rf; assert(res != NULL); Fctn(NULL, cov, res); if (s->prodproc_random) { double g = GAUSS_RANDOM(1.0); for(i=0; isub[0]; int i, dummy = loc->i_row, rows = next->vdim[0], cols = next->vdim[1], vdimsq = rows * cols; ALLOC_EXTRA(w, vdimsq); loc->i_row = loc->i_col; FCTN(y, next, w); loc->i_row = dummy; FCTN(x, next, v); for (i=0; isub[0] == NULL) { addModel(cov, 0, IDCOORD); } cov_model *next = cov->sub[0]; int err; if ((err = CHECK(next, cov->tsdim, cov->xdimown, ShapeType, XONLY, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; setbackward(cov, next); if (cov->vdim[0] != cov->vdim[1]) SERR("sub model must return symmetric a square matrix"); EXTRA_STORAGE; return NOERROR; } #define NUMBER_DERIV 10 #define NUMBER_NORM 20 #define DIM_MAX 10 RandomFields/src/Coordinate_systems.h0000644000176200001440000001730013074763020017442 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef Coordinates_H #define Coordinates_H 1 void iso2iso(double *x, cov_model *cov, double *v); void spaceDiso2iso(double *x, cov_model *cov, double *v); void spiso2spiso(double *x, cov_model *cov, double *v); void spaceDspiso2spiso(double *x, cov_model *cov, double *v); void spacetime2iso(double *x, cov_model *cov, double *v); void spaceDspiso2iso(double *x, cov_model *cov, double *v); void Stat2iso(double *x, cov_model *cov, double *v); void Stat2spacetime(double *x, cov_model *cov, double *v); void Stat2Stat(double *x, cov_model *cov, double *v); void Nonstat2iso(double *x, double *y, cov_model *cov, double *v); void Nonstat2spacetime(double *x, double *y, cov_model *cov, double *v); void Nonstat2Stat(double *x, double *y, cov_model *cov, double *v); void logiso2iso(double *x, cov_model *cov, double *v, double *Sign); void logspiso2spiso(double *x, cov_model *cov, double *v, double *Sign); void logspacetime2iso(double *x, cov_model *cov, double *v, double *Sign); void logStat2iso(double *x, cov_model *cov, double *v, double *Sign); void logNonstat2iso(double *x, double *y, cov_model *cov, double *v, double *Sign); void logStat2spacetime(double *x, cov_model *cov, double *v, double *Sign); void logNonstat2spacetime(double *x, double *y, cov_model *cov, double *v, double *Sign); void logStat2Stat(double *x, cov_model *cov, double *v, double *Sign); void logNonstat2Stat(double *x, double *y, cov_model *cov, double *v, double *Sign); void Nonstat2Nonstat(double *x, double *y, cov_model *cov, double *v); void logNonstat2Nonstat(double *x, double *y, cov_model *cov, double *v, double *Sign); void EarthIso2EarthIso(double *x, cov_model *cov, double *v); void logEarthIso2EarthIso(double *x, cov_model *cov, double *v, double *Sign); void NonstatEarth2EarthIso(double *x, double *y, cov_model *cov, double *v); void logNonstatEarth2EarthIso(double *x, double *y, cov_model *cov, double *v, double *Sign); void Earth2Earth(double *x, cov_model *cov, double *v); void logEarth2Earth(double *x, cov_model *cov, double *v, double *Sign); void NonstatEarth2Earth(double *x, double *y, cov_model *cov, double *v); void logNonstatEarth2Earth(double *x, double *y, cov_model *cov, double *v, double *Sign); void EarthIso2SphereIso(double *x, cov_model *cov, double *v); void logEarthIso2SphereIso(double *x, cov_model *cov, double *v, double *Sign); void NonstatEarth2SphereIso(double *x, double *y, cov_model *cov, double *v); void logNonstatEarth2SphereIso(double *x, double *y, cov_model *cov, double *v, double *Sign); void Earth2Sphere(double *x, cov_model *cov, double *v); void logEarth2Sphere(double *x, cov_model *cov, double *v, double *Sign); void NonstatEarth2Sphere(double *x, double *y, cov_model *cov, double *v); void logNonstatEarth2Sphere(double *x, double *y, cov_model *cov, double *v, double *Sign); void SphereIso2SphereIso(double *x, cov_model *cov, double *v); void logSphereIso2SphereIso(double *x, cov_model *cov, double *v, double *Sign); void NonstatSphere2SphereIso(double *x, double *y, cov_model *cov,double *v); void logNonstatSphere2SphereIso(double *x, double *y, cov_model *cov, double *v, double *Sign); void Sphere2Sphere(double *x, cov_model *cov, double *v); void logSphere2Sphere(double *x, cov_model *cov, double *v, double *Sign); void NonstatSphere2Sphere(double *x, double *y, cov_model *cov, double *v); void logNonstatSphere2Sphere(double *x, double *y, cov_model *cov, double *v, double *Sign); void EarthKM2CartStat(double *x, cov_model *cov, double *v); void logEarthKM2CartStat(double *x, cov_model *cov, double *v, double *Sign); void EarthKM2Cart(double *x, double *y, cov_model *cov, double *v); void logEarthKM2Cart(double *x, double *y, cov_model *cov, double *v, double *Sign); void EarthMiles2CartStat(double *x, cov_model *cov, double *v); void logEarthMiles2CartStat(double *x, cov_model *cov, double *v,double*Sign); void EarthMiles2Cart(double *x, double *y, cov_model *cov, double *v); void logEarthMiles2Cart(double *x, double *y, cov_model *cov, double *v, double *Sign); int checkEarth(cov_model *cov); void EarthKM2OrthogStat(double *x, cov_model *cov, double *v); void logEarthKM2OrthogStat(double *x, cov_model *cov, double *v, double *Sign); void EarthKM2Orthog(double *x, double *y, cov_model *cov, double *v); void logEarthKM2Orthog(double *x, double *y, cov_model *cov, double *v, double *Sign); void EarthMiles2OrthogStat(double *x, cov_model *cov, double *v); void logEarthMiles2OrthogStat(double *x, cov_model *cov, double *v,double*Sign); void EarthMiles2Orthog(double *x, double *y, cov_model *cov, double *v); void logEarthMiles2Orthog(double *x, double *y, cov_model *cov, double *v, double *Sign); void Earth2GnomonicStat(double *x, cov_model *cov, double *v); void logEarth2GnomonicStat(double *x, cov_model *cov, double *v, double*Sign); void Earth2Gnomonic(double *x, double *y, cov_model *cov, double *v); void logEarth2Gnomonic(double *x, double *y, cov_model *cov, double *v, double *Sign); #define Mod(ZZ, modulus) ((ZZ) - FLOOR((ZZ) / (modulus)) * (modulus)) double mod(double x, double modulus); double lonmod(double x, double modulus); double latmod(double x, double modulus); #define STATMODE_BASE(X, ZZ, lon, lat) \ X[0]=lonmod(ZZ[0], lon); \ X[1]=latmod(ZZ[1], lat) \ void statmod2(double *x, double lon, double lat, double *y); // 2dim only bool isIsotropic(isotropy_type iso); bool isAnyIsotropic(isotropy_type iso); bool isSpaceIsotropic(isotropy_type iso); bool isZeroSpaceIsotropic(isotropy_type iso); bool isVectorIsotropic(isotropy_type iso); bool isSymmetric(isotropy_type iso); bool isCartesian(isotropy_type iso); bool isSpherical(isotropy_type iso); bool isCylinder(isotropy_type iso); bool isEarth(isotropy_type iso); bool isAnySpherical(isotropy_type iso); bool isAnySphericalIso(isotropy_type iso); bool isAnySphericalNotIso(isotropy_type iso); bool isPrevModelI(cov_fct *C); bool isUnreduced(cov_fct *C); bool isCoordinateSystem(isotropy_type iso); bool atleastSpecialised(isotropy_type iso, isotropy_type as); isotropy_type UpgradeToCoordinateSystem( isotropy_type iso); isotropy_type CoordinateSystemOf(isotropy_type iso); isotropy_type SymmetricOf(isotropy_type iso); isotropy_type IsotropicOf(isotropy_type iso); bool equal_coordinate_system(isotropy_type iso1, isotropy_type iso2); bool equal_coordinate_system(isotropy_type iso1, isotropy_type iso2, bool refined); bool is_any(isotropy_type iso, cov_fct *C); bool is_all(isotropy_type iso, cov_fct *C); typedef bool (*isofct)(isotropy_type iso); /* h, cov, result */ bool is_any(isofct iso, cov_fct *C); bool is_all(isofct iso, cov_fct *C); #define ASSERT_CARTESIAN if (!isCartesian(cov->isoown)) return ERRORCARTESIAN #define radiuskm_aequ 6378.1 #define radiuskm_pol 6356.8 #define radiusmiles_aequ 3963.17 #define radiusmiles_pol 3949.93 void Earth2Cart(double *x, cov_model *cov, double RAEQU, double RPOL, double *X); #endif RandomFields/src/Userinterfaces.h0000644000176200001440000003606513074763020016557 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2017 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef RFuser_H #define RFuser_H 1 #define NAT_SCALE 0 #define MAX_CE_MEM 16777216 #define generalN 18 // IMPORTANT: all names of general must be at least 3 letters long !!! extern const char *general[generalN]; #define GENERAL_MODUS 0 #define GENERAL_STORING 1 #define GENERAL_EXACTNESS 7 #define GENERAL_CLOSE 10 typedef struct general_param { char pch; /* character shown after each simulation just for entertainment of the user except for "!", then the numbers are shown */ bool allowdist0, na_rm_lines, vdim_close_together, storing, /* true: intermediate results are stored: might be rather memory consuming, but the simulation can (depending on the method chosen) be much faster when done the second time with exactly the same parameters do not forget to call DeleteAllKeys when all the simulation are done. false: intermediate results are not stored if SimulateRF is called or stored only until DoGauss is called. minimum memory consumption, but might be rather slow if many simulations are performed with exactly the same parameters to be safe call DeleteAllKeys when all the simulations are done Warning! init_foo may depend on GENERAL_STORING! This may cause problems if GENERAL_STORING is changed between init_foo and do_foo from false to true and if do_foo is called more than once! (SimulateRF is safe in this case) indifferent behaviour for the simulation methods if parameters are changed after each simulation. In case, only MAXFIELDS different parameter sets are used, but after each step the parameter set is changed, use different keynr for each parametere set, and STORING==true, to get fast simulation */ sp_conform, /* should the simulation result be return in as an sp class or in the old form ? --- getting obsolete in future --- todo */ detailed_output, returncall; int mode, /* hightailing, fast, normal, save, pedantic */ output, /* output mode, #alternative to mode that changes several other parameters; vice versa, spConform sets 'output' */ reportcoord ; /* see convert.T PL_* and RF.h PL_* */ int naturalscaling; /* is called PracticalRange in R (see Chiles&Delfiner?!) Note: RFparameters() allows only 0 and 1 as values! has an effect only if cov (and not only cov.local, e.g. Brownian Motion) is defined 0 : using the covariance function as defined 1 : rescaling of cov fctn such that cov(1)~=0.05, if rescaling function does not exist then failure, e.g. for Bessel model 2 : exact or approximate value (e.g. expPLUScirc) 3 : MLE (special needs taken into account, long memory covariance functions have too long tails, which are shortened (so threshold 0.05 is changed to higher values in this case)) +10: if any of the above fails : numerical evaluation! else : using rescaling if rescaling function exists, otherwise without rescaling */ int expected_number_simu, every, // every 'every' line is announced if every>0 // bool aniso; // currerntly cannot be changed by the user !! // siehe InternalCov.cc line 350, simu.cc line 394 /* expand scale immediately to aniso; this allows higher flexibility in the choice of simulation methods (tbm2 does not like dimension reduction), but it is slower */ Ttriple, set; double gridtolerance, exactness; } general_param; #define general_START \ {pch[NM], \ allowdistance0[NM], false, false, false, \ true, /* 6 */ \ false, false, \ startmode/* mode */ , output_sp, reportcoord_warnings, \ NAT_SCALE, \ 1, 0, \ NA_INTEGER, 0, \ 1e-6, exactness[NM] \ } #define gaussN 6 extern const char *gauss[gaussN]; #define GAUSS_BEST_DIRECT 3 #define GAUSS_BOXCOX_OPTION 5 typedef struct gauss_param{ double stationary_only, // logical + NA approx_zero, boxcox[2 * MAXGAUSSVDIM]; bool paired, loggauss; int direct_bestvariables; } gauss_param; #define gauss_START {RF_NA, 0.05, \ {RF_INF, 0, RF_INF, 0, RF_INF, 0, RF_INF, 0, RF_INF, 0, \ RF_INF, 0, RF_INF, 0, RF_INF, 0, RF_INF, 0, RF_INF, 0}, \ false, false, 1200} #define MINSPLITN(locmaxn) (locmaxn / 40) #define MEDSPLITN(locmaxn) (locmaxn / 8) #define MAXSPLITN(locmaxn) ((locmaxn * 5) / 8) #define krigeN 5 #define KRIGE_SPLITN 2 extern const char *krige[krigeN]; typedef struct krige_param { bool ret_variance, fillall; int locmaxn, locsplitn[3], // 0:when splitting is done; 1:min pts in a neighbourhood ; 2:max pts when still neighbourhoods are included locsplitfactor; } krige_param; #define krige_START {false, true, locmaxn[NM], \ {MINSPLITN(locmaxn[NM]), MEDSPLITN(locmaxn[NM]), MAXSPLITN(locmaxn[NM])},\ 2} #define CEN 12 extern const char *CE[CEN]; typedef struct ce_param { bool force, useprimes, dependent; char strategy; int trials, maxgridsize, maxmem; double maxGB, tol_re, tol_im, mmin[MAXCEDIM], approx_grid_step; } ce_param; #define ce_START \ {ce_force[NM], true, ce_dependent[NM], \ TRIVIALSTRATEGY, \ 3, MAX_CE_MEM, MAXINT, \ 1, ce_tolRe[NM], ce_tolIm[NM], {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \ ce_approx_step[NM]} #define spectralN 4 #define SPECTRAL_PROPFACTOR 2 extern const char * spectral[spectralN]; typedef struct spectral_param { bool grid; double prop_factor, sigma; int lines[MAXTBMSPDIM]; } spectral_param; #define spectral_START {sp_grid[NM], 50, 0.0, {2500, 2500, 2500, 2500}} #define pTBMN 9 extern const char * pTBM[pTBMN]; typedef struct tbm_param { bool grid; int tbmdim, fulldim, points, lines[MAXTBMSPDIM]; // number of lines simulated double layers; // 0, 1, NA double linesimufactor, /*factor by which simulation on the line is finer than the grid */ linesimustep, /* grid lag defined absolutely */ // bool tbm2num; center[MAXTBMSPDIM]; } tbm_param; #define tbm_START \ {sp_grid[NM], -2, 3, 0, {1, 60, 500}, RF_NA, tbm_linefactor[NM], 0.0, \ {RF_NA, RF_NA, RF_NA, RF_NA}} #define directN 1 #define DIRECT_MAXVAR_PARAM 0 #define DIRECT_ORIG_MAXVAR 8192 extern const char *direct[directN]; typedef struct direct_param { // InversionMethod inversionmethod; // double svdtolerance; int maxvariables; } direct_param; #define direct_START { DIRECT_ORIG_MAXVAR } // {Cholesky, direct_tol[NM], 8192 } #define sequN 2 extern const char * sequ[sequN]; typedef struct sequ_param{ int back, initial; } sequ_param; #define sequ_START {10, -10} typedef struct ave_param { } ave_param; #define ave_START {} #define pnuggetN 1 extern const char * pnugget[pnuggetN]; typedef struct nugget_param { double tol; } nugget_param; #define nugget_START {nugget_tol[NM]} #define mppN 6 extern const char * mpp[mppN]; typedef struct mpp_param { int n_estim_E, scatter_max[MAXMPPDIM]; double intensity[MAXMPPDIM], // intensity factor for e.g. unif_initu about_zero, shape_power, scatter_step[MAXMPPDIM]; } mpp_param; #define mpp_START \ {50000, \ {NA_INTEGER, NA_INTEGER, NA_INTEGER, NA_INTEGER}, \ {mpp_intensity[NM], mpp_intensity[NM], mpp_intensity[NM],mpp_intensity[NM]},\ mpp_zero[NM], /* about zero */ \ 2.0, \ {RF_NA, RF_NA, RF_NA, RF_NA} \ } #define hyperN 4 extern const char * hyper[hyperN]; typedef struct hyper_param { int superpos, maxlines, mar_distr; double mar_param; } hyper_param; #define hyper_START {700, 1000, HYPER_UNIFORM, RF_NA} #define extremeN 10 extern const char * extreme[extremeN]; #define EXTREME_FLAT 5 typedef struct extremes_param { int maxpoints, check_every, flat, min_n_zhou, max_n_zhou, mcmc_zhou; double standardmax, GEV_xi, density_ratio, eps_zhou; } extremes_param; #define extreme_START \ {MAXINT, 30, FALSE, /* FLAT_UNDETERMINED */ \ 1000, 10000000, 20, \ max_max_gauss[NM], \ 1.0, 0.0, 0.01} #define brN 7 extern const char * br[brN]; typedef struct br_param { int BRmaxmem, BRvertnumber, BRoptim, deltaAM; double BRmeshsize, BRoptimtol, variobound; } br_param; #define br_START \ {10000000, 7, 1, 300, \ 0.1, 0.01, 8.0} \ #define distrN 9 extern const char * distr[distrN]; typedef struct distr_param{ double safety, minsteplen, innermin, outermax; int maxsteps, parts, maxit, mcmc_n, repetitions; } distr_param; #define distr_START {0.08, 0, 1e-20, 1e5, 1000, 8, 20, 15, 1000} // distr (rectangular) // todo should be 500 and better algorithm for approximation! #define MINCLIQUE(locmaxn) (locmaxn / 25) #define MEDCLIQUE(locmaxn) (locmaxn / 5) #define MAXCLIQUE(locmaxn) ((locmaxn * 3) / 5) #define FLAT_UNDETERMINED -1 #define GRIDEXPAND_AVOID -1 #define fitN 42 #define FIT_MAXNEIGHBOUR 25 #define FIT_BC_LB 12 #define FIT_BC_UB 13 #define FIT_CLIQUE 26 extern const char * fit[fitN]; typedef struct fit_param{ double bin_dist_factor, upperbound_scale_factor, lowerbound_scale_factor, lowerbound_scale_LS_factor, upperbound_var_factor, lowerbound_var_factor, //lowerbound_sill, scale_max_relative_factor, minbounddistance, minboundreldist, minmixedvar, maxmixedvar, BC_lambdaLB[2 * MAXGAUSSVDIM], BC_lambdaUB[2 * MAXGAUSSVDIM], scale_ratio, min_diag, pgtol, pgtol_recall, factr, factr_recall;// logical + NA // 19 int approximate_functioncalls, bins, nphi, ntheta, ntime, critical, n_crit, locmaxn, locsplitn[3], // 0:when splitting is done; 1:min pts in a neighbourhood ; 2:max pts when still neighbourhoods are included locsplitfactor, smalldataset, optimiser, algorithm, likelihood, estimate_variance, split; // 16 bool use_naturalscaling, onlyuser, reoptimise, ratiotest_approx, split_refined, cross_refit; // 8 char lengthshortname; // 1..255 } fit_param; #define fit_START\ {0.4, 3.0, 5.0, 3.0, 10.0, 1e4, /* 6 */ \ 1000.0, 0.001, 0.02, 1/1000, 1000, /* 11 */ \ {-10, -10.0, -10, -10.0, -10, -10.0, -10, -10.0, -10, -10.0, \ -10, -10.0, -10, -10.0, -10, -10.0, -10, -10.0, -10, -10.0}, \ {10, 10.0, 10, 10.0, 10, 10.0, 10, 10.0, 10, 10.0, \ 10, 10.0, 10, 10.0, 10, 10.0, 10, 10.0, 10, 10.0}, \ 0.1, 1e-7, fit_pgtol[NM], fit_pgtol_recall[NM], /* 17 */ \ fit_factr[NM], fit_factr_recall[NM], \ /* int: */ \ 50, 20, 1, 1, 20, 0 /* critical */, /* 6 */ \ 5 /* ncrit */ , maxclique[NM], \ {MINCLIQUE(maxclique[NM]), MEDCLIQUE(maxclique[NM]),\ MAXCLIQUE(maxclique[NM]) }, 2, 2000, /* 11 */ \ 0, -1 /* algorithm */, 0, NA_INTEGER, fit_split[NM], /* 16 */ \ !true, false, fit_reoptimise[NM], /* 5 */\ fit_ratiotest_approx[NM], true, fit_cross_refit[NM], \ 12} // fit #define empvarioN 5 extern const char * empvario[empvarioN]; typedef struct empvario_param{ double phi0, theta0, tol; bool pseudovariogram, fft; } empvario_param; #define empvario_START {0.0, 0.0, 1e-13, false, true} #define guiN 3 extern const char * gui[guiN]; #define GUI_SIZE 2 typedef struct gui_param{ bool alwaysSimulate; int method, size[2]; } gui_param; #define gui_START {true, CircEmbed, {1024, 64}} #define graphicsN 12 extern const char *graphics[graphicsN]; #define GRAPHICS_UPTO 3 typedef struct graphics_param { bool split_screen, close_screen, onefile; double height, width, resolution; int PL, increase_upto[2], always_open, always_close, number; char filename[100]; } graphics_param; #define graphics_START { true, true, false, \ 6.0, RF_NA, 72.0, \ 1, {3, 4}, true, NA_INTEGER, 0, ""} #define registersN 3 extern const char *registers[registersN]; typedef struct registers_param { int keynr, predict, likelihood; } registers_param; #define register_START {0, MODEL_PREDICT, MODEL_USER} #define internalN 20 extern const char * internals[internalN]; #define INTERNALS_NEWANISO 2 #define INTERNALS_ONGRID 9 #define INTERNALS_COORD_CHANGE 12 #define INTERNALS_ZENIT 14 typedef struct internal_param{ // if changed, CHANGE ALSO RestWarnings in 'userinterfaces.cc'; bool warn_oldstyle, warn_newstyle, warn_Aniso, warn_ambiguous, warn_normal_mode, warn_mode, stored_init, warn_scale, warn_coordinates, warn_on_grid, warn_new_definitions, warn_aspect_ratio, warn_coord_change, warn_color_palette, warn_zenit, do_tests, warn_constant, warn_negvar, warn_onlyvar ;// int examples_reduced; } internal_param; #define internal_START\ {true, true, true, false, true, \ true, false, true, true, true, \ true, true, true, true, true, \ DO_TESTS, true, true, true, 0} #define coordsN 10 #define COORDS_XYZNOTATION 0 #define ZENIT 8 extern const char *coords[coordsN]; typedef struct coords_param{ double xyz_notation, zenit[2]; coord_sys_enum coord_system, new_coord_system; char newunits[MAXUNITS][MAXUNITSCHAR], // only to read curunits[MAXUNITS][MAXUNITSCHAR], varunits[MAXUNITS][MAXUNITSCHAR], // 2 user variables for data.frames data_names[MAXUNITS][MAXCHAR],/// x_names[MAXUNITS][MAXCHAR]; // auxiliary variables int data_nr_names, x_nr_names, // needed by data_names and x_names data_idx[2], x_idx[2]; // alternatives for data_names and x_namwe bool polar_coord; } coords_param; #define coords_START\ {RF_NA, {1, RF_NA}, coord_auto, coord_keep, \ {""}, {""}, {""}, {""}, {""}, 0, 0, {NA_INTEGER, NA_INTEGER}, \ {NA_INTEGER, NA_INTEGER}, false} #define specialN 1 extern const char * special[specialN]; typedef struct special_param { int multcopies; } special_param; #define special_START {10} #define obsoleteN 10 extern const char * obsolete[obsoleteN]; typedef struct globalparam{ general_param general; gauss_param gauss; krige_param krige; ce_param ce; spectral_param spectral; tbm_param tbm; direct_param direct; sequ_param sequ; ave_param ave; nugget_param nugget; mpp_param mpp; hyper_param hyper; extremes_param extreme; br_param br; distr_param distr; fit_param fit; empvario_param empvario; gui_param gui; graphics_param graphics; registers_param registers; internal_param internal; coords_param coords; special_param special; } globalparam; extern globalparam GLOBAL; #define prefixN 23 extern const char * prefixlist[prefixN], **all[prefixN]; extern int allN[prefixN]; void setparameter(int i, int j, SEXP el, char name[200], bool isList); void getRFoptions(SEXP *sublist); void finalparameter(); #endif RandomFields/src/auxiliary.cc0000644000176200001440000002777013074763020015745 0ustar liggesusers//#define DEBUG 1 /* Authors Martin Schlather, schlather@math.uni-mannheim.de Collection of auxiliary functions Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include #include #include #include #include "RF.h" // important check !! #ifndef SCHLATHERS_MACHINE #ifdef SHOW_ADDRESSES SHOW_ADRESSES IS NOT ALLOWED #endif #ifdef RANDOMFIELDS_DEBUGGING RANDOMFIELDS_DEBUGGING IS NOT ALLOWED #endif #endif double intpow(double x, int p) { double res = 1.0; if (p < 0) { p = -p; x = 1.0 / x; } while (p != 0) { if (p % 2 == 1) res *= x; x *= x; p /= 2; } return res; } void AxResType(double *A, double *x, int nrow, int ncol, double *y) { int i,j,k; for (i=0; i0; i+=dimP1, ii--) { // filling lower half endfor = i + ii; for (ve = i + 1, ho = i + dim; ve < endfor; ve++, ho += dim) { C[ve] = C[ho]; } } } */ void memory_copy(void *dest, void *src, int bytes) { int i, len = bytes / sizeof(int), *d = (int*) dest, *s = (int *) src; if ((len * (int) sizeof(int)) != bytes) { ERR("size not a multiple of int"); } for (i=0; i= x --- sollte das gleiche sein // wie searchFirstGreater int mitte, min = 0, max = size - 1; while (min < max) { mitte = 0.5 * (min + max); if (cum[mitte] >= x) max = mitte; else min = mitte + 1; } // printf("%f < %f <= %f\n", cum[min-1], x, cum[min]); assert((min==0) || x > cum[min-1]); assert(x <= cum[min] && (min==0 || x > cum[min-1])); return min; } /* int searchFirstGreater(double *v, int len, double z) { // assumes the list has non decreasing values int firsti = 0, lasti = len - 1, i = len / 2; if (z > v[lasti]) { BUG; } if (z <= v[firsti]) return firsti; while (firsti < lasti) { if (v[i] < z) { firsti = i + 1; i = i + (int) ((lasti - i + 1) / 2); } else { // v[i] <= z lasti = i; i = i - (int) ((i - firsti + 1) / 2); } } assert((i==0) || z > v[i-1]); assert(z <= v[i]); // printf("%f < %f <= %f\n", v[i-1], z, v[i]);// } */ /* double searchInverse(isofct fct, double start, double *value, double releps) { while (fct(start, cov) > value) start *= 2.0; while (fct(start, cov) < value) start *= 0.5; double x = start, step = start; releps *= start; while (step > releps) { step *= 0.5; if (fct(step, cov) < value) x -= step; else x += step; } } */ double searchInverse(covfct fct, cov_model *cov, double start, double value, double releps) { double v; fct(&start, cov, &v); while (v > value) {start *= 2.0; fct(&start, cov, &v);} while (v < value) {start *= 0.5; fct(&start, cov, &v);} double x = start, step = start; releps *= step; while (step > releps) { step *= 0.5; fct(&step, cov, &v); if (v < value) x -= step; else x += step; } return x; } double searchInverse(covfct fct, cov_model *cov, double start, double min, double value, double releps) { double v; assert(start > min); fct(&start, cov, &v); while (v > value) {start = 2.0 * (start - min) + min; fct(&start, cov, &v);} while (v < value) {start = 0.5 * (start - min) + min; fct(&start, cov, &v);} double x = start, step = start - min; releps *= step; while (step > releps) { step *= 0.5; fct(&step, cov, &v); if (v < value) x -= step; else x += step; } return x; } //double gamma(double x) { BUG; } // use gammafn instead double incomplete_gamma(double start, double end, double s) { // int_start^end t^{s-1} e^{-t} \D t // print("incomplete IN s=%f e=%f s=%f\n", start, end, s); double v = 0.0, w = 0.0; if (s <= 1.0) { if (start == 0.0) return RF_NA; } double e_start = EXP(-start), e_end = EXP(-end), power_start = POW(start, s), power_end = end < RF_INF ? POW(end, s) : 0, factor = 1.0; while (s < 0.0) { factor /= s; v += factor * (power_end * e_end - power_start * e_start); power_start *= start; if (end < RF_INF) power_end *= end; s += 1.0; } w = pgamma(start, s, 1.0, false, false); // q, shape, scale, lower, log if (R_FINITE(end)) w -= pgamma(end, s, 1.0, false, false); // print("incomplete s=%f e=%f s=%f v=%f g=%f w=%f\n", start, end, s, v, gammafn(s), w); return v + gammafn(s) * w * factor; } int addressbits(void VARIABLE_IS_NOT_USED *addr) { #ifndef SCHLATHERS_MACHINE return -1; #else double x = (intptr_t) addr, cut = 1e9; x = x - TRUNC(x / cut) * cut; return (int) x; #endif } bool LOCAL_DEBUG = false; void start_debug() { LOCAL_DEBUG = true; } void end_debug() { LOCAL_DEBUG = false; } void Abbreviate(char *Old, char *abbr) { char *old = Old; if (old[0] == '.') old++; int len = GLOBAL.fit.lengthshortname / 3, nold = STRLEN(old), nabbr = len - 1; if (nold <= len) { abbr[len] = '\0'; STRCPY(abbr, old); // printf(">%s**%s<\n", Old, abbr); return; } abbr[0] = old[0]; abbr[len] = '\0'; while (nabbr >= 1 && nabbr < nold) { char b = old[nold]; if (b=='a' || b=='A' || b=='e' || b=='E' || b=='i' || b=='I' || b =='o' || b=='O' || b=='u' || b=='U') nold--; else abbr[nabbr--] = old[nold--]; } if (nabbr > 1) { assert(nabbr==0 || nold == nabbr); for (int i=2; i<=nold; i++) abbr[i] = old[i]; } //printf(">%s--%s<\n", Old, abbr); } RandomFields/src/AutoRandomFields.h0000644000176200001440000002214213074763020016764 0ustar liggesusers#ifndef AutoRandomFields_H #define AutoRandomFields_H 1 #include #define MAXCHAR 18 // max number of characters for (covariance) names #define METHODMAXCHAR MAXCHAR // max number of character to describe a Method (including \0) #define MAXCOVDIM 1000000 #define MAXMLEDIM MAXCOVDIM #define MAXSIMUDIM MAXCOVDIM #define MAXSUB 10 #define MAXCEDIM 13 #define MAXTBMSPDIM 4 #define MAXMPPDIM 4 #define MAXMPPVDIM 10 #define MAXHYPERDIM 4 #define MAXNUGGETDIM 20 #define MAXVARIODIM 20 #define MAXTBMVDIM 5 #define MAXGETNATSCALE 5 #define MAXGAUSSVDIM 10 #define MAXPARAM 20 typedef int domain_type; typedef int isotropy_type; #define MAXUNITS 4 typedef enum units_enum { units_none, units_km, units_miles, units_time, units_user} units_enum; #define nr_units (units_user + 1) typedef enum coord_sys_enum { coord_auto, coord_keep, cartesian, earth, sphere, gnomonic, orthographic, coord_mix } coord_sys_enum; #define nr_coord_sys (coord_mix + 1) typedef enum reportcoord_modes {reportcoord_always, reportcoord_warnings_orally, reportcoord_warnings, reportcoord_none} reportcoord_modes; #define nr_reportcoord_modes (reportcoord_none + 1) typedef enum modes {careless, sloppy, easygoing, normal, precise, pedantic, neurotic} modes; #define nr_modes (neurotic + 1) typedef enum output_modes {output_sp, output_rf, output_geor} output_modes; #define nr_output_modes (output_geor + 1) // 0 sicherheitshalber nirgendswo nehmen #define PARAM_DEP -1 // parameter dependent fuer vdim, finiterange, etc; for CovList only, falls von submodel und param abhaengig, so submodel_dep #define PREVMODEL_DEP -2 #define SUBMODEL_DEP -3 // immer, wenn zumindest submodel depedence //#define PARAMSUBMODELM -2 // for CovList only #define MISMATCH -4 //#define NON_QUADRATIC -5 // NOTE!!! // if any definition is changed check setbackward() #define XONLY (domain_type) 0 // TRANS_INV #define KERNEL (domain_type) 1 // not a genuine covariance function; // takes only x vector, but is not statonary #define PREVMODELD (domain_type) 2 // type taken from calling models #define DOMAIN_MISMATCH (domain_type) 3// always last ! #define LAST_DOMAIN DOMAIN_MISMATCH // NOTE!! // !!! CHANGE ALSO RF_GLOBALS.R !!! #define ISOTROPIC (isotropy_type) 0 // RC genauer : rotation invariant!! #define SPACEISOTROPIC (isotropy_type) 1 // RC fully symmetric #define ZEROSPACEISO (isotropy_type) 2 // isotropic if time diff is zero #define VECTORISOTROPIC (isotropy_type) 3 #define SYMMETRIC (isotropy_type) 4 //"stationary" only if XONLY; in the covariance sense if multivariate! #define CARTESIAN_COORD (isotropy_type) 5 // RC #define GNOMONIC_PROJ (isotropy_type) 6 // RC projection on the plane #define ORTHOGRAPHIC_PROJ (isotropy_type) 7 // RC dito; to do: implement further projections #define LAST_CARTESIAN ORTHOGRAPHIC_PROJ // danach MUSS sphaerisch kommen!! #define SPHERICAL_ISOTROPIC (isotropy_type) 8 #define SPHERICAL_SYMMETRIC (isotropy_type) 9 #define SPHERICAL_COORDS (isotropy_type) 10 // RC #define EARTH_ISOTROPIC (isotropy_type) 11 #define EARTH_SYMMETRIC (isotropy_type) 12 #define EARTH_COORDS (isotropy_type) 13 // RC #define LAST_ANYSPHERICAL EARTH_COORDS #define CYLINDER_COORD (isotropy_type) 14 // unused #define UNREDUCED (isotropy_type) 15 //CARTESIAN_COORD or EARTH_COORD #define PREVMODELI (isotropy_type) 16 // type taken from submodels #define ISO_MISMATCH (isotropy_type) 17 // always last ! #define LAST_ISO ISO_MISMATCH #define MON_PARAMETER -1 #define NOT_MONOTONE 0 #define MONOTONE 1 #define GNEITING_MON 2 // Euclid's hat, Gneiting, J.Mult.Anal. 69, 1999 #define NORMAL_MIXTURE 3 #define COMPLETELY_MON 4 #define BERNSTEIN 5 // is different from everything else before #define MAXFIELDS 10 #define MODEL_USER (MAXFIELDS + 0) // for user call of Covariance etc. #define MODEL_AUX (MAXFIELDS + 1) // auxiliary in fitgauss.R #define MODEL_INTERN (MAXFIELDS + 2) // for kriging, etc; internal call of cov #define MODEL_SPLIT (MAXFIELDS + 3) // split covariance model and other auxiliary methods #define MODEL_GUI (MAXFIELDS + 4) // RFgui #define MODEL_MLE (MAXFIELDS + 5) // mle covariance model #define MODEL_MLESPLIT (MAXFIELDS + 6) // ="= #define MODEL_LSQ (MAXFIELDS + 7) // unused #define MODEL_BOUNDS (MAXFIELDS + 8) // MLE, lower, upper #define MODEL_KRIGE (MAXFIELDS + 9) #define MODEL_PREDICT (MAXFIELDS + 10) #define MODEL_ERR (MAXFIELDS + 11) #define MODEL_MAX MODEL_ERR typedef enum Types { TcfType, PosDefType, VariogramType, NegDefType, ProcessType, GaussMethodType, BrMethodType, // change also rf_globals.R if deleted PointShapeType, RandomType, ShapeType, TrendType, InterfaceType, RandomOrShapeType, // only for parameters, e.g. nu in Whittle UndefinedType, // Bedeutung: C->Type:TypeFct existiert; cov->typus:ungesetzt MathDefinition, OtherType, // always last for usual use NN1, NN2, NN3, NN4 // for use in generateMmodels only } Types; #define nOptimiser 8 #define nNLOPTR 15 #define nLikelihood 4 extern const char *ISONAMES[LAST_ISO + 1], *OPTIMISER_NAMES[nOptimiser], *NLOPTR_NAMES[nNLOPTR], *LIKELIHOOD_NAMES[nLikelihood], *DOMAIN_NAMES[LAST_DOMAIN + 1], *TYPENAMES[OtherType + 1], *MONOTONE_NAMES[BERNSTEIN + 1 - MISMATCH] , *MODENAMES[nr_modes], *OUTPUTMODENAMES[nr_output_modes], *REPORTCOORDNAMES[nr_reportcoord_modes], *UNITS_NAMES[nr_units], *COORD_SYS_NAMES[nr_coord_sys]; typedef enum sortsofeffect { // ! always compare with convert.R! DetTrendEffect, // trend, nichts wird geschaetzt FixedTrendEffect, // linearer Parameter wird geschaetzt FixedEffect, // trend is also converted to FixedEffect ? RandomEffect, // b is random, no variance is estimated; cov. matrix RvarEffect, // b is random, variance is estimated; covariance matrix LargeEffect, // wie RandomEffect, aber gross, somit keine Optimierung LVarEffect, // wie RVarEffekt, aber gross, somit keine Optimierung SpaceEffect, // spatial covariance model for random effect SpVarEffect, //spatial covariance model for random effect DataEffect, // box cox RemainingError, // error term: effect_error // } sortsofeffect; #define FirstMixedEffect FixedEffect #define LastMixedEffect SpVarEffect ////////////////////////////////////////////////////////////////////// // the different types of parameters typedef enum sortsofparam { // never change ordering; just add new ones !!!!!! VARPARAM, SIGNEDVARPARAM, SDPARAM, SIGNEDSDPARAM, // 0..3 SCALEPARAM, DIAGPARAM, ANISOPARAM, // 4..6 INTEGERPARAM, ANYPARAM, TRENDPARAM, // unused , // 7..9 NUGGETVAR, MIXEDVAR, // unused // 10..12 CRITICALPARAM, IGNOREPARAM, // not recognised in mle, e.g. when some parameter is doubled by another, e.g. biWM DONOTVERIFYPARAM, DONOTRETURNPARAM, // some as IGNOREPARAM, but also not returned by key FORBIDDENPARAM } sortsofparam; // never change the ordering -- at least chech nich Standard in location_rules // in gauss.cc // typedef enum Methods { CircEmbed, // Circulant embedding - must always be the first one! //0 CircEmbedCutoff, CircEmbedIntrinsic, TBM, // Turning Bands, performed in 2 or 3 dimensions SpectralTBM, // Spectral turning bands, only 2 dimensional Direct, // directly, by matrix inversion // 5 Sequential, // sequential simulation TrendEval, // Trend evaluation Average, // Random spatial averages Nugget, // just simulate independent variables RandomCoin, // "additive MPP (random coins)" // 10 Hyperplane, // by superposition of Poisson hyperplane tessellations; only in the plane! Not implemented yet Specific, // Specific Methods Nothing, // (*) Forbidden // must always be the last one } SimulationMeth; // (*) [continued] must always be the last of the list of methods for // simulation of Gaussian random fields; // // NOTE: Nothing has three meanings: // (1) used in preference list whether variogram/covariance fct // can be calculated // (2) method equals Nothing, if no method is preferred // (3) method is not shown, if ErrorMessage is called with // Nothing #define INTERNAL_PARAM "internal" #define MAXVARIANTS 6 #define GETMODEL_AS_SAVED 0 #define GETMODEL_DEL_NATSC 1 #define GETMODEL_SOLVE_NATSC 2 #define GETMODEL_DEL_MLE 3 #define GETMODEL_SOLVE_MLE 4 #define MIXED_X_NAME "X" #define MIXED_BETA_NAME "beta" #define COVARIATE_C_NAME "c" #define COVARIATE_X_NAME "x" #define COVARIATE_ADDNA_NAME "addNA" #define CONST_A_NAME "a" #define MINMAX_PMIN 1 #define MINMAX_PMAX 2 #define MINMAX_TYPE 3 #define MINMAX_NAN 4 #define MINMAX_MIN 5 #define MINMAX_MAX 6 #define MINMAX_OMIN 7 #define MINMAX_OMAX 8 #define MINMAX_ROWS 9 #define MINMAX_COLS 10 #define MINMAX_BAYES 11 #define MINMAX_ENTRIES MINMAX_BAYES #define XLIST_X 0 #define XLIST_Y 1 #define XLIST_T 2 #define XLIST_GRID 3 #define XLIST_SPATIALDIM 4 #define XLIST_TIME 5 #define XLIST_DIST 6 #define XLIST_RESTOT 7 #define XLIST_L 8 #define XLIST_UNITS 9 #define XLIST_NEWUNITS 10 #define XLIST_ENTRIES (XLIST_NEWUNITS + 1) #define PROJ_SPACE -2 #define PROJ_TIME -1 #define PROJECTIONS 2 #define INTERN_SHOW 2 #endif RandomFields/src/variogramAndCo.cc0000644000176200001440000005132613074763020016624 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de main library for unconditional simulation of random fields Copyright (C) 2001 -- 2003 Martin Schlather Copyright (C) 2004 -- 2004 Yindeng Jiang & Martin Schlather Copyright (C) 2005 -- 2017 Martin Schlather s This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include //#include #include #include "RF.h" //#include #include "Operator.h" #include "variogramAndCo.h" void genuineStatOwn(cov_model *cov, domain_type *stat, Types *type) { cov_model *sub = cov; while (isGaussMethod(sub)) sub = sub->sub[0]; *stat = sub->domown; *type = sub->typus; } /* bool ok_ = prev->nr == COVFCTN || prev->nr == VARIOGRAM_CALL || \ prev->nr == PREDICT_CALL || \ CovList[prev->nr].check == check_cov || prev->nr == COVMATRIX || \ CovList[prev->nr].check == check_fctn || prev->nr == DIRECT || \ CovList[prev->nr].check == check_likelihood || \ CovList[prev->nr].check == checkS; \ if (!ok_) BUG; \ */ #define STANDARDSTART \ cov_model *cov = Cov; \ assert(cov != NULL); \ if (isGaussProcess(cov)) cov = cov->sub[0]; \ cov_model *prev = cov; \ if (prev->Spgs == NULL) { \ assert(isVariogram(prev)); \ prev = cov->calling; /* either interface or process */ \ if (prev != NULL && prev->Spgs == NULL) { \ assert(isProcess(prev)); \ prev = prev->calling; \ } \ } \ assert(prev != NULL && (isInterface(prev) || isProcess(prev))); \ FINISH_START(prev, cov, false, 0) /* assert(cov->vdim[0] == cov->vdim[1]); */ // PMI(prev); print("\n%d %d %d\n", prev->nr, PREDICT_CALL, ok_); void CovVario(cov_model *Cov, bool is_cov, bool pseudo, double *value) { STANDARDSTART; domain_type domown; Types type; long m, n; bool stat; double *y = ygiven ? pgs->supportmin : ZERO, // vgl. def von *y bei Matrizen *C0x = pgs->C0x, *C0y = pgs->C0y; bool kernel = cov->domprev != XONLY; INCLUDE_VAL; if (loc->distances) BUG; // if(isCartesian(prev->isoown) || ygiven) // printf("covvario %s, line %d %d %ld %ld %ld\n", __FILE__, __LINE__, ygiven, y, ZERO, pgs->supportmin) ; genuineStatOwn(cov, &domown, &type); stat = !kernel && isVariogram(type); if (is_cov) { assert(({/*PMI(cov, "Cov/vario"); */ cov->pref[Nothing] != PREF_NONE && isShape(type);})); // } else { if (cov->pref[Nothing] == PREF_NONE || !isVariogram(type)) { assert(({PMI(cov); true;})); // ERR("given model is not a variogram"); } if (stat && isCartesian(prev->isoown)) { // PMI(cov); printf("%f\n", ZERO[0]); COV(ZERO, cov, C0y); } else { if (vdim0 > 1 && !stat) ERR("multivariate variogram only possible for stationary models"); NONSTATCOV(ZERO, ZERO, cov, C0y); } } #define UNIVAR COV(x, cov, value) #define UNIVAR_Y NONSTATCOV(x, y, cov, value) #define MULT \ COV(x, cov, cross); \ for (v = 0; vi_row] = cross[v]; #define MULT_Y \ NONSTATCOV(x, y, cov, cross); \ for (v = 0; vi_row] = cross[v]; #define VARIO_UNIVAR \ COV(x, cov, cross); \ *value = *C0y - *cross; #define VARIO_UNIVAR_Y \ NONSTATCOV(x, y, cov, cross); \ NONSTATCOV(x, x, cov, C0x); \ NONSTATCOV(y, y, cov, C0y); \ *value = 0.5 * (*C0x + *C0y) - *cross; #define VARIO_MULT \ COV(x, cov, cross); \ for (v=0, m=0; mi_row] = \ /* 0.5 * (C0x[v] + C0y[v] - cross[m*vdim0+n] -cross[n*vdim0+m]); */ \ C0y[v] - 0.5 * (cross[v] + cross[n*vdim0+m]); \ } \ } #define VARIO_MULT_Y \ NONSTATCOV(x, y, cov, cross); \ NONSTATCOV(x, x, cov, C0x); \ NONSTATCOV(y, y, cov, C0y); \ for (v=m=0; mi_row] = \ 0.5 * (C0x[v] + C0y[v] - cross[v] -cross[n*vdim0+m]); \ } \ } #define PSEUDO_MULT \ COV(x, cov, cross); \ for (v=0; vi_row] = C0y[v] - cross[v]; #define PSEUDO_MULT_Y \ NONSTATCOV(x, y, cov, cross); \ NONSTATCOV(x, x, cov, C0x); \ NONSTATCOV(y, y, cov, C0y); \ for (v=0; vi_row] = 0.5 * (C0x[v] + C0y[v]) - cross[v]; \ } // printf("covvario 2 %s, line %d %d %ld %ld %ld\n", // __FILE__, __LINE__, ygiven, y, ZERO, pgs->supportmin) ; if (is_cov) { // printf("XX\n"); PERFORM(UNIVAR, MULT, UNIVAR_Y, MULT_Y); } else if (pseudo) { PERFORM(VARIO_UNIVAR, PSEUDO_MULT, VARIO_UNIVAR_Y, PSEUDO_MULT_Y); } else { PERFORM(VARIO_UNIVAR, VARIO_MULT, VARIO_UNIVAR_Y, VARIO_MULT_Y); /* if (grid) { if (ygiven || kernel) { STANDARDSTART_Y_SUPPL; if (vdim0 == 1) { GRIDCYCLE_Y(VARIO_UNIVAR_Y; value+=vdimSq); } else { GRIDCYCLE_Y(VARIO_MULT_Y); } } else { // grid, y not given if (vdim0 == 1) { GRIDCYCLE(VARIO_UNIVAR; value+=vdimSq); } else {GRIDCYCLE(VARIO_MULT); } } } else { // not a grid if (trafo) { TransformLoc(cov, &xx, &yy, false); x = xx; if (ygiven) y = yy; } else { x=loc->x; if (ygiven) y=loc->y; } assert(ygiven xor (y==ZERO)); if (ygiven || kernel) { double *y0, *yend; yend = ygiven ? y + tsxdim * loc->ly : ZERO; y0 = y; NONGRIDCYCLE(DO_INCREMENTY, DO_RECYCLY, VARIO_UNIVAR_Y; value+=vdimSq, VARIO_MULT_Y); } else { //NONGRIDCYCLE(EMPTY, EMPTY, VARIO_UNIVAR; value+=vdimSq, VARIO_MULT); } //#define NONGRIDCYCLE(INCREMENTY, RECYCLY, FCTN1, FCTN2) if (vdim0 == 1) { for (; loc->i_rowi_row++, x+=tsxdim ){ p rintf("i=%d %ld %d\n", loc->i_row, value, tot); COV(x, cov, cross); *value = *C0y - *cross; value+=vdimSq; } } else { for (; loc->i_rowi_row++, x+=tsxdim ){ VARIO_MULT; } } } STANDARD_ENDE; if (err != NOERROR) XERR(err); } */ } } void CovarianceMatrix(cov_model *Cov, double *v) { STANDARDSTART; domain_type domown; Types type; genuineStatOwn(cov, &domown, &type); if (cov->pref[Nothing] == PREF_NONE || (!isPosDef(type) && (!isVariogram(type) || domown!=XONLY))) { // Variogramme sind hier definitiv erlaubt, da durch Addition einer // Konstanten, das Zeug zu einer Kovarianzmatrix gemacht werden kann // siehe direct.cc //assert(({PMI(cov, "cov matrix"); true;})); // ERR("covariance matrix: given model is not a covariance function"); } bool dist = loc->distances, vdim_closetogether = GLOBAL.general.vdim_close_together; long l,n,m, VDIM, NEND, NINCR, MINCR, ENDFORINCR, totM1 = tot - 1, vdim0totSq = vdim0tot * tot, vdimSqtotSq = vdimSq * tot * tot; double *C = NULL, *x0 = NULL, /* never free it */ *z = pgs->z; double *y = pgs->supportmin; if (grid) { STANDARDSTART_Y_SUPPL; } if (ygiven && (loc->x != loc->y || loc->xgr[0] != loc->ygr[0])) { // ein Paerchen ist NULL; GERR("for the covariance matrix, no y-value may be given"); } if (vdim_closetogether) { // v-dimensions close together VDIM = vdim0; NEND = vdimSqtot; NINCR = vdim0tot; ENDFORINCR = vdim0; MINCR = 1; } else { // values of any single multivariate component close together // default in GLOBAL.CovMatrixMulti VDIM = 1; NEND = vdimSqtotSq; NINCR = vdim0totSq; ENDFORINCR = vdim0tot; MINCR = tot; } #define MULTICOV \ C = v + VDIM * (loc->i_col + loc->i_row * vdim0tot); \ for (l=n=0; ni_col != loc->i_row) { \ C = v + VDIM * (loc->i_row + loc->i_col * vdim0tot); \ for (l=m=0; mi_col = 0; while (true) { loc->i_row = loc->i_col; for (d=0; di_row, loc->i_col, *x, x[1], *y, y[1], *z); MULTICOV; loc->i_row++; STANDARDINKREMENT_Y; // APMI(cov); if (d >= tsxdim) break; } loc->i_col++; STANDARDINKREMENT; } } else { int localdim = tsxdim; // just to control if (trafo) { localdim = TransformLoc(cov, &xx, false); assert(localdim == tsxdim); x0 = xx; } else x0 = loc->x; x = x0; for (loc->i_col=0; loc->i_coli_col++, x+=localdim) { for (y=x, loc->i_row=loc->i_col; loc->i_rowi_row++, y+=localdim) { if (dist) { // here x and y are ignored if (loc->i_row==loc->i_col) { COV(ZERO, cov, z); // !! Achtung; wegen der Mixed models // koennen hier verschiedene Werte auftreten // aufgrund von loc->i_col und loc->i_row !! } else { COV(x0 + (loc->i_col * totM1 - (loc->i_col * (loc->i_col + 1)) / 2 + loc->i_row -1) * localdim , cov, z); // PMI(cov->calling->calling->calling); // int idx = (loc->i_col * totM1 - (loc->i_col * (loc->i_col + 1)) / 2 + loc->i_row -1) * localdim; // printf("loc=%d %f %f %f\n", idx, x[idx], x[idx +1], z); } if (false) { if (loc->i_col < 10 && loc->i_row<10) printf("cm %d %d totM1=%d %ld %f %f \n", (int) loc->i_row, (int)loc->i_col, (int) totM1, (loc->i_col * totM1 - (loc->i_col * (loc->i_col + 1)) / 2 + loc->i_row -1) * localdim, x0[ (loc->i_col * totM1 - (loc->i_col * (loc->i_col + 1)) / 2 + loc->i_row -1) * localdim] , *z); // else assert(false); } } else { NONSTATCOV(x, y, cov, z); assert(R_FINITE(z[0])); } MULTICOV; } } } if (false) { for (m=0; m<27; m++) { for (n=0; n<27; n++) { //printf("%+2.2f ", v[n * 27 + m]); } //printf("\n"); } } //assert(false); ErrorHandling: STANDARD_ENDE; if (err!=NOERROR) XERR(err); // int i,j,k; // for (k=i=0; i= step + tot) ptr[v] = -1; for (v=1; v=0 && selected[i] >= step) i--; ptr[v] = i+1; /// if (ptr[v]>=nsel || selected[ptr[v]] >= step + tot) ptr[v] = -1; else { newstart = selected[ptr[v]] % tot; if (newstart < start) start = newstart; } } // for (v=0; v= nsel || selected[ptr[v]] >= step) { ptr[v] = -1; continue; } } int newmin = selected[ptr[v]] % tot; if (newmin < *min) *min = newmin; } // for (v=0; v=0; k--) { j = i / cum[k]; i -= j * cum[k]; x[k] = (double) j * inc[k]; } } void partial_loc_set_matrix(cov_model *cov, double *x, long lx, bool dist, bool grid){ location_type *loc = Loc(cov); int err; bool ygiven = !dist && loc->ly != 0; if ((err = partial_loc_set(loc, x, ygiven ? x : NULL, lx, ygiven ? lx : 0, dist, loc->xdimOZ, NULL, grid, false)) != NOERROR) XERR(err); } void partial_loc_set_matrixOZ(cov_model *cov, double *x, long lx, bool dist, int *xdimOZ){ // *xdimOZ to distinguish from the previous partial_loc_set definition location_type *loc = Loc(cov); int err; bool ygiven = !dist && loc->ly != 0; if ((err = partial_loc_set(loc, x, ygiven ? x : NULL, lx, ygiven ? lx : 0, dist, *xdimOZ, NULL, loc->grid, false)) != NOERROR) XERR(err); } void partial_loc_set(cov_model *cov, double *x, long lx, bool dist, bool grid){ location_type *loc = Loc(cov); int err; // bool cartesian = isCartesian(cov->isoown); // if (!cartesian && loc->ly==0) add_y_zero(loc); if ((err = partial_loc_set(loc, x, NULL, // cartesian ? NULL : ZERO, lx, 0, //!cartesian, dist, loc->xdimOZ, NULL, grid, false)) != NOERROR) XERR(err); } void partial_loc_setOZ(cov_model *cov, double *x, double *y, long lx, long ly, bool dist, int *xdimOZ){ // *xdimOZ to distinguish from the previous partial_loc_set definition location_type *loc = Loc(cov); int err; // printf("partial_loc_set dist = %d %d \n", dist, loc->ly); if ((err = partial_loc_set(loc, x, y, lx, ly, dist, *xdimOZ, NULL, loc->grid, false)) != NOERROR) XERR(err); } void partial_loc_setOZ(cov_model *cov, double *x, long lx, bool dist, int *xdimOZ){ // *xdimOZ to distinguish from the previous partial_loc_set definition location_type *loc = Loc(cov); int err; // bool cartesian = isCartesian(cov->isoown); // if (!cartesian && loc->ly==0) add_y_zero(loc); // printf("partial_loc_set dist = %d %d \n", dist, loc->ly); if ((err = partial_loc_set(loc, x, NULL, // cartesian ? NULL : ZERO, lx, 0, //!cartesian, dist, *xdimOZ, NULL, loc->grid, false)) != NOERROR) XERR(err); //PMI(cov); } void partial_loc_setXY(cov_model *cov, double *x, double *y, long lx, long ly) { location_type *loc = Loc(cov); int err; // if (y == NULL) crash(); // assert(y != NULL); if ((err = partial_loc_set(loc, x, y, lx, ly, false, loc->xdimOZ, NULL, loc->grid, false)) != NOERROR) XERR(err); } void partial_loc_setXY(cov_model *cov, double *x, double *y, long lx) { location_type *loc = Loc(cov); int err; // PMI(cov); //printf("XY %ld %ld %d\n", y, NULL, y == NULL ? 0 : lx); if ((err = partial_loc_set(loc, x, y, lx, y == NULL ? 0 : lx, false, loc->xdimOZ, NULL, loc->grid, false)) != NOERROR) XERR(err); } void partial_loc_null(cov_model *cov) { location_type *loc = Loc(cov); loc->lx = loc->ly = 0; loc->x = NULL; loc->y = NULL; } void InverseCovMatrix(cov_model *Cov, double *v, double *det) { cov_model *cov = Cov; if (isGaussProcess(cov)) cov = cov->sub[0]; location_type *loc = Loc(cov); long vdimtot = loc->totalpoints * cov->vdim[0]; assert(cov->vdim[0] == cov->vdim[1]); CovList[cov->nr].covariance(cov, v); if (cov->Ssolve == NULL) SOLVE_STORAGE; RU_setErrorLoc(ERROR_LOC); // printf("inverse\n"); int Exterr = RU_solvePosDef(v, vdimtot, true, NULL, 0, det, cov->Ssolve); if (Exterr != NOERROR){ RU_getErrorString(ERRORSTRING); ErrorStop(Exterr); } } ////////////////////////////////////////////////////////////////////// // Schnittstellen #define STANDARDINTERN \ if (reg < 0 || reg > MODEL_MAX) XERR(ERRORREGISTER); \ if (currentNrCov==-1) InitModelList(); \ cov_model *cov = KEY[reg]; \ if (cov == NULL) { ERR("register not initialised") } \ cov_model *truecov = !isInterface(cov) ? \ cov : cov->key == NULL ? cov->sub[0] : cov->key #define STANDARDINTERN_SEXP_BASIC \ if (INTEGER(reg)[0] < 0 || INTEGER(reg)[0] > MODEL_MAX) XERR(ERRORREGISTER); \ if (currentNrCov==-1) InitModelList(); \ cov_model *cov = KEY[INTEGER(reg)[0]]; \ if (cov == NULL) { ERR("register not initialised") } #define STANDARDINTERN_SEXP \ STANDARDINTERN_SEXP_BASIC; \ cov_model VARIABLE_IS_NOT_USED *truecov = !isInterface(cov) ? \ cov : cov->key == NULL ? cov->sub[0] : cov->key; \ if (isGaussProcess(truecov)) truecov = truecov->sub[0] // if (cov->pref[Nothing] == PREF_NONE) { PMI(cov); XERR(ERRORINVALIDMODEL) } SEXP Delete_y(SEXP reg) { STANDARDINTERN_SEXP_BASIC; int d; location_type *loc = Loc(cov); if (loc->y != NULL) { if (loc->y != loc->x) UNCONDFREE(loc->y); loc->y = NULL; } if (loc->ygr[0] != NULL) { if (loc->ygr[0] != loc->xgr[0]) UNCONDFREE(loc->ygr[0]); for (d=0; dygr[d] = NULL; } loc->ly = 0; return NULL; } SEXP CovLoc(SEXP reg, SEXP x, SEXP y, SEXP xdimOZ, SEXP lx, SEXP result) { STANDARDINTERN_SEXP; // PMI(cov); if (Loc(cov)->len > 1) BUG; // printf("y = %d %d xdim %d new:%d \n", TYPEOF(y), NILSXP, Loc(cov)->xdimOZ, INTEGER(xdimOZ)[0]); partial_loc_setXY(cov, REAL(x), TYPEOF(y) == NILSXP ? NULL : REAL(y), INTEGER(lx)[0]); CovList[truecov->nr].covariance(truecov, REAL(result)); // PMI(cov, "covloc"); printf("xdimOZ %d \n", INTEGER(xdimOZ)[0]); partial_loc_null(cov); if (Loc(cov)->xdimOZ != INTEGER(xdimOZ)[0]) BUG; return NULL; } void CovIntern(int reg, double *x, double *y, long lx, long ly, double *value) { STANDARDINTERN; partial_loc_setXY(cov, x, y, lx, ly); CovList[truecov->nr].covariance(truecov, value); partial_loc_null(cov); } SEXP CovMatrixLoc(SEXP reg, SEXP x, SEXP dist, SEXP xdimOZ, SEXP lx, SEXP result) { STANDARDINTERN_SEXP; partial_loc_set_matrixOZ(cov, REAL(x), INTEGER(lx)[0], LOGICAL(dist)[0], INTEGER(xdimOZ)); // // PMI(cov, "covmatrixloc"); CovList[truecov->nr].covmatrix(truecov, REAL(result)); // printf("***************************************************\n"); // { int i,j,k, tot=Loc(cov)->totalpoints; // printf("covmatrixloc %ld %ld %d\n", CovList[cov->nr].covmatrix, covmatrix_select, INTEGER(lx)[0]); // for (k=i=0; ixdimprev == 2); CovList[truecov->nr].covmatrix(truecov, REAL(result)); partial_loc_null(cov); return(NULL); } SEXP VariogramIntern(SEXP reg) { STANDARDINTERN_SEXP; // location_type *loc = Loc(cov); SEXP ans; int vdim =cov->vdim[0], size = Gettotalpoints(cov) * vdim * vdim; PROTECT(ans = allocVector(REALSXP, size)); CovList[truecov->nr].variogram(truecov, REAL(ans)); //for (int j=0; jxdimOZ)); CovList[truecov->nr].pseudovariogram(truecov, value); partial_loc_null(cov); } void PseudovariogramIntern(int reg, double *x, double *value) { STANDARDINTERN; location_type *loc = Loc(cov); // bool cartesian = isCartesian(cov->isoown); // if (!cartesian && loc->ly==0) add_y_zero(loc); partial_loc_setOZ(cov, x, NULL, // cartesian ? NULL : ZERO, 1, 0, // !cartesian, false, &(loc->xdimOZ)); CovList[truecov->nr].pseudovariogram(truecov, value); partial_loc_null(cov); } RandomFields/src/initNerrorSpherModels.h0000644000176200001440000000030013074763020020055 0ustar liggesusers/* initNerrorSpherModels.h */ #ifndef initNerrorSPHERMODELS_H #define initNerrorSPHERMODELS_H 1 /* declaration of functions */ void initSpherModels( ); #endif /* initNerrorSpherModels.h */ RandomFields/src/error.h0000644000176200001440000001246513074763020014724 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef RFerror_H #define RFerror_H 1 extern char ERRMSG[LENERRMSG], MSG[LENERRMSG], BUG_MSG[250], MSG2[LENERRMSG]; extern errorloc_type ERROR_LOC; extern errorstring_type ERRORSTRING; extern int ERRORMODELNUMBER; void errorMSG(int error, char* EM); void FinalErrorMSG(int err, char* m); void ErrorStop(int err); // Error codes & messages // positive values are error codes // negative values are messages // #define NOERROR 0 // #define ERRORMEMORYALLOCATION 1 /* NEVER CHANGE VALUE; MALLOC returned NULL pointer */ // LESS THAN 10 IS RESERVED TO BE JOINTLY USED BY RFUTILS #define ERRORMEND 11 /* a single error message -- und alles dazwischen */ #define ERRORCARTESIAN 12 #define ERRORTYPECONSISTENCY 14 #define ERRORWRONGVDIM 15 #define ERRORBADVDIM 16 #define ERRORNOTCARTESIAN 17 #define ERRORODDCOORDTRAFO 18 #define ERRORVDIMNOTPROGRAMMEDYET 19 #define ERRORNOTDEFINED 20 /* the specification for the covariance and method is not given/known, e.g. TBM2 for many covariance functions */ #define ERRORUNKOWNSXPTYPE 22 /* parameter value of unknown SXP type */ #define ERRORSTATVARIO 23 /* only stat or variogram allowed as submodel */ #define ERRORANISO_T 24 /* anisoT' may not be given at the same time with 'Aniso' or 'proj' */ //#define ERRORVARIOGRAMONLY 25 /* attempt to get the covariance whereas only the variogram is defined */ #define ERRORDECOMPOSITION 26 /* direct.cc */ #define ERRORPREFNONE 27 #define ERRORPREFNONECOV 28 #define ERRORSUBMETHODFAILED 30 /* aufsplitten der Modelle bringt nichts */ #define ERRORMAXDIMMETH 31 /* max dimension of method exceeded */ #define ERRORPREVDOLLAR 32 /* one of the prev method was dollar, but cannot be taken into account */ #define ERRORINVALIDMODEL 33 /* no gauss method available, including 'Nothing'*/ #define ERRORODDMODEL 34 /* no gauss method available */ #define ERROROUTOFMETHODLIST 35 /* no further method we can try is available */ #define ERRORREGISTER 36 #define ERRORWRONGISO 37 #define ERRORKERNEL 38 #define ERRORWRONGDIM 40 /* (tbm) dimension couldn't be reduced to be appropriate for the respective method */ #define ERRORTOOMANYLINES 41 /* Hyperplane tesselation: estimated simulated lines passes given threshold*/ #define ERRORNOVARIOGRAM 43 /* variogram models not allowed in ci and direct */ #define ERRORSPECTRAL 44 #define ERRORTBMCOMBI 45 // for getnaturalscaling !! #define ERRORWAVING 50 /* numerical determination of practical range fails */ #define ERRORRESCALING 51 /* attempt to rescale where not possible */ #define NOERROR_REPEAT 97 #define NOERROR_ENDOFLIST 98 #define ERRORDUMMY 99 /* no error, only for tracing purposes */ // *** severe errors #define ERRORNORMALMIXTURE 101 /* normal mixture required */ #define ERRORNOMULTIVARIATE 102 /* vdim > 1 not allowed */ #define ERROR_MATRIX_SQUARE 103 #define ERROR_MATRIX_VDIM 104 #define ERROR_MATRIX_POSDEF 105 #define MATRIX_NOT_CHECK_YET -999 /* must be a negative value not used somewhere else ! */ //#define ERROR_MATRIX_ 10 #define ERRORNOTINITIALIZED 107 /* key.active==false in DoSimulateRF; is only checked there !!! */ #define ERRORDIM 119 /* dim<1 or dim>MAXDIM */ #define ERRORANISO 127 /* anisotropic call not allowed */ #define ERRORDIAMETERNOTGIVEN 128 #define ERRORUNKNOWNMETHOD 131 #define ERRORNOSTATMATCH 134 /* no matching ISO/STAT found in check2 */ // **** extremes #define ERRORTREND 203 /* extremes: no trend allowed */ #define ERRORUNKNOWNMAXTYPE 204 //#define ERRORONLYATOMS 250 /* Poisson distribution */ #define ERRORANISODOLLARNOTALLOWED_YET 251 //#define ERRORATOMNOTPROGRAMMED_YET 252 #define ERRORATOMP 253 // *** kriging #define ERRORKRIGETOL 350 // messages and strategies for local methods // ENDOFLIST also used for any kind of error appearing in getparam // never change order of the message numbers up to ENDOFLIST #define MSGLOCAL_OK 400 /* do not change ordering! (the less the better) */ #define MSGLOCAL_NUMOK 401 #define MSGLOCAL_JUSTTRY 402 #define MSGLOCAL_ENDOFLIST 403 #define MSGLOCAL_SIGNPHI 404 #define MSGLOCAL_SIGNPHIFST 405 #define MSGLOCAL_SIGNPHISND 406 #define MSGLOCAL_INITINTRINSIC 407 #define MSGLOCAL_FAILED 408 #define MSGLOCAL_NOPOSITIVEROOT 409 #define MSGLOCAL_NOTSYMMETRICMULTIVARIATE 410 #define MSGLOCAL_WRONGRADII 411 #define ERRORUNSPECIFIED 999 /* do not use numbers 800 -- 900 : reserved to MPP package */ #endif RandomFields/src/Brown.cc0000644000176200001440000012264213074763020015017 0ustar liggesusers/* Authors Marco Oesting, Martin Schlather, schlather@math.uni-mannheim.de simulation of Brown-Resnick processes Copyright (C) 2009 -- 2010 Martin Schlather Copyright (C) 2011 -- 2017 Marco Oesting & Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "RF.h" #include "Operator.h" #define BR_MESHSIZE (LAST_MAXSTABLE + 1) #define BR_VERTNUMBER (LAST_MAXSTABLE + 2) #define BR_OPTIM (LAST_MAXSTABLE + 3) #define BR_OPTIMTOL (LAST_MAXSTABLE + 4) #define BR_LAMBDA (LAST_MAXSTABLE + 5) #define BR_OPTIMAREA (LAST_MAXSTABLE + 6) #define BR_VARIOBOUND (LAST_MAXSTABLE + 7) // ********************************************************************** // Brown Resnick int checkBrownResnickProc(cov_model *cov) { //NotProgrammedYet("at the moment Brown-Resnick processes"); cov_model *key = cov->key, *sub = key != NULL ? key : cov->sub[cov->sub[MPP_SHAPE] != NULL ? MPP_SHAPE: MPP_TCF]; int err, role, dim = cov->tsdim; isotropy_type isoprev; Types type; ASSERT_CARTESIAN; ASSERT_ONE_SUBMODEL(cov); if ((err = SetGEVetc(cov, ROLE_BROWNRESNICK)) != NOERROR) return err; role = isVariogram(sub) ? ROLE_COV : (isGaussProcess(sub) && isPointShape(cov)) ? ROLE_GAUSS : isBrownResnickProcess(sub) ? ROLE_BROWNRESNICK : isPointShape(sub) ? ROLE_BROWNRESNICK : ROLE_UNDEFINED; type = isProcess(sub) || isPointShape(sub) ? CovList[sub->nr].Typi[0] : VariogramType; ASSERT_ROLE_DEFINED(sub); isoprev = role == ROLE_COV ? SYMMETRIC : CARTESIAN_COORD; if ((err = CHECK(sub, dim, dim, type,//Martin: changed 27.11.13 CovList[cov->nr].Type, XONLY, isoprev, 1, role)) != NOERROR) { return err; } setbackward(cov, sub); if (cov->vdim[0] != 1) SERR("BR only works in the univariate case"); return NOERROR; isoprev = role == ROLE_COV ? SYMMETRIC : CARTESIAN_COORD; if ((err = CHECK(sub, dim, dim, type,//Martin: changed 27.11.13 CovList[cov->nr].Type, XONLY, isoprev, 1, role)) != NOERROR) { return err; } setbackward(cov, sub); if (cov->vdim[0] != 1) SERR("BR only works in the univariate case"); return NOERROR; } #define ORIG_IDX 0 int init_BRorig(cov_model *cov, gen_storage *s){ cov_model *key = cov->key; location_type *keyloc = NULL; int err, d, dim = cov->tsdim; bool keygrid; br_storage *sBR = NULL; if (cov->role != ROLE_BROWNRESNICK) ILLEGAL_ROLE; if (key == NULL) BUG; if ((err = alloc_cov(cov, dim, 1, 1)) != NOERROR) return err; pgs_storage *pgs = cov->Spgs; for (d=0; dsupportmin[d] = RF_NEGINF; // 4 * for debugging... pgs->supportmax[d] = RF_INF; pgs->supportcentre[d] = RF_NA; } pgs->log_density = 0.0; keyloc = Loc(key); keygrid = keyloc->grid; key->simu.active = true; key->simu.expected_number_simu = cov->simu.expected_number_simu; assert(cov->mpp.moments >= 1); if ((err = INIT(key, 1, s)) != NOERROR) goto ErrorHandling; cov->loggiven = true; assert(key->nr == GAUSSPROC); assert(key->mpp.moments >= 1); cov->mpp.mM[0] = cov->mpp.mMplus[0] = 1.0; cov->mpp.mM[1] = cov->mpp.mMplus[1] = 1.0; cov->mpp.maxheights[0] = EXP(GLOBAL.extreme.standardmax); pgs->zhou_c = 1.0; sBR = cov->Sbr; sBR->trendlen = 1; if ((sBR->trend = (double**) MALLOC(sizeof(double*)))==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((sBR->trend[ORIG_IDX] = (double*) MALLOC(keyloc->totalpoints*sizeof(double)) ) == NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((err = loc_set(keygrid ? keyloc->xgr[0] : keyloc->x, NULL, NULL, dim, dim, keygrid ? 3 : keyloc->totalpoints, 0, false, keygrid, keyloc->distances, cov->Sbr->vario)) > NOERROR) goto ErrorHandling; if (sBR->vario->sub[0] != NULL) SetLoc2NewLoc(sBR->vario->sub[0], PLoc(sBR->vario)); Variogram(NULL, sBR->vario, sBR->trend[ORIG_IDX]); if ((err = FieldReturn(cov)) != NOERROR) // must be later than INIT ! goto ErrorHandling; ErrorHandling: if (err != NOERROR) br_DELETE(&(cov->Sbr)); return err; } void do_BRorig(cov_model *cov, gen_storage *s) { cov_model *key = cov->key; assert(key != NULL); br_storage *sBR = cov->Sbr; assert(sBR != NULL && sBR->trend != NULL); double *res = cov->rf; #define ORIG_IDX 0 int i, zeropos = sBR->zeropos; long totalpoints = Loc(cov)->totalpoints; assert(totalpoints > 0); assert(zeropos >= 0 && zeropos trend[ORIG_IDX]; assert(cov->origrf); DO(key, s); // nicht gatternr, double *lgres = key->rf; double lgreszeropos = (double) lgres[zeropos]; // wird durch DO veraendert! for (i=0; ikey; location_type *keyloc = NULL; int d, dim, err = NOERROR; long j, shiftedloclen, keytotal, trendlenmax, trendlenneeded; bool keygrid; br_storage *sBR = NULL; if (cov->role == ROLE_BROWNRESNICK) { if (key != NULL) { dim = cov->tsdim; if ((err = alloc_cov(cov, dim, 1, 1)) != NOERROR) return err; pgs_storage *pgs = cov->Spgs; for (d=0; dsupportmin[d] = RF_NEGINF; // 4 * for debugging; pgs->supportmax[d] = RF_INF; pgs->supportcentre[d] = RF_NA; } pgs->log_density = 0.0; keyloc = Loc(key); keygrid = keyloc->grid; keytotal = keyloc->totalpoints; key->simu.active = true; key->simu.expected_number_simu = cov->simu.expected_number_simu; assert(cov->mpp.moments >= 1); if ((err = INIT(key, 1, s)) != NOERROR) return err; cov->loggiven = true; assert(key->nr == GAUSSPROC); assert(key->mpp.moments >= 1); cov->mpp.mM[0] = cov->mpp.mMplus[0] = 1.0; cov->mpp.mM[1] = cov->mpp.mMplus[1] = 1.0; cov->mpp.maxheights[0] = EXP(GLOBAL.extreme.standardmax); pgs->zhou_c = 1.0; sBR = cov->Sbr; shiftedloclen = keygrid ? 3 : keytotal; if ((sBR->shiftedloc = (double*) MALLOC(dim*shiftedloclen*sizeof(double))) == NULL || (sBR->locindex = (int*) MALLOC(sizeof(int) * dim))==NULL ) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } trendlenmax = (int) CEIL((double) GLOBAL.br.BRmaxmem / keytotal); trendlenneeded = MIN(keytotal, cov->simu.expected_number_simu); sBR->trendlen = MIN(trendlenmax, trendlenneeded); assert(sBR->trendlen > 0); sBR->memcounter = 0; if ((sBR->loc2mem=(int*) MALLOC(sizeof(int)*keytotal))==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } for (j=0; jloc2mem[j] = -1; if ((sBR->mem2loc=(int*) MALLOC(sizeof(int)*sBR->trendlen))==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((sBR->trend=(double**) MALLOC(sizeof(double*)*sBR->trendlen)) ==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } for (j=0; jtrendlen; j++) { sBR->mem2loc[j] = -1; if ((sBR->trend[j] = (double*) MALLOC(keytotal*sizeof(double)))==NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } } if ((err = loc_set(keygrid ? keyloc->xgr[0] : keyloc->x, NULL, NULL, dim, dim, keygrid ? 3 : keytotal, 0, false, keygrid, keyloc->distances, sBR->vario)) > NOERROR) return err; if (sBR->vario->sub[0] != NULL) SetLoc2NewLoc(sBR->vario->sub[0], PLoc(sBR->vario)); if ((err = FieldReturn(cov)) != NOERROR) // must be later than INIT ! return err; } goto ErrorHandling; // no error } else ILLEGAL_ROLE; ErrorHandling: if (err != NOERROR) br_DELETE(&(cov->Sbr)); return err; } void indextrafo(long onedimindex, double ** xgr, int dim, int *multidimindex) { int d; for (d=0; dSbr; cov_model *key = cov->key; assert(cov->key != NULL); location_type *keyloc = Loc(key); long i, k, zeropos, zeroposMdim, keytotal = keyloc->totalpoints; int d, trendindex, dim = cov->tsdim, trendlen = sBR->trendlen, *locindex = sBR->locindex, *mem2loc = sBR->mem2loc, *loc2mem = sBR->loc2mem; bool keygrid = keyloc->grid; double *shiftedloc = sBR->shiftedloc, **xgr = keyloc->xgr, **trend = sBR->trend; assert(cov->origrf); double *res = cov->rf; double *lgres = cov->key->rf; DO(key, s); zeropos = (long) FLOOR(UNIFORM_RANDOM * keytotal); if (loc2mem[zeropos] > -1) { trendindex = loc2mem[zeropos]; if (mem2loc[trendindex] != zeropos) BUG; } else { if (sBR->memcountermemcounter; sBR->memcounter++; } else { trendindex = trendlen - 1; loc2mem[mem2loc[trendlen-1]] = -1; mem2loc[trendlen-1] = -1; } if (keygrid) { indextrafo(zeropos, keyloc->xgr, dim, locindex); // to do: ersetzen for (d=0; dx[k] - keyloc->x[zeroposMdim+d]; } } } partial_loc_set(Loc(sBR->vario), shiftedloc, NULL, keygrid ? 3: keytotal, 0, keyloc->distances, dim, NULL, keygrid, true); if (sBR->vario->sub[0] != NULL) SetLoc2NewLoc(sBR->vario->sub[0], PLoc(sBR->vario)); Variogram(NULL, sBR->vario, sBR->trend[trendindex]); mem2loc[trendindex] = zeropos; // todo ? long instead of int loc2mem[zeropos] = trendindex; } for (i=0; ilogspeed) SERR("BrownResnick requires a variogram model as submodel that tends to infinity [t rate of at least 4log(h) for being compatible with BRmixed"); kdefault(cov, BR_MESHSIZE, bp->BRmeshsize); kdefault(cov, BR_VERTNUMBER, bp->BRvertnumber); kdefault(cov, BR_OPTIM, bp->BRoptim); kdefault(cov, BR_OPTIMTOL, bp->BRoptimtol); kdefault(cov, BR_VARIOBOUND, bp->variobound); if (cov->nr == BRMIXED_USER && cov->key == NULL && P0INT(BR_OPTIM) > 0) { if (!PisNULL(BR_LAMBDA)) { if (PisNULL(BR_OPTIMAREA)) SERR1("'%s' not given", KNAME(BR_OPTIMAREA)); if (PL > 0) PRINTF("'%s' set to '0'", KNAME(BR_OPTIM)); PINT(BR_OPTIM)[0] = 0; } else if (P0INT(BR_OPTIM) == 2 && !PisNULL(BR_OPTIMAREA)) if (PL > 0) PRINTF("'%s' set to '1'", KNAME(BR_OPTIM)); } if (cov->key != NULL && P0INT(BR_OPTIM) == 2) { if (!isIsotropic(cov->key->isoown)) { // SERR("area optimisation implemented for the isotropic case only"); //@MARTIN: das scheint nicht zu funktionieren, wenn ich ein Variogramm eingebe } } kdefault(cov, BR_LAMBDA, RF_NA); if (PisNULL(BR_OPTIMAREA)) kdefault(cov, BR_OPTIMAREA, 0.0); if ((err = checkBrownResnickProc(cov)) != NOERROR) return err; if ((err = checkkappas(cov, true)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if (cov->vdim[0] != 1) SERR("BR only works in the univariate case"); return NOERROR; } void kappaBRmixed(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc){ // i nummer des parameters switch(i) { case GEV_XI: case GEV_MU: case GEV_S: case BR_MESHSIZE: case BR_VERTNUMBER: case BR_OPTIM: case BR_OPTIMTOL: case BR_LAMBDA: case BR_VARIOBOUND: *nr = 1; *nc = 1; break; case BR_OPTIMAREA: *nr = 1; *nc = SIZE_NOT_DETERMINED; break; default: *nr = -1; *nc = -1; } } double IdxDistance(int maxind, int zeropos, double **xgr, int dim) { int d, delta = 0, x = maxind, y = zeropos; for (d=0; dSbr; pgs_storage *pgs = cov->Spgs; cov_model *key = sBR->sub[0]; location_type *keyloc = Loc(key); double **xgr = keyloc->xgr, *optimarea, dummy, Error, lambda, maxErrorbound, Errorbound, Errorboundtmp, Errortol = P0(BR_OPTIMTOL), step = P0(BR_MESHSIZE), invstepdim, **am=NULL; int d, j, k, cellnumber, *cellcounter, idxdist, n_zhou_c = pgs->n_zhou_c, vertnumber = P0INT(BR_VERTNUMBER), minradius = (int) (sBR->minradius/step), **countvector = sBR->countvector, zeropos = sBR->zeropos, dim = cov->tsdim, keytotal = keyloc->totalpoints; if (minradius==0) return; if ((cellcounter = (int*) MALLOC((minradius+1) * sizeof(int))) == NULL) goto ErrorHandling; for (k=0; k<=minradius; k++) cellcounter[k]=0; if ((am = (double**) CALLOC(vertnumber, sizeof(double*)))==NULL) goto ErrorHandling; for (j=0; j=0; j--) { am[j][d] = countvector[j][d] * invstepdim / (n_zhou_c * cellcounter[d]); for (k=j+1; k Error matrix for (j=0; j Errorbound) { Errorboundtmp = FMIN(Errorboundtmp, am[j][d]); } } } Error = 0.0; for (d=0; d<=minradius; d++) { for (j=0; jSbr; assert(sBR != NULL); assert(sBR->sub[0] != NULL); double step = P0(BR_MESHSIZE), *optimarea = P(BR_OPTIMAREA); int j, k, dim = cov->tsdim, minradius = (int) (sBR->minradius / step); cov_model *key = sBR->sub[0]; location_type *keyloc = Loc(key); double **xgr = keyloc->xgr; long keytotal = keyloc->totalpoints; for (j=0; jlowerbounds[j] = RF_INF; k = (int) CEIL(IdxDistance(j, sBR->zeropos, xgr, dim)); if (k <= minradius && optimarea[k]>1e-5) { sBR->lowerbounds[j] = -LOG(optimarea[k]); } //printf("%f ", sBR->lowerbounds[j]); } //printf("\n"); } int prepareBRoptim(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { br_storage *sBR = cov->Sbr; cov_model *key = sBR->sub[0]; location_type *keyloc = Loc(key); double step = P0(BR_MESHSIZE), **xgr = keyloc->xgr; int i, j, d, vertnumber = P0INT(BR_VERTNUMBER), dim = cov->tsdim, maxradius = 1, minradius = (int) (sBR->minradius/step); for (d=0; dvertnumber = vertnumber; if (sBR->countvector != NULL || sBR->areamatrix != NULL) BUG; if ((sBR->countvector = (int**) CALLOC(vertnumber, sizeof(int*)))==NULL || (sBR->logvertnumber = (double *) MALLOC(vertnumber * sizeof(double))) == NULL) return ERRORMEMORYALLOCATION; for (j=0; jcountvector[j] = (int*) CALLOC(minradius + 1, sizeof(int))) == NULL) return ERRORMEMORYALLOCATION; for (i=0; i<=minradius; i++) sBR->countvector[j][i] = 0; } for (j=0; jlogvertnumber[j] = - LOG((double) (j+1)/vertnumber); break; default: SERR("optimization might not be used here\n"); } if ((sBR->areamatrix = (double *) MALLOC((minradius + 1)* sizeof(double))) == NULL) { return ERRORMEMORYALLOCATION; } sBR->areamatrix[0] = 1.0; if (minradius > 0) { for (i=1; i<=minradius; i++) { if (i <= cov->ncol[BR_OPTIMAREA]) { sBR->areamatrix[i] = P(BR_OPTIMAREA)[i-1]; } else sBR->areamatrix[i] = 0.0; } } PFREE(BR_OPTIMAREA); PALLOC(BR_OPTIMAREA, 1, minradius + 1); double *optimarea = P(BR_OPTIMAREA); for (i=0; i<=minradius; i++) { optimarea[i] = sBR->areamatrix[i]; } set_lowerbounds(cov); if (PL >= PL_STRUCTURE) PRINTF("BR optimisation finished...\n"); return NOERROR; } int init_BRmixed(cov_model *cov, gen_storage *s) { location_type *loc = Loc(cov); br_storage *sBR = cov->Sbr; assert(sBR != NULL); assert(sBR->sub[0] != NULL); cov_model *key = sBR->sub[0]; pgs_storage *pgs = NULL; location_type *keyloc = Loc(key); int d, err = NOERROR, dim = cov->tsdim, bytes = sizeof(double) * dim, keytotal = keyloc->totalpoints; double area = 1.0, step = P0(BR_MESHSIZE); sBR->trendlen = 1; assert(isPointShape(cov)); if (cov->role != ROLE_BROWNRESNICK) ILLEGAL_ROLE; assert(dim > 0); if ((err = alloc_cov(cov, dim, 1, 1)) != NOERROR) goto ErrorHandling;; // nur pgs pgs = cov->Spgs; // nach alloc_cov !! if ((sBR->suppmin = (double*) MALLOC(bytes))==NULL || (sBR->suppmax = (double*) MALLOC(bytes))==NULL || (sBR->locmin = (double*) MALLOC(bytes))==NULL || (sBR->locmax = (double*) MALLOC(bytes))==NULL || (sBR->loccentre = (double*) MALLOC(bytes))==NULL || (sBR->locindex = (int*) MALLOC(sizeof(int) * dim))==NULL || (sBR->trend == NULL && (sBR->trend = (double**) CALLOC(sBR->trendlen, sizeof(double*)))==NULL) ) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } GetDiameter(loc, sBR->locmin, sBR->locmax, sBR->loccentre); assert(pgs->supportmin != NULL); for (d=0; down_grid_cumsum[d] = d==0 ? 1 : pgs->own_grid_cumsum[d-1]*pgs->own_grid_len[d-1]; sBR->suppmin[d] = FLOOR((sBR->locmin[d] - sBR->radius - sBR->minradius)/step)*step - step/2; sBR->suppmax[d] = CEIL((sBR->locmax[d] + sBR->radius + sBR->minradius)/step)*step + step/2; area *= sBR->suppmax[d] - sBR->suppmin[d]; pgs->supportmin[d] = RF_NEGINF; pgs->supportmax[d] = RF_INF; pgs->own_grid_start[d] = RF_NEGINF; pgs->own_grid_step[d] = keyloc->xgr[d][XSTEP]; pgs->own_grid_len[d] = keyloc->xgr[d][XLENGTH]; } pgs->log_density = 0.0; //@MARTIN: besser: +/-LOG(area)? Rolle von logdens nicht ganz klar (s. extremes.cc) for (d=0; d<=cov->mpp.moments; d++) { cov->mpp.mM[d] = cov->mpp.mMplus[d] = 1.0; } cov->mpp.maxheights[0] = EXP(0.0); assert(keyloc->grid); assert(key->nr == GAUSSPROC); key->simu.expected_number_simu = cov->simu.expected_number_simu; assert(cov->mpp.moments >= 1); if ((err = INIT(key, 1, s)) != NOERROR) goto ErrorHandling; key->simu.active = true; cov->loggiven = true; assert(key->mpp.moments >= 1); key->mpp.mM[0] = key->mpp.mMplus[0] = 1.0; key->mpp.mM[1] = key->mpp.mMplus[1] = 1.0; if (sBR->trend[0] == NULL && (sBR->trend[0] =(double*) MALLOC(keytotal*sizeof(double)))==NULL){ err = ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((err = loc_set(keyloc->xgr[0], NULL, NULL, dim, dim, 3, 0, false, true, keyloc->distances, sBR->vario)) > NOERROR) goto ErrorHandling; if (sBR->vario->sub[0] != NULL) SetLoc2NewLoc(sBR->vario->sub[0], PLoc(sBR->vario)); Variogram(NULL, sBR->vario, sBR->trend[0]); if ((sBR->lowerbounds = (double*) MALLOC(keytotal*sizeof(double))) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((err = prepareBRoptim(cov, s)) != NOERROR) { goto ErrorHandling; } assert(keyloc != NULL); key->simu.active = true; set_lowerbounds(cov); cov->rf = sBR->sub[0]->rf; cov->origrf = false; cov->fieldreturn = HUETCHEN_OWN_GRIDSIZE; pgs->estimated_zhou_c = ISNAN(P0(BR_LAMBDA)); pgs->zhou_c = pgs->estimated_zhou_c ? 0.0 : P0(BR_LAMBDA)*area; //@MARTIN: area kann weg, falls in logdens pgs->logmean = false; pgs->sq_zhou_c = pgs->sum_zhou_c = 0.0; pgs->n_zhou_c = 0; sBR->next_am_check = GLOBAL.br.deltaAM; ErrorHandling: if (err != NOERROR) br_DELETE(&(cov->Sbr)); return err; } void do_BRmixed(cov_model *cov, gen_storage *s) { // to do: improve simulation speed by dynamic sizes assert(cov->key!=NULL); br_storage *sBR = cov->Sbr; cov_model *key = sBR->sub[0]; assert(cov->rf == key->rf); location_type *keyloc = Loc(key); assert(keyloc->grid); pgs_storage *pgs = cov->Spgs; assert(pgs != NULL); int d, dim = cov->tsdim, minradius, i, j, maxind, idxdist, hatnumber=0, lgtotalpoints = keyloc->totalpoints, zeropos = sBR->zeropos, vertnumber = P0INT(BR_VERTNUMBER); double step = P0(BR_MESHSIZE), invstepdim = intpow(step, -dim), uplusmaxval , maxval, u[MAXMPPDIM], ** xgr = keyloc->xgr, *lowerbounds = sBR->lowerbounds, area=1.0, *lgres = key->rf, //@MARTIN: area obsolet, falls in logdens *trend = sBR->trend[0]; if (P0INT(BR_OPTIM) == 2 && pgs->n_zhou_c >= sBR->next_am_check) { sBR->next_am_check += GLOBAL.br.deltaAM; OptimArea(cov); set_lowerbounds(cov); } minradius = (int) (sBR->minradius/step); for (d=0; dsuppmax[d] - sBR->suppmin[d]) + sBR->suppmin[d]) / step) * step; area *= sBR->suppmax[d] - sBR->suppmin[d]; pgs->supportmin[d] = u[d] - sBR->minradius - sBR->radius; pgs->supportmax[d] = u[d] + sBR->minradius + sBR->radius; pgs->supportcentre[d] = u[d]; pgs->own_grid_start[d] = keyloc->xgr[d][XSTART] + u[d]; } while(true) { DO(key, s); hatnumber++; maxval = RF_NEGINF; maxind = 0; for (i=0; i maxval) { maxval = lgres[i]; maxind = i; } } if (maxind == zeropos) { pgs->sq_zhou_c += area * invstepdim * area * invstepdim; // @MARTIN: s.o pgs->sum_zhou_c += area * invstepdim; // } uplusmaxval = maxval - lgres[zeropos] - LOG(UNIFORM_RANDOM); if (P0INT(BR_OPTIM) == 2) { for (j=0; j sBR->logvertnumber[j]) { idxdist = (int) CEIL(IdxDistance(maxind, zeropos, xgr, dim)); if (idxdist<=minradius) (sBR->countvector[j][idxdist])++; break; } } } if (uplusmaxval > lowerbounds[maxind]) break; } pgs->n_zhou_c += hatnumber; if (PL >= PL_STRUCTURE && hatnumber > 300) PRINTF("note: large hat number (%d) might indicate numerically suboptimal framework\n", hatnumber); //shifting maximum to origin is not necessary because of stationarity //(conditional on T=t, the "correct" shape function is shifted which yields //the same stationary max-stable process; OK because there is a finite number //of values for t! for (i=0; imin[BR_MESHSIZE] = 0; range->max[BR_MESHSIZE] = RF_INF; range->pmin[BR_MESHSIZE] = 0; range->pmax[BR_MESHSIZE] = RF_INF; range->openmin[BR_MESHSIZE] = true; range->openmax[BR_MESHSIZE] = true; range->min[BR_VERTNUMBER] = 1; range->max[BR_VERTNUMBER] = RF_INF; range->pmin[BR_VERTNUMBER] = 1; range->pmax[BR_VERTNUMBER] = 50; range->openmin[BR_VERTNUMBER] = false; range->openmax[BR_VERTNUMBER] = false; range->min[BR_OPTIM] = 0; range->max[BR_OPTIM] = 2; range->pmin[BR_OPTIM] = 0; range->pmax[BR_OPTIM] = 2; range->openmin[BR_OPTIM] = false; range->openmax[BR_OPTIM] = false; range->min[BR_OPTIMTOL] = 0; range->max[BR_OPTIMTOL] = 1; range->pmin[BR_OPTIMTOL] = 0; range->pmax[BR_OPTIMTOL] = 0.1; range->openmin[BR_OPTIMTOL] = true; range->openmax[BR_OPTIMTOL] = true; range->min[BR_LAMBDA] = 0; range->max[BR_LAMBDA] = RF_INF; range->pmin[BR_LAMBDA] = 0; range->pmax[BR_LAMBDA] = RF_INF; range->openmin[BR_LAMBDA] = true; range->openmax[BR_LAMBDA] = true; range->min[BR_OPTIMAREA] = 0; range->max[BR_OPTIMAREA] = 1; range->pmin[BR_OPTIMAREA] = 0; range->pmax[BR_OPTIMAREA] = 1; range->openmin[BR_OPTIMAREA] = false; range->openmax[BR_OPTIMAREA] = false; range->min[BR_VARIOBOUND] = 0; range->max[BR_VARIOBOUND] = RF_INF; range->pmin[BR_VARIOBOUND] = 2; range->pmax[BR_VARIOBOUND] = 25; range->openmin[BR_VARIOBOUND] = false; range->openmax[BR_VARIOBOUND] = true; } int structBRuser(cov_model *cov, cov_model **newmodel) { location_type *loc = Loc(cov); cov_model *sub = cov->sub[cov->sub[MPP_SHAPE] != NULL ? MPP_SHAPE: MPP_TCF]; int i, d, err, model_intern, dim = sub->tsdim, newxlen; bool grid; double centreloc[MAXMPPDIM], minloc[MAXMPPDIM], maxloc[MAXMPPDIM], *newx= NULL, **xgr = loc->xgr; ASSERT_NEWMODEL_NULL; if (cov->role != ROLE_BROWNRESNICK) BUG; assert(isBRuserProcess(cov)); if (loc->Time || (loc->grid && loc->caniso != NULL)) { TransformLoc(cov, false, GRIDEXPAND_AVOID, false); SetLoc2NewLoc(sub, PLoc(cov)); } loc = Loc(cov); grid = loc->grid; model_intern = (cov->nr == BRORIGINAL_USER) ? BRORIGINAL_INTERN : (cov->nr == BRMIXED_USER) ? BRMIXED_INTERN : (cov->nr == BRSHIFTED_USER) ? BRSHIFTED_INTERN : BRORIGINAL_USER; if (cov->key != NULL) COV_DELETE(&(cov->key)); if (cov->Sgen == NULL) NEW_STORAGE(gen); GetDiameter(loc, minloc, maxloc, centreloc); newxlen = loc->lx; if ((newx = (double*) MALLOC(dim * newxlen * sizeof(double))) == NULL) { GERR("Memory allocation failed.\n"); } if (grid) { for (d=0; dlx; i++) for(d=0; dx[i*dim+d] - centreloc[d]; } if ((err = loc_set(newx, NULL, dim, dim, newxlen, false, loc->grid, loc->distances, cov)) > NOERROR) goto ErrorHandling; SetLoc2NewLoc(sub, PLoc(cov)); if ((err=covCpy(&(cov->key), sub)) > NOERROR) goto ErrorHandling; if (cov->sub[MPP_TCF] != NULL) { if ((err = STRUCT(sub, &(cov->key))) > NOERROR) goto ErrorHandling; assert(cov->key->calling == cov); } addModel(&(cov->key), model_intern); kdefault(cov->key, GEV_XI, P0(GEV_XI)); kdefault(cov->key, GEV_MU, P0(GEV_MU)); kdefault(cov->key, GEV_S, P0(GEV_S)); if (cov->nr == BRMIXED_USER) { kdefault(cov->key, BR_MESHSIZE, P0(BR_MESHSIZE)); kdefault(cov->key, BR_VERTNUMBER, P0INT(BR_VERTNUMBER)); kdefault(cov->key, BR_OPTIM, P0INT(BR_OPTIM)); kdefault(cov->key, BR_OPTIMTOL, P0(BR_OPTIMTOL)); kdefault(cov->key, BR_VARIOBOUND, P0(BR_VARIOBOUND)); kdefault(cov->key, BR_LAMBDA, P0(BR_LAMBDA)); if (!PisNULL(BR_OPTIMAREA)) { PARAMALLOC(cov->key, BR_OPTIMAREA, cov->nrow[BR_OPTIMAREA], cov->ncol[BR_OPTIMAREA]); PCOPY(cov->key, cov, BR_OPTIMAREA); } } cov->key->calling = cov; if ((err = CHECK(cov->key, dim, dim, PointShapeType, cov->domown, cov->isoown, 1, ROLE_BROWNRESNICK)) == NOERROR) { if ((err = STRUCT(cov->key, NULL)) <= NOERROR) { err = CHECK(cov->key, dim, dim, PointShapeType, cov->domown, cov->isoown, 1, ROLE_BROWNRESNICK); } } assert(cov->key->calling == cov); ErrorHandling: FREE(newx); return err; } // new int structBRintern(cov_model *cov, cov_model **newmodel) { cov_model *sub = cov->sub[cov->sub[MPP_SHAPE] != NULL ? MPP_SHAPE: MPP_TCF]; location_type *loc = Loc(cov); int i, d, j, err, dim = sub->tsdim, totaldim = loc->totalpoints*dim, zeropos = 0, // default, mostly overwritten newxlen = 3; // default (grid) bool grid = loc->grid; double norm, step, mindist, dist, **xgr = loc->xgr; br_storage *sBR = NULL; ASSERT_NEWMODEL_NULL; if (cov->role != ROLE_BROWNRESNICK) BUG; assert(isPointShape(cov)); if (cov->key != NULL) COV_DELETE(&(cov->key)); if (cov->Sgen == NULL) NEW_STORAGE(gen); NEW_STORAGE(br); sBR = cov->Sbr; if (cov->sub[MPP_TCF] != NULL) { if ((err = STRUCT(sub, &(cov->key))) > NOERROR) goto ErrorHandling; cov->key->calling = cov; } else if ((err=covCpy(&(cov->key), sub)) > NOERROR) goto ErrorHandling; if ((err = CHECK(cov->key, dim, dim, VariogramType, cov->domown, SYMMETRIC, 1, ROLE_COV)) != NOERROR) goto ErrorHandling; if ((err = covCpy(&(sBR->submodel), cov->key)) != NOERROR) goto ErrorHandling; if ((err = CHECK(sBR->submodel, 1, 1, VariogramType, XONLY, ISOTROPIC, 1, ROLE_COV)) != NOERROR) goto ErrorHandling; if ((err = newmodel_covCpy(&(sBR->vario), VARIOGRAM_CALL, cov->key))!=NOERROR) goto ErrorHandling; if ((err = alloc_cov(sBR->vario, dim, 1, 1)) != NOERROR) goto ErrorHandling; addModel(&(cov->key), GAUSSPROC, cov); assert(cov->key->ownloc == NULL); if (cov->nr == BRORIGINAL_INTERN) { if (!grid) { zeropos = loc->lx; for (i=0; ilx; i++) { norm = 0.0; for (d=0; dx[i*dim+d]*loc->x[i*dim+d]; } if (norm<1e-8) zeropos = i; } newxlen = loc->lx + (zeropos == loc->lx); if ((sBR->newx = (double*) MALLOC(dim*newxlen*sizeof(double))) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } for(d=0; dlx; i++) sBR->newx[i*dim+d] = loc->x[i*dim+d]; if (zeropos == loc->lx) sBR->newx[loc->lx*dim+d] = 0.0; } } } else if (cov->nr == BRMIXED_INTERN) { step = P0(BR_MESHSIZE); mindist = RF_INF; if (grid) { for (d=0; d 1000) { warning("minimal distance is only estimated"); maxtotal = 1000; // to do } for (i=0; ix[i+d] - loc->x[j]); if (dist > 1e-15 && dist < mindist) mindist = dist; } } if (mindist < step) { PRINTF("Warning! meshsize is larger than resolution of simulation! meshsize is automatically decreased to %f.\n", mindist); P(BR_MESHSIZE)[0] = step = mindist; } if (!PisNULL(BR_OPTIMAREA)) { sBR->minradius = cov->ncol[BR_OPTIMAREA] * step; } else { sBR->minradius = 0; } double alpha = -1, yy, C0, gammamin, xx=step * 1e-6; COV(ZERO, sBR->submodel, &C0); COV(&xx, sBR->submodel, &yy); alpha = LOG(C0 - yy) / LOG(xx); if (alpha > 2.0) alpha = 2.0; gammamin = 4.0 - 1.5 * alpha; INVERSE(&gammamin, sBR->submodel, &xx); xx = CEIL(xx/step) * step; sBR->minradius = FMAX(sBR->minradius, xx); yy = P0(BR_VARIOBOUND); INVERSE(&yy, sBR->submodel, &(sBR->radius)); sBR->radius = CEIL(sBR->radius / step) * step; newxlen = 3; grid = true; if ((sBR->newx = (double*) MALLOC(newxlen*dim*sizeof(double))) == NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((err = covCpy(sBR->sub, cov->key)) != NOERROR) goto ErrorHandling; for (d=0; dnewx[3*d+XSTART] = -sBR->radius - sBR->minradius; sBR->newx[3*d+XLENGTH] = 2 * ((int) ROUND((sBR->radius + sBR->minradius) / step)) + 1; sBR->newx[3*d+XSTEP] = step; } err = loc_set(sBR->newx, NULL, dim, dim, newxlen, false, grid, false, sBR->sub[0]); double **subxgr = Loc(sBR->sub[0])->xgr; zeropos = 0; for (d = dim; d > 0; d--) { double len = subxgr[d-1][XLENGTH]; zeropos = zeropos * (int) len + (int) CEIL(len * 0.5) - 1; } sBR->zeropos = zeropos; if ((err = CHECK(sBR->sub[0], dim, dim, ProcessType, cov->domown, cov->isoown, 1, ROLE_GAUSS)) == NOERROR) { if ((err = STRUCT(sBR->sub[0], NULL)) <= NOERROR) { err = CHECK(sBR->sub[0], dim, dim, ProcessType, cov->domown, cov->isoown, 1, ROLE_GAUSS); } } if (err > NOERROR) goto ErrorHandling; assert(sBR->sub[0]->calling == cov); } else { // END BRMIXED; START SHIFTED assert(cov->nr == BRSHIFTED_INTERN); } if (sBR->newx == NULL) { if ((err = loc_set(grid ? * loc->xgr : loc->x, NULL, dim, dim, grid ? 3 : loc->totalpoints, false, grid, loc->distances, cov->key)) != NOERROR) goto ErrorHandling; } else { if ((err = loc_set(sBR->newx, NULL, dim, dim, newxlen, false, grid, false, cov->key)) != NOERROR) goto ErrorHandling; } xgr = loc->xgr; if (cov->nr != BRMIXED_INTERN && grid) { double **subxgr = Loc(cov->key)->xgr; for (d=dim; d>0; d--) { double len = subxgr[d-1][XLENGTH]; zeropos = zeropos * len + (int) CEIL(len * 0.5) - 1; } sBR->zeropos = zeropos; } if ((err = CHECK(cov->key, dim, dim, ProcessType, cov->domown, cov->isoown, 1, ROLE_GAUSS)) == NOERROR) { if ((err = STRUCT(cov->key, NULL)) <= NOERROR) { err = CHECK(cov->key, dim, dim, ProcessType, cov->domown, cov->isoown, 1, ROLE_GAUSS); } } if (err > NOERROR) goto ErrorHandling; assert(cov->key->calling == cov); ErrorHandling: if (err != NOERROR) br_DELETE(&(cov->Sbr)); return err; } int structBrownResnick(cov_model *cov, cov_model **newmodel) { int d, err, meth, role, dim = cov->tsdim; double maxcov, minloc[MAXMPPDIM], maxloc[MAXMPPDIM], centreloc[MAXMPPDIM], maxdist[MAXMPPDIM]; cov_model *next = cov->sub[0]; location_type *loc = Loc(cov); if (cov->role != ROLE_BROWNRESNICK) BUG; if (loc->Time || (loc->grid && loc->caniso != NULL)) { TransformLoc(cov, false, GRIDEXPAND_AVOID, false); SetLoc2NewLoc(next, PLoc(cov)); } loc = Loc(cov); if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if (cov->key != NULL) COV_DELETE(&(cov->key)); if (cov->role == ROLE_SMITH) { if (!cov->logspeed) SERR2("'%s' requires a variogram model as submodel that tends to infinity with rate of at least 4log(h) for being compatible with '%s'", NICK(cov), CovList[SMITHPROC].nick); cov_model *calling = cov->calling; double newscale, factor = INVSQRTTWO; ASSERT_NEWMODEL_NULL; if (next->full_derivs < 0) SERR("given submodel does not make sense"); while (isDollar(next)) { addModel(&(cov->key), DOLLAR); newscale = 1.0; if (!PARAMisNULL(next, DSCALE) ) newscale *= PARAM0(next, DSCALE); if (!PARAMisNULL(next, DVAR) ) newscale /= SQRT(PARAM0(next, DVAR)); if (factor != 1.0) { newscale *= factor; factor = 1.0; } return ERRORNOTPROGRAMMEDYET; kdefault(calling, DSCALE, newscale); next = next->sub[0]; // ok } if (cov->sub[MPP_TCF] != NULL) { return ERRORNOTPROGRAMMEDYET; } if (next->nr == BROWNIAN && PARAM0(next, BROWN_ALPHA) == 2.0) { addModel(&(cov->key), GAUSS); // ?? if (factor != 1.0) { addModel(&(cov->key), DOLLAR); kdefault(cov->key, DSCALE, factor); } } else { SERR("Smith process with BrownResnick tcf only possible for fractal Brownian motion with alpha=2"); } } else if (cov->role == ROLE_BROWNRESNICK) { if (next->role == ROLE_BROWNRESNICK) { SERR1("submodel of '%s' must be a covariance model or tcf", NICK(cov)); } else { role = isVariogram(next) ? ROLE_COV : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(next); if (((err = covCpy(&(cov->key), next)) != NOERROR) || ((err = CHECK(cov->key, dim, dim, VariogramType, XONLY, SYMMETRIC, 1, role)) != NOERROR)) { return err; } GetDiameter(loc, minloc, maxloc, centreloc); for (d=0; dkey, maxdist, NULL, NULL, dim, dim, 1, 0, false, false, false)) != NOERROR) return err; if ((err = alloc_cov(K, dim, 1, 1)) != NOERROR) return err; if (K->sub[0] != NULL) SetLoc2NewLoc(K->sub[0], PLoc(K)); Variogram(NULL, K, &maxcov); COV_DELETE(&K); if (isPosDef(next) || maxcov <= 4.0) { meth = BRORIGINAL_USER; } else if (!next->logspeed || next->logspeed <= 4.0 || maxcov <= 10.0) { meth = BRSHIFTED_USER; } else { meth = BRMIXED_USER; } addModel(&(cov->key), meth, cov); cov_model *key = cov->key; key->prevloc = PLoc(cov); kdefault(key, GEV_XI, P0(GEV_XI)); kdefault(key, GEV_MU, P0(GEV_MU)); kdefault(key, GEV_S, P0(GEV_S)); if ((err = CHECK(key, dim, dim, BrMethodType, cov->domown, cov->isoown, 1, ROLE_BROWNRESNICK)) == NOERROR) { if ((err = STRUCT(key, NULL)) <= NOERROR) { err = CHECK(key, dim, dim, BrMethodType, cov->domown, cov->isoown, 1, ROLE_BROWNRESNICK); } } if (err > NOERROR) return(err); } } else { ILLEGAL_ROLE; } // need check to be called? return NOERROR; } int initBrownResnick (cov_model *cov, gen_storage *S) { cov_model *sub = cov->key != NULL ? cov->key : cov->sub[cov->sub[MPP_SHAPE] != NULL ? MPP_SHAPE: MPP_TCF]; int err; assert(cov->nr == BROWNRESNICKPROC); if (cov->role == ROLE_BROWNRESNICK) { if (cov->key != NULL) { sub->simu.active = true; sub->simu.expected_number_simu = cov->simu.expected_number_simu; if ((err = INIT(sub, 0, S)) != NOERROR) return err; cov->fieldreturn = true; cov->origrf = false; cov->rf = sub->rf; } } else ILLEGAL_ROLE; return NOERROR; } void doBrownResnick(cov_model *cov, gen_storage *s) { assert(!cov->origrf); assert(cov->key != NULL); cov_model *key = cov->key; PL++; DO(key, s); // nicht gatternr PL--; } int initBRuser (cov_model *cov, gen_storage *S) { location_type *loc = Loc(cov); cov_model *sub = cov->key != NULL ? cov->key : cov->sub[cov->sub[MPP_SHAPE] != NULL ? MPP_SHAPE: MPP_TCF]; int err, maxpoints = GLOBAL.extreme.maxpoints; assert(isBRuserProcess(cov)); if (cov->role == ROLE_BROWNRESNICK) { if (loc->distances) return ERRORFAILED; if (cov->key != NULL) { sub->simu.active = true; double ens = ((double) cov->simu.expected_number_simu) * maxpoints; sub->simu.expected_number_simu = (int) MIN(ens, (double) MAXINT); if ((err = INIT(sub, 1, S)) != NOERROR) return err; FieldReturn(cov); } return NOERROR; } else ILLEGAL_ROLE; } RandomFields/src/Huetchen.cc0000644000176200001440000014565013074763020015477 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de simulation of max-stable random fields Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "RF.h" #include "Operator.h" #define POISSON_INTENSITY 0 #define RANDOMCOIN_INTENSITY (COMMON_GAUSS + 1) #define PGS_VOXEL 0 #define PGS_CORNER 1 #define PGS_SIDES (PGS_CORNER + 1) #define PGS_2D_SIDE1 PGS_SIDES #define PGS_2D_SIDE2 (PGS_SIDES + 1) #define PGS_3D_SIDE1 PGS_SIDES #define PGS_3D_SIDE2 (PGS_SIDES + 1) #define PGS_3D_SIDE3 (PGS_SIDES + 2) #define PGS_3D_EDGE1 (PGS_SIDES + 3) #define PGS_3D_EDGE2 (PGS_SIDES + 4) #define PGS_3D_EDGE3 (PGS_SIDES + 5) int addUnifModel(cov_model *cov, double radius, cov_model **newmodel) { addModel(newmodel, UNIF, cov); kdefault(*newmodel, UNIF_MIN, -radius); kdefault(*newmodel, UNIF_MAX, radius); return NOERROR; } void pts_given_shape(double *x, cov_model *cov, double *v) { cov_model *shape = cov->sub[PGS_FCT]; NONSTATCOV(x, cov->q, shape, v); } void logpts_given_shape(double *x, cov_model *cov, double *v, double *Sign) { cov_model *shape = cov->sub[PGS_FCT]; LOGNONSTATCOV(x, cov->q, shape, v, Sign); } int check_pts_given_shape(cov_model *cov) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; location_type *loc = Loc(cov); int err, role, dim = cov->tsdim; ASSERT_CARTESIAN; if (loc->Time) SERR("Time component not allowed yet"); // todo kdefault(cov, PGS_RATIO, GLOBAL.extreme.density_ratio); kdefault(cov, PGS_FLAT, GLOBAL.extreme.flat); kdefault(cov, PGS_INFTY_SMALL, !PINT(PGS_FLAT)); kdefault(cov, PGS_NORMED, true); kdefault(cov, PGS_ISOTROPIC, true); if ((err = checkkappas(cov)) != NOERROR) return err; if (cov->q == NULL) QALLOC(dim); if (cov->xdimprev != cov->xdimown || cov->xdimprev != cov->tsdim) return ERRORDIM; if (cov->role == ROLE_GAUSS) { role = isShape(shape) ? cov->role //Marco, 29.5.13 : isGaussProcess(shape) ? ROLE_GAUSS : shape->nr == BINARYPROC ? ROLE_GAUSS : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(shape); } else if (hasPoissonRole(cov)) { role = ROLE_POISSON; } else if (hasMaxStableRole(cov)) { role = ROLE_MAXSTABLE; } else ILLEGAL_ROLE; // isotropy is the property -- user should not define unisotropic functions! // so !isotropic only for special, internal definitions, e.g. // strokorbPoly // int err2 = NOERROR; // if (P0INT(PGS_ISOTROPIC)) // err2 = CHECK(shape, dim, dim, ShapeType, XONLY, ISOTROPIC, // SCALAR, role); // but it must be treated in any case as if it was non-isotropic if ((err = CHECK(shape, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, SCALAR, role)) != NOERROR) { if (P0INT(PGS_ISOTROPIC)) BUG; XERR(err); return err; } setbackward(cov, shape); //if (!shape->deterministic) return ERRORNOTPROGRAMMED; // Dichte muss nicht normiert sein und stattdessen durch das mittlere Volumen dividiert werden. if (pts != NULL) { if ((err = CHECK_R(pts, dim)) != NOERROR) return err; } return NOERROR; } int struct_pts_given_shape(cov_model *cov, cov_model **newmodel){ cov_model *shape = cov->sub[PGS_FCT]; // location_type *loc = Loc(cov); int err = NOERROR; ASSERT_NEWMODEL_NULL; if (cov->Spgs != NULL) pgs_DELETE(&(cov->Spgs)); if (shape->role != ROLE_POISSON && shape->role != ROLE_MAXSTABLE) ILLEGAL_ROLE; if (cov->sub[PGS_LOC] == NULL) { // COV_DELETE(cov->sub + PGS_LOC); // assert(cov->sub[PGS_LOC] == NULL); if ((err = STRUCT(shape, cov->sub + PGS_LOC)) != NOERROR) return err; if (cov->sub[PGS_LOC] == NULL) SERR1("no intensity found for '%s'", NICK(shape)); assert(cov->sub[PGS_LOC]->calling != NULL); // printf("here %s\n", NICK(cov->sub[PGS_LOC])); //if ((err = CHECK_R(cov->sub[PGS_LOC], cov->tsdim)) != NOERROR) return err; } return NOERROR; } int calculate_mass_gauss(cov_model *cov) { /* erste Idee bei Gitter --- diese ist aber viel zu kompliziert, insbesondere beim Auswerten der Dichtefunktion bei der Simulation: jeweils von der Seite wird mit konstanter, groesserer Schrittweite (newstep) ins zentrum gegangen. Das Verfahren waere schoen wenn nicht in der mitte etwas Chaos gegeben wuerde, sofern die Schrittweite nicht aufgeht (!addingup[d]): (a) die Massen um die Punkte am naechsten zum Zentrum ueberlappen sich sehr (oldmass > reference) dann weiss nicht so richtig was ich tun soll; hier wird einfach alles so gelassen wie es ist (b) die Massen ueberlappen sich nicht genug. Dann werden zusaetzliche Punkte aufgenommen (und zwar fuer alle 2^d bzw. 2^d -1 Moeglichkeiten einzeln, ob die Punkte dem Zentrum am naechsten in einer Richtung sind (fixed[d]=true) oder nicht. Zweite Idee (ab V.2.1.31): die Dichten werden auf einem "beliebigen" Gitter (pgs->xgr) definiert. Dies vereinfacht die Berechnung der Dichten. Ob dieses Gitter auf den zu simulierenden Punkten liegen muss oder nicht sei dahingestellt (auch wenn Felix' Resultate zeigen, dass dies aus theoretischen Gruenden so sein muss). Was letztendlich die kleinste reale Rechenzeit verursacht ist nicht klar. Auch sind die Gewichte voellig unklar. Insbesondere wo/wieviele Nullen auftreten und die Schwere der Randeffekte bei ueberall konstantem Gewicht. Um hier den ersten Algorithmus einfach zu halten werden konstante Gewichte genommen und (dafuer das Gebiet eher etwas groesser gemacht) TODO! */ pgs_storage *pgs = cov->Spgs; location_type *loc = Loc(cov); cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; double zx, zy, **xgr = pgs->xgr, // out *v = pgs->v, // dummy *x = pgs->x, // dummy *y = pgs->y; // dummy int d, dim = cov->tsdim; if (loc->grid) { // int size = pgs->size; COV(ZERO, shape, v); v[0] *= intpow(0.5, dim); NONSTATINVERSE_D(v, shape, x, y); if (ISNAN(x[0]) || x[0] > y[0]) SERR1("inverse function of '%s' unknown", NICK(shape)); // is the underlying point distribution uniform? Then // no safety division by SQRT(dim) seems to be necessary // todo // unif might be modified by $. So a check on the equality // of three values is done VTLG_D(ZERO, pts, v); VTLG_D(x, pts, &zx); VTLG_D(y, pts, &zy); //printf("> x=%f %f; %f %f %f\n", x[0], x[1], zx, zy, v[0]); for (d=0; d 0); } if (zx != v[0] || zy != v[0] || true) { for (d=0; d 1 pgs->totalmass = 1; for (d=0; dxgr[d][XLENGTH] > 1) { double range = loc->xgr[d][XSTEP] * (loc->xgr[d][XLENGTH] - 1.0); xgr[d][XLENGTH] = CEIL(range / y[d] + 1.0); if (xgr[d][XLENGTH] >= loc->xgr[d][XLENGTH]) { BUG; MEMCOPYX(xgr[d], loc->xgr[d], 3 * sizeof(double)); } else { xgr[d][XSTART] = loc->xgr[d][XSTART] - 0.5 *((xgr[d][XLENGTH] - 1.0) * y[d] - range); xgr[d][XSTEP] = y[d]; } pgs->totalmass *= xgr[d][XLENGTH]; // printf("%d %f %f %f \n", d,xgr[d][XSTART], xgr[d][XSTEP], xgr[d][XLENGTH] ); assert(xgr[d][XSTEP] >= 0); } else { int i; assert(XSTART == 0 && XLENGTH == 2); for (i=XSTART; XLENGTH; i++) xgr[d][i] = loc->xgr[d][i]; } } //for (d=0; d<=1; d++) // printf("%d %f %f %f \n", d,xgr[d][XSTART], xgr[d][XSTEP], xgr[d][XLENGTH] ); assert(false); } else { // not grid pgs->totalmass = loc->totalpoints; } // PMI(cov, "ccccc"); // assert(false); return NOERROR; } int calculate_mass_maxstable(cov_model *cov) { pgs_storage *pgs = cov->Spgs; location_type *loc = Loc(cov); cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; double voxels, value_orig, *single = pgs->single, // out *total = pgs->total, // out *halfstepvector = pgs->halfstepvector, //out *x = pgs->x; // bool flat = false; int d, dim = cov->tsdim, flat =P0INT(PGS_FLAT); if (shape->role == ROLE_POISSON) { BUG; // to do : felix's paper; derzeit einfach wie max-stable // if (pts->nr != SERR("currently, only simple domain fields are allowed that are based on Poisson processes"); } // else { assert(dim <= MAXSIMUDIM); VTLG_D(ZERO, pts, &value_orig); // PMI(cov, "calculate max"); // printf("%s %d %d %f\n",NICK(cov), PGS_FLAT, P0INT(PGS_FLAT), value_orig );// APMI(cov); assert(false); // VOXEL for (d=0; dxgr[d][XSTEP]; if (flat == FLAT_UNDETERMINED) { // flat == im Kerngebiet wird konstant simuliert; ausserhalb dann // abfallend if (loc->grid) { double v; VTLG_D(halfstepvector, pts, &v); double threshold = value_orig == RF_INF//&& cov->p[PGS_RATIO][0] == 0.0 ? RF_INF : value_orig * P0(PGS_RATIO); pgs->flat = threshold < v && cov->deterministic; // sicherheitshalber //printf("thres %f %f %f\n", threshold, v, value_orig); } else { // not grid BUG; // long term project: to do pgs->flat = true; /* Bei letzterem und nicht Gitter wird dann wird eine maximale Kaestchengroesse bestimmt so dass gerade noch beruehrt wird und der Rest ausserhalb aller Kaestchen auf einen konstanten wert gesetzt, etwas niedriger als der hoechste Grenzwert. Was "hoch" bedeutet ist hier unklar. */ } } else pgs->flat = flat; if (pgs->flat) { if (P0INT(PGS_INFTY_SMALL)) { //PMI(cov); SERR2("'%s' and '%s' may not be positive at the same time", KNAME(PGS_FLAT), KNAME(PGS_INFTY_SMALL)); } single[PGS_VOXEL] = value_orig; for (d=0; dxgr[d][XLENGTH] - 1.0; total[PGS_VOXEL] = single[PGS_VOXEL] * voxels; // CORNER for (d=0; d= 2) { for (d=0; dflat) for (i=0; iflat) single[PGS_SIDES + d] *= loc->xgr[i][XSTEP]; nr *= loc->xgr[i][XLENGTH] - 1.0; } } // //PMI(cov); // printf(" single d=%d %d x=(%f %f %f) val=%f %d\n", d, PGS_SIDES + d, // x[0], x[1], x[2], single[PGS_SIDES + d], nr); assert(false); total[PGS_SIDES + d] = total[PGS_SIDES + d - 1] + nr * single[PGS_SIDES + d]; } if (dim == 3) { // Kanten for (d=0; dflat ? 0.0 : halfstepvector[d]; VTLG_P2SIDED(NULL, x, pts, single + PGS_SIDES + dim + d); if (pgs->flat) single[PGS_SIDES + dim + d] *= loc->xgr[d][XSTEP]; nr *= loc->xgr[d][XLENGTH] - 1.0; // printf(" single d=%d %d x=(%f %f %f) val=%f %d\n", d, PGS_SIDES + dim + d, x[0], x[1], x[2], single[PGS_SIDES + dim + d], nr); //assert(false); total[PGS_SIDES + dim + d] = total[PGS_SIDES + dim + d - 1] + nr * single[PGS_SIDES + dim + d]; } } else if (dim > 3) BUG; } // APMI(cov); pgs->totalmass = total[pgs->size - 1]; if (!R_FINITE(pgs->totalmass)) { // int i; for (i=0; isize; i++) printf("i=%d total=%f\n", i, total[i]); SERR("the total intensity mass is not finite"); } return NOERROR; } cov_model *prunecov(cov_model *newmodel, cov_model *cov) { //printf("names= %s %s\n", NICK(newmodel->calling), NICK(cov->calling)); cov_model **sub = NULL, *next = NULL, *calling = cov->calling; if (calling == newmodel->calling) { return newmodel; } if (calling == NULL) BUG; prunecov(newmodel, calling); if (calling->key == cov) sub = &(newmodel->key); else if (calling->sub[0] == cov) sub = newmodel->sub + 0; else if (calling->sub[1] == cov) sub = newmodel->sub + 1; else BUG; next = *sub; *sub = NULL; COV_DELETE(&newmodel); return next; } int complete_copy(cov_model **newmodel, cov_model *cov) { cov_model *prev = NULL, *start = cov; int err; while (start->calling != NULL) start = start->calling; if (start->typus != InterfaceType) BUG; // nur zur Sicherheit, derzeit; kann erweitert werden if (start == cov) BUG; prev = start->key != NULL ? start->key : start->sub[0]; if (prev->typus != ProcessType) BUG; if ((err = covCpy(newmodel, prev)) != NOERROR) return err; (*newmodel)->calling = cov; int role = prev->role ;// role_of_process(prev->nr); if ((err = CHECK(*newmodel, prev->tsdim, prev->xdimprev, prev->typus, prev->domprev, prev->isoprev, prev->vdim, role)) != NOERROR) return err; if ((err = STRUCT(*newmodel, NULL)) != NOERROR) { return err; } if (!(*newmodel)->initialised) { if ((err = CHECK(*newmodel, prev->tsdim, prev->xdimprev, prev->typus, prev->domprev, prev->isoprev, prev->vdim, role)) != NOERROR) return err; NEW_COV_STORAGE(*newmodel, gen); //APMI(*newmodel); if ((err = INIT(*newmodel, 0, cov->Sgen)) != NOERROR) { //APMI(cov); // !!! ?? hier weitermachen return err; } } ///APMI(cov); (*newmodel)->calling = start; *newmodel = prunecov(*newmodel, cov); (*newmodel)->calling = NULL; return NOERROR; } int init_pts_given_shape(cov_model *cov, gen_storage *S) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; cov_fct *Cshape = CovList + shape->nr; location_type *loc = Loc(cov); int d, i, err = NOERROR, dim = shape->xdimprev; pgs_storage *pgs = cov->Spgs; bool grid = Loc(cov)->grid, pgsnull = pgs == NULL; //PMI(cov); assert(cov->sub[PGS_LOC] != NULL); assert(dim == cov->sub[PGS_LOC]->xdimprev); assert(dim == Loc(cov)->timespacedim); if (Cshape->inverse == ErrCov) // && Cshape->nonstat_inverse == ErrCovNonstat) SERR1("support of the model is unknown. Use '%s' to determine the support", CovList[TRUNCSUPPORT].nick); if (pgsnull) { if ((err = alloc_pgs(cov)) != NOERROR) return err; pgs = cov->Spgs; if ((pgs->v = (double*) CALLOC(dim, sizeof(double))) == NULL || (pgs->y = (double*) CALLOC(dim, sizeof(double))) == NULL ) return ERRORMEMORYALLOCATION; pgs->zhou_c = 1.0; pgs->sum_zhou_c = pgs->sq_zhou_c = 0.0; pgs->n_zhou_c = 0; } // PMI(cov, "hi"); assert(pts == cov->sub[PGS_LOC]); // selbst wenn zufaelliger Shape: 1x laufen lassen, ob // Fehler auftauchen. Unter "Do" lassen sie sich nicht mehr // schoen abfangen. // printf("A moments=%d\n", cov->mpp.moments); // APMI(cov); if ((err = INIT(shape, cov->mpp.moments, S)) != NOERROR) return err; //gatter? // APMI(shape); assert(cov->mpp.moments >= 1); assert(shape->mpp.moments >= 1); // printf("AB moments=%d\n", cov->mpp.moments); //APMI(pts->calling); if ((err = INIT(pts, 0, S)) != NOERROR) { // , 0, S statt ,1,S return err; } // printf("AC moments=%d\n", cov->mpp.moments); if (!grid) { // todo SERR("non-grid not programmed yet"); // meiste da; fehlt noch // welche Vektoren ich wirklich brauche } pgs->size = grid ? intpow(2, dim) : loc->totalpoints; if (cov->role == ROLE_POISSON_GAUSS) { if (pgsnull && ( (pgs->xgr[0] = (double*) CALLOC(dim * 3, sizeof(double))) == NULL || (pgs->pos = (int *) CALLOC(dim, sizeof(int))) ==NULL || (pgs->min = (int*) CALLOC(dim, sizeof(int))) == NULL || (pgs->max = (int*) CALLOC(dim, sizeof(int))) == NULL )) return ERRORMEMORYALLOCATION; for (i=3, d=1; dxgr[d] = pgs->xgr[0] + i; // printf("%d\n", pgs->xgr[1] - pgs->xgr[0]); assert(false); if ((err = calculate_mass_gauss(cov)) != NOERROR) return err; } else if (hasMaxStableRole(cov)) { if (pgsnull && ( (pgs->single = (double*) CALLOC(pgs->size, sizeof(double)))==NULL || (pgs->total = (double*) CALLOC(pgs->size, sizeof(double))) ==NULL || (pgs->halfstepvector = (double*) CALLOC(dim, sizeof(double)))==NULL )) return ERRORMEMORYALLOCATION; // APMI(cov); assert(!cov->deterministic || P0INT(PGS_NORMED)); // printf("init %f zhou=%f\n", pgs->totalmass, cov->mpp.zhou_c); if (P0INT(PGS_NORMED)) { if (R_FINITE(pts->mpp.unnormedmass)) { // APMI(pts); // TO DO !! Richtig nur falls Huetchen derministisch ist !!! cov->mpp.maxheights[0] = pts->mpp.unnormedmass / shape->mpp.mMplus[1]; // korrekt, da pts * mass >= shape !! //APMI(cov); // } else { //PMI(pts->calling); // // BUG; // not programmed yet // to do: funktioniert nur bei ausgewaehlten funktionen. Z.B. Gauss cov->mpp.maxheights[0] = shape->mpp.maxheights[0] * pts->mpp.maxheights[0]; // APMI(cov); } } else { if (R_FINITE(pts->mpp.maxheights[0])) { // eigentlich ein 1.0 / pts->mpp.minheight cov->mpp.maxheights[0] = pts->mpp.maxheights[0] * shape->mpp.maxheights[0]; } else { BUG; } } // f_raw,rectangular must be always >= the shape function. // this is the fundamental condition if (!R_FINITE(cov->mpp.maxheights[0])) BUG; if ((cov->deterministic = shape->deterministic)) { if ((err = calculate_mass_maxstable(cov)) != NOERROR) return err; pgs->zhou_c = pgs->totalmass / shape->mpp.mMplus[1]; // printf("%f %f %f\n", pgs->zhou_c, pgs->totalmass, shape->mpp.mMplus[1]);assert(false); } else { // currently both cases are identical ... pgs->zhou_c = RF_NA; if (pgs->cov == NULL) { cov_model *start=cov->calling; if (start == NULL) BUG; // APMI(start); while (start->calling != NULL && start->nr != PTS_GIVEN_SHAPE) start = start->calling; if (start->nr != PTS_GIVEN_SHAPE) { if ((err = complete_copy(&(pgs->cov), cov)) != NOERROR) return err; pgs->cov->calling = cov->calling; pgs->cov->Spgs->cov = cov; //PMI(cov); APMI(pgs->cov); } } pgs->old_zhou = 0.0; } pgs->estimated_zhou_c = !cov->deterministic; // PMI(cov); assert(!pgs->estimated_zhou_c); } else { // APMI(cov); BUG; } if (CovList[shape->nr].nonstat_inverse == ErrInverseNonstat) { if (pts->nr != RECTANGULAR) { // PMI(pts); // APMI(shape); warning("Inverse of shape function cannot be determined. Simulation speed might be heavily decreased."); } } for (i=0; i<=cov->mpp.moments; i++) { // printf("%d %f %f %d\n", i, pts->mpp.mM[i], shape->mpp.mMplus[i], cov->mpp.moments); //assert(pts->mpp.mMplus[0] == 1.0); cov->mpp.mM[i] = shape->mpp.mM[i] * pts->mpp.mMplus[0]; cov->mpp.mMplus[i] = shape->mpp.mMplus[i] * pts->mpp.mMplus[0]; } cov->rf = shape->rf; cov->origrf = false; // APMI(cov); return err; } int DrawCathegory(int size, double *single, double *total, bool calculate_elements, int *elmts) { int i; double mass; mass = UNIFORM_RANDOM * total[size - 1]; if (calculate_elements) { //printf("mass=%f\n", mass); for (i = 0; mass > total[i]; i++); if (i > 0) mass -= total[i-1]; *elmts = FLOOR(mass / single[i]); //printf("draw: i=%d tot=%f mass=%f sing=%f elm=%d\n", i, total[i], mass, single[i], *elmts); return i; } else { // falls nicht calculate_elements, so sind letztere unwichtig, // d.h. zu single wird nur der Faktor 1.0 multipliziert. // dies ist aber der Fall nur falls !grid return CeilIndex(mass, total, size); } } static double gauss_eps = 1e-10; void do_pgs_gauss(cov_model *cov, gen_storage *S) { pgs_storage *pgs = cov->Spgs; cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; location_type *loc = Loc(cov); // window_info *w = &(S->window); long i; int d, *min = pgs->min, // dummy *max = pgs->max, // dummy *pos = pgs->pos, // dummy dim = shape->xdimprev; double value, total = 0.0, *x = pgs->x, // dummy or (future) static local *y = pgs->y, // dummy or (future) static local // *supportmin = pgs->supportmin, // *supportmax = pgs->supportmax, // *pgstotal = pgs->total, // in //*single = pgs->single, // in **xgr = pgs->xgr, // in *v = pgs->v; bool grid = Loc(cov)->grid; if (!cov->deterministic) { DO(shape, S); DORANDOM(pts, cov->q); // cov->q nur dummy. Wird ueberschrieben if (cov->role == ROLE_POISSON_GAUSS || !grid) { if (calculate_mass_gauss(cov) != NOERROR) ERR("unexpected error in 'do_pts_given_shape' (maxstable)"); } else BUG; } // printf("name = %s\n", CovList[pts->nr].name); // APMI(pts); VTLG_R(NULL, pts, v); i = UNIFORM_RANDOM * pgs->totalmass; // to determine the points that contribute to the value of the // random field by the shape function centered at cov->q //printf("cat=%d el=%d\n", i, elmts); if (loc->grid) { NONSTATINVERSE_D(&gauss_eps, pts, x, y); if (ISNAN(x[0]) || x[0] > y[0]) BUG; // printf("extremes %f %f %f\n", eps, x[0], y[0]); for (d=0; dq[d] = xgr[d][XSTART] + xgr[d][XSTEP] * which + v[d]; // to determine the points that contribute to the value of the // density function at cov->q min[d] = CEIL((cov->q[d] - y[d] - xgr[d][XSTART]) / xgr[d][XSTEP]); max[d] = (cov->q[d] - x[d] - xgr[d][XSTART]) / xgr[d][XSTEP]; // printf("%d %d delat=%f %f y=%f %f step=%f\n", min[d], max[d], // cov->q[d] - y[d] - xgr[d][XSTART], // cov->q[d] - x[d] - xgr[d][XSTART], // y[d], x[d], xgr[d][XSTEP]); // PMI(cov); assert(xgr[d][XSTEP] > 0); if (min[d] < 0) min[d] = 0; if (max[d] >= xgr[d][XLENGTH]) max[d] = xgr[d][XLENGTH] -1; if (min[d] > max[d]) { // no point contributed to cov->q -- this might be possible if // the simulating grid goes beyond the actual grid and //printf("redo d=%d x=%f y=%f q=%f i=%d d=%d range=%d %d\n", // d, x[d], y[d], cov->q[d], i, d, min[d], max[d]); do_pgs_gauss(cov, S); pgs->log_density = RF_INF; return; } // else printf("ok q=%f i=%d\n", cov->q[d], i, d, min[d], max[d]); pos[d] = min[d]; y[d] = x[d] = cov->q[d] - (xgr[d][XSTART] + pos[d] * xgr[d][XSTEP]); } while (true) { VTLG_D(y, pts, &value); total += value; //printf("y=%f v=%f q=%f val=%f tot=%f min=%d max=%d pos=%d xgr.len=%d\n", // y[0], v[0], cov->q[0], value, total, min[0], max[0], pos[0], //(int) loc->xgr[0][XLENGTH]); d = 0; while(d < dim && pos[d] == max[d]) { pos[d] = min[d]; y[d] = x[d]; d++; } if (d >= dim) break; pos[d] ++; y[d] -= xgr[d][XSTEP]; // !! nicht '+' !! } } else { // not grid if (loc->timespacedim != dim) BUG; double *xx = loc->x + dim * i; for (d=0; dq[d] = v[d] + xx[d]; // todo : mit Unterteilung des Feldes viel schneller xx = loc->x; long endfor = loc->totalpoints; for (i=0; iq[d] - xx[d]; VTLG_D(y, pts, &value); total += value; } } pgs->log_density = LOG(total / pgs->totalmass); //printf("total=%f %f grid=%d dim=%d\n", total, pgs->totalmass,loc->grid,dim); assert(R_FINITE(pgs->log_density)); // assert(false); } #define SET_COV \ pgs = cov->Spgs; \ shape = cov->sub[PGS_FCT]; \ pts = cov->sub[PGS_LOC]; \ loc = Loc(cov); \ single = pgs->single; \ total = pgs->total; \ halfstepvector = pgs->halfstepvector; \ x = pgs->x; \ v = pgs->v; \ dim = shape->xdimprev; \ flat = pgs->flat; \ assert(pgs != NULL); \ assert(cov->deterministic || \ (pgs->cov!=NULL && pgs->cov->Spgs!=NULL \ && pgs->cov->Spgs->cov==cov)); #define SWAP_PGS \ cov = cov->Spgs->cov; \ SET_COV //static double sumArea = 0.0; void do_pgs_maxstable(cov_model *cov, gen_storage *S) { pgs_storage *pgs = NULL; cov_model *shape = NULL, *pts = NULL; location_type *loc = NULL; int i, d, elmts, mcmc, dim, err; double *single = NULL, // in *total = NULL, // in *halfstepvector = NULL, // in *x = NULL, // dummy *v = NULL; // dummy bool flat; assert(cov->calling != NULL); if (cov->deterministic) { SET_COV; } else { // assert(PARAM0(shape->sub[0], POWSCALE) == PARAM0(pts, LOC_SCALE)); double cmaxDmu; SWAP_PGS; for (mcmc=0; mcmcmpp.moments, S)) != NOERROR) BUG; DO(shape, S); if (calculate_mass_maxstable(cov) != NOERROR) ERR("unexpected error in 'do_pts_given_shape' (maxstable)"); cmaxDmu = pgs->totalmass / shape->mpp.mMplus[1]; if (pgs->n_zhou_c < GLOBAL.extreme.max_n_zhou) { pgs->n_zhou_c++; pgs->sum_zhou_c += cmaxDmu; pgs->sq_zhou_c += cmaxDmu * cmaxDmu; // sumArea += getArea( shape->sub[0]->Spolygon->P); //if (pgs->n_zhou_c % 1000 == 0) printf("mean area = %f\n", sumArea / (double) pgs->n_zhou_c); } // PMI(cov); // PMI(pts); if (false) printf("//cmaxDmu %4.1f; mass=%4.1f m1=%4.1e beta=%4.1f (%4.6f, %4.6f) (%4.6f, %4.6f) %4.3f %e\n", cmaxDmu, (double) pgs->totalmass, shape->mpp.mMplus[1], PARAM0(shape->sub[0], 0), shape->sub[0]->Spolygon->P->box0[0], shape->sub[0]->Spolygon->P->box0[1], shape->sub[0]->Spolygon->P->box1[0], shape->sub[0]->Spolygon->P->box1[1], 101 * 101 * shape->sub[0]->Spolygon->P->box1[0]* shape->sub[0]->Spolygon->P->box1[1] * 4, 101 * 101 * shape->sub[0]->Spolygon->P->box1[0]* shape->sub[0]->Spolygon->P->box1[1] * 4 - pgs->totalmass); //assert( shape->sub[0] != NULL); //assert(shape->sub[0]->Spolygon != NULL); //assert(shape->sub[0] ->Spolygon->P != NULL); //assert(false); // if (!(shape->mpp.mMplus[1] > 0.0001 || pgs->totalmass < 100)) APMI(cov); // assert( pgs->totalmass <= 101 * 101 * shape->sub[0]->Spolygon->P->box1[0]* shape->sub[0]->Spolygon->P->box1[1] * 4 + 1e-12); //PMI(cov); //assert( shape->sub[0]->Spolygon->P->box0[0] == PARAM(pts, 0)[0]); double old_zhou = pgs->cov->Spgs->old_zhou; if (old_zhou < cmaxDmu || UNIFORM_RANDOM * old_zhou < cmaxDmu) { //printf(". %f %f\n", old_zhou, cmaxDmu); pgs->old_zhou = cmaxDmu; SWAP_PGS; } //else printf("* %f %f\n", old_zhou, cmaxDmu); } // mcmc SWAP_PGS; cov_model *prev=cov->calling; assert(prev != NULL); if (prev->key != NULL) prev->key = cov; else if (prev->sub[0] != NULL) prev->sub[0] = cov; else if (prev->sub[1] != NULL) prev->sub[1] = cov; else ERR("structure mismatch"); // APMI(cov); // printf("\n"); //PMI(pts); // printf("%f %f\n", PARAM(pts, 1)[0] *PARAM(pts, 1)[1] * 4 , pts->mpp.mMplus[0]); //assert(FABS(PARAM(pts, 1)[0] *PARAM(pts, 1)[1] * 4 - pts->mpp.mMplus[0]) < 1e-14 * pts->mpp.mMplus[0]); // PMI(save_pts); //APMI(pts); DORANDOM(pts, cov->q); // cov->q ist hier nur dummy // if (!newshape) printf("failed\n"); //printf("old %f %f %f\n", (double) pgs->old_zhou, (double) pgs->totalmass, PARAM0(shape->sub[0], POWSCALE)); // assert(pgs->old_zhou == pgs->totalmass); // if (pgs->old_zhou > 1e6 && PARAM0(shape->sub[0], POWSCALE)>1) APMI(cov); // assert(shape->sub[0]->nr == POWER_DOLLAR && pts->nr == LOC); // assert(PARAM0(shape->sub[0], POWSCALE) == PARAM0(pts, LOC_SCALE)); // if (false) printf("//zhou %4.1f %4.3f %ld mean=%4.3f, shape=%s %f \n", (double) pgs->sum_zhou_c, pgs->totalmass, pgs->n_zhou_c, (double) pgs->sum_zhou_c / (double) pgs->n_zhou_c, NICK(shape->sub[0]), PARAM0(shape->sub[0], POWSCALE) ); // assert(pgs->n_zhou_c <= 500); } i = DrawCathegory(pgs->size, single, total, loc->grid, &elmts); if (flat) for (d=0; dxgr[d][XSTEP] * UNIFORM_RANDOM - halfstepvector[d]; } else { // printf("here %f %f %f\n", x[0], x[1], x[2]); // double xx[3]; /* print */ // xx[0] = xx[1] = 0.5; xx[2] = RF_INF; bad // xx[0] = 0.5; xx[1] = xx[2] = RF_INF; badd // xx[0] = xx[1] = xx[2] = RF_INF; ok //xx[0] = 0.5; xx[1] = xx[2] = RF_INF; VTLG_R2SIDED(NULL, x, pts, v); } // v[0] = (2 * UNIFORM_RANDOM - 1) * PARAM0(shape->sub[0], POWSCALE) ; // v[1] = (2 * UNIFORM_RANDOM - 1) * PARAM0(shape->sub[0], POWSCALE); // v[2] = (2 * UNIFORM_RANDOM - 1) * PARAM0(shape->sub[0], POWSCALE); // if (v[0] * v[0] + v[1] * v[1] + v[2] * v[2] > 0.1001 * 0.1001 * 2) // printf("i=%d %f %f %f v=%f %f %f\n", i, x[0], x[1], x[2], v[0], v[1], v[2]); // APMI(cov); //printf("i=%d %f %f v=%f %f\n", i, x[0], x[1], v[0], v[1]); for (d=0; dq[d] = loc->xgr[d][XSTART] + v[d]; // // printf("q=%f %f %f %d\n", cov->q[d], loc->xgr[d][XSTART], v[d], flat); //APMI(pts->calling); if (R_FINITE(x[d])) { int len = (int) loc->xgr[d][XLENGTH] - 1, nr = elmts % len; elmts /= len; cov->q[d] += loc->xgr[d][XSTEP] * (nr + (v[d] > 0.0)); // simuliert von VTLF_R2SIDED ist die abgeschnittene Dichte symmetrisch // um 0; in Ursprung muss die Dichtekurve aufgeschnitten werden und // versetzt wieder zusammengesetzt werden, so dass in der Mitte i.a. // der kleinste Werte ist und aussen die groessten, ehemaligen Werte // in der Naehe des Ursprungs. Dies bewirkt gerade (v>0) und "+ v" } else { if (v[d] > 0.0) cov->q[d] += loc->xgr[d][XSTEP] * (loc->xgr[d][XLENGTH] - 1.0); // dichte function der pts muss "zerschnitten" werden; der negative // Teil wird vor den Beginn des Gitters gesetzt, der positive Teil // ans Ende des Gitters. Somit immer "+v", nie "-v"; // loc->xgr[0][XSTEP] * (loc->xgr[0][XLENGTH] - 1.0) schiebt den // Punkt ans Ende des Gitters. x[d] = v[d]; } // printf("D=%d %f %f %d\n", d, cov->q[d], v[d], elmts); } if (flat) for (d = 0; dnr].logD != ErrCov) { // printf("log!\n"); VTLG_DLOG(v, pts, &(pgs->log_density)); // hier muss allgemein die nicht-normierte Dichte stehen und stattdessen durch das Mittel des Volumens geteilt werden //printf("log density v=%f, %f, %f %e\n", v[0],v[1],v[2], pgs->log_density); //printf("log_dens %f\n", pgs->log_density); // pgs->log_density -= LOG(pgs->totalmass); // ueberprueft: normierung // zu einer WK'Dichte. } else { double density; VTLG_D(v, pts, &density); // printf("dens %f\n", density); // printf("density %e v=%f %f %f\n", density, v[0], v[1], v[2]); pgs->log_density = LOG(density); } if (!R_FINITE(pgs->log_density)) { //PMI(cov); BUG; } //assert(pgs->log_density == 0); // PMI(cov); } void do_pts_given_shape(cov_model *cov, gen_storage *S) { // muss zu allerst stehen, da cov sich aendern kann! if (cov->role == ROLE_POISSON_GAUSS) { do_pgs_gauss(cov, S); } else if (hasMaxStableRole(cov)) { // todo: sauber trennen, wann do_pgs_maxstable(cov, S); } else { PMI(cov); BUG; // } // do_gs_maxstable might break links of the cov structure: cov_model *prev=cov->calling; assert(prev != NULL); if (prev->key != NULL) cov = prev->key; else if (prev->sub[0] != NULL) cov = prev->sub[0]; else if (prev->sub[1] != NULL) cov = prev->sub[1]; else ERR("structure mismatch"); cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; pgs_storage *pgs = cov->Spgs; int d, dim = shape->xdimprev; double eps, *x = pgs->x, *y = pgs->y; if (cov->role == ROLE_POISSON_GAUSS) { eps = GLOBAL.mpp.about_zero * EXP(pgs->log_density); } else if (hasMaxStableRole(cov)) { // todo: sauber trennen, wann // max-stable, smith etc eps = pgs->currentthreshold; //printf("eps= %f\n", eps); if (!R_FINITE(pgs->log_density)) { //PMI(cov->Spgs->cov); PMI(cov); BUG; } if (cov->loggiven) eps += pgs->log_density; else eps *= EXP(pgs->log_density); } else BUG; //printf("here %f %d\n", eps, cov->loggiven); // APMI(cov); if (cov->loggiven) { NONSTATLOGINVERSE(&eps, shape, x, y); } else NONSTATINVERSE(&eps, shape, x, y); // assert(false); // warum fkt obiges nicht bei gauss?? // PMI(shape); //printf("eps=%f x=%f %d %f %f\n", eps, *x, cov->loggiven, // // pgs->currentthreshold, pgs->log_density); if (ISNAN(x[0]) || x[0] > y[0]) { //double eps_neu = eps / cov->mpp.maxheights[0]; // warum ?? 29.12.2013 double eps_neu = eps; // 29.12.2013 if (cov->loggiven) { BUG; } else NONSTATINVERSE_D(&eps_neu, pts, x, y); if (ISNAN(x[0]) || x[0] > y[0]) BUG; //printf("eps=%f %f %f x=(%e %e %e) y=(%e %e %e) q=(%f %f %f)\n", // eps, pgs->currentthreshold, EXP(pgs->log_density), // x[0], x[1], x[2], y[0], y[1], y[2], // cov->q[0], cov->q[1], cov->q[2]); } // printf("Xx=%f %d %d %f %f\n", *x, ISNAN(x[0]),cov->loggiven, pgs->currentthreshold, pgs->log_density); //APMI(cov); for (d=0; dsupportmin[d] = cov->q[d] - y[d]; // 4 * for debugging... pgs->supportmax[d] = cov->q[d] - x[d]; // printf("do d=%d q=%f x=%f y=%f eps=%e thr=%e %f %f\n", // d, cov->q[d], x[d], y[d], eps, pgs->currentthreshold, pgs->supportmin[d], pgs->supportmax[d]); if (ISNAN(pgs->supportmin[d]) || ISNAN(pgs->supportmax[d]) || pgs->supportmin[d] > pgs->supportmax[d]) { // printf("do d=%d q=%f min=%f max=%f eps=%e thr=%e supp=(%e, %e)\n", d, cov->q[d], x[d], y[d], eps, pgs->currentthreshold, pgs->supportmin[d], pgs->supportmax[d]); // APMI(shape); // BUG; } //assert(pgs->supportmin[d] <= pgs->supportmax[d]); } // assert(false); // BUG; // APMI(cov); cov->fieldreturn = shape->fieldreturn; cov->origrf = false; } void range_pts_given_shape(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { range->min[PGS_RATIO] = 0; range->max[PGS_RATIO] = 1; range->pmin[PGS_RATIO] = 0; range->pmax[PGS_RATIO] = 1; range->openmin[PGS_RATIO] = false; range->openmax[PGS_RATIO] = false; range->min[PGS_FLAT] = -1; range->max[PGS_FLAT] = 1; range->pmin[PGS_FLAT] = -1; range->pmax[PGS_FLAT] = 1; range->openmin[PGS_FLAT] = false; range->openmax[PGS_FLAT] = false; range->min[PGS_INFTY_SMALL] = 0; range->max[PGS_INFTY_SMALL] = 1; range->pmin[PGS_INFTY_SMALL] = 0; range->pmax[PGS_INFTY_SMALL] = 1; range->openmin[PGS_INFTY_SMALL] = false; range->openmax[PGS_INFTY_SMALL] = false; range->min[PGS_NORMED] = 0; range->max[PGS_NORMED] = 1; range->pmin[PGS_NORMED] = 0; range->pmax[PGS_NORMED] = 1; range->openmin[PGS_NORMED] = false; range->openmax[PGS_NORMED] = false; range->min[PGS_ISOTROPIC] = 0; range->max[PGS_ISOTROPIC] = 1; range->pmin[PGS_ISOTROPIC] = 0; range->pmax[PGS_ISOTROPIC] = 1; range->openmin[PGS_ISOTROPIC] = false; range->openmax[PGS_ISOTROPIC] = false; } #define STAT_SHAPE_FCT 0 void stationary_shape(double *x, cov_model *cov, double *v) { cov_model *shape = cov->sub[STAT_SHAPE_FCT]; FCTN(x, shape, v); // if (cov->q[0] < 1) { // printf("x=%f q=%f v=%f\n", x[0], cov->q[0], v[0]); // assert(false); // } // APMI(cov); } void logstationary_shape(double *x, cov_model *cov, double *v, double *Sign) { cov_model *shape = cov->sub[STAT_SHAPE_FCT]; LOGCOV(x, shape, v, Sign); } int check_stationary_shape(cov_model *cov) { cov_model *shape = cov->sub[STAT_SHAPE_FCT]; int err, role, dim = cov->tsdim; ASSERT_CARTESIAN; if (cov->xdimprev != cov->xdimown || cov->xdimprev != cov->tsdim) return ERRORDIM; if (cov->role == ROLE_GAUSS) { role = isGaussProcess(shape) ? ROLE_GAUSS : shape->nr == BINARYPROC ? ROLE_GAUSS : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(shape); } else if (hasPoissonRole(cov)) { role = ROLE_POISSON; } else if (hasMaxStableRole(cov)) { role = ROLE_MAXSTABLE; } else ILLEGAL_ROLE; //printf("here\n"); if ((err = CHECK(shape, dim, dim, ProcessType, XONLY, CARTESIAN_COORD, SCALAR, role)) != NOERROR) return err; setbackward(cov, shape); return NOERROR; } int struct_stationary_shape(cov_model *cov, cov_model **newmodel){ cov_model *shape = cov->sub[STAT_SHAPE_FCT]; // location_type *loc = Loc(cov); ASSERT_NEWMODEL_NULL; if (shape->role != ROLE_POISSON && shape->role != ROLE_MAXSTABLE) ILLEGAL_ROLE; //printf("here\n"); return NOERROR; } int init_stationary_shape(cov_model *cov, gen_storage *S) { cov_model *shape = cov->sub[STAT_SHAPE_FCT]; int d, i, err = NOERROR, dim = shape->xdimprev; //PMI(cov); assert(dim == Loc(cov)->timespacedim); if ((err = alloc_pgs(cov)) != NOERROR) return err; pgs_storage *pgs = cov->Spgs; // selbst wenn zufaelliger Shape: 1x laufen lassen, ob // Fehler auftauchen. Unter "Do" lassen sie sich nicht mehr // schoen abfangen. assert(cov->mpp.moments >= 1); if ((err = INIT(shape, 1, S)) != NOERROR) { return err; //gatter? } assert(shape->mpp.moments >= 1); for (i=0; i<=cov->mpp.moments; i++) { cov->mpp.mM[i] = shape->mpp.mM[i]; cov->mpp.mMplus[i] = shape->mpp.mMplus[i]; } pgs->zhou_c = 1.0 / cov->mpp.mMplus[1]; // passt fuer binary, und auch fuer if (!R_FINITE(pgs->zhou_c)) SERR1("max height of '%s' not finite", NICK(shape)); pgs->estimated_zhou_c = false; if (!cov->deterministic) SERR("not deterministic shapes in stationary modelling -- please contact author"); pgs->log_density = 0; // printf("dims %d %d\n", cov->xdimown, shape->xdimprev); for (d=0; dsupportmin[d] = RF_NEGINF; // 4 * for debugging... pgs->supportmax[d] = RF_INF; } cov->mpp.maxheights[0] = shape->mpp.maxheights[0]; cov->rf = shape->rf; cov->origrf = false; cov->fieldreturn = shape->fieldreturn; if (!cov->fieldreturn) BUG; // APMI(cov); return NOERROR; } void do_stationary_shape(cov_model *cov, gen_storage *S) { cov_model *shape = cov->sub[STAT_SHAPE_FCT]; DO(shape, S); cov->mpp.maxheights[0] = shape->mpp.maxheights[0]; assert(shape->fieldreturn); } void standard_shape(double *x, cov_model *cov, double *v) { cov_model *shape = cov->sub[PGS_FCT]; NONSTATCOV(x, cov->q, shape, v); } void logstandard_shape(double *x, cov_model *cov, double *v, double *Sign) { cov_model *shape = cov->sub[PGS_FCT]; LOGNONSTATCOV(x, cov->q, shape, v, Sign); } int check_standard_shape(cov_model *cov) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; int err, role, dim = cov->tsdim; ASSERT_CARTESIAN; if (cov->q == NULL) QALLOC(dim); if (cov->xdimprev != cov->xdimown || cov->xdimprev != cov->tsdim) return ERRORDIM; if (hasPoissonRole(cov)) { role = ROLE_POISSON; } else if (hasMaxStableRole(cov)) { role = ROLE_MAXSTABLE; } else ILLEGAL_ROLE; if ((err = CHECK(shape, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, SCALAR, role)) != NOERROR) return err; setbackward(cov, shape); if (!shape->deterministic) SERR1("random shapes for '%s' not allowed yet", NICK(cov)); if (pts != NULL) { if ((err = CHECK_R(pts, dim)) != NOERROR) return err; } return NOERROR; } int struct_standard_shape(cov_model *cov, cov_model **newmodel){ cov_model *shape = cov->sub[PGS_FCT]; // int err = NOERROR; //dim = shape->xdimprev; // printf("ttt\n"); ASSERT_NEWMODEL_NULL; if (shape->role != ROLE_POISSON && shape->role != ROLE_MAXSTABLE) ILLEGAL_ROLE; // printf("here %s\n", NICK(cov->sub[PGS_LOC])); // APMI(cov); //if ((err = CHECK_R(cov->sub[PGS_LOC], cov->tsdim)) != NOERROR) return err; return NOERROR; } int init_standard_shape(cov_model *cov, gen_storage *S) { cov_model *shape = cov->sub[PGS_FCT]; // location_type *loc = Loc(cov); //APMI(cov); assert(cov->sub[PGS_LOC] != NULL); location_type *loc = Loc(cov); int d, dim = shape->xdimprev, err = NOERROR; pgs_storage *pgs = cov->Spgs; //APMI(cov); assert(shape->xdimprev == Loc(cov)->timespacedim); if (pgs == NULL) { if ((err = alloc_pgs(cov)) != NOERROR) return err; pgs = cov->Spgs; if ((pgs->localmin = (double*) CALLOC(dim, sizeof(double))) == NULL || (pgs->localmax = (double*) CALLOC(dim, sizeof(double))) == NULL || (pgs->minmean = (double*) CALLOC(dim, sizeof(double))) == NULL || (pgs->maxmean = (double*) CALLOC(dim, sizeof(double))) == NULL) return ERRORMEMORYALLOCATION; } // selbst wenn zufaelliger Shape: 1x laufen lassen, ob // Fehler auftauchen. Unter "Do" lassen sie sich nicht mehr // schoen abfangen. // ROLE_ASSERT(ROLE_POISSON || cov->role == ROLE_MAXSTABLE); assert(cov->mpp.moments == hasMaxStableRole(cov)); if ((err = INIT(shape, cov->mpp.moments, S)) != NOERROR) return err; //gatter? cov_model *u = cov->sub[PGS_LOC]; //PMI(cov); assert(u->nr == UNIF); double *min = PARAM(u, UNIF_MIN), *max = PARAM(u, UNIF_MAX), *x = pgs->minmean, // !! wird gespeichert *y = pgs->maxmean; // !! // try out whether it works: NONSTATINVERSE(ZERO, shape, x, y); if (ISNAN(x[0]) || x[0] > y[0]) SERR1("inverse of '%s' unknown", NICK(shape)); GetDiameter(loc, pgs->localmin, pgs->localmax, pgs->supportcentre); // last is only a dummy pgs->totalmass = 1.0; // PMI(cov); printf("d=%d", dim); for (d=0; dlocalmin[d] - y[d]; max[d] = pgs->localmax[d] - x[d]; if (!(R_FINITE(min[d]) && R_FINITE(max[d]))) SERR1("simulation window does not have compact support. Should '%s' be used?", CovList[TRUNCSUPPORT].nick); pgs->totalmass *= max[d] - min[d]; } if (cov->role == ROLE_POISSON) { pgs->log_density = 0.0; } else { pgs->log_density = 0.0; pgs->zhou_c = pgs->totalmass / shape->mpp.mMplus[1]; cov->mpp.maxheights[0] = shape->mpp.maxheights[0]; pgs->estimated_zhou_c = !cov->deterministic; if (pgs->estimated_zhou_c) SERR("random shapes in standard approach not coded yet -- please contact author"); } cov->rf = shape->rf; cov->origrf = false; cov->fieldreturn = shape->fieldreturn; // APMI(cov); return NOERROR; } void do_standard_shape(cov_model *cov, gen_storage *S) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; assert(cov->sub[PGS_LOC] != NULL); pgs_storage *pgs = cov->Spgs; double *x = pgs->x, *y = pgs->xstart; int d, dim = shape->xdimprev; DO(shape, S); DORANDOM(pts, cov->q); //printf("q=%f\n", cov->q[0]); // APMI(cov->calling); assert(!shape->fieldreturn); //PMI(shape, "standard"); NONSTATINVERSE(ZERO, shape, x, y); if (ISNAN(x[0])|| x[0] > y[0]) BUG; for (d=0; dq[d], x[d], y[d], pgs->currentthreshold); pgs->supportmin[d] = cov->q[d] - y[d]; // 4 * for debugging... pgs->supportmax[d] = cov->q[d] - x[d]; assert(pgs->supportmin[d] != NA_INTEGER && pgs->supportmax[d] != NA_INTEGER); assert(pgs->supportmin[d] <= pgs->supportmax[d]); } pgs->log_density = 0.0; } void mcmc_pgs(double VARIABLE_IS_NOT_USED *x, cov_model VARIABLE_IS_NOT_USED *cov, double VARIABLE_IS_NOT_USED *v) { } void logmcmc_pgs(double *x, cov_model *cov, double *v, double *Sign) { cov_model *shape = cov->sub[PGS_FCT]; LOGNONSTATCOV(x, cov->q, shape, v, Sign); // printf("x = %f %f log=%f\n", *x, cov->q[0], *v, *Sign); } int check_mcmc_pgs(cov_model *cov) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; location_type *loc = Loc(cov); int err, role, dim = cov->tsdim; ASSERT_CARTESIAN; if (loc->Time) SERR("Time component not allowed yet"); // todo kdefault(cov, PGS_RATIO, GLOBAL.extreme.density_ratio); kdefault(cov, PGS_FLAT, GLOBAL.extreme.flat); kdefault(cov, PGS_INFTY_SMALL, !PINT(PGS_FLAT)); kdefault(cov, PGS_NORMED, true); kdefault(cov, PGS_ISOTROPIC, true); //PMI(cov, "checking"); if ((err = checkkappas(cov)) != NOERROR) return err; if (cov->q == NULL) QALLOC(dim); if (cov->xdimprev != cov->xdimown || cov->xdimprev != cov->tsdim) return ERRORDIM; if (cov->role == ROLE_GAUSS) { role = isShape(shape) ? cov->role //Marco, 29.5.13 : isGaussProcess(shape) ? ROLE_GAUSS : shape->nr == BINARYPROC ? ROLE_GAUSS : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(shape); } else if (hasPoissonRole(cov)) { role = ROLE_POISSON; } else if (hasMaxStableRole(cov)) { role = ROLE_MAXSTABLE; } else ILLEGAL_ROLE; // printf("here %d\n"); // isotropy is the property -- user should not define unisotropic functions! // so !isotropic only for special, internal definitions, e.g. // strokorbPoly // int err2 = NOERROR; // if (P0INT(PGS_ISOTROPIC)) // err2 = CHECK(shape, dim, dim, ShapeType, XONLY, ISOTROPIC, // SCALAR, role); // printf("here2\n"); // PMI(shape); // but it must be treated in any case as if it was non-isotropic if ((err = CHECK(shape, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, SCALAR, role)) != NOERROR) { if (P0INT(PGS_ISOTROPIC)) BUG; XERR(err); return err; } // if (err2 != NOERROR) SERR("isotropic shape function expected."); setbackward(cov, shape); //if (!shape->deterministic) return ERRORNOTPROGRAMMED; // Dichte muss nicht normiert sein und stattdessen durch das mittlere Volumen dividiert werden. if (pts != NULL) { //printf("pts %s %s\n", CovList[pts->nr + 1].nick, CovList[pts->nr + 1].name); //PMI(pts); // assert(dim == 2); print("x"); // printf("dim=%d\n", dim); // APMI(pts); if ((err = CHECK_R(pts, dim)) != NOERROR) return err; } // printf("done\n"); return NOERROR; } int struct_mcmc_pgs(cov_model VARIABLE_IS_NOT_USED *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){ // cov_model *shape = cov->sub[PGS_FCT]; // location_type *loc = Loc(cov); // int err = NOERROR; ASSERT_NEWMODEL_NULL; return NOERROR; } int init_mcmc_pgs(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S) { cov_model *shape = cov->sub[PGS_FCT], *pts = cov->sub[PGS_LOC]; // cov_fct *Cshape = CovList + shape->nr; //location_type *loc = Loc(cov); int i, //dim = shape->xdimprev, err = NOERROR; // pgs_storage *pgs = cov->Spgs; // bool // grid = Loc(cov)->grid, // pgsnull = pgs == NULL; //PMI(cov); for (i=0; i<=cov->mpp.moments; i++) { // printf("%d %f %f %d\n", i, pts->mpp.mM[i], shape->mpp.mMplus[i], cov->mpp.moments); //assert(pts->mpp.mMplus[0] == 1.0); cov->mpp.mM[i] = shape->mpp.mM[i] * pts->mpp.mMplus[0]; cov->mpp.mMplus[i] = shape->mpp.mMplus[i] * pts->mpp.mMplus[0]; } cov->rf = shape->rf; cov->origrf = false; // APMI(cov); return err; } void do_mcmc_pgs(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *S) { } void range_mcmc_pgs(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { range->min[PGS_RATIO] = 0; range->max[PGS_RATIO] = 1; range->pmin[PGS_RATIO] = 0; range->pmax[PGS_RATIO] = 1; range->openmin[PGS_RATIO] = false; range->openmax[PGS_RATIO] = false; range->min[PGS_FLAT] = -1; range->max[PGS_FLAT] = 1; range->pmin[PGS_FLAT] = -1; range->pmax[PGS_FLAT] = 1; range->openmin[PGS_FLAT] = false; range->openmax[PGS_FLAT] = false; range->min[PGS_INFTY_SMALL] = 0; range->max[PGS_INFTY_SMALL] = 1; range->pmin[PGS_INFTY_SMALL] = 0; range->pmax[PGS_INFTY_SMALL] = 1; range->openmin[PGS_INFTY_SMALL] = false; range->openmax[PGS_INFTY_SMALL] = false; range->min[PGS_NORMED] = 0; range->max[PGS_NORMED] = 1; range->pmin[PGS_NORMED] = 0; range->pmax[PGS_NORMED] = 1; range->openmin[PGS_NORMED] = false; range->openmax[PGS_NORMED] = false; range->min[PGS_ISOTROPIC] = 0; range->max[PGS_ISOTROPIC] = 1; range->pmin[PGS_ISOTROPIC] = 0; range->pmax[PGS_ISOTROPIC] = 1; range->openmin[PGS_ISOTROPIC] = false; range->openmax[PGS_ISOTROPIC] = false; } RandomFields/src/direct.cc0000644000176200001440000001475113074763020015203 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Simulation of a random field by Cholesky or SVD decomposition Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include #include #include "RF.h" #include "shape_processes.h" #include "Coordinate_systems.h" #include "variogramAndCo.h" //#include bool debug=false; int check_directGauss(cov_model *cov) { #define nsel 4 cov_model *next=cov->sub[0]; location_type *loc = Loc(cov); int j, err ; // taken[MAX DIM], ROLE_ASSERT(ROLE_GAUSS); if ((err = checkkappas(cov, false)) != NOERROR) return err; if ((cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) && (!loc->distances || cov->xdimprev!=1)) { return ERRORDIM; } int jj, isotropy[2], endjj = 0; if (!isCartesian(cov->isoown)) isotropy[endjj++] = cov->isoown; else isotropy[endjj++] = SymmetricOf(cov->isoown); Types type[2] = {PosDefType, VariogramType}; for (jj=0; jjisoown == EARTH_COORD); if ((err = CHECK(next, cov->tsdim, cov->xdimprev, type[j], KERNEL, isotropy[jj], SUBMODEL_DEP, ROLE_COV)) == NOERROR) break; } if (err == NOERROR) break; } if (err != NOERROR) return err; if (next->pref[Direct] == PREF_NONE) return ERRORPREFNONE; setbackward(cov, next); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov)) != NOERROR) return err; return NOERROR; } void range_direct(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { GAUSS_COMMON_RANGE; } int init_directGauss(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S) { cov_model *next = cov->sub[0]; double //*xx, *Cov=NULL; int err = NOERROR, maxvariab = GLOBAL.direct.maxvariables; int dim=cov->tsdim; direct_storage* s=NULL; location_type *loc = Loc(cov); // bool storing = GLOBAL.internal.stored_init; // // nonstat_covfct cf; long vdim = cov->vdim[0], locpts = loc->totalpoints, // loctot = locpts *dim, vdimtot = vdim * locpts, // vdimSqtot = vdim * vdimtot, // vdimtotSq = vdimtot * locpts, vdimSqtotSq = vdimtot * vdimtot; ROLE_ASSERT_GAUSS; EXT_NEW_STORAGE(solve); assert(cov->vdim[0] == cov->vdim[1]); cov->method = Direct; if ((err = alloc_cov(cov, dim, vdim, vdim)) != NOERROR) return err; // printf("vdimdot %d\n", vdimtot); // printf("%s \n", KNAME(DIRECT_MAXVAR)); if (vdimtot > maxvariab) { GERR4(" '%s' valid only for less than or equal to '%s'=%d data. Got %ld data.", NICK(cov), direct[DIRECT_MAXVAR_PARAM],maxvariab, vdimtot); } //printf("vdim = %d %d %d %d\n", vdim, locpts, vdimtot, vdimSqtotSq); // PMI(cov); if ((Cov =(double *) MALLOC(sizeof(double) * vdimSqtotSq))==NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } NEW_STORAGE(direct); s = cov->Sdirect; /* ********************* */ /* matrix creation part */ /* ********************* */ CovarianceMatrix(next, Cov); assert(R_FINITE(Cov[0])); //PMI(cov->calling->calling->calling->calling); if (false) { long i,j; PRINTF("\n"); for (i=0; iSsolve); // err = RU_sqrtPosDefFree(Cov, vdimtot, cov->Ssolve); if (err != NOERROR) { RU_getErrorString(ERRORSTRING); goto ErrorHandling; } if ((err = FieldReturn(cov)) != NOERROR) goto ErrorHandling; if ( (s->G = (double *) CALLOC(vdimtot + 1, sizeof(double))) == NULL) { err=ERRORMEMORYALLOCATION; } ErrorHandling: // and NOERROR... // Free(Cov); //printf("init sqrtPosDef emthod %d err=%d\n", cov->Ssolve->method, err); return err; } void do_directGauss(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S) { location_type *loc = Loc(cov); direct_storage *s = cov->Sdirect; long locpts = loc->totalpoints, vdim = cov->vdim[0], vdimtot = locpts * vdim; double *G = NULL, //*U = NULL, *res = cov->rf; // bool vdim_close_together = GLOBAL.general.vdim_close_together; // printf("do sqrtPosDef emthod %d\n", cov->Ssolve->method); SAVE_GAUSS_TRAFO; G = s->G;// only the memory space is of interest (stored to avoid // allocation errors here) for (int i=0; iSsolve, G, res); //res[0]res[1]=res[2]=1; // printf("done vdimtot = %d\n", vdimtot); //for (int i=0; i #include #include "Local.h" #include "basic.h" #include "convhull2D.h" int ccw(double **P, int i, int j, int k) { double a = P[i][0] - P[j][0], b = P[i][1] - P[j][1], c = P[k][0] - P[j][0], d = P[k][1] - P[j][1]; return a*d - b*c <= 0; /* true if points i, j, k counterclockwise */ } int cmpl(const void *a, const void *b) { double v; v = (*(double**)a)[0] - (*(double**)b)[0]; if (v>0) return 1; if (v<0) return -1; v = (*(double**)b)[1] - (*(double**)a)[1]; if (v>0) return 1; if (v<0) return -1; return 0; } int cmph(const void *a, const void *b) {return cmpl(b,a);} int make_chain(double** V, int n, int (*cmp)(const void*, const void*)) { int i, j, s = 1; double* t; QSORT(V, n, sizeof(double*), cmp); for (i=2; i=1 && ccw(V, i, j, j-1); j--){} s = j+1; t = V[s]; V[s] = V[i]; V[i] = t; } return s; } int ch2d(double **P, int n) { int u = make_chain(P, n, cmpl); /* make lower hull */ if (!n) return 0; P[n] = P[0]; return u+make_chain(P+u, n-u+1, cmph); /* make upper hull */ } RandomFields/src/gausslikeli.cc0000644000176200001440000014723413074763020016250 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Definition of correlation functions and derivatives of hypermodels Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "RF.h" #include "Operator.h" #include "shape_processes.h" #include "variogramAndCo.h" #include "Coordinate_systems.h" // *sub = cov->key == NULL ? cov->sub[0] : cov->key; #define START_GAUSS_INTERFACE \ currentRegister = INTEGER(model_reg)[0]; \ if (currentRegister < 0 || currentRegister > MODEL_MAX) BUG; \ cov_model *cov = KEY[currentRegister]; \ if (cov == NULL || !isInterface(cov)) BUG; \ cov = cov->key != NULL ? cov->key : cov->sub[0]; \ if (!isProcess(cov)) BUG; \ if (cov->nr != GAUSSPROC) \ ERR("register not initialised as Gaussian likelihood"); \ cov_model *prev = cov->calling; \ if (prev == NULL || \ (prev->nr != LIKELIHOOD_CALL && prev->nr != LINEARPART_CALL) \ ) BUG; \ likelihood_storage *L = cov->Slikelihood; \ if (L == NULL) ERR("register not initialised as likelihood method");\ int store = GLOBAL.general.set; int matrixcopyNA(double *dest, double *src, double *cond, int rows, int cols, int append_cond) { int k = 0; double *ptsrc = src; for (int j=0; j MAXGAUSSVDIM) ERR2("multi-dimensionality, %d, exceeds maximum, %d", vdim, MAXGAUSSVDIM); if (length(res) != pts * vdim * repet) ERR("multi-dimensionality incorrect"); if (length(boxcox) < 2 * vdim) ERR("too few entries in 'boxcox'"); if (LOGICAL(inverse)[0]) boxcox_inverse(REAL(boxcox), vdim, REAL(res), pts, repet); else boxcox_trafo(REAL(boxcox), vdim, REAL(res), pts, repet); return R_NilValue; } SEXP gauss_linearpart(SEXP model_reg, SEXP Set){ START_GAUSS_INTERFACE; #define ll 3 const char *names[ll] = {"Y", "X", "vdim"}; SEXP ans, namevec, X, Y; int unp = 4, // ans, namevec, X, Y sets = L->sets, element = INTEGER(Set)[0], vdim = cov->vdim[0], betatot = L->betas[L->fixedtrends]; if (element > 0 && element > sets) ERR("set number out of range"); PROTECT(ans = allocVector(VECSXP, ll)); PROTECT(namevec = allocVector(STRSXP, ll)); for (int k=0; kYhatWithoutNA[GLOBAL.general.set], totptsvdim * sizeof(double)); SET_VECTOR_ELT(Y, GLOBAL.general.set, partY); UNPROTECT(1); if (L->fixedtrends) { PROTECT(partX = allocMatrix(REALSXP, totptsvdim, betatot)); MEMCOPY(REAL(partX), L->X[GLOBAL.general.set], totptsvdim * betatot * sizeof(double)); SET_VECTOR_ELT(X, GLOBAL.general.set, partX); UNPROTECT(1); } else { SET_VECTOR_ELT(ans, GLOBAL.general.set, R_NilValue); } } } else { GLOBAL.general.set = element - 1; int totptsvdim = Gettotalpoints(cov) * vdim; PROTECT(Y = allocVector(REALSXP, totptsvdim)); MEMCOPY(REAL(Y), L->YhatWithoutNA[GLOBAL.general.set], totptsvdim * sizeof(double)); if (L->fixedtrends) { PROTECT(X = allocMatrix(REALSXP, totptsvdim, betatot)); MEMCOPY(REAL(X), L->X[GLOBAL.general.set], totptsvdim * betatot * sizeof(double)); } else { X = R_NilValue; unp--; } } int k=0; SET_VECTOR_ELT(ans, k++, Y); SET_VECTOR_ELT(ans, k++, X); SET_VECTOR_ELT(ans, k++, ScalarInteger(vdim)); assert(k == ll); setAttrib(ans, R_NamesSymbol, namevec); UNPROTECT(unp); GLOBAL.general.set = store; return ans; } void get_logli_residuals(cov_model *cov, double *work, double *ans) { assert(isProcess(cov)); likelihood_storage *L = cov->Slikelihood; assert(L != NULL); listoftype *datasets = L->datasets; assert(datasets != NULL); assert(ans != NULL); int vdim = cov->vdim[0], betas = L->betas[L->fixedtrends], ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, nrow = NROW_OUT_OF(datasets), ndata = nrow * ncol, totptsvdim = nrow * vdim; double *X = L->X[GLOBAL.general.set], *pres = ans, *data = SET_OUT_OF(datasets); MEMCOPY(pres, data, ndata * sizeof(double)); if (R_FINITE(P(GAUSS_BOXCOX)[0]) && R_FINITE(P(GAUSS_BOXCOX)[1])) boxcox_trafo(P(GAUSS_BOXCOX), vdim, pres, nrow, repet); // for (int i=0; iignore_trend, L->dettrends, L->fixedtrends, vdim); if (L->ignore_trend) { return; } bool delete_work; if ((delete_work = work == NULL)) { work = (double *) MALLOC(nrow * vdim * sizeof(double)); } double *betavec = L->betavec; int r, z; if (L->dettrends) { for (int i=0; idettrends; i++) { if (L->nas_det[i]) { FctnIntern(cov, L->cov_det[i], L->cov_det[i], work, true); for (z=r=0; rYhatWithoutNA[GLOBAL.general.set][k]; } if (L->fixedtrends) { for (r=0; rbetas_separate) { for (int i=0; iSlikelihood; listoftype *datasets = L->datasets; int vdim = cov->vdim[0], sets = GET_LOC_SETS(cov); bool matrix = false; SEXP all_res, res; assert(!L->betas_separate || sets == 1); int max = 0; for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ int nrow = NROW_OUT_OF(datasets), totptsvdim = nrow * vdim; if (max < totptsvdim) max = totptsvdim; } if (L->work == NULL) L->work = (double*) MALLOC(max * sizeof(double)); PROTECT(all_res = allocVector(VECSXP, sets)); for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++) if ((matrix = NCOL_OUT_OF(datasets) > 1)) break; for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ int ncol = NCOL_OUT_OF(datasets), nrow = NROW_OUT_OF(datasets); if (matrix) { PROTECT(res = allocMatrix(REALSXP, nrow, ncol)); } else { PROTECT(res =allocVector(REALSXP, nrow)); } get_logli_residuals(cov, L->work, REAL(res)); SET_VECTOR_ELT(all_res, GLOBAL.general.set, res); UNPROTECT(1); } UNPROTECT(1); return all_res; } SEXP get_logli_residuals(SEXP model_reg) { START_GAUSS_INTERFACE; SEXP ans = get_logli_residuals(cov); GLOBAL.general.set = store; return ans; } void get_fx(cov_model *predict, cov_model *cov, double *v, int set) { // muss angenommen werden, dass alles gesetzt ist. likelihood_storage *L = cov->Slikelihood; int store = GLOBAL.general.set, sets = GET_LOC_SETS(predict); if (set < 0 || set >= sets) BUG; GLOBAL.general.set = set; listoftype *datasets = L->datasets; int err = NOERROR, betatot = L->betas[L->fixedtrends], vdim = cov->vdim[0], ncol = NCOL_OUT_OF(datasets), repet = L->betas_separate ? ncol / vdim : 1, pred_tot = Gettotalpoints(predict), predtotvdim = pred_tot * vdim, predtotvdimrepet = pred_tot * ncol; double *X = NULL; for (int k=0; kignore_trend) goto ErrorHandling; // exist if (!L->betas_separate && repet > 1) GERR("BUG"); if ((X = (double*) MALLOC(predtotvdim * sizeof(double))) == NULL) { // printf("%d %d \n", pred_tot, vdim); APMI(cov); err = ERRORMEMORYALLOCATION; goto ErrorHandling; } int r,m; for (int i=0; idettrends; i++) { FctnIntern(predict, L->cov_det[i], L->cov_det[i], X, true); for (r = m = 0; r < repet; r++) { for (int k=0; kdettrends){ for (z=r=0; rYhatWithoutNA[GLOBAL.general.set][k]; }*/ for (int i=0; ifixedtrends; i++) { FctnIntern(predict, L->cov_fixed[i], L->cov_fixed[i], X, true); if (L->betas[i+1] - L->betas[i] != 1) BUG; double *betavec = L->betavec + L->betas[i]; for (r = m = 0; r < repet; r++) { double beta = *betavec; //printf("beta = %f %f\n", beta, X[0]); BUG; for (int k=0; kbetas_separate) betavec += betatot; } } ErrorHandling : GLOBAL.general.set = store; FREE(X); if (err != NOERROR) XERR(err); } void get_F(cov_model *cov, double *work, double *ans) { assert(isProcess(cov)); likelihood_storage *L = cov->Slikelihood; assert(L != NULL); listoftype *datasets = L->datasets; assert(datasets != NULL); assert(ans != NULL); int vdim = cov->vdim[0], betas = L->betas[L->fixedtrends], ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, nrow = NROW_OUT_OF(datasets), // ndata = nrow * ncol, totptsvdim = nrow * vdim; double *X = L->X[GLOBAL.general.set], *pres = ans, *data = SET_OUT_OF(datasets); //MEMCOPY(pres, data, ndata * sizeof(double)); if (R_FINITE(P(GAUSS_BOXCOX)[0]) && R_FINITE(P(GAUSS_BOXCOX)[1])) boxcox_trafo(P(GAUSS_BOXCOX), vdim, pres, nrow, repet); // for (int i=0; iignore_trend, L->dettrends, L->fixedtrends, vdim); if (L->ignore_trend) { return; } bool delete_work; if ((delete_work = work == NULL)) { work = (double *) MALLOC(nrow * vdim * sizeof(double)); } double *betavec = L->betavec; int r, z; if (L->dettrends) { for (int i=0; idettrends; i++) { if (L->nas_det[i]) { FctnIntern(cov, L->cov_det[i], L->cov_det[i], work, true); for (z=r=0; rYhatWithoutNA[GLOBAL.general.set][k]; } if (L->fixedtrends) { for (r=0; rbetas_separate) { for (int i=0; ikey != NULL ? Cov->key : Cov->sub[0], // *sub = cov->key == NULL ? cov->sub[0] : cov->key, *pred_cov = predict->key != NULL ? predict->key : predict->sub[0]; //PMI(predict); assert(isProcess(cov) && isVariogram(cov->key == NULL ? cov->sub[0] : cov->key) && isInterface(predict)); likelihood_storage *L = cov->Slikelihood; assert(L != NULL); listoftype *datasets = L->datasets; int err = NOERROR, Exterr = NOERROR, store = GLOBAL.general.set, sets = GET_LOC_SETS(cov); if (sets != 1) ERR("only one data set allowed when predicting"); assert(cov->Ssolve != NULL); // APMI(predict); assert(predict->Sextra != NULL); location_type *loc = Loc(cov), *pred_loc = Loc(predict); assert(pred_loc != NULL && loc != NULL); GLOBAL.general.set = 0; int spatialdim = pred_loc->spatialdim, tsdim = pred_loc->timespacedim, vdim = cov->vdim[0], ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, totpts = Gettotalpoints(Cov), totptsvdim = totpts * vdim, // totvdimrepet = totpts * vdim * repet, pred_tot = Gettotalpoints(predict), pred_totvdim = pred_tot * vdim; double *residuals = NULL; if ((residuals = (double *) MALLOC(totvdimrepet * sizeof(double))) == NULL) { GLOBAL.general.set = store; XERR(ERRORMEMORYALLOCATION); } get_logli_residuals(cov, NULL, residuals); CovarianceMatrix(cov, L->C); // tot x tot x vdim x vdim //sub -> cov 30.12.15 if (GLOBAL.krige.ret_variance) { // GERR("kriging variance cannot be returned, currently"); // end !data_nas } else { ALLOCCOV_NEW(predict, Sextra, Cx0, vdim * vdim * pred_tot, a); ALLOCCOV_NEW(predict, Sextra, y0, tsdim, b); gauss_trend(predict, cov, v, 0); // not sub assert(cov->Ssolve != NULL); double *ResiWithoutNA, *Ccur; int atonce, endfor, notnas = NA_INTEGER; if (L->data_nas[GLOBAL.general.set]) { atonce = 1; Ccur = L->Cwork; ResiWithoutNA = L->Xwork; } else { notnas = totptsvdim; atonce = repet; Ccur = L->C; ResiWithoutNA = residuals; } endfor = repet / atonce; for (int r=0; rdata_nas[GLOBAL.general.set]) { double *resi = residuals + r * totptsvdim; notnas = matrixcopyNA(ResiWithoutNA, resi, resi, totptsvdim, 1, 0); SqMatrixcopyNA(Ccur, L->C, resi, totptsvdim); } //printf("********************\n"); Exterr = RU_solvePosDef(Ccur, notnas, true, // except for intrinsic Kriging // as if ordinary Kriging (p 167; 265 in Chiles ResiWithoutNA, atonce, NULL, cov->Ssolve); if (Exterr != NOERROR) goto ErrorHandling; double inc[MAXLILIGRIDDIM+1], x[MAXLILIGRIDDIM+1], xstart[MAXLILIGRIDDIM+1], *pt_locx = loc->x, *pty = y0; assert(pred_loc != NULL && loc != NULL); int d, gridlen[MAXLILIGRIDDIM + 1], end[MAXLILIGRIDDIM + 1], start[MAXLILIGRIDDIM + 1], nx[MAXLILIGRIDDIM + 1], Tidx = 0, Tlen = loc->Time ? loc->T[XLENGTH] : 0, pred_tsdim = pred_loc->timespacedim, tsxdim = tsdim, cumgridlen[MAXLILIGRIDDIM + 1]; if (tsdim > MAXLILIGRIDDIM) GERR("dimension too large"); if (loc->grid) { STANDARDSTART_X; pty = x; } for (int i=0; igrid) { if (loc->Time) { MEMCOPY(pty, pt_locx, spatialdim * sizeof(double)); pty[spatialdim] = loc->T[XSTART] + loc->T[XSTEP] * Tidx; Tidx = (Tidx + 1) % Tlen; if (Tidx == 0) pt_locx += spatialdim; } else { pty = pt_locx + spatialdim * i; } } if (pred_loc->grid) { for(d=0; dygr[d][XSTART] = pty[d]; } else { MEMCOPY(pred_loc->y, pty, pred_tsdim * sizeof(double)); if (pred_loc->Time) pred_loc->T[0] = pty[spatialdim]; } assert(pred_cov -> calling != NULL); CovList[pred_cov->nr].covariance(pred_cov, Cx0); // predtot x vdim^2; double *ptCx0 = Cx0; for (int j=0; jgrid) { // !! geklammert!!! STANDARDINKREMENT; } } } // end !data_nas } // for (int i=0; i<10; i++) printf("%f\n", v[i]); ErrorHandling : GLOBAL.general.set = store; FREE(residuals); if (Exterr != NOERROR) { if (Exterr == ERRORM) { RU_getErrorString(ERRORSTRING); ERR(ERRORSTRING); } else err = Exterr; } if (err != NOERROR) XERR(err); } ////////////////////////////////////////////////////////////////////// // Gauss process SEXP simple_residuals(SEXP model_reg){ START_GAUSS_INTERFACE; likelihood_info *info = &(L->info); if (L->ignore_trend) BUG; listoftype *datasets = L->datasets; if (info->globalvariance && info->pt_variance != NULL) *(info->pt_variance) = 1.0; int i, j, fx_notnas = 0, sets = GET_LOC_SETS(prev), err = NOERROR, Exterr = NOERROR, vdim = cov->vdim[0], betatot = L->betas[L->fixedtrends], betaSq = betatot * betatot; //if (cov->vdim[1] != 1) BUG; for (i=0; ifixedtrends; i++) fx_notnas += (!L->nas_fixed[i]) * (L->betas[i+1] - L->betas[i]); for (i=0; iXtX[i++] = 0.0); for (i=0; iXCY[i++] = 0.0); for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++) { // Gettotalpoints, Loc etc haengen alle von GLOBAL.general.set ab ! int k, m, ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, nrow = NROW_OUT_OF(datasets), ndata = nrow * ncol, totpts = Gettotalpoints(prev), totptsvdim = totpts * vdim; assert(nrow == totpts); double *Xdata = L->X[GLOBAL.general.set] + betatot * totptsvdim; if (L->dettrend_has_nas || L->nas_boxcox) { MEMCOPY(Xdata, SET_OUT_OF(datasets), ndata * sizeof(double)); if (L->nas_boxcox) boxcox_trafo(P(GAUSS_BOXCOX), vdim, Xdata, nrow, repet); } for (i=0; ifixedtrends; i++) { if (L->nas_fixed[i]) { double *Lx = L->X[GLOBAL.general.set] + L->betas[i] * totptsvdim, end = totptsvdim * (L->betas[i+1] - L->betas[i]); for (m=0; mrandom > 0) BUG; // to do double *Xcur, *dataWithoutNA = NULL; int atonce, endfor, notnas = NA_INTEGER; if (L->data_nas[GLOBAL.general.set]) { atonce = 1; Xcur = L->Xwork; } else { atonce = repet; Xcur = L->X[GLOBAL.general.set]; dataWithoutNA = Xdata; notnas = totptsvdim; } endfor = repet / atonce; for (int r=0; rdata_nas[GLOBAL.general.set]) { double *datacur = Xdata + r * totptsvdim; notnas = matrixcopyNA(Xcur, L->X[GLOBAL.general.set], datacur, totptsvdim, betatot, atonce); dataWithoutNA = Xcur + notnas * betatot; } if (L->fixedtrends) { matmulttransposed(Xcur, Xcur, L->XitXi, notnas, betatot, betatot); // bei simple residuals muessen alle spalten und Zeilen // mit nas_fixed raus: for (int i1=k=0; i1fixedtrends; i1++) { if (L->nas_fixed[i1] == 0) { int end_i = L->betas[i1 + 1]; for (int i2=L->betas[i1]; i2fixedtrends; j1++) { if (L->nas_fixed[j1] == 0) { int end_j = L->betas[j1 + 1]; for (int j2=L->betas[j1]; j2XtX[k++] += atonce * L->XitXi[idx]; } // j2 } } // j1 } // i2 } } // i1 MEMCOPY(L->sumY, dataWithoutNA, sizeof(double) * notnas); k = notnas; for (int rr=1; rrsumY[d] += dataWithoutNA[k++]; } } double *dummy = L->betavec; matmult(L->sumY, Xcur, dummy, 1, notnas, betatot); for (i=0; iXCY[i] += dummy[i]; } } // end !data_nas } // Global.general.set if (L->fixedtrends) { // XCY, etc NUR FUER FIXED TREND double *beta = L->betavec; // !!! for (i = 0; i 0) { int k=0; for (int j1=0; j1fixedtrends; j1++) { if (L->nas_fixed[j1] == 0) { int end=L->betas[j1 + 1]; for (int j2=L->betas[j1]; j2XCY[j2]; } // j2 } } assert(cov->Ssolve != NULL); Exterr = RU_solvePosDef(L->XtX, fx_notnas, true, beta, 1, NULL, cov->Ssolve); if (Exterr != NOERROR) goto ErrorHandling; if (fx_notnas < betatot) { int b = L->fixedtrends - 1; i = betatot - 1; j = fx_notnas - 1; while (b>=0 && i >= 0) { int bi = L->betas[b + 1] - L->betas[b]; if (L->nas_fixed[b]) { for (k=0; k= 0 && j >= 0); beta[i--] = beta[j--]; } assert(i>=j); } if (i != 0 || j != 0 || b != 0) BUG; } else assert(fx_notnas == betatot); } } ErrorHandling: GLOBAL.general.set = store; if (Exterr != NOERROR) { if (Exterr == ERRORM) { RU_getErrorString(ERRORSTRING); ERR(ERRORSTRING); } else err = Exterr; } if (err != NOERROR) XERR(err); return get_logli_residuals(model_reg); } ////////////////////////////////////////////////////////////////////// // Gauss process // likelihood / density void gaussprocessDlog(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double *v){ assert(isProcess(cov)); cov_model *prev = cov->calling; //*sub = cov->key == NULL ? cov->sub[0] : cov->key; if (prev == NULL || CovList[prev->nr].cov != likelihood) BUG; likelihood_storage *L = cov->Slikelihood; assert(L != NULL); listoftype *datasets = L->datasets; if (L->ignore_trend) BUG; likelihood_info *info = &(L->info); if (info->globalvariance && info->pt_variance != NULL) *(info->pt_variance) = 1.0; double proj = 0.0, YCinvY = 0.0, logdettot = 0.0; int i, j, repet, sets = GET_LOC_SETS(prev), err = NOERROR, Exterr = NOERROR, variables = 0, vdim = cov->vdim[0], store = GLOBAL.general.set, betatot = L->betas[L->fixedtrends], betaSq = betatot * betatot; // PMI(cov); // if (cov->vdim[1] != 1) BUG; *v = 0.0; for (i=0; iXtX[i++] = 0.0); for (i=0; iXCY[i++] = 0.0); for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++) { // Gettotalpoints, Loc etc haengen alle von GLOBAL.general.set ab ! int k, m, p, ncol = NCOL_OUT_OF(datasets); assert(!L->betas_separate || sets == 1); repet = ncol / vdim; int nrow = NROW_OUT_OF(datasets), ndata = nrow * ncol, totpts = Gettotalpoints(prev), totptsvdim = totpts * vdim; double logdet, *val = L->C, *YhatWithoutNA = L->YhatWithoutNA[GLOBAL.general.set], *Xdata = L->X[GLOBAL.general.set] + betatot * totptsvdim; if (L->dettrend_has_nas || L->nas_boxcox) { MEMCOPY(Xdata, SET_OUT_OF(datasets), ndata * sizeof(double)); if (L->nas_boxcox) { for (p = m = 0; m < repet; m++) { for (k = 0; k < totptsvdim; k++) { Xdata[p++] -= YhatWithoutNA[k]; } } } for (i=0; idettrends; i++) { if (L->nas_det[i]) { FctnIntern(cov, L->cov_det[i], L->cov_det[i], val, false); for (p = m = 0; m < repet; m++) { for (k = 0; k < totptsvdim; k++) Xdata[p++] -= val[k]; } } } if (L->nas_boxcox) boxcox_trafo(P(GAUSS_BOXCOX), vdim, Xdata, nrow, repet); } // (L->dettrend_has_nas || L->nas_boxcox) for (i=0; ifixedtrends; i++) { if (L->nas_fixed[i]) { FctnIntern(cov, L->cov_fixed[i], L->cov_fixed[i], L->X[GLOBAL.general.set] + L->betas[i] * totptsvdim, false); // "Lueckentext" auffuelen !! } } if (L->random > 0) BUG; // to do if (info->globalvariance && info->pt_variance != NULL) *(info->pt_variance) = 1.0; CovarianceMatrix(cov, L->C); //sub -> cov 30.12.15 // printf("\nC = ");for (i=0; iC[i]); printf("\n"); // BUG; APMI(sub); // printf("%f %f %f %f %f\n", Xdata[0], Xdata[1], Xdata[2], Xdata[3], Xdata[4]); double *Xcur, *Ccur, *dataWithoutNA = NULL; int atonce, endfor, XYcols, notnas = NA_INTEGER; if (L->data_nas[GLOBAL.general.set]) { atonce = 1; Ccur = L->Cwork; Xcur = L->Xwork; } else { notnas = totptsvdim; atonce = repet; Ccur = L->C; Xcur = L->X[GLOBAL.general.set]; dataWithoutNA = Xdata; } endfor = repet / atonce; XYcols = betatot + atonce; for (int r=0; rdata_nas[GLOBAL.general.set]) { double *datacur = Xdata + r * totptsvdim; notnas = matrixcopyNA(Xcur, L->X[GLOBAL.general.set], datacur, totptsvdim, betatot, atonce); SqMatrixcopyNA(Ccur, L->C, datacur, totptsvdim); dataWithoutNA = Xcur + notnas * betatot; } variables += notnas * atonce; MEMCOPY(L->CinvXY, Xcur, notnas * XYcols * sizeof(double)); assert(cov->Ssolve != NULL); Exterr = RU_solvePosDef(Ccur, notnas, true, // except for negative definite function L->CinvXY, XYcols, &logdet, cov->Ssolve); if (Exterr != NOERROR) goto ErrorHandling; logdettot += logdet * atonce; double *CinvY = L->CinvXY + betatot * notnas; int end_i = notnas * atonce; for (i=0; ifixedtrends) { if (L->betas_separate) { assert(sets == 1); matmulttransposed(Xcur, L->CinvXY, L->XtX, notnas, betatot, betatot); matmulttransposed(L->CinvXY, dataWithoutNA, L->XCY, notnas, betatot,atonce); } else { matmulttransposed(Xcur, L->CinvXY, L->XitXi, notnas, betatot,betatot); for (i=0; iXtX[i] += atonce * L->XitXi[i]; MEMCOPY(L->sumY, dataWithoutNA, sizeof(double) * notnas); int kk = notnas; for (int rr=1; rrsumY[d] += dataWithoutNA[kk++]; } } double *dummy = L->betavec; matmult(L->sumY, L->CinvXY, dummy, 1, notnas, betatot); for (i=0; iXCY[i] += dummy[i]; } } // fixedtrends } // r, repet } // Global.general.set if (L->fixedtrends) { // XCY, etc NUR FUER FIXED TREND assert(!L->betas_separate || sets == 1); GLOBAL.general.set = 0; // betas_separate only double *beta = L->betavec; // !!! int all_betatot = betatot, ncol = NCOL_OUT_OF(datasets); repet = ncol / vdim; if (L->betas_separate) { all_betatot *= repet; } MEMCOPY(beta, L->XCY, sizeof(double) * all_betatot); assert(!L->betas_separate || sets == 1); assert(cov->Ssolve != NULL); Exterr = RU_solvePosDef(L->XtX, betatot, true, beta, L->betas_separate ? repet : 1, NULL, cov->Ssolve); if (Exterr != NOERROR) goto ErrorHandling; // printf("%s AC %f %f %f %fdone\n", NAME(cov), beta[0], beta[1], beta[2], beta[3]); BUG; for (j=0; jXCY[j] * beta[j]; } MEMCOPY(v + 1 + info->globalvariance, beta, all_betatot * sizeof(double)); if (L->betas_separate) for(i=0; iwhere_fixed[i]) =RF_NA; else for (i=0; iwhere_fixed[i]) = beta[i]; } *v = -0.5 * (logdettot + variables * LOG(TWOPI)); // printf(">> v =%f %f #=%d pi=%f sq=%f %f %d\n", *v, 0.5 *logdettot, variables , -0.5 * variables * LOG(TWOPI), YCinvY, proj, info->globalvariance); double delta; delta = YCinvY - proj; if (info->globalvariance) { // printf("%f delta=%f %f %f \n", *v, delta, variables, 0.5 * variables * LOG(delta)); v[1] = delta / variables; *v -= 0.5 * variables * (1 + LOG(v[1])); if (info->pt_variance != NULL) *(info->pt_variance) = v[1]; } else { *v -= 0.5 * delta; } // printf("*v=%f %f %d\n", *v, P(GAUSS_BOXCOX)[0], info->globalvariance); if (R_FINITE(P(GAUSS_BOXCOX)[0])) { for (j=0; j MODEL_MAX) BUG; cov_model *cov = KEY[*reg]; if (cov == NULL || !isInterface(cov)) BUG; cov_model *sub = cov->key == NULL ? cov->sub[0] : cov->key; likelihood_storage *L; if (sub == NULL || !isProcess(sub) || (L = sub->Slikelihood) == NULL) BUG; likelihood_info *info = &(L->info); if (info->pt_variance != NULL) { // == NULL may happen if globalvariance is true by user, but not // reflected in the model *(info->pt_variance) = *var; } } SEXP get_likeliinfo(SEXP model_reg) { START_GAUSS_INTERFACE; likelihood_info *info = &(L->info); #define nn 5 const char *names[nn] = {"betas", "betanames", "estimate_variance", "sum_not_isna_data", "betas_separate"}; listoftype *datasets = L->datasets; int k, sets = GET_LOC_SETS(cov), sum_not_isna_data = 0, betas = L->betas[L->fixedtrends]; SEXP namevec, ans, betanames; for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ int ncol = NCOL_OUT_OF(datasets), nrow = NROW_OUT_OF(datasets), ndata = nrow * ncol; sum_not_isna_data += ndata - L->data_nas[GLOBAL.general.set]; } PROTECT(ans = allocVector(VECSXP, nn)); PROTECT(namevec = allocVector(STRSXP, nn)); for (k=0; kbetanames[k]); SET_STRING_ELT(betanames, k, mkChar(L->betanames[k])); } k = 0; SET_VECTOR_ELT(ans, k++, ScalarReal(betas)); SET_VECTOR_ELT(ans, k++, betanames); SET_VECTOR_ELT(ans, k++, ScalarLogical(info->globalvariance)); SET_VECTOR_ELT(ans, k++, ScalarInteger(sum_not_isna_data)); SET_VECTOR_ELT(ans, k++, ScalarLogical(L->betas_separate)); assert(k == nn); setAttrib(ans, R_NamesSymbol, namevec); UNPROTECT(3); GLOBAL.general.set = store; return ans; } int countbetas(cov_model *cov, double ***where) { cov_fct *C = CovList + cov->nr; int i, sum = 0, kappas = C->kappas; for(i=0; ikappasub[i] != NULL) continue; if (ParamIsTrend(cov, i)) { assert(C->kappatype[i] == REALSXP); if (!PisNULL(i)) { int total = cov->ncol[i] * cov->nrow[i]; double *p = P(i); if (ISNA(p[0]) || ISNAN(p[0])) { sum += total; for (int j=0; jkey == NULL); assert(!PisNULL(GAUSS_BOXCOX)); if (nas > 0) (*neffect)++; GetBeta(cov->sub[0], L, neffect); return; } int i, n = cov->nr == PLUS ? cov->nsub : 1; if (*neffect >= MAX_LIN_COMP) ERR("too many linear components"); bool plus = cov->nr == PLUS; likelihood_info *info = &(L->info); // printf("entering getbeta\n"); pmi(cov, 0); for (i=0; isub[i] : cov; // pmi(component, 0); if (component->nr == PLUS) { // printf("recursive\n"); GetBeta(component, L, neffect); // printf("end recursive\n"); continue; } // printf("%s %d %ld\n", NAME(cov), info->effect[*neffect], (long int) L); // if (L->effect[*neffect] > LastMixedEffect) { } else //printf("neffect %d %d\n", *neffect, info->effect[*neffect]); if (info->effect[*neffect] == DetTrendEffect) { L->cov_det[L->dettrends++] = component; } else if (info->effect[*neffect] == FixedTrendEffect) { int b = -1; L->betas[L->fixedtrends + 1] = L->betas[L->fixedtrends]; L->cov_fixed[L->fixedtrends++] = component; if (component->nr == MULT) { for (int j=0; jnsub; j++) { if ((b = countbetas(component->sub[j], NULL)) > 0) { break; } } } else b = countbetas(component, NULL); if (b <= 0) { (*neffect)++; continue; } //ERR("fixed effect expected, but corresponding NA not found"); int base = L->betas[L->fixedtrends]; L->betas[L->fixedtrends] += b; if (L->maxbeta < b) L->maxbeta = b; cov_model *model = component; if (model->nr == MULT) { for (int ii=0; iinsub; ii++) if (model->sub[0]->nr == CONST && ISNA(PARAM0(model->sub[0], CONST_C))){ model = model->sub[ii==0 && model->nsub >= 2]; break; } } if (isDollar(model)) model = model->sub[0]; char abbr[LENMSG]; int bytes = (1 + GLOBAL.fit.lengthshortname) * sizeof(char); // printf("%d %s %s\n", *neffect, NAME(component), NAME(model)); Abbreviate(NAME(model), abbr); // printf("%s<\n", abbr); // if (L->betanames[*neffect] != NULL) {printf("%s %d %s\n", NAME(cov), *neffect, L->betanames[*neffect]); crash();} else printf("%s %d NULL\n", NAME(cov), *neffect); assert(L->betanames[base] == NULL); if (b == 1) { L->betanames[base] = (char*) MALLOC(bytes); SPRINTF(L->betanames[base], "%s", abbr); } else { for (int ii=0; iibetanames[base + ii] = (char*) MALLOC(bytes); SPRINTF(L->betanames[base + ii], "%s.%d", abbr, ii); } } //printf("----> %d %s\n", base, L->betanames[base]); } else if (info->effect[*neffect] <= LastMixedEffect) { L->cov_random[L->random++] = component; ERR("mixed effects currently not programmed yet"); } (*neffect)++; } } void GetBeta(cov_model *cov, likelihood_storage *L, int *neffect, double ***where) { if (isProcess(cov)) { int nas = ISNA((P(GAUSS_BOXCOX)[0])) + ISNA((P(GAUSS_BOXCOX)[1])); assert(cov->key == NULL); assert(!PisNULL(GAUSS_BOXCOX)); if (nas > 0) (*neffect)++; GetBeta(cov->sub[0], L, neffect, where); return; } int i, n = cov->nr == PLUS ? cov->nsub : 1; bool plus = cov->nr == PLUS; likelihood_info *info = &(L->info); for (i=0; isub[i] : cov; if (component->nr == PLUS) { GetBeta(component, L, neffect, where); continue; } if (info->effect[*neffect] == FixedTrendEffect) { if (component->nr == MULT) { for (int j=0; jnsub; j++) { if ((countbetas(component->sub[j], where)) > 0) { break; } } } else countbetas(component, where); } (*neffect)++; } } #define MAX_TOTALPTS 10000 int struct_gauss_logli(cov_model *cov) { assert(isProcess(cov)); cov_model *prev = cov->calling, *sub = cov->key != NULL ? cov->key : cov->sub[0]; location_type *loc = Loc(cov); if (false) { // Beschleunigung, insb. im Genetik-Bereich // gleich ganz allgemein implementieren?? if (isCartesian(sub->isoown)) { if (sub->domown==XONLY) { if (isIsotropic(sub->isoown)) { if (Gettotalpoints(cov) < MAX_TOTALPTS) { // nur distances abspeichern // in ownloc } } else { if (Gettotalpoints(cov) < MAX_TOTALPTS / SQRT((double) Gettimespacedim(cov))) { // distance vectors abspeochen } } } } else { NotProgrammedYet("non-cartesian systems") // to do } } int i, k, // info->neffect, max_total_data_Sq, betatot, err = NOERROR, ne = 0, //n = sub->nr == PLUS ? sub->nsub : 1, store = GLOBAL.general.set, sets = GET_LOC_SETS(cov), maxrepet = 0, maxndata = 0, maxtotpts = 0, vdim = cov->vdim[0], two_vdim = 2 * vdim, n = vdim * vdim, dim = Gettimespacedim(cov), dummy_fixed=0, dummy_det = 0, dummy_random = 0, global_var = prev->nr==LIKELIHOOD_CALL // ja nicht boolean ! ? PARAM0INT(prev, LIKELIHOOD_NA_VAR) : false; assert(prev != NULL); if (prev->nr != LIKELIHOOD_CALL && prev->nr != LINEARPART_CALL) BUG; NEW_STORAGE(likelihood); likelihood_storage *L = cov->Slikelihood; likelihood_NULL(L); likelihood_info *info = &(L->info); likelihood_info_NULL(info); L->ignore_trend = prev->nr == LIKELIHOOD_CALL && PARAM0INT(prev, LIKELIHOOD_IGNORETREND); // to do : betas_separate bereinigen && ignore_trend nicht alles // allocieren! L->betas_separate = prev->nr == LIKELIHOOD_CALL && PARAM0INT(prev, LIKELIHOOD_BETASSEPARATE); if (L->betas_separate && sets > 1) SERR("separate estimation of the betas only for one data set possible."); L->nas_boxcox = L->nas_boxcox_mu = 0; for (i=0; inas_boxcox += ISNA(P(GAUSS_BOXCOX)[i]); if (i % 2 == 1) L->nas_boxcox_mu += ISNA(P(GAUSS_BOXCOX)[i]); } // printf("%f %f\n ", P(GAUSS_BOXCOX)[0], P(GAUSS_BOXCOX)[1]); BUG; //PMI(cov); // information about free variables: // first: get effect and NAs // printf("globar %d %d\n", global_var, PARAM0INT(prev, LIKELIHOOD_NA_VAR)); // assert(false); err = SetAndGetModelInfo(cov, GLOBAL.fit.lengthshortname, // 3 LIKELI_NA_INTEGER, LIKELI_EXCLUDE_TREND, loc->xdimOZ, global_var, info); if (err != NOERROR) goto ErrorHandling; // second: existence and "size" of deterministic and fixed trend // printf("\n\n\n\n .>>>>>>>> get Beta:\n"); GetBeta(cov, L, &ne); // printf("\n\n\n\n .>>>>>>>> get Beta fodnex\n"); if (L->fixedtrends + 1 < MAX_LIN_COMP) L->betas[L->fixedtrends + 1] = L->betas[L->fixedtrends]; betatot = L->betas[L->fixedtrends]; if (betatot > 0) { ne = 0; double **pt = L->where_fixed = (double **) MALLOC( L->betas[L->fixedtrends] * sizeof(double**) ); GetBeta(cov, L, &ne, &pt); // pt wird hochgezaehlt // printf("%d %d\n", betatot, pt - L->where_fixed ); assert(pt == L->where_fixed + betatot); } // alloc_cov is need for both CovarianceMatrix and FctnInternal if (n < L->maxbeta) n = L->maxbeta; //printf("maxbeta %d %d %d\n", L->maxbeta, vdim, n); if ((err = alloc_cov(cov, dim, n, 1)) != NOERROR) goto ErrorHandling; // printf("betas = %d/%d %d; %d %d %d\n", L->betas[ne], betatot, info->neffect, info->effect[0], info->effect[1], info->effect[2]); // printf("%d %d %d %d; %d %d %d %d - %d\n", dummy_det, L->dettrends, DataEffect, LastMixedEffect, dummy_fixed,L->fixedtrends, dummy_random, L->random, FixedTrendEffect); for(k=0; kneffect; k++) { // printf("k=%d %d \n", k, info->effect[k]); if (info->effect[k] == DetTrendEffect) { L->nas_det[dummy_det++] = info->nas[k]; } else if (info->effect[k] == FixedTrendEffect) { L->nas_fixed[dummy_fixed++] = info->nas[k]; } else if (info->effect[k] >= FirstMixedEffect && info->effect[k] <= LastMixedEffect) { L->nas_fixed[dummy_random++] = info->nas[k]; } } // printf("%d %d %d %d; %d %d %d %d\n", dummy_det, L->dettrends, DataEffect, LastMixedEffect, dummy_fixed,L->fixedtrends, dummy_random, L->random); assert(dummy_det == L->dettrends && dummy_fixed == L->fixedtrends && dummy_random == L->random); for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ int totptsvdim = Gettotalpoints(cov) * vdim; if (totptsvdim > L->max_total_data) L->max_total_data = totptsvdim; } L->X = (double **) CALLOC(sets, sizeof(double *)); L->YhatWithoutNA = (double **) CALLOC(sets, sizeof(double *)); for (i=0; iX[i] = L->YhatWithoutNA[i] = NULL; L->sumY = (double *) MALLOC(L->max_total_data * sizeof(double)); L->sets = sets; for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ double *val = L->sumY; // dummy int totptsvdim = Gettotalpoints(cov) * vdim; double *Yhat = L->YhatWithoutNA[GLOBAL.general.set] = (double*) CALLOC(totptsvdim, sizeof(double)); for (i=0; idettrends; i++) { if (L->nas_det[i] == 0) { FctnIntern(cov, L->cov_det[i], L->cov_det[i], val, false); for (k = 0; k < totptsvdim; k++) Yhat[k] += val[k]; } else L->dettrend_has_nas = true; } if (L->random) GERR("Currently the linear part of random effects cannot be determined"); } if (prev->nr == LINEARPART_CALL) { if (L->fixedtrends) { for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ int tot = betatot * Gettotalpoints(cov) * vdim; L->X[GLOBAL.general.set] = (double*) CALLOC(tot, sizeof(double)); } } } else { listcpy(&(L->datasets), PARAMLIST(prev, LIKELIHOOD_DATA), false); L->data_nas = (int *) MALLOC(sets * sizeof(int)); listoftype *datasets = L->datasets; for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ double *data = SET_OUT_OF(datasets); int ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, nrow = NROW_OUT_OF(datasets), data_nas = 0, ndata = nrow * ncol; if (nrow != Gettotalpoints(cov)) BUG; if (repet > maxrepet) maxrepet = repet; if (nrow > maxtotpts) maxtotpts = nrow; if (ndata > maxndata) maxndata = ndata; // any_data_nas = false; for (k = 0; kdata_nas[GLOBAL.general.set] = data_nas; L->data_has_nas |= data_nas > 0; if (L->nas_boxcox_mu) { bool warn_boxcox = true; int z = 0; for (int r=0; rmax_total_data * L->max_total_data; int totdata_bytes = max_total_data_Sq * sizeof(double); L->C = (double *) MALLOC(totdata_bytes); if (L->data_has_nas) { L->Cwork = (double *) MALLOC(totdata_bytes); int tot = L->max_total_data + betatot * Gettotalpoints(cov); L->Xwork = (double*) MALLOC(tot * sizeof(double)); } if (L->fixedtrends) { L->XitXi = (double*) MALLOC(sizeof(double) * betatot * (betatot > maxrepet ? betatot : maxrepet)); L->XtX = (double*) CALLOC(betatot * betatot, sizeof(double)); int all_betatot = betatot; if (L->betas_separate) all_betatot *= maxrepet; L->XCY = (double *) MALLOC(all_betatot * sizeof(double)); L->betavec = (double *) MALLOC(all_betatot * sizeof(double)); } L->CinvXY = (double*) MALLOC(sizeof(double) * (betatot* maxtotpts* vdim + maxndata)); for (GLOBAL.general.set = 0; GLOBAL.general.setYhatWithoutNA[GLOBAL.general.set]; int m, p, ncol = NCOL_OUT_OF(datasets), repet = ncol / vdim, nrow = NROW_OUT_OF(datasets), ndata = nrow * ncol, totptsvdim = nrow * vdim; L->X[GLOBAL.general.set] = (double*) CALLOC( (betatot + repet * vdim) * Gettotalpoints(cov), sizeof(double)); // auch die Y-Werte; vdim included! if (!L->dettrend_has_nas && L->nas_boxcox == 0) { double *Xdata = L->X[GLOBAL.general.set] + betatot * totptsvdim; MEMCOPY(Xdata, data, ndata * sizeof(double)); for (p = m = 0; m < repet; m++) { for (k = 0; k < totptsvdim; k++) { Xdata[p++] -= YhatWithoutNA[k]; } } if (L->nas_boxcox == 0 && R_FINITE(P0(GAUSS_BOXCOX))) boxcox_trafo(P(GAUSS_BOXCOX), vdim, Xdata, nrow, repet); } for (i=0; irandom; i++) { BUG; // not programmed yet if (L->nas_random[i] == 0) { BUG; } else L->random_has_nas = true; } } // GLOBAL.set } // not rftrend for (GLOBAL.general.set = 0; GLOBAL.general.set < sets; GLOBAL.general.set++){ for (i=0; ifixedtrends; i++) { if (L->nas_fixed[i] == 0) { FctnIntern(cov, L->cov_fixed[i], L->cov_fixed[i], L->X[GLOBAL.general.set] + L->betas[i] * Gettotalpoints(cov), false);// "Lueckentext"!! } else L->fixedtrend_has_nas = true; } // int kk = 0; // for (int h=0; hX[GLOBAL.general.set][kk++]); // } // } BUG; } // GLOBAL.set EXT_NEW_STORAGE(solve); // assert(cov->Slikelihood != NULL); printf("%d\n", addressbits(cov->Slikelihood)); APMI(cov); ErrorHandling: GLOBAL.general.set = store; return err; } void gauss_trend(cov_model *predict, cov_model *cov, double *v, int set) { // muss angenommen werden, dass alles gesetzt ist. likelihood_storage *L = cov->Slikelihood; int store = GLOBAL.general.set, sets = GET_LOC_SETS(predict); if (set < 0 || set >= sets) BUG; GLOBAL.general.set = set; listoftype *datasets = L->datasets; int err = NOERROR, betatot = L->betas[L->fixedtrends], vdim = cov->vdim[0], ncol = NCOL_OUT_OF(datasets), repet = L->betas_separate ? ncol / vdim : 1, pred_tot = Gettotalpoints(predict), predtotvdim = pred_tot * vdim, predtotvdimrepet = pred_tot * ncol; double *X = NULL; for (int k=0; kignore_trend) goto ErrorHandling; // exist if (!L->betas_separate && repet > 1) GERR("BUG"); if ((X = (double*) MALLOC(predtotvdim * sizeof(double))) == NULL) { // printf("%d %d \n", pred_tot, vdim); APMI(cov); err = ERRORMEMORYALLOCATION; goto ErrorHandling; } int r,m; for (int i=0; idettrends; i++) { FctnIntern(predict, L->cov_det[i], L->cov_det[i], X, true); for (r = m = 0; r < repet; r++) { for (int k=0; kfixedtrends; i++) { FctnIntern(predict, L->cov_fixed[i], L->cov_fixed[i], X, true); if (L->betas[i+1] - L->betas[i] != 1) BUG; double *betavec = L->betavec + L->betas[i]; for (r = m = 0; r < repet; r++) { double beta = *betavec; // printf("beta = %f %f\n", beta, X[0]); BUG; for (int k=0; kbetas_separate) betavec += betatot; } } ErrorHandling : GLOBAL.general.set = store; FREE(X); if (err != NOERROR) XERR(err); } RandomFields/src/fftVario.cc0000644000176200001440000004467513074763020015521 0ustar liggesusers/* Authors Sebastian Engelke Johannes Martini library for simulation of random fields -- init part and error messages Copyright (C) 2011 -- 2013 Sebastian Engelke, Johannes Martini Copyright (C) 2014 Sebastian Engelke, Johannes Martini, Martin Schlather Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include #include "RF.h" // z coordinate run the fastest in values, x the slowest #define TOOLS_MEMORYERROR 501 #define TOOLS_XERROR 502 #define TOOLS_BIN_ERROR 503 #define NEARBY 1e15 // naechste Zeile nur notwendig, weil atan2 in Windows nicht // ordentlich programmiert ist #define NEARBYINT(x) (FLOOR((x) * (NEARBY) + 0.5) / (NEARBY)) // #define NEARBYINT(x) x int GetAngleBin(double angle, double startangle, double SegPerPI, double maxAngle){ double phi; int kphi; phi = angle - startangle; while (phi < 0) phi += maxAngle; while (phi >= maxAngle) phi -= maxAngle; kphi = (int) (phi * SegPerPI / PI); return(kphi); } static int maxjj = 0; double get(double *sumvals, int jj) { if (jj > maxjj) { maxjj = jj; //printf("jj=%d\n", jj); } return sumvals[jj]; } SEXP fftVario3D(SEXP Coord, SEXP Sumvals, SEXP Nbvals, SEXP Bin, SEXP Nbin, SEXP LenT, SEXP StepT, SEXP NstepT, SEXP Phi, SEXP Theta, SEXP Repet, SEXP Vdim, SEXP SegmentEmpVario, SEXP Pseudo ) { /* coord : 3x3 matrix of coordinates of the 3 space dimension * in (new) gridtriple notation, (start,by,length) * sumvals : matrix of non-averaged values of the empirical variogram * as a function of the distance vector * nbvals : number of values contributing to the respective direction * sumvals / nbvals = meanvals * bin : vector of bin boundaries for the radial space part * nbin : number of bins of the radial space part * stepT : stepsize in temporal direction (must be multiple of the time stepsize) * nstepT : number of steps in temporal direction * phi : 2-dim vector, first component gives the starting angle and * second component the number of angles / PI (all in the xy-plane) * theta : 2-dim vector, first component gives the starting angle and * repet : number of repetitions (the calculated emprical variogram will * be an overall average, see also EmpiricalVariogram in empvario.R) * second component the number of angles / PI (all orthogonal to xy-plane) * empvario: vector of bins filled with averaged empirical variogram * n : number of pairs in each bin * pseudo : if pseudo == 1, then the pseudo (cross)-variogram is computed */ long rep; int i, binidx, halfnbin, totalbinsvdimSq, Nphi, NphiNbin, Ntheta, nbinNphiNtheta, Nphihalf, maxi[3], ix, iy, iz, startX, startY, startZ, startT, startrep, low, cur, ktheta, kthetaz, kphi, kphixy, kphix, kphiy, kT, nstepTstepT, deltaT, x, y, z, v1, v2, timecomp, k, err = NOERROR, nbin = INTEGER(Nbin)[0], vdim = INTEGER(Vdim)[0], repet = INTEGER(Repet)[0], segmentEmpVario = INTEGER(SegmentEmpVario)[0], totalbins = segmentEmpVario * vdim * vdim, nstepT = INTEGER(NstepT)[0], stepT = INTEGER(StepT)[0], lenT = INTEGER(LenT)[0] ; bool pseudo = LOGICAL(Pseudo)[0]; double tolerance, *xx[3], maxbinsquare, step[3], d0, d1, d2, // delta0 psq0, psq1, psq2, startphi, starttheta, thetadata, phidata, phixdata, phiydata, phixydata, binshift, *phi = REAL(Phi), *theta = REAL(Theta), *BinSq = NULL, *sumvals = REAL(Sumvals), *nbvals= REAL(Nbvals), *bin = REAL(Bin), *coord = REAL(Coord); SEXP back; back = PROTECT(allocMatrix(REALSXP, totalbins, 2) ); double *emp_vario = REAL(back), *n = emp_vario + totalbins ; #define SUMVALS_JJ sumvals[jj] //#define SUMVALS_JJ get(sumvals, jj) kphix = 0; kphixy = 0; kphiy = 0; Nphihalf = 0; nstepTstepT = stepT * nstepT; timecomp = nstepTstepT==0 ? 1 : 2; if((!pseudo) && (timecomp==1)){ Nphi = phi[1]==0 ? 1 : (int) phi[1]; } else{ Nphihalf = phi[1]==0 ? 0 : (int) phi[1]; Nphi = phi[1]==0 ? 1 : 2 * ((int) phi[1]); } Ntheta = theta[1]==0 ? 1 : (int) theta[1]; //print("1,.."); NphiNbin = Nphi * nbin; startphi = ((!pseudo) && (timecomp==1)) ? (phi[0] - PI / (double) (2*Nphi)) : (phi[0] - PI / (double) (Nphi) ); // [0, 2 pi] //invsegphi = phi[1] / PI; // note that phi[1] can be zero! //starttheta = theta[0] - PI / (double) (2*theta[1]); // [0, pi] starttheta = 0; // invsegtheta = theta[1] / PI; // note that theta[1] can be zero nbinNphiNtheta = NphiNbin * Ntheta; //print("2,.."); for (rep=i=0; i<3; i++, rep+=3) xx[i] = coord + rep; if (xx[0]==NULL) {err=TOOLS_XERROR; goto ErrorHandling;} for (i=0; i=bin[i+1]) {err=TOOLS_BIN_ERROR; goto ErrorHandling;} } halfnbin = nbin / 2; if ((BinSq = (double *) MALLOC(sizeof(double)* (nbin + 1))) ==NULL) { err=TOOLS_MEMORYERROR; goto ErrorHandling; } //print("3,.."); totalbins = nbinNphiNtheta * (nstepT + 1); totalbinsvdimSq = totalbins * vdim * vdim; for (i=0; i0 ? bin[i] * bin[i] + binshift : bin[i]; } assert(NEARBYINT(atan2(-1.0, 0.0) + PIHALF) == 0.0); assert(atan2(0.0, 0.0) == 0.0); maxbinsquare = BinSq[nbin]; int segmentbase[10]; segmentbase[0]=1; // here x runs the fastest; for (i=0; i<=2; i++) { step[i] = xx[i][1]; maxi[i] = xx[i][2]; segmentbase[i+1] = segmentbase[i] * maxi[i]; } segmentbase[4] = segmentbase[3] * lenT; if (!pseudo) { segmentbase[5] = 4 * segmentbase[4]; segmentbase[6] = segmentbase[5] * timecomp; } else { segmentbase[5] = 8 * segmentbase[4]; segmentbase[6] = segmentbase[5]; } segmentbase[7] = segmentbase[6] * repet; segmentbase[8] = segmentbase[7] * vdim * vdim; // sementbase: [0] : 1, [1] : length(x), [2] : length(x) * l(y), // [3] : l(x) * l(y) * l(z), [4] : l(x) * l(y) * l(z) * l(T) // [5] : 4 (or 8) * l(x) * l(y) * l(z) * l(T) // [6] : 4 (or 8) * l(x) * l(y) * l(z) * l(T) * timecomp // [7] : 4 (or 8) * l(x) * l(y) * l(z) * l(T) * timecomp * repet // for pseudo variogram we need the whole sphere (not only half-sphere) for (v1=0; v1> ... %d %d %d\n", v1, v2, segmentEmpVario); startX = 0; binidx = 0; for (x=startX, ix=0; x < segmentbase[1]; x++, ix++) { d0 = ix * step[0]; startY = x; if ((psq0 = d0 * d0) > maxbinsquare) continue; for (y = startY, iy=0; y < segmentbase[2]; y+=segmentbase[1], iy++){ d1 = iy * step[1]; startZ = y; if ((psq1 = d1 * d1 + psq0) >maxbinsquare) continue; // angles if(!pseudo){ phidata = NEARBYINT(atan2(d1, d0) - startphi); kphi = GetAngleBin(phidata, 0, phi[1], PI); phixdata = NEARBYINT(atan2(d1, -d0) - startphi); kphix = GetAngleBin(phixdata, 0, phi[1], PI); if((d0 == 0) && (d1 == 0)) kphi = 0;// points on the z-axes } else{ phidata = NEARBYINT(atan2(d1, d0) - startphi); kphi = GetAngleBin(phidata,0, phi[1], TWOPI); phixdata = NEARBYINT(atan2(d1, -d0) - startphi); kphix = GetAngleBin(phixdata, 0, phi[1], TWOPI); phiydata = NEARBYINT(atan2(-d1, d0) - startphi); kphiy = GetAngleBin(phiydata, 0, phi[1], TWOPI); phixydata = NEARBYINT(atan2(-d1, -d0) - startphi); kphixy = GetAngleBin(phixydata, 0, phi[1], TWOPI); } //if(d1 == d0) //print("kphi: %d and kphix: %d, phidata: %lf, startphi: %lf", kphi, kphix, phidata, startphi); // kphi is index of angle bin in x,y > 0 plane // kphix is index of angle bin if phi // is mirrored along the x-axis (in the xy-plane) // kphiy and kphixy similar for (d2=0.0, z=startZ, iz=0; z < segmentbase[3]; z+=segmentbase[2], iz++, d2 += step[2]){ startT = z; if ((psq2 = d2 * d2 + psq1) > maxbinsquare) continue; //print("5,.."); { /* finds the bins for the radial space part */ int up = nbin; low=0; cur= halfnbin; while(low!=up){ if (psq2 > BinSq[cur]) {low=cur;} else {up=cur-1;}/*( . ; . ]*/ cur=(up+low+1) / 2; } } // low // angles thetadata = NEARBYINT(PIHALF - atan2(d2, SQRT(psq1))); ktheta = GetAngleBin(thetadata, starttheta, theta[1], PI); kthetaz = GetAngleBin(PI - thetadata, starttheta, theta[1], PI); for (deltaT=0, kT=0; deltaT<=nstepTstepT; deltaT += stepT, kT += nbinNphiNtheta) { //print("kT %d, stepT %d, nsteptT %d, deltaT %d", kT, *stepT, *nstepT, deltaT); //print("kT %d --", kT); //timecomp = x==0 ? 1 : 2; startrep = startT + deltaT * segmentbase[3]; for (k=1; k <= timecomp; k++, startrep += segmentbase[5]){ //if a time component is given, then, for statistical efficiency, the data is reflected also along the time component binidx = cur + kT; assert( binidx < totalbins && binidx >= 0 ); //print("ix = %d -- k = %d", ix, k); //for (i=0, T=(startT+(deltaT+i)*segmentbase[3]); i < endT; T+=segmentbase[3], i++) { for (rep = startrep; rep < segmentbase[7]; rep += segmentbase[6]) { //print("6,.."); //print("ix: %d, iy: %d, iz: %d, kphi: %d, ktheta: %d, kphix: %d, kthetaz: %d, \n", ix, iy, iz, kphi, ktheta, kphix, kthetaz); //if(binidx == 0) print("rep: %d , sumvals[rep]: %lf \n", rep, sumvals[rep]); if(!pseudo) { int basX = NA_INTEGER, jj = rep, kM1 = k - 1, TkM2 = 2 - k, base = binidx + (kphi + Nphihalf * kM1) * nbin, Idx = ((Ntheta - 1 - ktheta) * kM1 + ktheta * TkM2) * NphiNbin; //printf("rep =%d [%d %d; %d] v1=%d %d [%d] x=%d %d %d deltaT=%d %d\n", //rep, startrep, segmentbase[7], segmentbase[6], //v1, v2, vdim, x, y, z, deltaT, k); emp_vario[base + Idx] += SUMVALS_JJ; n[base + Idx] += nbvals[jj]; jj += segmentbase[4]; if (ix > 0 && (iy > 0 || iz > 0)) { basX = binidx + (kphix + Nphihalf * kM1) * nbin; emp_vario[basX + Idx] += SUMVALS_JJ; n[basX + Idx] += nbvals[jj]; } if (iy > 0 && iz > 0){ Idx = ((Ntheta -1 - kthetaz) * kM1 + kthetaz * TkM2) * NphiNbin; jj += segmentbase[4]; emp_vario[base + Idx] += SUMVALS_JJ; n[base + Idx] += nbvals[jj]; if (ix > 0){ jj += segmentbase[4]; emp_vario[basX + Idx] += SUMVALS_JJ; n[basX + Idx] += nbvals[jj]; } } } else { // not pseudo int jj = rep, knbin = binidx + kphi * nbin, kxnbin = binidx + kphix * nbin, kN = ktheta * NphiNbin, kzN = kthetaz * NphiNbin, Idx = knbin + kN; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; jj += segmentbase[4]; if (ix > 0) { Idx = kxnbin + kN; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; } if (iz > 0) { Idx = knbin + kzN; jj += segmentbase[4]; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; if (ix > 0) { Idx = kxnbin + kzN; jj += segmentbase[4]; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; } } if(iy > 0) { int kxynbin = NA_INTEGER, kynbin = binidx + kphiy * nbin; Idx = kynbin + kN; jj = rep + 4 * segmentbase[4]; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; jj += segmentbase[4]; if (ix > 0){ // vor ix>0 && iz > 0 ! kxynbin = binidx + kphixy * nbin; Idx = kxynbin + kN; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; } if (iz > 0){ Idx = kynbin + kzN; jj += segmentbase[4]; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; if (ix > 0) { Idx = kxynbin + kzN; jj += segmentbase[4]; emp_vario[Idx] += SUMVALS_JJ; n[Idx] += nbvals[jj]; } } // iz > 0 } // iy > 0 } // else (not pseudo) } // repet } // k timecomponent } // deltaT ; time bin } // z } // y } //x tolerance = GLOBAL.empvario.tol * segmentbase[3]; // to do. Warum? for(i=0; i < totalbins ;i++){ if (FABS(emp_vario[i]) < tolerance) emp_vario[i] = 0.0; } } // vdim1 } // vdim // print("C SCRIPT END !!!!!!!!! \n"); ErrorHandling: if (err != NOERROR) { switch (err) { case TOOLS_MEMORYERROR : ERR("Memory alloc failed in empiricalvariogram.\n"); case TOOLS_XERROR : ERR("The x coordinate may not be NULL.\n"); break; case TOOLS_BIN_ERROR : ERR("Bin components not an increasing sequence.\n"); break; default : BUG; } } FREE(BinSq); UNPROTECT(1); return back; } /* coord : 3xd matrix of coordinates of d dimensional space in gridtriple notation, * last row is number of gridpoints * S : array of non-averaged values of the empirical variogram * as a function of the distance vector * N : number of values contributing to the respective direction * sumvals / nbvals = meanvals * bounds : vector of bin boundaries for the radial space part * nBounds : length of the bounds vector * stepT : stepsize in temporal direction (must be multiple of the time stepsize) * nstepT : number of steps in temporal direction * repeat : number of repetitions */ // void fftVarioIsotrop( // double* spaceStepLength, // int* nSpaceSteps, // int* dim, // int* nTimeSteps, // double* S, // int* W, // double* spaceBounds, // int* nSpaceBounds, // int* timeBounds, // int* nTimeBounds, // int* repeat, // double* matrix // ) // { // /* // * ******************************************************************************************** // * DEKLARATION // * ******************************************************************************************** // */ // // die bin-Matrix fuer die aufsummierten werte // double sumBins[*nSpaceBounds][*nTimeBounds]; // // die bin-Matrix fuer die gewichte // int weightBins[*nSpaceBounds][*nTimeBounds]; // // der cache fuer die quadrierten werte der bin grenzen // double sqrBoundCache[*nSpaceBounds]; // // der cache fuer die quadrierten werte der koordinatenpunkte // double sqrCache[*dim]; // // der koordinatenvektor // int coord[*dim]; // // der dazugehoerige index // int index; // // die dazugehoerige norm quadriert (so spart man sich das staendige wurzelziehen, denn man will ja nur distanzen vergleichen) // double sqrNorm; // // der zeit index // int time; // // der wiederholungsindex // int rep; // // die bin nummer im raum // int spaceBin; // // die bin nummer in der zeit // int timeBin; // // die anzahl der koordinatenpunkte // int nPoints; // // die anzahl der zeit + koordinatenpunkte // int nSpaceTimePoints; // // die dimension, in die gerade gegangen wird // int current; // // flag, das anzeigt ob in der "wandernden" dimension ein wraparound stattfand // int wrap; // /* // * ******************************************************************************************** // * INITIATION // * ******************************************************************************************** // */ // for (int i= 0; i < *nSpaceBounds; i++) // { // sqrBoundCache[i]= spaceBounds[i] * spaceBounds[i]; // for (j= 0; j < *nTimeBounds; i++) // { // sumBins[i][j]= 0; // weightBins[i][j]= 0; // } // } // nPoints= 1; // for (int i= 0; i < *dim; i++) // { // nPoints*= nSpaceSteps[i]; // sqrCache[i]= 0; // coord[i]= 0; // } // nSpaceTimePoints= nPoints* *nTimeSteps; // sqrNorm= 0; // // wir starten mit der x richtung // current= 0; // wrap= FALSE; // /* // * ******************************************************************************************** // * MAIN LOOP // * ******************************************************************************************** // */ // for (index= 0; index < nPoints; index++) // { // sqrNorm= sqrCache[1]+ coord[0]* spaceStepLength[0]* coord[0]* spaceStepLength[0]; // spaceBin= getSpaceBin(sqrBoundCache, nSpaceBounds, sqrNorm); // // wenn der abstand > maxbin ist, koennen wir mit dem naechsten punkt weitermachen // if (spaceBin == -1) // { // for (time= 0; time < *nTimeSteps; time++) // { // int timeOffset= time* nPoints; // timeBin= getTimeBin(timeBounds, nTimeBounds, time); // // selbes argument wie oben, wir koennen hier auch mit dem naechsten raumpunkt weitermachen // if (timeBin == -1) // break; // for (rep= 0, int repOffset= 0; rep < repeat; rep++; repOffset+= nSpaceTimePoints) // { // sumBins[spaceBin][timeBin]= S[index+ timeOffset+ repOffset]; // weightBins[spaceBin][timeBin]= W[index+ timeOffset+ repOffset]; // } // } // } // //TODO // //update coord and caches // } // } // int getSpaceBin(double *sqrBoundCache, int* nSpaceBounds, double sqrNorm) // { // int bin= -1; // if (sqrNorm > sqrBoundCache[*nSpaceBounds- 1]) // return bin; // for (bin= 0; (bin < *nSpaceBounds) && (sqrNorm > sqrBoundCache[bin]); bin++) // { // } // return bin; // } // int getTimeBin(*timeBounds, *nTimeBounds, time) // { // int bin= -1; // if (*timeBounds * *nTimeBounds < time) // return bin; // bin= (time- 1)/ *timeBounds; // return bin; // } RandomFields/src/Gneiting.cc0000644000176200001440000011672513074763020015501 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Gneiting's space-time covariance models and related models Copyright (C) 2006 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "RF.h" #include "Operator.h" #define LOG2 M_LN2 #define AVESTP_MINEIGEN 2 #define AVESTP_LOGDET 3 #define AVESTP_V 4 #define AVESTP_LOGV 5 #define AVESTP_LOGMIXDENS 6 #define TOTALAVESTP (AVESTP_LOGMIXDENS + 1) #define AVE_A 0 #define AVE_Z 1 #define AVE_SPACETIME 2 #define AVE_PHI 0 #define AVE_GAUSS 1 void kappa_ave(int i, cov_model *cov, int *nr, int *nc){ bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); int dim = spacetime ? cov->tsdim-1 : cov->tsdim; *nr = (i==AVE_A || i==AVE_Z) ? dim : 1; *nc = (i==AVE_A) ? dim : i < CovList[cov->nr].kappas ? 1 : -1; } void ave(double *h, cov_model *cov, double *v) { // f = uAu +zu; bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); cov_model *next = cov->sub[0]; int i,j,k,d, dim = spacetime ? cov->tsdim - 1 : cov->tsdim; double detEplus2B, Ah[AveMaxDim], Eplus2B[AveMaxDim], dummy, hh, *A = P(AVE_A), *z = P(AVE_Z), c = spacetime ? h[cov->tsdim-1] : 0.0; // Sockelwert fuer c hh = 0.0; for (k=d=0; dsub[0]; bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); int i, j, err, dim = cov->tsdim, spdim = spacetime ? dim - 1 : dim; double *A = P(AVE_A); char msg[2][4] = {"d", "d-1"}; if (cov->xdimown < 2) SERR("The spatial dimension must be at least 2."); if (dim > AveMaxDim) SERR2("For technical reasons max. dimension for ave is %d. Got %d.", AveMaxDim, dim); if (cov->ncol[AVE_A] != spdim || cov->nrow[AVE_A] != spdim) SERR5("A not %sx%s matrix, but %dx%d (dim=%d)", msg[spacetime], msg[spacetime], cov->ncol[AVE_A], cov->nrow[AVE_A], spdim); if (cov->ncol[AVE_Z] != 1 || cov->nrow[AVE_Z] != spdim) SERR1("z not (%s)-dim vector", msg[spacetime]); for (i=0; ixdimprev != cov->tsdim) // || cov->xdimprev != cov->tsdim) return ERRORDIM; if ((err = CHECK(next, dim, 1, PosDefType, XONLY, ISOTROPIC, SCALAR, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; next->delflag = DEL_COV; // set gatternr=nr, since non-negativity ensured if (!isNormalMixture(next->monotone)) return ERRORNORMALMIXTURE; if (CovList[next->nr].spectral == NULL) return ERRORSPECTRAL; // nicht gatter // updatepref(cov, next); ## gute idee? if (next->pref[SpectralTBM] == PREF_NONE) cov->pref[RandomCoin] = cov->pref[Average] = PREF_NONE; // kein setbackward?? // no setbackard return NOERROR; } void rangeave(cov_model VARIABLE_IS_NOT_USED *cov, range_type* ra){ int i; for (i=0; i<=1; i++) { ra->min[i] = RF_NEGINF; ra->max[i] = RF_INF; ra->pmin[i] = -10.0; ra->pmax[i] = 10.0; ra->openmin[i] = true; ra->openmax[i] = true; } ra->min[2] = 0; ra->max[2] = 1; ra->pmin[2] = 0; ra->pmax[2] = 1; ra->openmin[2] = false; ra->openmax[2] = false; } void sd_avestp(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S, int dim, double *sd){ ///// window_info *w = &(S->window); int d; double b, alphamin, x2, InvSqrt2a, EmA, *q = cov->q; // see article/GEOSTATS/simuspacetime/simuspacetime2008/simuspacetime.tex // for the reasoning of these calculations BUG; assert(cov->role == Average); q[AVESTP_LOGV] = LOG(q[AVESTP_V]); for (x2=0.0, d=0; dmax[d] - w->min[d]; x2 += lensimu * lensimu; } // x2 *= 0.25; b = 3.0 * q[AVESTP_V] * x2 / dim; alphamin = (4.0 + 4.0 * b - 2.0 * SQRT(4.0 * b * b + 8.0 * b + 1.0)) / 3.0; InvSqrt2a = 1.0 / SQRT(2.0 * alphamin * 6.0 * q[AVESTP_V]); *sd = InvSqrt2a; EmA = 1.0 - alphamin; cov->mpp.maxheights[0] = EXP(-0.5 * LOG(EmA) - 0.25 * LOG(alphamin) + b / EmA - 2 * x2); // proportional zum dritten Moment ! /* double radius = SQRT((-9 // so e^{-9} as threshold - 0.25 * dim * (q[AVESTP_LOGV] - 1.14473) // log pi - 0.25 * q[AVESTP_LOGDET] //+ 0.5 * cov_a->logdens - q[AVESTP_LOGMIXDENS] ) / ( - q[AVESTP_MINEIGEN] * q[AVESTP_V]) ); // ??? assert(radius > 0); */ } int structAve(cov_model *cov, cov_model **newmodel) { cov_model *shape, *gaussmix; int err; ASSERT_NEWMODEL_NOT_NULL; if (cov->role != Average) ILLEGAL_ROLE; if ((err = covCpy(newmodel, cov)) != NOERROR) return err; shape = *newmodel; shape->nr = SHAPEAVE; addModel(shape, AVE_GAUSS, GAUSS); gaussmix = shape->sub[AVE_GAUSS]; gaussmix->tsdim = 1; gaussmix->role = ROLE_GAUSS; gaussmix->method = SpectralTBM; return NOERROR; } void logshapeave(double *x, cov_model *cov, double *v, double *Sign) { // nur stationaer bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); int d, j, k, dim = spacetime ? cov->tsdim - 1 : cov->tsdim; double f, dummy, r2, *A = P(AVE_A), *z = P(AVE_Z), t = spacetime ? x[cov->tsdim-1] : 0.0, *q = cov->q; f = r2 = 0.0; for (k=d=0; dnr].logmixdens(x, q[AVESTP_LOGV], phi); /* g */// nicht gatternr ; Sign[0] = 1.0; double phase = q[AVERAGE_YPHASE] + q[AVERAGE_YFREQ] * (f - t); // Y Sign[1] = phase > 0.0 ? 1.0 : phase < 0.0 ? -1.0 : 0.0; v[1] = LOG(FABS(phase)); } int check_shapeave(cov_model *cov) { if (cov->sub[AVE_GAUSS] == NULL) SERR1("both submodels must be set to '%s'", CovList[GAUSS].nick); cov->mpp.maxheights[0] = RF_NA; return checkave(cov); // !! not next } int init_shapeave(cov_model *cov, gen_storage *s) { ASSERT_GAUSS_METHOD(Average); cov_model *gaussmix = cov->sub[AVE_GAUSS]; double sd, *q = cov->q; bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); int err = NOERROR, dim = spacetime ? cov->tsdim - 1 : cov->tsdim; q[AVESTP_V] = 0.0; q[AVESTP_MINEIGEN] = 1.0; q[AVESTP_LOGDET] = 0.0; sd_avestp(cov, s, dim, &sd); // sd->gauss assert(cov->vdim[0] == 1); assert(cov->vdim[0] == cov->vdim[1]); if (cov->mpp.moments >= 0) { cov->mpp.mM[0] = cov->mpp.mMplus[0] = 1.0; if (cov->mpp.moments >= 1) { if ((err = INIT(gaussmix, cov->mpp.moments, s)) != NOERROR) return err; if (cov->mpp.moments >= 2) { cov->mpp.mM[2] = 1.0; } } } return err; } void do_shapeave(cov_model *cov, gen_storage *S) { // Simulation of V; sopee Bernoulli Sec. 4.2 cov_model *aveGAUSS = cov->sub[AVE_GAUSS], *phi = cov->sub[AVE_PHI]; double spec_ret[StpMaxDim], sd, *q = cov->q; bool spacetime = (bool) (PisNULL(AVE_SPACETIME) || P0INT(AVE_SPACETIME)); int dim = spacetime ? cov->tsdim - 1 : cov->tsdim; CovList[phi->nr].drawmix(phi, q + AVESTP_V); // nicht gatternr sd_avestp(cov, S, dim, &sd); // sd->gauss BUG; SPECTRAL(aveGAUSS, S, spec_ret); // nicht gatternr q[AVERAGE_YFREQ] = *spec_ret * q[AVESTP_V]; q[AVERAGE_YPHASE] = TWOPI * UNIFORM_RANDOM; BUG; // what to do with the next line? } /* coxgauss, cmp with nsst1 !! */ // C = 2 (C + 4 M H M), H = h h^t // a = t - h M h - zh // EXP(- 0.5 * (h *h + 2 a^2 - mu C mu)) // stimmen die Vorzeichen?? // mu = h - 2 a M h /* cox, cmp with nsst1 !! */ // coxisham #define COX_MU 0 #define COX_D 1 #define COX_BETA 2 void GetEu2Dinv(cov_model *cov, double *x, int dim, double *det, double *Eu2Dinv, double *newxsq, double *newx, double *z) { double y[CoxMaxDim], *V = P(COX_MU), *D= P(COX_D), beta = P0(COX_BETA), t = x[dim], t2 = POW(FABS(t), beta); // standard t^2 int d, dimP1 = dim + 1, dimsq = dim * dim; for (d=0; dtsdim - 1; break; case COX_D : *nc = *nr = cov->tsdim - 1; break; case COX_BETA : *nc = *nr = 1; break; default: *nc = *nr = -1; } } void cox(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; int dim = cov->tsdim - 1, dimsq = dim * dim; double det, newx, newxsq; ALLOC_EXTRA(Eu2Dinv, dimsq); GetEu2Dinv(cov, x, dim, &det, Eu2Dinv, &newxsq, &newx, NULL); COV(&newx, next, v); *v /= SQRT(det); } void coxhess(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; int tsdim = cov->tsdim, dim = tsdim - 1, dimsq = dim * dim; double z[CoxMaxDim], det, newx, newxsq, phiD, phiD2; ALLOC_EXTRA(Eu2Dinv, dimsq); GetEu2Dinv(cov, x, dim, &det, Eu2Dinv, &newxsq, &newx, z); Abl2(&newx, next, &phiD2); if (newxsq == 0.0) { cpyUf(Eu2Dinv, phiD2 / SQRT(det), dim, tsdim, v); } else { Abl1(&newx, next, &phiD); cpyUf(Eu2Dinv, phiD / (SQRT(det) * newx), dim, tsdim, v); addzzT(v, (phiD2 - phiD/newx) / (SQRT(det) * newxsq), z, dim, tsdim); } } void coxnabla(double *x, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; int d, tsdim = cov->tsdim, dim = tsdim - 1, dimsq=dim * dim; double z[CoxMaxDim], det, newx, newxsq, phiD, factor; ALLOC_EXTRA(Eu2Dinv, dimsq); GetEu2Dinv(cov, x, dim, &det, Eu2Dinv, &newxsq, &newx, z); if (newxsq == 0.0) { for (d=0; d<=dim; d++) v[d] = 0.0; } else { newx = SQRT(newxsq); Abl1(&newx, next, &phiD); factor = phiD / (det * newx); for (d=0; dsub[0]; int err, i, dim = cov->tsdim - 1, dimsq = dim * dim; if (cov->xdimown < 2) SERR("The space-time dimension must be at least 2."); if (cov->ncol[COX_MU] != 1 || cov->nrow[COX_MU] != dim) { if (cov->ncol[COX_MU] == dim && cov->nrow[COX_MU] == 1) { cov->nrow[COX_MU] = dim; cov->ncol[COX_MU] = 1; } else { SERR3("mu is not given or not a vector of dimen. %d (nrow=%d ncol=%d)", dim, cov->nrow[COX_MU], cov->ncol[COX_MU]); } } // is matrix positive definite? if (PisNULL(COX_D)) { PALLOC(COX_D, dim, dim); for (i=0; irole // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; if (cov->tsdim != 3) cov->pref[SpectralTBM] = PREF_NONE;; next->delflag = DEL_COV; // set gatternr=nr, since non-negativity ensured if (!isNormalMixture(next->monotone)) return ERRORNORMALMIXTURE; if (CovList[next->nr].spectral == NULL) return ERRORSPECTRAL; // nicht gatternr // no setbackard updatepref(cov, next); if (P0(COX_BETA) != 2.0) cov->pref[SpectralTBM] = 0; cov->hess = true; EXTRA_STORAGE; return NOERROR; } void rangecox(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[COX_MU] = RF_NEGINF; range->max[COX_MU] = RF_INF; range->pmin[COX_MU] = -100.0; range->pmax[COX_MU] = +100.0; range->openmin[COX_MU] = true; range->openmax[COX_MU] = true; range->min[COX_D] = RF_NEGINF; range->max[COX_D] = RF_INF; range->pmin[COX_D] = -100.0; range->pmax[COX_D] = +100.0; range->openmin[COX_D] = false; range->openmax[COX_D] = false; range->min[COX_BETA] = 0.0; range->max[COX_BETA] = 2.0; range->pmin[COX_BETA] = 0.1; range->pmax[COX_BETA] = 2.0; range->openmin[COX_BETA] = true; range->openmax[COX_BETA] = false; } int initcox(cov_model *cov, gen_storage *s) { ASSERT_GAUSS_METHOD(SpectralTBM); cov_model *next = cov->sub[0]; return INIT(next, 0, s); } void spectralcox(cov_model *cov, gen_storage *s, double *e) { cov_model *next = cov->sub[0]; int d, dim = cov->tsdim - 1; double t, v[CoxMaxDim], *V = P(COX_MU), rho= P0(COX_D); SPECTRAL(next, s, e); // nicht gatternr v[0] = rnorm(0.0, INVSQRTTWO); v[1] = rho * v[0] + SQRT(1.0 - rho * rho) * rnorm(0.0, INVSQRTTWO); for (t = 0.0, d=0; dtsdim : 1; *nr = i < CovList[cov->nr].kappas ? cov->tsdim : -1; } void stp(double *x, double *y, cov_model *cov, double *v) { int d, j, k, dim =cov->tsdim, dimsq = dim * dim; double h[StpMaxDim], Mh[StpMaxDim], hSx[StpMaxDim], Syh[StpMaxDim], xi2x, xi2y, detA, hMh, cxy, zh, Q, Amux[StpMaxDim], Amuy[StpMaxDim], *Sc = P(STP_S), *M = P(STP_M), *z = P(STP_Z); cov_model *phi = cov->sub[STP_PHI], *Sf = cov->kappasub[STP_S], *xi2 =cov->sub[STP_XI2]; ALLOC_EXTRA(Sx, dimsq); ALLOC_EXTRA2(Sy, dimsq); ALLOC_EXTRA3(A, dimsq); if (Sf != NULL) { FCTN(x, Sf, Sx); // symmetric, pos definite !! FCTN(y, Sf, Sy); // // if (false) { // int ii; // printf("x=%f %f y=%f %f\n", x[0], x[1], y[0], y[1]); //for (ii=0; ii<4; ii++) printf("%f ", Sx[ii]); // printf("\n"); // for (ii=0; ii<4; ii++) printf("%f ", Sy[ii]); // printf("\n"); // } } else { int bytes = sizeof(double) * dimsq; MEMCOPY(Sx, Sc, bytes); MEMCOPY(Sy, Sc, bytes); } if (xi2 != NULL) { FCTN(x, xi2, &xi2x); FCTN(y, xi2, &xi2y); } else { xi2x = xi2y = 0.0; } for (k=0, d=0; dgatternr].aux_cov) != NULL) auxcf(x, y, Q, phi, v); else FCTN(&Q, phi, v); double dx = detU(Sx, dim), dy = detU(Sy, dim); *v *= POW(2.0, 0.5 * double(dim)) * POW(dx * dy / (detA * detA), 0.25); } int checkstp(cov_model *cov){ cov_model *phi = cov->sub[STP_PHI], *Sf = cov->kappasub[STP_S], *xi2 =cov->sub[STP_XI2]; int err, dim = cov->tsdim; ASSERT_CARTESIAN; if (dim > StpMaxDim) SERR2("For technical reasons max. dimension for ave is %d. Got %d.", StpMaxDim, cov->xdimprev); if (PisNULL(STP_S) && Sf==NULL) { // Sc if ((cov->px[STP_S] = EinheitsMatrix(dim)) == NULL) return ERRORMEMORYALLOCATION; cov->ncol[STP_S] = cov->nrow[STP_S] = dim; } if (PisNULL(STP_M)) { // M if ((cov->px[STP_M] = EinheitsMatrix(dim)) == NULL) return ERRORMEMORYALLOCATION; cov->ncol[STP_M] = cov->nrow[STP_M] = dim; } if (PisNULL(STP_Z)) { // z PALLOC(STP_Z, dim, 1); } if (cov->xdimprev != cov->tsdim) // || cov->xdimprev != cov->tsdim) return ERRORDIM; if ((err = CHECK(phi, dim, 1, PosDefType, XONLY, ISOTROPIC, SCALAR, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; if (!isNormalMixture(phi->monotone)) return ERRORNORMALMIXTURE; cov->pref[Average] = 5; if (Sf != NULL) { if ((err = CHECK(Sf, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, dim, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; } if (xi2 != NULL) { if ((err = CHECK(xi2, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, SCALAR, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; } // kein setbackward?? EXTRA_STORAGE; cov->mpp.maxheights[0] = RF_NA; return NOERROR; } void rangestp(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ int i; for (i=0; i<=2; i++) { /* S, M, z */ range->min[i] = RF_NEGINF; range->max[i]= RF_INF; range->pmin[i] = -1e10; range->pmax[i] = 1e10; range->openmin[i] = true; range->openmax[i] = true; } } int structStp(cov_model *cov, cov_model **newmodel) { cov_model *shape; int err; ASSERT_NEWMODEL_NOT_NULL; if (cov->role != Average) ILLEGAL_ROLE; if ((err = covCpy(newmodel, cov)) != NOERROR) return err; shape = *newmodel; shape->nr = SHAPESTP; addModel(shape, STP_GAUSS, GAUSS); shape->sub[STP_GAUSS]->tsdim = 1; return NOERROR; } int check_shapestp(cov_model *cov) { if (cov->sub[AVE_GAUSS] == NULL) SERR1("both submodels must be set to '%s'", CovList[GAUSS].nick); EXTRA_STORAGE; return checkstp(cov); // !! not next } int init_shapestp(cov_model *cov, gen_storage *s) { ASSERT_GAUSS_METHOD(Average); cov_model *Sf = cov->kappasub[STP_S], *gaussmix = cov->sub[STP_GAUSS]; double sd, *q = cov->q; int err = NOERROR; if (Sf != NULL) { double minmax[2]; assert(CovList[Sf->nr].minmaxeigenvalue != NULL); CovList[Sf->nr].minmaxeigenvalue(Sf, minmax); if (minmax[0] <= 0.0) ERR("neg eigenvalue in shape function of 'stp'"); q[AVESTP_MINEIGEN] = minmax[0]; q[AVESTP_LOGDET] = (double) cov->xdimprev * LOG(minmax[1]); } else { #define dummyN (5 * StpMaxDim) double value[StpMaxDim], ivalue[StpMaxDim], dummy[dummyN], det, min = RF_INF; int i, Ferr, dim = cov->tsdim, ndummy = dummyN; F77_NAME(dgeev)("No", "No", &dim, P(STP_S), &dim, value, ivalue, NULL, &dim, NULL, &dim, dummy, &ndummy, &Ferr); if (Ferr != 0) SERR("error in F77 function call"); det = 1.0; for (i=0; i v) min = v; } q[AVESTP_MINEIGEN] = min; q[AVESTP_LOGDET] = LOG(det); } q[AVESTP_LOGV] = 0.0; q[AVESTP_LOGMIXDENS] = 0.0; sd_avestp(cov, s, cov->tsdim, &sd); // sd->gauss assert(cov->vdim[0] == 1); assert(cov->vdim[0] == cov->vdim[1]); if (cov->mpp.moments >= 0) { cov->mpp.mM[0] = cov->mpp.mMplus[0] = 1.0; //// ??? notwendig if (cov->mpp.moments >= 1) { if ((err = INIT(gaussmix, 2, s)) != NOERROR) return err; if (cov->mpp.moments >= 2) cov->mpp.mM[2] = 1.0; } } return err; } void do_shapestp(cov_model *cov, gen_storage *s) { // Simulation of V; see Bernoulli Sec. 4.2 cov_model *stpGAUSS = cov->sub[STP_GAUSS], *phi = cov->sub[STP_PHI]; double spec_ret[StpMaxDim], sd, *q = cov->q; CovList[phi->nr].drawmix(phi, &(q[AVESTP_V])); sd_avestp(cov, s, cov->tsdim, &sd); // sd->gauss BUG; SPECTRAL(stpGAUSS, s, spec_ret); // nicht gatternr q[AVERAGE_YFREQ] = *spec_ret * SQRT(q[AVESTP_V]); q[AVERAGE_YPHASE] = TWOPI * UNIFORM_RANDOM; BUG; /// what to do with the next line? // info->logdens = CovList[phi->nr].logmixdens(ZERO, q[AVESTP_LOGV], phi); //info->radius = RF_INF; // info-sd s.o. } void logshapestp(double *x, double *u, cov_model *cov, double *v, double *Sign){ // kann um ca. Faktor 2 beschleunigt werden, wenn // Sx , logdetU, Hx fuer alle x abgespeichert werden // und die Werte dann aus dem Speicher gelesen werden // jedoch sehr Speicherintensiv. MEMCOPY braucht man auch nicht cov_model *Sf = cov->kappasub[STP_S], *xi2 =cov->sub[STP_XI2]; int j, k, d, dim= cov->xdimprev, dimsq = dim * dim, bytes = sizeof(double) * dimsq; double h[StpMaxDim], hSxh, hSx, xi, Mhd, *Sc = P(STP_S), *M = P(STP_M), *z = P(STP_Z), *q = cov->q; ALLOC_EXTRA(Sx, dimsq); if (Sf == NULL) { MEMCOPY(Sx, Sc, bytes); } else { FCTN(x, Sf, Sx); // symmetric, pos definite !! } if (xi2 == NULL) { xi = 0.0; } else { FCTN(x, xi2, &xi); } for (k=0, d=0; dnr].logmixdens(x, q[AVESTP_LOGV], phi) // g //nicht gatternr // - 0.5 * cov_a->logdens // f ; // 1 / SQRT(f) if (!(exponent < 5.0) && PL >= PL_DETAILS) { if (!(exponent < 6.0)) // could be NA, too PRINTF("\n%f logDetU=%f %f expon=%f", 0.25 * dim * (// M_LN2 + ??? !!! Rechnung!!! q[AVESTP_LOGV] - 2.0 * M_LN_SQRT_PI) // (2V/pi)^{d/4} , 0.25 * LOG(detU(Sx, dim)) /// Sx ^1/4 , -q[AVESTP_V]* hSxh // EXP(-V(U-x) S (U-x)) // , CovList[phi->nr].logmixdens(x, q[AVESTP_LOGV], phi)// g //, - 0.5 * cov_a->logdens // f , exponent); else PRINTF("!"); }; assert(EXP(exponent) < 10000000.0); double cos_value = COS(q[AVERAGE_YPHASE] + q[AVERAGE_YFREQ] * xi); *v = exponent + LOG(FABS(cos_value)) ; // Y *Sign = cos_value > 0.0 ? 1.0 : cos_value < 0.0 ? -1.0 : 0.0; } /* Whittle-Matern or Whittle or Besset */ #define RATIONAL_A 0 #define RATIONAL_a 1 void kappa_rational(int i, cov_model *cov, int *nr, int *nc){ *nc = (i == RATIONAL_A) ? cov->tsdim : 1; *nr = (i == RATIONAL_A) ? cov->tsdim : (i==RATIONAL_a) ? 2 : -1; } void minmaxEigenrational(cov_model *cov, double *mm) { double *a = P(RATIONAL_a); if (a[0] < a[1]) { mm[0] = a[0]; mm[1] = a[1]; } else { mm[0] = a[1]; mm[1] = a[0]; } } double maxEigenrational(cov_model VARIABLE_IS_NOT_USED *cov, double VARIABLE_IS_NOT_USED *mm) { double *a = P(RATIONAL_a); return (a[0] > a[1]) ? a[0] : a[1]; } void rational(double *x, cov_model *cov, double *v) { int i, k, j, dim = cov->tsdim; double nu, *A = P(RATIONAL_A), *a = P(RATIONAL_a); nu = 0.0; for (k=0, i=0; inrow[RATIONAL_a] == 1) { double dummy = P0(RATIONAL_a); PFREE(RATIONAL_a); PALLOC(RATIONAL_a, 2, 1); P(RATIONAL_a)[0] = dummy; P(RATIONAL_a)[1] = 0.0; } if ((err = checkkappas(cov)) != NOERROR) return err; cov->mpp.maxheights[0] = P(RATIONAL_a)[0] > P(RATIONAL_a)[1] ? P(RATIONAL_a)[0] : P(RATIONAL_a)[1]; return NOERROR; } void rangerational(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[RATIONAL_A] = RF_NEGINF; range->max[RATIONAL_A] = RF_INF; range->pmin[RATIONAL_A] = -1e10; range->pmax[RATIONAL_A] = 1e10; range->openmin[RATIONAL_A] = true; range->openmax[RATIONAL_A] = true; range->min[RATIONAL_a] = 0.0; range->max[RATIONAL_a] = RF_INF; range->pmin[RATIONAL_a] = 0.0; range->pmax[RATIONAL_a] = 10; range->openmin[RATIONAL_a] = false; range->openmax[RATIONAL_a] = true; } // Sigma(x) = diag>0 + A'xx'A #define EAXXA_E 0 #define EAXXA_A 1 #define ETAXXA_ALPHA 2 void kappa_EAxxA(int i, cov_model *cov, int *nr, int *nc){ *nc = (EAXXA_A == i) ? cov->tsdim : 1; *nr = i < CovList[cov->nr].kappas ? cov->tsdim : -1; } void EAxxA(double *x, cov_model *cov, double *v) { int d, k, j, dim = cov->tsdim; double xA[EaxxaMaxDim], *E = P(EAXXA_E), *A = P(EAXXA_A); for (k=0, d=0; dtsdim; for (mm[0] = RF_INF, mm[1]=RF_NEGINF, i=0; i mm[1]) mm[1] = E[i]; } } int checkEAxxA(cov_model *cov){ int err; if (cov->xdimown > EaxxaMaxDim) SERR2("For technical reasons max. dimension for ave is %d. Got %d.", EaxxaMaxDim, cov->xdimown); if ((err = checkkappas(cov)) != NOERROR) return err; cov->vdim[0] = cov->vdim[1] = cov->tsdim; cov->mpp.maxheights[0] = RF_NA; return NOERROR; } void rangeEAxxA(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[EAXXA_E] = 0.0; range->max[EAXXA_E] = RF_INF; range->pmin[EAXXA_E] = 0.0001; range->pmax[EAXXA_E] = 10; range->openmin[EAXXA_E] = true; range->openmax[EAXXA_E] = true; range->min[EAXXA_A] = RF_NEGINF; range->max[EAXXA_A] = RF_INF; range->pmin[EAXXA_A] = -1e10; range->pmax[EAXXA_A] = 1e10; range->openmin[EAXXA_A] = true; range->openmax[EAXXA_A] = true; } // Sigma(x) = diag>0 + A'xx'A void kappa_EtAxxA(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc){ int tsdim = 3; *nc = (i == EAXXA_A) ? tsdim : 1; *nr = (i == EAXXA_E || i==EAXXA_A) ? tsdim : (i==ETAXXA_ALPHA) ? 1 : -1; } void EtAxxA(double *x, cov_model *cov, double *v) { int d, k, j, dim = cov->tsdim, time = dim - 1; double xAR[EaxxaMaxDim], R[9], *E = P(EAXXA_E), *A = P(EAXXA_A), phi = P0(ETAXXA_ALPHA), c = COS(phi * x[time]), s = SIN(phi * x[time]); R[0] = R[4] = c; R[1] = s; R[3] = -s; R[2] = R[5] = R[6] = R[7] = 0.0; R[8] = 1.0; { double xA[EaxxaMaxDim]; for (k=0, d=0; dtsdim; for (mm[0] = RF_INF, mm[1]=RF_NEGINF, i=0; i mm[1]) mm[1] = E[i]; } } int checkEtAxxA(cov_model *cov){ int err; if (cov->xdimown != 3) SERR("The space-time dimension must be 3."); cov->vdim[0] = cov->vdim[1] = cov->tsdim; if ((err = checkkappas(cov)) != NOERROR) return err; cov->mpp.maxheights[0] = RF_NA; return NOERROR; } void rangeEtAxxA(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ int i; for (i=0; i<=2; i++) { range->min[i] = RF_NEGINF; range->max[i] = RF_INF; range->pmin[i] = -1e10; range->pmax[i] = 1e10; range->openmin[i] = true; range->openmax[i] = true; } range->min[EAXXA_E] = 0.0; range->max[EAXXA_E] = RF_INF; range->pmin[EAXXA_E] = 0.0001; range->pmax[EAXXA_E] = 10; range->openmin[EAXXA_E] = true; range->openmax[EAXXA_E] = true; } // Sigma(x) = diag>0 + A'xx'A #define ROTAT_PHI 0 // both rotat and Rotat #define ROTAT_SPEED 1 void kappa_rotat(int i, cov_model *cov, int *nr, int *nc){ *nc = 1; *nr = i < CovList[cov->nr].kappas ? 1 : -1; } void rotat(double *x, cov_model *cov, double *v) { int dim = cov->tsdim, time = dim - 1; double speed = P0(ROTAT_SPEED), phi = P0(ROTAT_PHI), absx = SQRT(x[0] * x[0] + x[1] * x[1]); *v = (absx == 0.0) ? 0.0 : speed * (COS(phi * x[time]) * x[0] + SIN(phi * x[time]) * x[1]) / absx; } void minmaxEigenrotat(cov_model VARIABLE_IS_NOT_USED *cov, double *mm) { mm[0] = -1; mm[1] = 1; } int checkrotat(cov_model *cov){ int err; if (cov->xdimown != 3) SERR("The space-time dimension must be 3."); if ((err = checkkappas(cov)) != NOERROR) return err; cov->mpp.maxheights[0] = RF_NA; return NOERROR; } void rangerotat(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ int i; for (i=0; i<2; i++) { range->min[i] = RF_NEGINF; range->max[i] = RF_INF; range->pmin[i] = -1e10; range->pmax[i] = 1e10; range->openmin[i] = true; range->openmax[i] = true; } } // Sigma(x) = diag>0 + A'xx'A void kappa_Rotat(int i, cov_model *cov, int *nr, int *nc){ *nc = 1; *nr = i < CovList[cov->nr].kappas ? 1 : -1; } void Rotat(double *x, cov_model *cov, double *v) { int d, k, j, dim = cov->tsdim, time = dim - 1; double phi = P0(ROTAT_PHI), c = COS(phi * x[time]), s = SIN(phi * x[time]), R[9]; assert(dim ==3); R[0] = R[4] = c; R[1] = s; R[3] = -s; R[2] = R[5] = R[6] = R[7] = 0.0; R[8] = 1.0; for (k=0, d=0; dxdimown != 3) SERR("The space-time dimension must be 3."); if ((err = checkkappas(cov)) != NOERROR) return err; cov->vdim[0] = cov->vdim[1] = cov->tsdim; cov->mpp.maxheights[0] = RF_NA; return NOERROR; } void rangeRotat(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[ROTAT_PHI] = RF_NEGINF; range->max[ROTAT_PHI] = RF_INF; range->pmin[ROTAT_PHI] = -1e10; range->pmax[ROTAT_PHI] = 1e10; range->openmin[ROTAT_PHI] = true; range->openmax[ROTAT_PHI] = true; } /* nsst */ /* Tilmann Gneiting's space time models, part I */ void nsst(double *x, cov_model *cov, double *v) { cov_model *subphi = cov->sub[0]; cov_model *subpsi = cov->sub[1]; double v1, v2, psi, y; COV(ZERO, subpsi, &v1); COV(x + 1, subpsi, &v2); psi = SQRT(1.0 + v1 - v2); // C0 : C(0) oder 0 // Cx : C(x) oder -gamma(x) y = x[0] / psi; COV(&y, subphi, v); *v *= POW(psi, -P0(NSST_DELTA)); } void Dnsst(double *x, cov_model *cov, double *v) { cov_model *subphi = cov->sub[0]; cov_model *subpsi = cov->sub[1]; double v1, v2, psi, y; COV(ZERO, subpsi, &v1); COV(x + 1, subpsi, &v2); psi = SQRT(1.0 + v1 - v2); // C0 : C(0) oder 0 // Cx : C(x) oder -gamma(x) y = x[0] / psi; Abl1(&y, subphi, v); *v *= POW(psi, -P0(NSST_DELTA) - 1.0); } void TBM2nsst(double *x, cov_model *cov, double *v) { cov_model *subphi = cov->sub[0]; cov_model *subpsi = cov->sub[1]; double v1, v2, psi, y; assert(false); COV(ZERO, subpsi, &v1); COV(x + 1, subpsi, &v2); psi = SQRT(1.0 + v1 - v2); // C0 : C(0) oder 0 // Cx : C(x) oder -gamma(x) y = x[0] / psi; TBM2CALL(&y, subphi, v); *v *= POW(psi, -P0(NSST_DELTA)); } int checknsst(cov_model *cov) { cov_model *subphi = cov->sub[0]; cov_model *subpsi = cov->sub[1]; int err; if (cov->xdimown != 2) SERR("reduced dimension must be 2"); if ((err = checkkappas(cov)) != NOERROR) return err; cov->finiterange = false; if ((err = CHECK(subphi, cov->tsdim, 1, PosDefType, XONLY, ISOTROPIC, SCALAR, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; if (!isNormalMixture(subphi->monotone)) return(ERRORNORMALMIXTURE); setbackward(cov, subphi); assert(cov->finiterange != true); // if ((err = CHECK(subpsi, 1, 1, VariogramType, XONLY, ISOTROPIC, SCALAR, cov->role // ROLE_COV changed 20.7.14 wg spectral )) != NOERROR) return err; subphi->delflag = subpsi->delflag = DEL_COV-20; // kein setbackward(cov, subpsi); return NOERROR; } void rangensst(cov_model *cov, range_type* range){ range->min[NSST_DELTA] = cov->tsdim - 1; range->max[NSST_DELTA] = RF_INF; range->pmin[NSST_DELTA] = cov->tsdim - 1; range->pmax[NSST_DELTA] = 10.0; range->openmin[NSST_DELTA] = false; range->openmax[NSST_DELTA] = true; } /* gennsst */ /* generalisation in schlather, bernoulli 2010 */ #define GENNSST_INTERN_A 0 void kappa_gennsst_intern(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc){ *nc = *nr = i == 0 ? 0 : -1; } void nonstatgennsst_intern(double *x,double *y, cov_model *cov, double *v) { cov_model *next = cov->sub[0]; double det, z, *A = P(GENNSST_INTERN_A); int d, dim = cov->tsdim; ALLOC_EXTRA(ds, dim); // printf("\nx=%f %f %f \ny=%f %f %f\nz=%f %f %f\n %f %f %f\n %f %f %f\n", x[0], x[1], x[2], y[0],y[1],y[2], A[0], A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8]); // PMI(cov->calling->sub[1]); det_UpperInv(A, &det, dim); for (d=0; dCartesian->isotropic hinzubekommen // und ^- hier noch mit A zu multiplizieren cov_model *next = cov->sub[0]; int err, dim = cov->xdimown; assert(cov->tsdim == cov->xdimown); if ((err = CHECK(next, cov->tsdim, 1, PosDefType, XONLY, ISOTROPIC, SCALAR, cov->role )) != NOERROR) return err; if (!isNormalMixture(next->monotone)) return ERRORNORMALMIXTURE; //APMI(cov->calling); if (PisNULL(GENNSST_INTERN_A)) { PALLOC(GENNSST_INTERN_A, dim, dim); } else if (cov->nrow[GENNSST_INTERN_A] != dim) { PFREE(GENNSST_INTERN_A); PALLOC(GENNSST_INTERN_A, dim, dim); } cov->finiterange = false; setbackward(cov, next); assert(!cov->finiterange); cov->vdim[0] = cov->vdim[1] = 1; EXTRA_STORAGE; return NOERROR; } void range_gennsst_intern(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[GENNSST_INTERN_A] = RF_NEGINF; range->max[GENNSST_INTERN_A] = RF_INF; range->pmin[GENNSST_INTERN_A] = -100.0; range->pmax[GENNSST_INTERN_A] = +100.0; range->openmin[GENNSST_INTERN_A] = true; range->openmax[GENNSST_INTERN_A] = true; } #define GENNSST_DELTA 0 void nonstatgennsst(double *x,double *y, cov_model *cov, double *v) { cov_model *subphi = cov->key; cov_model *subpsi = cov->sub[1]; int i, dim = cov->tsdim, dimSq = dim * dim; // print("A %s\n", TYPENAMES[subpsi->typus]); NONSTATCOV(x, y, subpsi, PARAM(subphi, GENNSST_INTERN_A)); if (isVariogram(subpsi)) { ALLOC_EXTRA(z, dimSq); NONSTATCOV(ZERO, ZERO, subpsi, z); for (i=0; itypus != NegDefType) BUG; // print("%f %f %f %f dim = %d %f %f %f %f %s\n", x[0], x[1], y[0], y[1], dim, v1[0], v1[1], v1[2], v1[3],NAME(subpsi)); NONSTATCOV(x, y, subphi, v); } int checkgennsst(cov_model *cov) { cov_model *subphi = cov->sub[0]; cov_model *subpsi = cov->sub[1]; #define ncs 3 int err, UCS = UpgradeToCoordinateSystem(cov->isoown); assert(cov->tsdim == cov->xdimown); if (cov->q == NULL) { QALLOC(1); cov->q[0]=NOERROR; } if (isSpherical(cov->isoown)) return cov->q[0]!=NOERROR ? (int) cov->q[0] : ERRORFAILED; if (UCS == ISO_MISMATCH) return cov->q[0]!=NOERROR ? (int) cov->q[0] : ERRORODDCOORDTRAFO; if (cov->xdimown != cov->tsdim) SERR("logical and physical dimension differ"); //STOPAFTER(cov->isoown==EARTH_COORD || true, PMI(cov)); // assert(cov->isoown ==EARTH_ISOTROPIC || __stopafter__ ==1); if (cov->key == NULL) { if ((err = covCpy(&(cov->key), subphi)) != NOERROR) return err; addModel(&(cov->key), GENNSST_INTERN); } if ((cov->q[0] =err = CHECK(cov->key, cov->tsdim, cov->tsdim, PosDefType, KERNEL, SYMMETRIC, // viel zu schwach, geht aber // z.Zt. nicht anders // hinsichtlich der Koordinatentransformation // -- wird das interne modell abgefangen SCALAR, cov->role )) != NOERROR) { return err; } // PL = GLOBAL.general.Cprintlevel = 7; // MUSSS ZWINGEND ALS ZWEITES KOMMEN if ((err = CHECK(subpsi, cov->tsdim, cov->tsdim, NegDefType, KERNEL, UCS, cov->key->xdimown, cov->role)) != NOERROR) { return err; } cov->finiterange = false; setbackward(cov, cov->key); assert(!cov->finiterange); // cov->vdim[0] = cov->vdim[1] = 1; EXTRA_STORAGE; COV_DELETE(cov->sub + 0); if ((err = covCpy(cov->sub + 0, cov->key->sub[0])) != NOERROR) BUG; cov->sub[0]->calling = cov; // PMI(cov->calling); assert(err == NOERROR);BUG; // ERR(err); BUG; // kein setbackward(cov, subpsi); return NOERROR; } RandomFields/src/QMath.cc0000644000176200001440000004224413074763020014741 0ustar liggesusers// This file has been created automatically by 'rfGenerateMaths' #include #include "RF.h" #include "primitive.h" void MathACos(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ACOS(w[0]); } void MathASin(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ASIN(w[0]); } void MathATan(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ATAN(w[0]); } void MathAtan2(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ATAN2(w[0], w[1]); } void MathCos(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = COS(w[0]); } void MathSin(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = SIN(w[0]); } void MathTan(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = TAN(w[0]); } void MathAcosh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ACOSH(w[0]); } void MathAsinh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ASINH(w[0]); } void MathAtanh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ATANH(w[0]); } void MathCosh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = COSH(w[0]); } void MathSinh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = SINH(w[0]); } void MathTanh(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = TANH(w[0]); } void MathExp(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = EXP(w[0]); } void MathLog(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = LOG(w[0]); } void MathExpm1(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = EXPM1(w[0]); } void MathLog1p(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = LOG1P(w[0]); } void MathLogb(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = LOGB(w[0]); // printf("logb %f\t%f\n", *v, logb(w[0])); } void MathExp2(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = EXP(w[0]); // printf("e %f\t%f\n", *v, EXP2(w[0])); } void MathLog2(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = LOG_BASE2(w[0]); // printf("e %f\t%f\n", *v, LOG_BASE2(w[0])); } void MathPow(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = POW(w[0], w[1]); } void MathSqrt(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = SQRT(w[0]); } void MathHypot(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = HYPOT(w[0], w[1]); // printf("e %f\t%f\n", *v, HYPOT(w[0], w[1])); } void MathCbrt(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = CBRT(w[0]); // printf("e %f\t%f\n", *v, CBRT(w[0])); } void MathCeil(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = CEIL(w[0]); } void MathFABS(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FABS(w[0]); } void MathFloor(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FLOOR(w[0]); } void MathFmod(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FMOD(w[0], w[1]); //printf("e %f\t%f\n", *v, FMOD(w[0], w[1])); } void MathRound(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ROUND(w[0]); } void MathTrunc(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = TRUNC(w[0]); } /* void Mathnearbyint(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = std::nearbyint(w[0]); } void MathLrint(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = std::lrint(w[0]); } void MathLlrint(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = llrint(w[0]); } void MathLRound(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = l ROUND(w[0]); } void MathLLRound(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = ll ROUND(w[0]); } void MathCopysign(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = copysign(w[0], w[1]); } void MathRint(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = rint(w[0]); } void MathNextafter(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = nextafter(w[0], w[1]); } void MathNexttoward(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = nexttoward(w[0], w[1]); } */ void MathErf(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = 1.0 - 2.0 * pnorm(w[0], 0.0, INVSQRTTWO, 0, 0); } void MathErfc(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = 2.0 * pnorm(w[0], 0.0, INVSQRTTWO, 0, 0); } void MathGamma(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = gammafn(w[0]); } void MathLgamma(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = lgammafn(w[0]); } void MathRemainder(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = REMAINDER(w[0], w[1]); // printf("e %f\t%f\t%f\n", *v, REMAINDER(w[0], w[1]), fr ound(w[1], 0)); } void MathFdim(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FDIM(w[0], w[1]); // printf("e %f\t%f\n", *v, FDIM(w[0], w[1])); } void MathFmax(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FMAX(w[0], w[1]); } void MathFmin(double *x, cov_model *cov, double *v){ MATH_DEFAULT *v = FMIN(w[0], w[1]); } void includeStandardMath() { IncludeModel(".acos", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("acos"); kappanames("a", REALSXP); addCov(MathACos, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".asin", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("asin"); kappanames("a", REALSXP); addCov(MathASin, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".atan", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("atan"); kappanames("a", REALSXP); addCov(MathATan, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".atan2", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("atan2"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathAtan2, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".cos", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("cos"); kappanames("a", REALSXP); addCov(MathCos, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".sin", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("sin"); kappanames("a", REALSXP); addCov(MathSin, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".tan", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("tan"); kappanames("a", REALSXP); addCov(MathTan, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".acosh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("acosh"); kappanames("a", REALSXP); addCov(MathAcosh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".asinh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("asinh"); kappanames("a", REALSXP); addCov(MathAsinh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".atanh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("atanh"); kappanames("a", REALSXP); addCov(MathAtanh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".cosh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("cosh"); kappanames("a", REALSXP); addCov(MathCosh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".sinh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("sinh"); kappanames("a", REALSXP); addCov(MathSinh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".tanh", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("tanh"); kappanames("a", REALSXP); addCov(MathTanh, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".exp", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("exp"); kappanames("a", REALSXP); addCov(MathExp, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".log", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("log"); kappanames("a", REALSXP); addCov(MathLog, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".expm1", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("expm1"); kappanames("a", REALSXP); addCov(MathExpm1, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".log1p", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("log1p"); kappanames("a", REALSXP); addCov(MathLog1p, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".logb", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("logb"); kappanames("a", REALSXP); addCov(MathLogb, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".exp2", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("exp2"); kappanames("a", REALSXP); addCov(MathExp2, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".log2", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("log2"); kappanames("a", REALSXP); addCov(MathLog2, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".pow", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("pow"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathPow, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".sqrt", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("sqrt"); kappanames("a", REALSXP); addCov(MathSqrt, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".hypot", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("hypot"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathHypot, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".cbrt", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("cbrt"); kappanames("a", REALSXP); addCov(MathCbrt, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".ceil", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("ceil"); kappanames("a", REALSXP); addCov(MathCeil, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".fabs", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("fabs"); kappanames("a", REALSXP); addCov(MathFABS, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".floor", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("floor"); kappanames("a", REALSXP); addCov(MathFloor, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".fmod", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("fmod"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathFmod, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".round", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("round"); kappanames("a", REALSXP); addCov(MathRound, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".trunc", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("trunc"); kappanames("a", REALSXP); addCov(MathTrunc, NULL, NULL); AddVariant(TrendType, PREVMODELI); /* IncludeModel(".nearbyint", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("nearbyint"); kappanames("a", REALSXP); addCov(MathNearbyint, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".lrint", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("lrint"); kappanames("a", REALSXP); addCov(MathLrint, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".llrint", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("llrint"); kappanames("a", REALSXP); addCov(MathLlrint, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".lround", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("lround"); kappanames("a", REALSXP); addCov(MathLRound, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".llround", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("llround"); kappanames("a", REALSXP); addCov(MathLLRound, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".copysign", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("copysign"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathCopysign, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".rint", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("rint"); kappanames("a", REALSXP); addCov(MathRint, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".nextafter", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("nextafter"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathNextafter, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".nexttoward", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("nexttoward"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathNexttoward, NULL, NULL); AddVariant(TrendType, PREVMODELI); */ IncludeModel(".erf", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("erf"); kappanames("a", REALSXP); addCov(MathErf, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".erfc", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("erfc"); kappanames("a", REALSXP); addCov(MathErfc, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".gamma", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("gamma"); kappanames("a", REALSXP); addCov(MathGamma, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".lgamma", MathDefinition, 0, 0, 1, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("lgamma"); kappanames("a", REALSXP); addCov(MathLgamma, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".remainder", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("remainder"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathRemainder, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".fdim", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("fdim"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathFdim, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".fmax", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("fmax"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathFmax, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel(".fmin", MathDefinition, 0, 0, 2, NULL, XONLY, PREVMODELI,checkMath,rangeMath, PREF_TREND, false, SCALAR, PREVMODEL_DEP, false, false); nickname("fmin"); kappanames("a", REALSXP, "b", REALSXP); addCov(MathFmin, NULL, NULL); AddVariant(TrendType, PREVMODELI); } RandomFields/src/SpherModelsInitNerror.h0000644000176200001440000000030113074763020020016 0ustar liggesusers/* SpherModelsinitNerror.h */ #ifndef SPHERMODELSinitNerror_H #define SPHERMODELSinitNerror_H 1 /* declaration of functions */ void SpherModelsinit( ); #endif /* SpherModelsinitNerror.h */ RandomFields/src/SpherModels.h0000644000176200001440000000116013074763020016006 0ustar liggesusers/* SpherModels.h */ #ifndef SPHERMODELS_H #define SPHERMODELS_H 1 // declaration of functions void SinePower(double *x, cov_model *cov, double *v); void rangeSinePower(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range); void Multiquad(double *x, cov_model *cov, double *v); void rangeMultiquad(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range); /* void kappa_choquet(int i, cov_model *cov, int *nr, int *nc); void Choquet(double *x, cov_model *cov, double *v); void rangeChoquet(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range); int checkChoquet(cov_model *cov); */ #endif /* SpherModels.h */ RandomFields/src/variogramAndCo.h0000644000176200001440000001727513074763020016473 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef variogramAndCo_H #define variogramAndCo_H 1 #define STANDARDSTART_X \ assert(loc != NULL && loc->xgr[0] != NULL); \ cumgridlen[0] = 1; \ for (d=0; dxgr[d][XSTEP]; \ gridlen[d] = loc->xgr[d][XLENGTH]; \ cumgridlen[d+1] = gridlen[d] * cumgridlen[d]; \ \ start[d] = 0; \ end[d] = gridlen[d]; \ nx[d] = start[d]; \ x[d] = xstart[d] = loc->xgr[d][XSTART]; \ } \ /* VARIABLE_IS_NOT_USED isposdef = isPosDef(cov), tsdim VARIABLE_IS_NOT_USED = loc->timespacedim, VARIABLE_IS_NOT_USED xdimOZ = loc->xdimOZ, // weicht u.U. von tsdim bei dist=true ab VARIABLE_IS_NOT_USED vdim0P1 = vdim0 + 1, */ #define FINISH_START(whereSpgs, whereVdim, ignore_y, vdim2) \ if (whereSpgs->Spgs == NULL) BUG; \ pgs_storage *pgs= whereSpgs->Spgs; \ assert(pgs->x != NULL); \ location_type *loc = Loc(cov); \ assert(loc != NULL); \ /*bool grid =loc->grid && !loc->Time && loc->caniso==NULL, why !time ?? 10.3.15*/ \ bool grid =loc->grid && loc->caniso==NULL, \ trafo = (loc->Time || loc->caniso != NULL) && !loc->distances, \ ygiven = !(ignore_y) && (loc->y != NULL || loc->ygr[0] != NULL);/* might be changed !*/ \ long cumgridlen[MAXMPPDIM +1], \ err = NOERROR, \ tot = loc->totalpoints; \ int d, \ vdim0 = whereVdim->vdim[0], \ vdimSq = vdim0 * whereVdim->vdim[vdim2], /*not nec. squ!!*/ \ *gridlen=pgs->gridlen, \ *start=pgs->start, \ *end=pgs->end, \ *endy =pgs->endy, \ *startny =pgs->startny, \ *ny = pgs->delta, \ *nx=pgs->nx, \ tsxdim = cov->xdimprev; /* weicht u.U. von tsdim bei dist=true ab */ \ long vdim0tot = vdim0 * tot, \ vdimSqtot = vdimSq * tot; \ double *x = pgs->x, \ *xstart= pgs->xstart, \ *inc=pgs->inc, \ *ystart =pgs->supportmax, \ *yy = NULL, /* set by TransformLoc; freed */ \ *xx = NULL, /* dito */ \ *incy =pgs->supportcentre; \ if (grid) { \ STANDARDSTART_X; \ } \ loc->i_row = 0; \ loc->i_col = I_COL_NA #define INCLUDE_VAL \ long i, ii, v, j; \ double **Val= pgs->Val, \ *cross=pgs->cross; \ if (vdimSq > 1) { \ for (v = i = 0; i 0) { \ char wrn[200]; \ SPRINTF(wrn, "'%s' is called with a single variable only, although it is used as a kernel. So, the second variable is set to zero, here.\n", NICK(cov)); \ warning(wrn); \ } #define STANDARDINKREMENT \ d = 0; \ nx[d]++; \ x[d] += inc[d]; \ while (nx[d] >= end[d]) { \ nx[d] = start[d]; \ x[d] = xstart[d]; \ if (++d >= tsxdim) break; \ nx[d]++; \ x[d] += inc[d]; \ } \ if (d >= tsxdim) break // end define StandardInkrement // Achtung hier *nicht* incy, starty #define STANDARDINKREMENT_Y \ d = 0; \ ny[d]++; \ y[d] += incy[d]; \ while (ny[d] >= endy[d]) { \ ny[d] = startny[d]; \ y[d] = ystart[d]; \ if (++d >= tsxdim) break; \ ny[d]++; \ y[d] += incy[d]; \ } // end define StandardInkrement_Y // ny wird nur inv CovMatrix verwendet! Stattdessen dort weder // ystart noch incy! #define STANDARDSTART_Y_SUPPL \ for (d=0; dygr[d]==NULL ? loc->xgr[d][XSTEP] : loc->ygr[d][XSTEP]; \ y[d] = ystart[d] = \ loc->ygr[d]==NULL ? loc->xgr[d][XSTART] : loc->ygr[d][XSTART]; \ endy[d] = loc->ygr[d]==NULL ? loc->xgr[d][XLENGTH]:loc->ygr[d][XLENGTH]; \ startny[d] = 0; \ ny[d] = startny[d]; \ } #define RECYCLE_Y \ if (d>tsxdim) \ for (d=0; dygr[d][XSTART]; \ ny[d] = startny[d]; \ } #define STANDARD_ENDE \ FREE(xx); \ FREE(yy); \ loc->i_col = loc->i_row = I_COL_NA; #define GRIDCYCLE_Y(SOME_FCTN) \ while (true) { \ SOME_FCTN; \ loc->i_row++; \ if (ygiven) { STANDARDINKREMENT_Y; RECYCLE_Y;} \ STANDARDINKREMENT; \ } #define GRIDCYCLE(SOME_FCTN) \ while (true) { \ SOME_FCTN; \ loc->i_row++; \ STANDARDINKREMENT; \ } #define DO_INCREMENTY , y+=tsxdim #define DO_RECYCLY if (y >= yend) y = y0; #define EMPTY #define NONGRIDCYCLE(INCREMENTY, RECYCLY, FCTN1, FCTN2) \ if (vdimSq == 1) { \ for (; loc->i_rowi_row++, x+=tsxdim INCREMENTY){ \ RECYCLY \ FCTN1; \ } \ } else { \ for (; loc->i_rowi_row++, x+=tsxdim INCREMENTY){ \ RECYCLY \ FCTN2; \ } \ } #define PERFORM(UNIVAR_FCTN, MULTIVAR_FCTN, UNIVAR_FCTN_Y, MULTIVAR_FCTN_Y) \ if (grid) { \ if (ygiven || kernel) { \ STANDARDSTART_Y_SUPPL; \ if (vdimSq == 1) { GRIDCYCLE_Y(UNIVAR_FCTN_Y; value+=vdimSq); \ } else { GRIDCYCLE_Y(MULTIVAR_FCTN_Y); } \ } else { /* grid, y not given */ \ if (vdimSq == 1) { \ GRIDCYCLE(UNIVAR_FCTN; value+=vdimSq); \ } else {GRIDCYCLE(MULTIVAR_FCTN); } \ } \ } else { /* not a grid */ \ if (trafo) { \ TransformLoc(cov, &xx, &yy, false); \ x = xx; \ if (ygiven) y = yy; \ } else { \ x=loc->x; \ if (ygiven) y=loc->y; \ } \ assert(ygiven xor (y==ZERO)); \ if (ygiven || kernel) { \ double *y0, *yend; \ yend = ygiven ? y + tsxdim * loc->ly : ZERO; \ y0 = y; \ NONGRIDCYCLE(DO_INCREMENTY, DO_RECYCLY, UNIVAR_FCTN_Y; value+=vdimSq,\ MULTIVAR_FCTN_Y); \ } else { \ NONGRIDCYCLE(EMPTY, EMPTY, UNIVAR_FCTN; value+=vdimSq, MULTIVAR_FCTN); \ } \ STANDARD_ENDE; \ if (err != NOERROR) XERR(err); \ } void CovVario(cov_model *cov, bool is_cov, bool pseudo, double *value); ///void CovIntern(int reg, double *x, double *value); void CovIntern(int reg, double *x, double *y, long lx, long ly, double *value); void PseudovariogramIntern(int reg, double *x, double *y, long lx, long ly, double *value); void PseudovariogramIntern(int reg, double *x, double *value); void CovarianceMatrix(cov_model *cov,double *COV); void InverseCovMatrix(cov_model *cov, double *v, double *det); void StandardCovariance(cov_model *cov, double *v); void StandardCovMatrix(cov_model *cov, double *v); void StandardInverseCovMatrix(cov_model *cov, double *inverse, double *det); void StandardVariogram(cov_model *cov, double *v); void StandardPseudoVariogram(cov_model *cov, double *v); #endif RandomFields/src/plusmalS.cc0000644000176200001440000031764313074763020015537 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Definition of auxiliary correlation functions Note: * Never use the below functions directly, but only by the functions indicated in RFsimu.h, since there is gno error check (e.g. initialization of RANDOM) * VARIANCE, SCALE are not used here * definitions for the random coin method can be found in MPPFcts.cc * definitions for genuinely anisotropic or nonsta tionary models are in SophisticatedModel.cc; hyper models also in Hypermodel.cc Copyright (C) 2001 -- 2003 Martin Schlather Copyright (C) 2004 -- 2004 Yindeng Jiang & Martin Schlather Copyright (C) 2005 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "RF.h" #include "Operator.h" #include "variogramAndCo.h" // $ bool hasVarOnly(cov_model *cov) { if (cov == NULL || !isDollar(cov)) BUG; if (!PisNULL(DSCALE) && P0(DSCALE) != 1.0) return false; if (!PisNULL(DANISO) || !PisNULL(DPROJ)) return false; int i, kappas = CovList[cov->nr].kappas; for (i=0; ikappasub[i] != NULL) return false; return true; } void kappaS(int i, cov_model *cov, int *nr, int *nc){ switch(i) { case DVAR : case DSCALE : *nr = *nc = 1; break; case DANISO : *nr = cov->xdimown; *nc = SIZE_NOT_DETERMINED; break; case DAUSER : *nr = SIZE_NOT_DETERMINED; *nc = cov->xdimown; break; case DPROJ : *nr = SIZE_NOT_DETERMINED; *nc = 1; break; default : *nr = *nc = -1; } } // simple transformations as variance, scale, anisotropy matrix, etc. void Siso(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[DOLLAR_SUB]; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim; double y, *aniso=P(DANISO), *scale =P(DSCALE), var = P0(DVAR); assert(cov->Sdollar->simplevar); y = *x; if (aniso != NULL) y = FABS(y * aniso[0]); // printf("scale = %d %d\n", scale == NULL, aniso == NULL); // printf("scale = %f %f \n", scale[0], *x); if (scale != NULL) y = scale[0]>0.0 ? y / scale[0] : (y == 0.0 && scale[0]==0.0) ? 0.0 : RF_INF; // letzteres darf nur passieren wenn dim = 1!! COV(&y, next, v); for (i=0; isub[DOLLAR_SUB]; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim; double y, *aniso=P(DANISO), *scale =P(DSCALE), logvar = LOG(P0(DVAR)); assert(cov->Sdollar->simplevar); y = *x; if (aniso != NULL) y = FABS(y * aniso[0]); if (scale != NULL) y = scale[0]>0.0 ? y / scale[0] : (y == 0.0 && scale[0]==0.0) ? 0.0 : RF_INF; LOGCOV(&y, next, v, Sign); for (i=0; ikappasub[DSCALE] == NULL && (cov->kappasub[DAUSER]==NULL || CovList[cov->kappasub[DAUSER]->nr].check==checkAngle)); cov_model *next = cov->sub[DOLLAR_SUB]; // *Aniso = cov->kappasub[DAUSER], // *Scale = cov->kappasub[DSCALE]; double *z1 = NULL, *scale =P(DSCALE), *aniso=P(DANISO); int i, nproj = cov->nrow[DPROJ], vdim = cov->vdim[0], vdimSq = vdim * vdim; if (nproj > 0) { int *proj = PINT(DPROJ); ALLOC_DOLLAR(z, nproj); if (scale == NULL || scale[0] > 0.0) { if (scale == NULL) for (i=0; ivdim[0]; // ALLOC_DOLLAR(z, dim); // FCTN(x, Aniso, z); // z1 = z; // } else if (Scale != NULL) { // int dim = Aniso->vdim[0]; // ALLOC_DOLLAR(z, dim); // FCTN(x, Aniso, z); // z1 = z; } else if (aniso==NULL && (scale == NULL || scale[0] == 1.0)) { z1 = x; } else { int xdimown = cov->xdimown; double *xz; // printf("xdimown %d\n", xdimown); BUG; ALLOC_DOLLAR(z, xdimown); if (aniso!=NULL) { xA(x, aniso, cov->nrow[DANISO], cov->ncol[DANISO], z); xz = z; } else xz = x; if (scale != NULL) { if (scale[0] > 0.0) { double invscale = 1.0 / scale[0]; for (i=0; i < xdimown; i++) z[i] = invscale * xz[i]; } else { for (i=0; i < xdimown; i++) z[i] = (xz[i] == 0.0 && scale[0] == 0.0) ? 0.0 : RF_INF; } } z1 = z; } double var; if (cov->Sdollar->simplevar) { var = P0(DVAR); } else { FCTN(x, cov->kappasub[DVAR], &var); } if (Sign==NULL) { COV(z1, next, v); for (i=0; isub[DOLLAR_SUB], *Aniso = cov->kappasub[DAUSER], *Scale = cov->kappasub[DSCALE]; double *z1, *z2, s1 = RF_NA, s2 = RF_NA, smeanSq=RF_NA, *scale =P(DSCALE), *aniso=P(DANISO); int i, nproj = cov->nrow[DPROJ], vdim = cov->vdim[0], vdimSq = vdim * vdim; if (nproj > 0) { int *proj = PINT(DPROJ); ALLOC_DOLLARY(Z1, Z2, nproj); z1 = Z1; z2 = Z2; if (scale==NULL || scale[0] > 0.0) { double invscale = scale==NULL ? 1.0 : 1.0 / scale[0]; for (i=0; ivdim[0]; ALLOC_DOLLARY(Z1, Z2, dim); z1 = Z1; z2 = Z2; FCTN(x, Aniso, z1); FCTN(y, Aniso, z2); } else if (Scale != NULL && !isRandom(Scale)) { int xdimown = cov->xdimown; double s; ALLOC_DOLLARY(Z1, Z2, xdimown); z1 = Z1; z2 = Z2; FCTN(x, Scale, &s1); FCTN(y, Scale, &s2); if (s1 <= 0.0 || s2 <= 0.0) ERR1("'%s' must be a positive function", KNAME(DSCALE)); smeanSq = 0.5 * (s1 * s1 + s2 * s2); s = SQRT(smeanSq); for (i=0; ixdimown; double *xz1, *xz2; ALLOC_DOLLARY(Z1, Z2, xdimown); z1 = Z1; z2 = Z2; if (aniso != NULL) { xA( x, y, aniso,cov->nrow[DANISO], cov->ncol[DANISO], z1, z2); xz1 = z1; xz2 = z2; } else { xz1 = x; xz2 = y; } if (scale != NULL) { double s = scale[0]; if (s > 0.0) { double invscale = 1.0 / s; for (i=0; iSdollar->simplevar) { var = P0(DVAR); if (Sign != NULL) var = LOG(var); } else { double w; location_type *loc = Loc(cov); int dummy = loc->i_row; loc->i_row = loc->i_col; FCTN(y, cov->kappasub[DVAR], &w); loc->i_row = dummy; FCTN(x, cov->kappasub[DVAR], &var); var *= w; var = Sign == NULL ? SQRT(var) : 0.5 * LOG(var); } if (Scale != NULL) { if (Sign != NULL) var += 0.5 * LOG(s1 * s2 / smeanSq); else var *= SQRT(s1 * s2 / smeanSq); } if (Sign == NULL) { NONSTATCOV(z1, z2, next, v); // printf("S-dim %d %f %f %f %f\n", vdimSq, v[0], v[1], v[2], v[3]); for (i=0; i S-dim %d %f %f %f %f\n", vdimSq, v[0], v[1], v[2], v[3]); } else { LOGNONSTATCOV(z1, z2, next, v, Sign); for (i=0; isub[DOLLAR_SUB]; location_type *locnext = Loc(next); assert(locnext != NULL); int i, tot, totSq, dim = loc->timespacedim, vdim = cov->vdim[0]; assert(dim == cov->tsdim); // printf("hier\n"); if ((!PisNULL(DSCALE) && P0(DSCALE) != 1.0) || !PisNULL(DANISO) || !PisNULL(DPROJ) || cov->kappasub[DSCALE] != NULL || cov->kappasub[DAUSER] != NULL || cov->kappasub[DPROJ] != NULL ) { cov_model *prev = cov->calling; if (prev == NULL || (!isInterface(prev) && !isProcess(prev))) prev = cov; if (prev->Spgs == NULL && alloc_cov(prev, dim, vdim, vdim) != NOERROR) ERR("memory allocation error in 'covmatrixS'"); // printf("hier B\n"); CovarianceMatrix(cov, v); // printf("hierC\n"); return; } // printf("hier A\n"); if (cov->Spgs == NULL && alloc_cov(cov, dim, vdim, vdim) != NOERROR) ERR("memory allocation error in 'covmatrixS'"); if (next->xdimprev != next->xdimown) { BUG; // fuehrt zum richtigen Resultat, sollte aber nicht // vorkommen! CovarianceMatrix(cov, v); return; } int next_gatter = next->gatternr, next_xdimgatter = next->xdimgatter, next_xdim = next->xdimprev; next->gatternr = cov->gatternr; next->xdimprev = cov->xdimprev; next->xdimgatter = cov->xdimgatter; CovList[next->nr].covmatrix(next, v);//hier wird uU next->totalpoints gesetzt next->gatternr = next_gatter; next->xdimgatter = next_xdimgatter; next->xdimprev = next_xdim; tot = cov->vdim[0] * locnext->totalpoints; totSq = tot * tot; if (cov->Sdollar->simplevar) { double var = P0(DVAR); if (var == 1.0) return; for (i=0; isub[DOLLAR_SUB]; return (int) ((PisNULL(DSCALE) || P0(DSCALE) ==1.0) && PARAMisNULL(cov, DAUSER) && PARAMisNULL(cov, DPROJ) && cov->Sdollar->simplevar && // to do PARAMisNULL(cov, DANISO)) * CovList[sub->nr].is_covariance(sub); } void DS(double *x, cov_model *cov, double *v){ cov_model *next = cov->sub[DOLLAR_SUB]; assert( cov->kappasub[DAUSER] == NULL && cov->kappasub[DSCALE] == NULL); int i, vdim = cov->vdim[0], vdimSq = vdim * vdim, nproj = cov->nrow[DPROJ]; double y[2], varSc, *scale =P(DSCALE), *aniso=P(DANISO), spinvscale = 1.0; assert(cov->Sdollar->simplevar); assert(isCartesian(cov->isoown)); if (aniso != NULL) { spinvscale *= aniso[0]; // was passiert, wenn es aniso nicht vom TypeIso ist ?? } if (scale != NULL) spinvscale /= scale[0]; varSc = P0(DVAR) * spinvscale; if (nproj == 0) { y[0] = x[0] * spinvscale; y[1] = (cov->isoown==ISOTROPIC || cov->ncol[DANISO]==1) ? 0.0 : x[1] * aniso[3]; // temporal; temporal scale } else { BUG; // for (i=0; isub[DOLLAR_SUB]; assert(cov->kappasub[DAUSER] == NULL); int i, vdim = cov->vdim[0], vdimSq = vdim * vdim, nproj = cov->nrow[DPROJ], *proj = PINT(DPROJ); double y[2], varScSq, *scale =P(DSCALE), *aniso=P(DANISO), spinvscale = 1.0; assert(isCartesian(cov->isoown)); assert(cov->Sdollar->simplevar); if (aniso != NULL) { spinvscale *= aniso[0]; // was passiert, wenn es aniso nicht vom TypeIso ist ?? } if (scale != NULL) spinvscale /= scale[0]; varScSq = P0(DVAR) * spinvscale * spinvscale; if (nproj == 0) { y[0] = x[0] * spinvscale; y[1] = (cov->isoown==ISOTROPIC || cov->ncol[DANISO]==1) ? 0.0 : x[1] * aniso[3]; // temporal; temporal scale } else { BUG; for (i=0; isub[DOLLAR_SUB]; assert(cov->kappasub[DAUSER] == NULL); int i, vdim = cov->vdim[0], vdimSq = vdim * vdim, nproj = cov->nrow[DPROJ], *proj = PINT(DPROJ); double y[2], varScS3, *scale =P(DSCALE), *aniso=P(DANISO), spinvscale = 1.0; assert(isCartesian(cov->isoown)); assert(cov->Sdollar->simplevar); if (aniso != NULL) { spinvscale *= aniso[0]; // was passiert, wenn es aniso nicht vom TypeIso ist ?? } if (scale != NULL) spinvscale /= scale[0]; varScS3 = P0(DVAR) * spinvscale * spinvscale * spinvscale; if (nproj == 0) { y[0] = x[0] * spinvscale; y[1] = (cov->isoown==ISOTROPIC || cov->ncol[DANISO]==1) ? 0.0 : x[1] * aniso[3]; // temporal; temporal scale } else { BUG; for (i=0; isub[DOLLAR_SUB]; assert(cov->kappasub[DAUSER] == NULL); int i, vdim = cov->vdim[0], vdimSq = vdim * vdim, nproj = cov->nrow[DPROJ], *proj = PINT(DPROJ); double y[2], varScS4, *scale =P(DSCALE), *aniso=P(DANISO), spinvscale = 1.0; assert(isCartesian(cov->isoown)); if (aniso != NULL) { spinvscale *= aniso[0]; // was passiert, wenn es aniso nicht vom TypeIso ist ?? } if (scale != NULL) spinvscale /= scale[0]; varScS4 = spinvscale * spinvscale; varScS4 *= varScS4 * P0(DVAR); if (nproj == 0) { y[0] = x[0] * spinvscale; y[1] = (cov->isoown==ISOTROPIC || cov->ncol[DANISO]==1) ? 0.0 : x[1] * aniso[3]; // temporal; temporal scale } else { BUG; for (i=0; isub[DOLLAR_SUB], *Aniso = cov->kappasub[DAUSER]; if (Aniso != NULL) BUG; int i, endfor, dim = cov->nrow[DANISO],// == ncol == x d i m ? xdimown = cov->xdimown, nproj = cov->nrow[DPROJ]; double *xy, *vw, *scale =P(DSCALE), *aniso=P(DANISO), var = P0(DVAR); if (nproj != 0) BUG; if (dim != xdimown) BUG; if (!cov->Sdollar->simplevar) NotProgrammedYet("nabla not programmed for arbitrary 'var'"); if (aniso != NULL) { ALLOC_DOLLAR(z, xdimown); ALLOC_DOLLAR2(w, xdimown); xA(x, aniso, xdimown, xdimown, z); xy = z; vw = w; } else { xy = x; vw = v; } if (scale != NULL) { ALLOC_DOLLAR3(y, xdimown); assert(scale[0] > 0.0); double spinvscale = 1.0 / scale[0]; var *= spinvscale; if (!nabla) var *= spinvscale; // gives spinvscale^2 in case of hess for (i=0; isub[DOLLAR_SUB]; int i, idx[2] = {DAUSER, DPROJ}; double scale; if (cov->kappasub[DVAR] != NULL) NotProgrammedYet("nabla not programmed for arbitrary 'var'"); for (i=0; i<2; i++) { if (cov->kappasub[idx[i]] != NULL) { char Msg[100]; SPRINTF(Msg, "inverse can only be calculated if '%s' is not an arbitrary function", KNAME(idx[i])); ERR(Msg); } } if (cov->kappasub[DSCALE] != NULL) { double left; NONSTATINVERSE(ZERO, cov->kappasub[DSCALE], &left, &scale); if (left < 0.0) ERR("scale not defined to be non-negative."); } else scale = PisNULL(DSCALE) ? 1.0 : P0(DSCALE); int dim = cov->xdimown, nproj = cov->nrow[DPROJ]; // *proj = (int *)P(DPROJ]; double y, s = 1.0, *aniso=P(DANISO), var = P0(DVAR); //PMI(cov); crash(); if (dim != 1) BUG; if (aniso != NULL) { if (isMiso(Type(aniso, cov->nrow[DANISO], cov->ncol[DANISO]))) s /= aniso[0]; else NotProgrammedYet(""); // to do } s *= scale; if (nproj == 0) { y= *x / var; // inversion, so variance becomes scale } else { BUG; //ERR("nproj is not allowed in invS"); } if (CovList[next->nr].inverse == ErrCov) BUG; INVERSE(&y, next, v); for (i=0; isub[DOLLAR_SUB], *Aniso = cov->kappasub[DAUSER], *Scale = cov->kappasub[DSCALE]; int i, dim = cov->tsdim, nproj = cov->nrow[DPROJ]; // *proj = (int *)P(DPROJ]; double y, s = 1.0, *scale =P(DSCALE), *aniso=P(DANISO), var = P0(DVAR); if (cov->kappasub[DVAR] != NULL) NotProgrammedYet("nabla not programmed for arbitrary 'var'"); if (nproj == 0) { y= *x / var; // inversion, so variance becomes scale } else { BUG; //ERR("nproj is not allowed in invS"); } if (CovList[next->nr].nonstat_inverse == ErrInverseNonstat) BUG; if (log) { NONSTATLOGINVERSE(&y, next, left, right); } else { NONSTATINVERSE(&y, next, left, right); } if (aniso != NULL) { if (isMiso(Type(aniso, cov->nrow[DANISO], cov->ncol[DANISO]))) s/=aniso[0]; else { dollar_storage *S = cov->Sdollar; int ncol = cov->ncol[DANISO], nrow = cov->nrow[DANISO], ncnr = ncol * nrow, bytes = ncnr * sizeof(double), size = ncol * sizeof(double); bool redo; if (ncol != nrow) BUG; if ((redo = S->save_aniso == NULL)) { S->save_aniso = (double *) MALLOC(bytes); S->inv_aniso = (double *) MALLOC(bytes); } ALLOC_DOLLAR4(LR, ncol); double *save = S->save_aniso, *inv = S->inv_aniso; if (!redo) { for (i=0; inr].inverse == ErrInverse) ERR("inverse of anisotropy matrix function unknown"); int nrow = Aniso->vdim[0], ncol = Aniso->vdim[1], size = nrow * sizeof(double); if (cov->xdimown != ncol || ncol != 1) ERR("anisotropy function not of appropriate form"); ALLOC_DOLLAR4(LR, nrow); MEMCOPY(LR, right, size); INVERSE(LR, Aniso, right); MEMCOPY(LR, left, size); INVERSE(LR, Aniso, left); } if (Scale != NULL && !isRandom(Scale)) { double dummy; COV(ZERO, Scale, &dummy); s *= dummy; } else if (scale != NULL) s *= scale[0]; if (s != 1.0) { for (i=0; iSdollar->simplevar); cov_model *next = cov->sub[DOLLAR_SUB]; if ( CovList[next->nr].coinit == NULL) ERR("# cannot find coinit -- please inform author"); CovList[next->nr].coinit(next, li); } void ieinitS(cov_model *cov, localinfotype *li) { assert(cov->Sdollar->simplevar); cov_model *next = cov->sub[DOLLAR_SUB]; if ( CovList[next->nr].ieinit == NULL) ERR("# cannot find ieinit -- please inform author"); CovList[next->nr].ieinit(next, li); } void tbm2S(double *x, cov_model *cov, double *v){ assert(cov->Sdollar->simplevar); cov_model *next = cov->sub[DOLLAR_SUB]; cov_fct *C = CovList + next->nr; // kein gatternr, da isotrop double y[2], *xy, *scale =P(DSCALE), *aniso = P(DANISO); assert(cov->kappasub[DAUSER] == NULL); assert(cov->nrow[DPROJ] == 0); if (aniso!=NULL) { if (cov->ncol[DANISO]==2) { // turning layers y[0] = x[0] * aniso[0]; // spatial y[1] = x[1] * aniso[3]; // temporal assert(aniso[1] == 0.0 && aniso[2] == 0.0); if (y[0] == 0.0) C->cov(y, next, v); else C->tbm2(y, next, v); } else { assert(cov->ncol[DANISO]==1); if (cov->nrow[DANISO] == 1) { // turning bands y[0] = x[0] * aniso[0]; // purely spatial C->tbm2(y, next, v); } else { // turning layers, dimension reduction if (P0(DANISO) == 0.0) { y[0] = x[1] * aniso[1]; // temporal C->cov(y, next, v); } else { y[0] = x[0] * aniso[0]; // temporal C->tbm2(y, next, v); } } } xy = y; } else xy = x; if (scale != NULL) { double s = scale[0]; if (s > 0) { double invscale = 1.0 / s; if (cov->xdimown == 2){ y[0] = xy[0] * invscale; // spatial y[1] = xy[1] * invscale; // temporal if (y[0] == 0.0) C->cov(y, next, v); else C->tbm2(y, next, v); } else { y[0] = xy[0] * invscale; // purely spatial C->tbm2(y, next, v); } } else { y[0] = (s < 0.0 || xy[0] != 0.0) ? RF_INF : 0.0; if (cov->xdimown == 2) y[1] = (s < 0.0 || xy[1] != 0.0) ? RF_INF : 0.0; C->tbm2(y, next, v); } } *v *= P0(DVAR); } // TODO : Aniso=Matrix: direkte implementierung in S, // sodass nicht ueber initS gegangen werden muss, sondern // e < - e^\top Aniso int TaylorS(cov_model *cov) { cov_model *next = cov->sub[DOLLAR_SUB], *sub = cov->key == NULL ? next : cov->key; int i; if (PisNULL(DPROJ) && PisNULL(DANISO)) { double scale = PisNULL(DSCALE) ? 1.0 : P0(DSCALE); cov->taylorN = sub->taylorN; for (i=0; itaylorN; i++) { cov->taylor[i][TaylorPow] = sub->taylor[i][TaylorPow]; cov->taylor[i][TaylorConst] = sub->taylor[i][TaylorConst] * P0(DVAR) * POW(scale, -sub->taylor[i][TaylorPow]); } cov->tailN = sub->tailN; for (i=0; itailN; i++) { cov->tail[i][TaylorPow] = sub->tail[i][TaylorPow]; cov->tail[i][TaylorExpPow] = sub->tail[i][TaylorExpPow]; cov->tail[i][TaylorConst] = sub->tail[i][TaylorConst] * P0(DVAR) * POW(scale, -sub->tail[i][TaylorPow]); cov->tail[i][TaylorExpConst] = sub->tail[i][TaylorExpConst] * POW(scale, -sub->tail[i][TaylorExpPow]); } } else { cov->taylorN = cov->tailN = 0; } return NOERROR; } int checkS(cov_model *cov) { // hier kommt unerwartet ein scale == nan rein ?!! cov_model *next = cov->sub[DOLLAR_SUB], *Aniso = cov->kappasub[DAUSER], *Scale = cov->kappasub[DSCALE], *sub = cov->key == NULL ? next : cov->key; isotropy_type isoown = cov->isoown; int i, err, xdimown = cov->xdimown, xdimNeu = xdimown, // KOMMENTAR NICHT LOESCHEN // *proj = PINT(DPROJ), // auf keinen Fall setzen, da Pointer unten neu // gesetzt wird!!!! nproj = cov->nrow[DPROJ]; // bool skipchecks = GLOBAL.general.skipchecks; matrix_type type = TypeMany; assert(isAnyDollar(cov)); if (!isDollarProc(cov)) cov->nr = DOLLAR; // wegen nr++ unten ! // cov->q[1] not NULL then A has been given // if (cov->method == SpectralTBM && cov->xdimown != next->xdimprev) // return ERRORDIM; if ((err = checkkappas(cov, false)) != NOERROR) { return err; } kdefault(cov, DVAR, 1.0); bool angle = Aniso!=NULL && CovList[Aniso->nr].check == checkAngle; if (angle && PisNULL(DANISO) && PisNULL(DAUSER) && cov->xdimown == cov->tsdim) { int dim = cov->tsdim; ASSERT_CARTESIAN; if (!isCartesian(cov->isoown)) return ERRORANISO; if ((err = CHECK(Aniso, dim, dim, ShapeType, XONLY, CARTESIAN_COORD, SUBMODEL_DEP, cov->role)) == NOERROR) { if (verysimple(Aniso)) { PALLOC(DAUSER, dim, dim); AngleMatrix(Aniso, P(DAUSER)); COV_DELETE(cov->kappasub + DAUSER); Aniso = cov->kappasub[DAUSER] = NULL; angle = false; } } } if (cov->kappasub[DANISO] != NULL) SERR1("'%s' may not be a function.", KNAME(DANISO)); if (!PisNULL(DAUSER)) { if (!isCartesian(cov->isoown)) return ERRORANISO; // if (GLOBAL.internal.warn_Aniso) { // PRINTF("NOTE! Starting with RandomFields 3.0, the use of '%s' is different from\nthe former '%s' insofar that '%s' is multiplied from the right by 'x' (i.e. Ax),\nwhereas '%s' had been multiplied from the left by 'x' (i.e. xA).\n", KNAME(DAUSER), KNAME(DANISO), KNAME(DANISO), KNAME(DAUSER)); // } GLOBAL.internal.warn_Aniso = false; // here for the first time if (!PisNULL(DANISO)) return ERRORANISO_T; int k, lnrow = cov->nrow[DAUSER], lncol = cov->ncol[DAUSER]; long j, total = lncol * lnrow; double *pA = P(DAUSER); PALLOC(DANISO, lncol, lnrow); // !! ACHTUNG col, row gekreuzt for (i=k=0; ikappasub[DVAR] == NULL || isRandom(cov->kappasub[DVAR]); if (!simplevar) { //cov->domown = KERNEL; ptwise_type ptt = cov->ptwise_definite; isotropy_type isonew = UpgradeToCoordinateSystem(cov->isoown); if (isonew == ISO_MISMATCH) SERR("reduced systems not allowed"); if ((err = CHECK(cov->kappasub[DVAR], cov->tsdim, cov->xdimown, ShapeType, // only!! -- for pos def use RMprod XONLY, isonew, SCALAR, ROLE_BASE)) != NOERROR) return err; if (cov->kappasub[DVAR]->ptwise_definite != pt_posdef) { if (cov->kappasub[DVAR]->ptwise_definite == pt_unknown) { if (GLOBAL.internal.warn_negvar && cov->q==NULL) { QALLOC(1); warning("positivity of the variance in '%s' cannot be detected.", NICK(next)); } } else { SERR2("positivity of '%s' required. Got '%s'", KNAME(DVAR), POSITIVITY_NAMES[cov->kappasub[DVAR]->ptwise_definite]); } } cov->ptwise_definite = ptt; } DOLLAR_STORAGE; if (Aniso != NULL) { if (!isDollarProc(cov) && !angle && cov->domown != KERNEL) return ERRORFAILED; if (!PisNULL(DANISO) || !PisNULL(DPROJ) || !PisNULL(DSCALE) || (Scale!=NULL && !isRandom(Scale)) ) SERR2("if '%s' is an arbitrary function, only '%s' may be given as additional parameter.", KNAME(DAUSER), KNAME(DVAR)); if (cov->isoown != SYMMETRIC && !isCoordinateSystem(cov->isoown)) { return ERRORANISO; } cov->full_derivs = cov->rese_derivs = 0; cov->loggiven = true; isotropy_type isonew = UpgradeToCoordinateSystem(cov->isoown); if (isonew == ISO_MISMATCH) SERR("reduced systems not allowed"); if ((err = CHECK(Aniso, cov->tsdim, cov->xdimown, ShapeType, XONLY, isonew, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } if (Aniso->vdim[1] != 1) SERR4("'%s' returns a matrix of dimension %d x %d, but dimension %d x 1 is need.", KNAME(DANISO), Aniso->vdim[0], Aniso->vdim[1], cov->xdimown); if (cov->key==NULL) { if ((err = CHECK(sub, Aniso->vdim[0], Aniso->vdim[0], cov->typus, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } } cov->pref[Nugget] = cov->pref[RandomCoin] = cov->pref[Average] = cov->pref[Hyperplane] = cov->pref[SpectralTBM] = cov->pref[TBM] = PREF_NONE; sub->pref[CircEmbed] = sub->pref[CircEmbedCutoff] = sub->pref[CircEmbedIntrinsic] = sub->pref[Sequential] = sub->pref[Specific] = PREF_NONE; } else if (Scale != NULL && !isRandom(Scale)) { if (!isDollarProc(cov) && cov->domown != KERNEL) return ERRORFAILED; if (!PisNULL(DANISO) || !PisNULL(DPROJ) || !PisNULL(DSCALE)) SERR2("if '%s' is an arbitrary function, only '%s' may be given as additional parameter.", KNAME(DSCALE), KNAME(DVAR)); if (cov->isoown != SYMMETRIC && !isCoordinateSystem(cov->isoown)) { return ERRORANISO; } cov->full_derivs = cov->rese_derivs = 0; cov->loggiven = true; isotropy_type isonew = UpgradeToCoordinateSystem(cov->isoown); if (isonew == ISO_MISMATCH) SERR("reduced systems not allowed"); if ((err = CHECK(Scale, cov->tsdim, cov->xdimown, ShapeType, XONLY, isonew, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } if (Scale->vdim[1] != 1 || Scale->vdim[0] != 1) SERR3("'%s' must be scalar, not %d x %d", KNAME(DSCALE), Aniso->vdim[0], Aniso->vdim[1]); if (cov->key==NULL) { if ((err = CHECK(sub, Scale->vdim[0], Scale->vdim[0], cov->typus, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } if (!isNormalMixture(next)) SERR("scale function only allowed for normal mixtures."); } cov->pref[Nugget] = cov->pref[RandomCoin] = cov->pref[Average] = cov->pref[Hyperplane] = cov->pref[SpectralTBM] = cov->pref[TBM] = PREF_NONE; sub->pref[CircEmbed] = sub->pref[CircEmbedCutoff] = sub->pref[CircEmbedIntrinsic] = sub->pref[Sequential] = sub->pref[Specific] = PREF_NONE; } else if (!PisNULL(DANISO)) { // aniso given int nrow = cov->nrow[DANISO], ncol = cov->ncol[DANISO]; if (nrow==0 || ncol==0) SERR("dimension of the matrix is 0"); if (!PisNULL(DPROJ)) return ERRORANISO_T; if (xdimown < nrow) { if (PL >= PL_ERRORS) {LPRINT("xdim=%d != nrow=%d\n", xdimown, nrow);} SERR("#rows of anisotropy matrix does not match dim. of coordinates"); } if (xdimown != cov->tsdim && nrow != ncol) SERR("non-quadratic anisotropy matrices only allowed if dimension of coordinates equals spatio-temporal dimension"); type = Type(P(DANISO), nrow, ncol); cov->full_derivs = cov->rese_derivs = 0; cov->loggiven = true; switch (cov->isoown) { case ISOTROPIC : if (cov->tsdim != 1) return ERRORANISO; cov->full_derivs = cov->rese_derivs = 2; break; case SPACEISOTROPIC : cov->full_derivs = cov->rese_derivs = isMdiag(type) ? 2 : 0; if (nrow != 2 || !isMdiag(type)) { SERR("spaceisotropy needs a 2x2 diagonal matrix"); } break; case ZEROSPACEISO : if (!isMdiag(type)) return ERRORANISO; break; case VECTORISOTROPIC : if (!isMiso(type)) return ERRORANISO; break; case SYMMETRIC: break; case PREVMODELI : BUG; case CARTESIAN_COORD : case GNOMONIC_PROJ : case ORTHOGRAPHIC_PROJ: if (!isProcess(cov->typus)) return ERRORANISO; break; default : if (isCartesian(cov->isoown)) { BUG; } else return ERRORANISO; } if (!isMdiag(type)) cov->pref[Nugget] = cov->pref[RandomCoin] = cov->pref[Average] = cov->pref[Hyperplane] = PREF_NONE; if (cov->isoown != SPACEISOTROPIC && !isMiso(type)) cov->pref[SpectralTBM] = cov->pref[TBM] = PREF_NONE; if (cov->key==NULL) { if ((err = CHECK(next, ncol, ncol, cov->typus, cov->domown, ncol==1 && !isProcess(cov->typus) ? ISOTROPIC : cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } if (next->domown == cov->domown && next->isoown == cov->isoown && xdimown > 1) next->delflag = DEL_COV - 7; } else { if ((err = CHECK(cov->key, ncol, ncol, cov->typus, cov->domown, ncol==1 && !isProcess(cov->typus) ? ISOTROPIC : cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; } } else { // PisNULL(DANISO) int tsdim = cov->tsdim; if (nproj > 0) { if (cov->Sdollar->proj < 0) { // different isoown cause different interpretations; here: restore original value PFREE(DPROJ); kdefault(cov, DPROJ, cov->Sdollar->proj); nproj = 1; } if (P0INT(DPROJ) < 0) { // here: interprete "space" and "time" //printf("%d\n", nproj); if (nproj != 1) { BUG; SERR1("unallowed use of '%s'", KNAME(DPROJ)); } cov->Sdollar->proj = P0INT(DPROJ); if (Loc(cov)->Time && tsdim >= 2) { assert(P0INT(DPROJ) == PROJ_TIME || P0INT(DPROJ) == PROJ_SPACE); bool Time = P0INT(DPROJ) == PROJ_TIME; PFREE(DPROJ); if (Time) { kdefault(cov, DPROJ, tsdim); } else { nproj = tsdim - 1; PALLOC(DPROJ, nproj, 1); for (i=1; i<=nproj; i++) PINT(DPROJ)[i-1] = i; } } else { SERR1("unallowed use of '%s' or model to complicated.", KNAME(DPROJ)); } // PMI(cov, 0); } if (nproj < tsdim) { for (i = 0; ipref[i] > 0) cov->pref[i] = 1; } cov->pref[Specific] = PREF_BEST; } bool ok = (cov->xdimprev == cov->xdimown) || ((cov->calling == NULL || cov->calling->isoown == EARTH_COORDS || cov->calling->isoown == EARTH_SYMMETRIC) && isCartesian(cov->isoown) && cov->xdimprev == cov->xdimown - 1); if (!ok) { // printf("!ok %d %d %d %d\n", cov->xdimprev, cov->xdimown, cov->isoprev == EARTH_COORDS, isCartesian(cov->isoown) ); //PMI(cov->calling); return ERRORANISO; } for (i=0; i xdimown) SERR4("%d%s value of '%s' (%d) out of range", i + 1, i == 0 ? "st" : i == 1 ? "nd" : i == 2 ? "rd" : "th", KNAME(DPROJ), PINT(DPROJ)[i]); for (j=i+1; jisoown) { case ISOTROPIC : case EARTH_ISOTROPIC : case SPHERICAL_ISOTROPIC : if (cov->tsdim != 1) return ERRORANISO; break; case SPACEISOTROPIC : if (nproj > 2) SERR("maximum length of projection vector is 2"); if (nproj == 2) { if (PINT(DPROJ)[0] >= PINT(DPROJ)[1]) SERR1("in case of '%s' projection directions must be ordered", ISONAMES[SPACEISOTROPIC]); } if (P0INT(DPROJ) == 1) { tsdim = cov->tsdim - 1 ; isoown = ISOTROPIC; xdimNeu = 1; } else { assert(P0INT(DPROJ) == 2); tsdim = 1; isoown = ISOTROPIC; xdimNeu = 1; } break; case ZEROSPACEISO : isoown = SYMMETRIC; break; case VECTORISOTROPIC : SERR("projection of vectorisotropic fields not programmed yet"); // to do: vdim muss auch reduziert werden ... --- das wird // grausam ! break; case SYMMETRIC: case CARTESIAN_COORD: break; case GNOMONIC_PROJ : case ORTHOGRAPHIC_PROJ : isoown = CARTESIAN_COORD; break; case PREVMODELI : BUG; break; case SPHERICAL_SYMMETRIC : case EARTH_SYMMETRIC : if (nproj != 2 || PINT(DPROJ)[0] != 1 || PINT(DPROJ)[1] != 2) isoown = SYMMETRIC; break; case SPHERICAL_COORDS : case EARTH_COORDS : if (nproj != 2 || PINT(DPROJ)[0] != 1 || PINT(DPROJ)[1] != 2) isoown = CARTESIAN_COORD; break; default : if (isCartesian(cov->isoown)) {BUG;} else return ERRORANISO; // todo } } // verhindern, dass die coordinaten-transformation anlaeuft, // da aus z.B. Erd-coordinaten durch Projektion (auf die Zeitachse) // kartesische werden if (cov->key==NULL) { if ((err = CHECK_NO_TRAFO(next, tsdim, xdimNeu, cov->typus, cov->domown, isoown, cov->vdim[0], // SUBMODEL_DEP; geaendert 20.7.14 cov->role)) != NOERROR) { return err; } if (next->domown == cov->domown && next->isoown == cov->isoown) // darf nicht nach C-HECK als allgemeine Regel ruebergezogen werden, u.a. nicht wegen stat/nicht-stat wechsel !! // hier geht es, da domown und isoown nur durchgegeben werden und die Werte // bereits ein Schritt weiter oben richtig/minimal gesetzt werden. next->delflag = DEL_COV - 8; } else { if ((err = CHECK_NO_TRAFO(cov->key, tsdim, xdimNeu, cov->typus, cov->domown, isoown, SUBMODEL_DEP, cov->role)) != NOERROR) return err; } // PMI(cov); } // end no aniso if (( err = checkkappas(cov, false)) != NOERROR) { return err; } setbackward(cov, sub); if ((Aniso != NULL || (Scale != NULL && !isRandom(Scale)) || !PisNULL(DANISO)|| !PisNULL(DPROJ)) && cov->maxdim < cov->xdimown) cov->maxdim = cov->xdimown; if (!isAnyIsotropic(cov->isoown) && !isDollarProc(cov)) { // multivariate kann auch xdimNeu == 1 problematisch sein cov->nr++; } if (xdimNeu > 1) { cov->pref[CircEmbedCutoff] = cov->pref[CircEmbedIntrinsic] = 0; } // 30.10.11 kommentiert: // cov->pref[CircEmbedCutoff] = cov->pref[CircEmbedIntrinsic] = // cov->pref[TBM] = cov->pref[SpectralTBM] = 0; if ( (PisNULL(DANISO) || isMiso(type)) && PisNULL(DPROJ)) { cov->logspeed = sub->logspeed * P0(DVAR); } //////////////// if (sub->pref[Nugget] > PREF_NONE) cov->pref[Specific] = 100; if (nproj == 0) cov->matrix_indep_of_x = sub->matrix_indep_of_x; if ((err = TaylorS(cov)) != NOERROR) return err; cov->Sdollar->simplevar = simplevar; cov->Sdollar->isoown = isoown; // for struct Sproc ! if (isProcess(cov->typus)) { MEMCOPY(cov->pref, PREF_NOTHING, sizeof(pref_shorttype)); } if (GLOBAL.coords.coord_system == earth && is_all(isCartesian, CovList + next->nr) && GLOBAL.internal.warn_scale && (PisNULL(DSCALE) || P0(DSCALE) < (STRCMP(GLOBAL.coords.newunits[0], "km")== 0 ? 10 : 6.3))) { char msg[300]; SPRINTF(msg, "value of scale parameter equals '%4.2f',\nwhich is less than 100, although models defined on R^3 are used in the\ncontext of earth coordinates where larger scales are expected.\n(This warning appears only ones per session.)\n", PisNULL(DSCALE) ? 1.0 : P0(DSCALE)); GLOBAL.internal.warn_scale = false; warning(msg); } return NOERROR; } void rangeS(cov_model *cov, range_type* range){ int i; bool negdef = isNegDef(cov->typus); range->min[DVAR] = negdef ? 0.0 : RF_NEGINF; range->max[DVAR] = RF_INF; range->pmin[DVAR] = negdef ? 0.0 : -10000; range->pmax[DVAR] = 100000; range->openmin[DVAR] = !negdef; range->openmax[DVAR] = true; range->min[DSCALE] = 0.0; range->max[DSCALE] = RF_INF; range->pmin[DSCALE] = 0.0001; range->pmax[DSCALE] = 10000; range->openmin[DSCALE] = true; range->openmax[DSCALE] = true; for (i=DANISO; i<= DAUSER; i++) { range->min[i] = RF_NEGINF; range->max[i] = RF_INF; range->pmin[i] = -10000; range->pmax[i] = 10000; range->openmin[i] = true; range->openmax[i] = true; } range->min[DPROJ] = -2; range->max[DPROJ] = cov->tsdim; range->pmin[DPROJ] = 1; range->pmax[DPROJ] = cov->tsdim; range->openmin[DPROJ] = false; range->openmax[DPROJ] = false; } bool TypeS(Types required, cov_model *cov, int depth) { cov_model *sub = cov->key==NULL ? cov->sub[0] : cov->key; // print(" TypeS %s %s : %d %d\n", TYPENAMES[required], NAME(sub), isShape(required) || isTrend(required) || isProcess(required), TypeConsistency(required, sub, depth-1)); return (isShape(required) || isTrend(required) || isProcess(required)) && TypeConsistency(required, sub, depth-1); } void spectralS(cov_model *cov, gen_storage *s, double *e) { cov_model *next = cov->sub[DOLLAR_SUB]; int d, ncol = PisNULL(DANISO) ? cov->tsdim : cov->ncol[DANISO]; double sube[MAXTBMSPDIM], *scale =P(DSCALE), invscale = 1.0; SPECTRAL(next, s, sube); // nicht gatternr // Reihenfolge nachfolgend extrem wichtig, da invscale auch bei aniso // verwendet wird if (scale != NULL) invscale /= scale[0]; if (!PisNULL(DANISO)) { int nrow = cov->nrow[DANISO]; long j, k, m, total = ncol * nrow; double *A = P(DANISO); for (d=0, k=0; dkappasub[DPROJ] == NULL && PisNULL(DANISO) && cov->kappasub[DAUSER] == NULL && (PisNULL(DVAR) || P0(DVAR)==1.0) && cov->kappasub[DVAR] == NULL; } int addScales(cov_model **newmodel, double anisoScale, cov_model *scale, double Scale) { // cov_model *calling = (*newmodel)->calling; if (anisoScale != 1.0) { addModel(newmodel, LOC); kdefault(*newmodel, LOC_SCALE, anisoScale); } if (scale != NULL) { if (!isRandom(scale)) SERR("unstationary scale not allowed yet"); addModel(newmodel, LOC); addSetDistr(newmodel, scale->calling, ScaleDollarToLoc, true, MAXINT); } else { if (Scale != 1.0) { addModel(newmodel, LOC); kdefault(*newmodel, LOC_SCALE, Scale); } } return NOERROR; } int structS(cov_model *cov, cov_model **newmodel) { if (cov->role == ROLE_GAUSS && isProcess(cov->typus)) { cov->nr = DOLLAR_PROC; return structSproc(cov, newmodel); // kein S-TRUCT(...) !! } cov_model *local = NULL, *dummy = NULL, *next = cov->sub[DOLLAR_SUB], *Aniso = cov->kappasub[DAUSER], *Scale = cov->kappasub[DSCALE]; int err = NOERROR; bool generalAniso = (Aniso != NULL && CovList[Aniso->nr].check != checkAngle) || (Scale != NULL && !isRandom(Scale)); ASSERT_NEWMODEL_NOT_NULL; if (cov->kappasub[DVAR] != NULL) { GERR2("Arbitrary functions for '%s' should be replaced by multiplicative models using '%s'", KNAME(DVAR), CovList[PROD].nick); } if (generalAniso) GERR1("complicated models including arbitrary functions for '%s' cannot be simulated yet", KNAME(DAUSER)); switch (cov->role) { case ROLE_POISSON_GAUSS : case ROLE_SMITH : if (!next->deterministic) GERR("random shapes not programmed yet"); if (!PisNULL(DANISO)) GERR("anisotropy parameter not allowed yet"); if (!PisNULL(DPROJ)) GERR("projections not allowed yet"); if ((err = STRUCT(next, newmodel)) > NOERROR) return err; addModel(newmodel, DOLLAR); if (!PisNULL(DVAR)) kdefault(*newmodel, DVAR, P0(DVAR)); if (!PisNULL(DSCALE)) kdefault(*newmodel, DSCALE, P0(DSCALE)); break; case ROLE_MAXSTABLE : // eigentlich nur von RPSmith moeglich ! if (!next->deterministic) GERR("random shapes not programmed yet"); if (!PisNULL(DPROJ)) GERR("projections not allowed yet"); // P(DVAR) hat keine Auswirkungen if (!PisNULL(DANISO)) { if (!isMonotone(next) || !isIsotropic(next->isoown) || PisNULL(DANISO) || cov->ncol[DANISO] != cov->nrow[DANISO]) GERR("anisotropy parameter only allowed for simple models up to now"); } assert(cov->calling != NULL); double anisoScale; if (!PisNULL(DANISO)) { anisoScale = 1.0 / getMinimalAbsEigenValue(P(DANISO), cov->nrow[DANISO]); if (!R_FINITE(anisoScale)) GERR("singular anisotropy matrices not allowed"); } else anisoScale = 1.0; if (cov->calling->nr == SMITHPROC) { if ((err = STRUCT(next, newmodel)) == NOERROR && *newmodel != NULL) { assert( (*newmodel)->calling == cov); Types type = TypeConsistency(PointShapeType, *newmodel, 0) ? PointShapeType : TypeConsistency(RandomType, *newmodel, 0) ? RandomType : TypeConsistency(ShapeType, *newmodel, 0) ? ShapeType : OtherType; double scale = PisNULL(DSCALE) ? 1.0 : P0(DSCALE); if (type == RandomType) { // random locations given; // so, it must be of pgs type (or standard): if ((err = CHECK_R(*newmodel, cov->tsdim)) != NOERROR) { goto ErrorHandling; } dummy = *newmodel; if ((err=addScales(&dummy, anisoScale, Scale, scale))!=NOERROR){ goto ErrorHandling; } *newmodel = NULL; assert(cov->vdim[0] == cov->vdim[1]); if ((err = addPointShape(newmodel, cov, dummy, cov->tsdim, cov->vdim[0])) != NOERROR) { goto ErrorHandling; } ASSERT_NEWMODEL_NOT_NULL; (*newmodel)->calling = cov; } else { // type not RandomType if (type == PointShapeType && (err = addScales((*newmodel)->sub + PGS_LOC, anisoScale, Scale, scale)) != NOERROR) goto ErrorHandling; if ((err = CHECK(*newmodel, cov->tsdim, cov->xdimprev, type, cov->domprev, cov->isoprev, cov->vdim, ROLE_MAXSTABLE)) != NOERROR) { goto ErrorHandling; } if (type==PointShapeType) { if ((err = PointShapeLocations(*newmodel, cov)) != NOERROR) goto ErrorHandling; } else if (type == ShapeType) { dummy = *newmodel; *newmodel = NULL; // suche nach geeigneten locationen if ((err = addScales(&local, anisoScale, Scale, scale))!=NOERROR) goto ErrorHandling; if ((err = addPointShape(newmodel, dummy, NULL, local, cov->tsdim, cov->vdim[0])) != NOERROR) goto ErrorHandling; } else BUG; } // ! randomtype } else { // S TRUCT does not return anything int err2; if ((err2 = addPointShape(newmodel, cov, NULL, cov->tsdim, cov->vdim[0])) != NOERROR) { if (err == NOERROR) err = err2; goto ErrorHandling; } err = NOERROR; } } else { // not from RPsmith BUG; // if ((err = STRUCT(next, newmodel)) > NOERROR) return err; } break; case ROLE_GAUSS : if (cov->key != NULL) COV_DELETE(&(cov->key)); if (PrevLoc(cov)->distances) GERR("distances do not allow for more sophisticated simulation methods"); if ((err = STRUCT(next, newmodel)) > NOERROR) return err; addModel(newmodel, DOLLAR); if (!PisNULL(DVAR)) kdefault(*newmodel, DVAR, P0(DVAR)); if (!PisNULL(DSCALE) ) kdefault(*newmodel, DSCALE, P0(DSCALE)); if (!next->deterministic) GERR("random shapes not programmed yet"); break; default : GERR2("%s : changes in scale/variance not programmed yet for '%s'", NICK(cov), ROLENAMES[cov->role]); } ErrorHandling: if (dummy != NULL) COV_DELETE(&dummy); if (local != NULL) COV_DELETE(&local); return err; } int initS(cov_model *cov, gen_storage *s){ // am liebsten wuerde ich hier die Koordinaten transformieren; // zu grosser Nachteil ist dass GetDiameter nach trafo // grid def nicht mehr ausnutzen kann -- umgehbar?! cov_model *next = cov->sub[DOLLAR_SUB], *varM = cov->kappasub[DVAR], *scaleM = cov->kappasub[DSCALE], *anisoM = cov->kappasub[DAUSER], *projM = cov->kappasub[DPROJ]; int vdim = cov->vdim[0], nm = cov->mpp.moments, nmvdim = (nm + 1) * vdim, err = NOERROR; bool angle = anisoM != NULL && CovList[anisoM->nr].check == checkAngle, maxstable = hasExactMaxStableRole(cov);// Realisationsweise if (hasAnyShapeRole(cov)) { // Average !! ohne maxstable selbst !! double var[MAXMPPVDIM], scale = PisNULL(DSCALE) ? 1.0 : P0(DSCALE); int i, dim = cov->tsdim; if (!PisNULL(DPROJ) || !PisNULL(DANISO) || projM!= NULL || (anisoM != NULL && (!angle || !anisoM->deterministic))){ SERR("(complicated) anisotropy ond projection not allowed yet in Poisson related models"); } // Achtung I-NIT_RANDOM ueberschreibt mpp.* !! if (varM != NULL) { int nm_neu = nm == 0 && !maxstable ? 1 : nm; if ((err = INIT_RANDOM(varM, nm_neu, s, P(DVAR))) != NOERROR) return err; int nmP1 = varM->mpp.moments + 1; for (i=0; impp.mM[idx + 1]; } } else for (i=0; impp.mM[1]; } if ((err = INIT(next, nm, s)) != NOERROR) return err; for (i=0; i < nmvdim; i++) { cov->mpp.mM[i] = next->mpp.mM[i]; cov->mpp.mMplus[i] = next->mpp.mMplus[i]; } if (varM != NULL && !maxstable) { for (i=0; i < nmvdim; i++) { cov->mpp.mM[i] *= varM->mpp.mM[i]; cov->mpp.mMplus[i] *= varM->mpp.mMplus[i]; } } else { int j, k; double pow_var; for (k=j=0; jmpp.mM[k] *= pow_var; cov->mpp.mMplus[k] *= pow_var; } } } if (scaleM != NULL && !maxstable) { if (scaleM->mpp.moments < dim) SERR("moments can not be calculated."); int j, k, nmP1 = scaleM->mpp.moments + 1; for (k=j=0; jmpp.mM[dim + j * nmP1]; for (i=0; i <= nm; i++, k++) { cov->mpp.mM[k] *= pow_scale; cov->mpp.mMplus[k] *= pow_scale; } } } else { double pow_scale = POW(scale, dim); for (i=0; i < nmvdim; i++) { cov->mpp.mM[i] *= pow_scale; cov->mpp.mMplus[i] *= pow_scale; } } if (!PisNULL(DANISO)) { if (cov->nrow[DANISO] != cov->ncol[DANISO]) SERR("only square anisotropic matrices allowed"); double invdet = FABS(1.0 / getDet(P(DANISO), cov->nrow[DANISO])); if (!R_FINITE(invdet)) SERR("determinant of the anisotropy matrix could not be calculated."); for (i=0; i < nmvdim; i++) { cov->mpp.mM[i] *= invdet; cov->mpp.mMplus[i] *= invdet; } } if (anisoM != NULL) { double invdet; if (angle) { int ncol = anisoM->vdim[0], nrow = anisoM->vdim[1]; if (nrow != ncol) SERR("only square anisotropic matrices allowed"); double *diag = PARAM(anisoM, ANGLE_DIAG); if (diag != NULL) { invdet = 1.0; for (i=0; impp.mM[i] *= invdet; cov->mpp.mMplus[i] *= invdet; } } if (R_FINITE(cov->mpp.unnormedmass)) { if (vdim > 1) BUG; cov->mpp.unnormedmass = next->mpp.unnormedmass * var[0]; } else { for (i=0; impp.maxheights[i] = next->mpp.maxheights[i] * var[i]; } } else if (cov->role == ROLE_GAUSS) { cov_model *key = cov->key, *sub = key == NULL ? next : key; assert(sub != NULL); assert(key == NULL || ({PMI(cov);false;}));// if ((err=INIT(sub, 0, s)) != NOERROR) return err; } else if (cov->role == ROLE_BASE) { cov_model *key = cov->key, *sub = key == NULL ? next : key; assert(sub != NULL); assert(key == NULL || ({PMI(cov);false;}));// if ((err=INIT(sub, 0, s)) != NOERROR) return err; } else { if ((err=INIT(next, 0, s)) != NOERROR) return err; // e.g. from MLE // PMI(cov->calling); // printf("%s ", NAME(cov->calling)); // SERR("initiation of scale and/or variance failed"); } if ((err = TaylorS(cov)) != NOERROR) return err; return NOERROR; } void doS(cov_model *cov, gen_storage *s){ cov_model *varM = cov->kappasub[DVAR], *scaleM = cov->kappasub[DSCALE]; int i, vdim = cov->vdim[0]; if (varM != NULL && !varM->deterministic && !isRandom(varM)) { assert(!PisNULL(DVAR)); DO(varM, s); } if (scaleM != NULL && !scaleM->deterministic && !isRandom(scaleM)) { assert(!PisNULL(DSCALE)); DO(scaleM, s); } if (hasAnyShapeRole(cov)) { cov_model *next = cov->sub[DOLLAR_SUB]; DO(next, s);// nicht gatternr for (i=0; impp.maxheights[i] = next->mpp.maxheights[i] * P0(DVAR); return; } else if (cov->role == ROLE_GAUSS) { double *res = cov->rf, sd = SQRT(P0(DVAR)); int totalpoints = Gettotalpoints(cov); assert(res != NULL); if (cov->key == NULL) BUG; if (sd != 1.0) for (i=0; itsdim, xdim = cov->xdimown, role = cov->role; bool plus = CovList[cov->nr].check == checkplus, trend = isTrend(cov->typus); // bool linearmodel = !plus && trend && cov->sub[0]->nr == CONST; Types covtype = cov->typus; domain_type covdom = trend ? XONLY : cov->domown; int trendiso = UpgradeToCoordinateSystem(cov->isoown); if (trendiso == ISO_MISMATCH) trendiso = cov->isoown; assert(trendiso != ISO_MISMATCH); int coviso = trend ? trendiso : cov->isoown; assert(cov->Splus == NULL); // printf("\n\n %s %s\n", TYPENAMES[cov->typus], ISONAMES[cov->isoprev]); int variants = 1 + (int) (!trend && (cov->calling == NULL || !isShape(cov->calling))); // PMI(cov->calling); cov->matrix_indep_of_x = true; for (i=0; insub; i++) { Types type = covtype; domain_type dom = covdom; int iso = coviso; sub = cov->sub[i]; // PMI(sub); assert(sub->nr != CONST || sub->maxdim > -2); // printf("> %s entering %s\n", NAME(cov), ISONAMES[coviso]); //PMI(cov->calling); // assert(covdom == KERNEL); //print("stop\n"); if ( iso != EARTH_SYMMETRIC || covdom != KERNEL) return ERRORFAILED; if (sub == NULL) SERR("+ or *: named submodels are not given in a sequence!"); if (!plus && type==VariogramType) type=PosDefType; err = ERRORTYPECONSISTENCY; // printf("unten zu 1 !!"); for (j=0; j> %s : %d %d type =%s %s \n", NAME(cov), j, variants, TYPENAMES[type], ISONAMES[ iso]); // int tt; printf("%d %s\n", tt=TypeConsistency(type, sub, 0), NAME(sub)); if (TypeConsistency(type, sub, 0) && (err = CHECK(sub, dim, xdim, type, dom, iso, SUBMODEL_DEP, type == TrendType ? ROLE_BASE : role)) == NOERROR) break; if ((!isNegDef(type) && !isProcess(type)) || isTrend(type)) break; // printf("trying trend %s %d %s %s %s!\n", NAME(sub), j, TYPENAMES[ type], DOMAIN_NAMES[dom], ISONAMES[iso]); type = TrendType; dom = XONLY; iso = trendiso; // // if (j == variants -1) { //printf("trying trend %s %d of %d %s!\n", NAME(sub), j, variants, ISONAMES[iso]); // PMI(sub); // // } } if (err != NOERROR) { // printf("here dddd %s %s %d of %d; %d\n", NAME(cov), NAME(sub), j, variants, TypeConsistency(type, sub, 0)); MERR(err); return err; } if (cov->typus == sub->typus) { setbackward(cov, sub); } else { updatepref(cov, sub); cov->tbm2num |= sub->tbm2num; cov->vdim[0] = sub->vdim[0]; cov->vdim[1] = sub->vdim[1]; cov->deterministic &= sub->deterministic; }; for(j=0; j<2; j++) { if (vdim[j] == 1) { if (cov->vdim[j] != 1) vdim[j] = cov->vdim[j]; } else { if (cov->vdim[j] != 1 && cov->vdim[j] != vdim[j]) SERR4("multivariate dimensionality is different in the submodels (%s is %d-variate; %s is %d-variate)", NICK(cov->sub[0]), cov->vdim[j], NICK(sub), sub->vdim[j]); } } // if (vdim[1] > vdim[0]) SERR("unclear construction"); // at least currently not allowed cov->matrix_indep_of_x &= sub->matrix_indep_of_x; } // i, nsub cov->vdim[0] = vdim[0]; cov->vdim[1] = vdim[1]; // !! incorrect !! // cov->semiseparatelast = false; //cov->separatelast = false; return NOERROR; } // see private/old.code/operator.cc for some code including variable locations void select(double *x, cov_model *cov, double *v) { int len, *element = PINT(SELECT_SUBNR); cov_model *sub = cov->sub[*element]; assert(cov->vdim[0] == cov->vdim[1]); if (*element >= cov->nsub) ERR("select: element out of range"); COV(x, sub, v); if ( (len = cov->nrow[SELECT_SUBNR]) > 1) { int i, m, vdim = cov->vdim[0], vsq = vdim * vdim; ALLOC_EXTRA(z, vsq); for (i=1; isub[element[i]]; COV(x, sub, z); for (m=0; mnrow[SELECT_SUBNR]; if (len == 1) { int element = P0INT(SELECT_SUBNR); cov_model *next = cov->sub[element]; if (element >= cov->nsub) ERR("select: element out of range"); CovList[next->nr].covmatrix(next, v); } else StandardCovMatrix(cov, v); } char iscovmatrix_select(cov_model VARIABLE_IS_NOT_USED *cov) { return 2; } int checkselect(cov_model *cov) { int err; assert(cov->Splus == NULL); if (!isCartesian(cov->isoown)) return ERRORNOTCARTESIAN; kdefault(cov, SELECT_SUBNR, 0); if ((err = checkplus(cov)) != NOERROR) return err; if ((err = checkkappas(cov)) != NOERROR) return err; EXTRA_STORAGE; return NOERROR; } void rangeselect(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[SELECT_SUBNR] = 0; range->max[SELECT_SUBNR] = MAXSUB-1; range->pmin[SELECT_SUBNR] = 0; range->pmax[SELECT_SUBNR] = MAXSUB-1; range->openmin[SELECT_SUBNR] = false; range->openmax[SELECT_SUBNR] = false; } void plusStat(double *x, cov_model *cov, double *v){ cov_model *sub; int i, m, nsub=cov->nsub, vdim = cov->vdim[0], vsq = vdim * vdim; // assert(cov->vdim[0] == cov->vdim[1]); // printf("%d %d\n", cov->vdim[0], cov->vdim[1]); ALLOC_EXTRA(z, vsq); for (m=0; msub[i]; // printf("PLUS %s %s ---> %s %s %d\n", NAME(sub), NICK(sub), TYPENAMES[cov->typus], TYPENAMES[sub->typus], TypeConsistency(cov->typus, sub->typus)); if (TypeConsistency(cov->typus, sub->typus)) { // pmi(sub, 0); // FCTN(x, sub, z); //printf("%s %d %s %d\n", NAME(cov), cov->typus, NAME(sub), cov->typus); // assert(cov->typus != 9); if (sub->vdim[0] == 1) for (m=0; mnsub, vsq = cov->vdim[0] * cov->vdim[1]; assert(cov->vdim[0] == cov->vdim[1]); ALLOC_EXTRA(z, vsq); for (m=0; msub[i]; if (TypeConsistency(cov->typus, sub->typus)) { NONSTATCOV(x, y, sub, z); if (sub->vdim[0] == 1) for (m=0; mnsub, i, vsq = cov->vdim[0] * cov->vdim[1]; ALLOC_EXTRA(z, vsq); for (int m=0; msub[i]; if (TypeConsistency(cov->typus, sub->typus)) { Abl1(x, sub, z); if (sub->vdim[0] == 1) for (int m=0; mnsub, i, vsq = cov->vdim[0] * cov->vdim[1]; ALLOC_EXTRA(z, vsq); for (int m=0; msub[i]; if (TypeConsistency(cov->typus, sub->typus)) { Abl2(x, sub, z); if (sub->vdim[0] == 1) for (int m=0; mdomown == DOMAIN_MISMATCH) return ERRORNOVARIOGRAM; if (cov->nsub == 0) cov->pref[SpectralTBM] = PREF_NONE; if (isPosDef(cov) && cov->domown == XONLY) cov->logspeed = 0.0; else if (isVariogram(cov) && cov->domown == XONLY) { cov->logspeed = 0.0; for (i=0; insub; i++) { cov_model *sub = cov->sub[i]; if (TypeConsistency(cov->typus, sub->typus)) { if (ISNAN(sub->logspeed)) { cov->logspeed = RF_NA; break; } else cov->logspeed += sub->logspeed; } } } else cov->logspeed = RF_NA; EXTRA_STORAGE; return NOERROR; // spectral mit "+" funktioniert, falls alle varianzen gleich sind, // d.h. nachfolgend DOLLAR die Varianzen gleich sind oder DOLLAR nicht // auftritt; dann zufaellige Auswahl unter "+" } bool Typeplus(Types required, cov_model *cov, int depth) { // assert(false); bool allowed = TypeConsistency(ShapeType, required) || isTrend(required); //||required==ProcessType ||required==GaussMethodType; not yet allowed;to do if (!allowed) return false; int i; for (i=0; insub; i++) { if (TypeConsistency(required, cov->sub[i], depth-1)) return true; } return false; } void spectralplus(cov_model *cov, gen_storage *s, double *e){ assert(cov->vdim[0] == 1); int nr; double dummy; spec_properties *cs = &(s->spec); double *sd_cum = cs->sub_sd_cum; nr = cov->nsub - 1; dummy = UNIFORM_RANDOM * sd_cum[nr]; if (ISNAN(dummy)) BUG; while (nr > 0 && dummy <= sd_cum[nr - 1]) nr--; cov_model *sub = cov->sub[nr]; SPECTRAL(sub, s, e); // nicht gatternr } int structplus(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel){ int m, err; switch(cov->role) { case ROLE_COV : return NOERROR; case ROLE_GAUSS : if (isProcess(cov->typus)) { //assert(cov->calling != NULL && (isInterface(cov->calling->typus) || /// isProcess(cov->calling->typus))); assert(cov->nr != PLUS_PROC); assert(cov->nr == PLUS); //cov->nr = PLUS_PROC; BUG; //return structplusproc(cov, newmodel); // kein S-TRUCT !! } if (cov->Splus != NULL) BUG; for (m=0; mnsub; m++) { cov_model *sub = cov->sub[m]; if ((err = STRUCT(sub, newmodel)) > NOERROR) { return err; } } break; default : SERR2("role '%s' not allowed for '%s'", ROLENAMES[cov->role], NICK(cov)); } return NOERROR; } int initplus(cov_model *cov, gen_storage *s){ int i, err, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; // ?? for (i=0; impp.maxheights[i] = RF_NA; if (cov->role == ROLE_GAUSS) { spec_properties *cs = &(s->spec); double *sd_cum = cs->sub_sd_cum; if (cov->vdim[0] == 1) { for (i=0; insub; i++) { cov_model *sub = cov->Splus == NULL ? cov->sub[i] : cov->Splus->keys[i]; if (sub->pref[Nothing] > PREF_NONE) { // to do ?? // for spectral plus only COV(ZERO, sub, sd_cum + i); if (i>0) sd_cum[i] += sd_cum[i-1]; } cov->sub[i]->Sgen = (gen_storage *) MALLOC(sizeof(gen_storage)); if ((err = INIT(sub, cov->mpp.moments, s)) != NOERROR) { // AERR(err); return err; } sub->simu.active = true; } } cov->fieldreturn = cov->Splus != NULL; cov->origrf = false; if (cov->Splus != NULL) cov->rf = cov->Splus->keys[0]->rf; return NOERROR; } else if (cov->role == ROLE_COV) { return NOERROR; } return ERRORFAILED; } void doplus(cov_model *cov, gen_storage *s) { int i; if (cov->role == ROLE_GAUSS && cov->method==SpectralTBM) { ERR("error in doplus with spectral"); } for (i=0; insub; i++) { cov_model *sub = cov->Splus==NULL ? cov->sub[i] : cov->Splus->keys[i]; DO(sub, s); } } void covmatrix_plus(cov_model *cov, double *v) { location_type *loc = Loc(cov); // cov_fct *C = CovList + cov->nr; // nicht gatternr long i, totalpoints = loc->totalpoints, vdimtot = totalpoints * cov->vdim[0], vdimtotSq = vdimtot * vdimtot; int nsub = cov->nsub; bool is = iscovmatrix_plus(cov) >= 2; double *mem = NULL; if (is && nsub > 1) { ALLOC_EXTRA2(MEM, vdimtotSq); mem = MEM; is = mem != NULL; } if (is) { int j; if (PisNULL(SELECT_SUBNR)) PALLOC(SELECT_SUBNR, 1, 1); P(SELECT_SUBNR)[0] = 0; CovList[SELECTNR].covmatrix(cov, v); for (i=1; isub[i])->totalpoints != totalpoints) BUG; P(SELECT_SUBNR)[0] = i; CovList[SELECTNR].covmatrix(cov, mem); for (j=0; jnsub; for (i=0; isub[i]; is = CovList[sub->nr].is_covmatrix(sub); if (is > max) max = is; } return max; } void malStat(double *x, cov_model *cov, double *v){ cov_model *sub; int i, m, nsub=cov->nsub, vdim = cov->vdim[0], vsq = vdim * vdim; ALLOC_EXTRA(z, vsq); // assert(x[0] >= 0.0 || cov->xdimown > 1); for (m=0; msub[i]; COV(x, sub, z); if (sub->vdim[0] == 1) for (m=0; mnsub, vdim = cov->vdim[0], vsq = vdim * vdim; ALLOC_EXTRA(z, vsq); ALLOC_EXTRA2(zSign, vsq); assert(cov->vdim[0] == cov->vdim[1]); assert(x[0] >= 0.0 || cov->xdimown > 1); for (m=0; msub[i]; LOGCOV(x, sub, z, zSign); if (sub->vdim[0] == 1) { for (m=0; mnsub, vdim = cov->vdim[0], vsq = vdim * vdim; ALLOC_EXTRA(z, vsq); assert(cov->vdim[0] == cov->vdim[1]); assert(cov->vdim[0] == cov->vdim[1]); for (m=0; msub[i]; NONSTATCOV(x, y, sub, z); if (sub->vdim[0] == 1) for (m=0; mnsub, vdim = cov->vdim[0], vsq = vdim * vdim; assert(cov->vdim[0] == cov->vdim[1]); ALLOC_EXTRA(z, vsq); ALLOC_EXTRA2(zSign, vsq); for (m=0; msub[i]; LOGNONSTATCOV(x, y, sub, z, zSign); if (sub->vdim[0] == 1) { for (m=0; mnsub, i, vsq = cov->vdim[0] * cov->vdim[1]; ALLOC_EXTRA3(c, vsq * MAXSUB); ALLOC_EXTRA4(d, vsq * MAXSUB); for (i=0; isub[i]; COV(x, sub, c + i * vsq); Abl1(x, sub, d + i* vsq); } *v = 0.0; for (i=0; isub[0]; cov_model *next2 = cov->sub[1]; int i, err, nsub = cov->nsub; if (next2 == NULL) next2 = next1; // printf("cov = %s\n", NAME(next2)); if ((err = checkplusmal(cov)) != NOERROR) return err; // printf("cov = %s no error \n", NAME(next2)); bool ok = cov->domown != DOMAIN_MISMATCH && (isTrend(cov->typus) || (isShape(cov->typus) && (!isNegDef(cov->typus) || isPosDef(cov->typus) ))); if (!ok) return ERRORNOVARIOGRAM; // to do istcftype und allgemeiner typ zulassen if (cov->typus == TrendType) { ok = false; for (i=0; isub[i]->nr == CONST || cov->sub[i]->nr == BIND)) break; if (!ok) SERR2("misuse as a trend function. At least one factor must be a constant (including 'NA') or a vector built with '%s(...)' or '%s(...).", CovList[BIND].name, CovList[BIND].nick); } cov->logspeed = cov->domown == XONLY ? 0 : RF_NA; if (cov->xdimown >= 2) cov->pref[TBM] = PREF_NONE; if (cov->xdimown==2 && cov->nsub == 2 && isAnyDollar(next1) && isAnyDollar(next2)) { double *aniso1 = PARAM(next1, DANISO), *aniso2 = PARAM(next2, DANISO); if (aniso1 != NULL && aniso2 != NULL) { if (aniso1[0] == 0.0 && next1->ncol[DANISO] == 1) { cov->pref[TBM] = next2->pref[TBM]; } else if (aniso2[0] == 0.0 && next2->ncol[DANISO] == 1) { cov->pref[TBM] = next1->pref[TBM]; } } } if (cov->ptwise_definite <= last_pt_definite) { cov->ptwise_definite = next1->ptwise_definite; if (cov->ptwise_definite != pt_zero) { for (i=1; insub; i++) { cov_model *sub = cov->sub[i]; if (sub->ptwise_definite == pt_zero) { cov->ptwise_definite = pt_zero; break; } if (sub->ptwise_definite != pt_posdef) { if (sub->ptwise_definite == pt_negdef) { cov->ptwise_definite = cov->ptwise_definite == pt_posdef ? pt_negdef : cov->ptwise_definite == pt_negdef ? pt_posdef : pt_indef; } else { // sub = indef cov->ptwise_definite = sub->ptwise_definite; break; } } } } } EXTRA_STORAGE; return NOERROR; } bool Typemal(Types required, cov_model *cov, int depth) { // printf("%d %d\n", isShape(required), isTrend(required)); if (!isShape(required) && !isTrend(required)) return false; int i; for (i=0; insub; i++) { // print("Typemal %s %s %d\n", TYPENAMES[required], NAME(cov->sub[i]), TypeConsistency(required, cov->sub[i], depth-1)); if (!TypeConsistency(required, cov->sub[i], depth-1)) return false; } // print("Typemal OK\n"); return true; } int initmal(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ // int err; // return err; return ERRORFAILED; int i, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; for (i=0; impp.maxheights[i] = RF_NA; } void domal(cov_model VARIABLE_IS_NOT_USED *cov, gen_storage VARIABLE_IS_NOT_USED *s){ BUG; } ////////////////////////////////////////////////////////////////////// // mpp-plus #define PLUS_P 0 // parameter int CheckAndSetP(cov_model *cov){ int n, nsub = cov->nsub; double cump = 0.0; if (PisNULL(PLUS_P)) { assert(cov->nrow[PLUS_P] == 0 && cov->ncol[PLUS_P] == 0); PALLOC(PLUS_P, nsub, 1); for (n=0; n 1.0 && n+1nsub; *nc = i < CovList[cov->nr].kappas ? 1 : -1; } void mppplus(double *x, cov_model *cov, double *v) { int i, n, vdim = cov->vdim[0], vdimSq = vdim * vdim; cov_model *sub; ALLOC_EXTRA(z, vdimSq); if (cov->role == ROLE_COV) { for (i=0; insub; n++, sub++) { sub = cov->sub[n]; COV(x, sub, z); // urspruenglich : covlist[sub].cov(x, cov, z); ?! for (i=0; imaxdim = MAXMPPDIM; SERR("the current version does not support RMmppplus\n"); if ((err = checkplusmal(cov)) != NOERROR) { return err; } if ((err = CheckAndSetP(cov)) != NOERROR) return(err); if (cov->q == NULL) QALLOC(size); EXTRA_STORAGE; return NOERROR; } void rangempplus(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ range->min[PLUS_P] = 0.0; range->max[PLUS_P] = 1.0; range->pmin[PLUS_P] = 0.0; range->pmax[PLUS_P] = 1.0; range->openmin[PLUS_P] = false; range->openmax[PLUS_P] = false; } int struct_mppplus(cov_model *cov, cov_model **newmodel){ int m, //nsub = cov->nsub, err = NOERROR; //if (cov->calling == NULL || cov->calling->ownloc == NULL) // SERR("mppplus does not seem to be used in the right context"); if (!hasMaxStableRole(cov) && !hasPoissonRole(cov)) { SERR("method is not based on Poisson point process"); } return ERRORNOTPROGRAMMEDYET; // Ausnahme: mppplus wird separat behandelt: // if (nr == MPPPLUS) return S TRUCT(shape, NULL); ASSERT_NEWMODEL_NOT_NULL; NEW_STORAGE(plus); plus_storage *s = cov->Splus; for (m=0; mnsub; m++) { cov_model *sub = cov->sub[m]; if (s->keys[m] != NULL) COV_DELETE(s->keys + m); if ((err = covCpy(s->keys + m, sub)) != NOERROR) return err; if ((err = addShapeFct(s->keys + m)) != NOERROR) return err; s->keys[m]->calling = cov; } return NOERROR; } int init_mppplus(cov_model *cov, gen_storage *S) { cov_model *sub; double M2[MAXMPPVDIM], M2plus[MAXMPPVDIM], Eplus[MAXMPPVDIM], maxheight[MAXMPPVDIM]; int i,n, err, vdim = cov->vdim[0]; if (cov->vdim[0] != cov->vdim[1]) BUG; if (vdim > MAXMPPVDIM) BUG; ext_bool loggiven = SUBMODEL_DEP, fieldreturn = SUBMODEL_DEP; pgs_storage *pgs = NULL; for (i=0; iSpgs; pgs->totalmass = 0.0; for (n=0; nnsub; n++) { sub = cov->sub[n]; //if (!sub->mpp.loc_done) //SERR1("submodel %d of '++': the location of the shapes is not defined", // n); if ((err = INIT(sub, cov->mpp.moments, S)) != NOERROR) return err; //if (!sub->mpp.loc_done) SERR("locations are not initialised"); if (n==0) { loggiven = sub->loggiven; fieldreturn = sub->fieldreturn; } else { if (loggiven != sub->loggiven) loggiven = SUBMODEL_DEP; if (fieldreturn != sub->loggiven) fieldreturn = SUBMODEL_DEP; } pgs->totalmass += sub->Spgs->totalmass * P(PLUS_P)[n]; for (i=0; impp.maxheights[i] > maxheight[i]) maxheight[i] = cov->mpp.maxheights[i]; loggiven &= cov->loggiven; // Achtung cov->mpp.mM2 und Eplus koennten nicht direkt gesetzt // werden, da sie vom CovList[sub->nr].Init ueberschrieben werden !! if (cov->mpp.moments >= 1) { int nmP1 = sub->mpp.moments + 1; for (i=0; impp.mMplus[idx + 1]; } if (cov->mpp.moments >= 2) { for (i=0; impp.mM[idx + 2]; M2plus[i] += PARAM0(sub, PLUS_P) * sub->mpp.mM[idx + 2]; } } } //assert(sub->mpp.loc_done); } for (i=0; impp.maxheights[i] = maxheight[i]; //cov->mpp.refsd = RF_NA; // cov->mpp.refradius = RF_NA; if (cov->mpp.moments >= 1) { int nmP1 = cov->mpp.moments + 1; for (i=0; impp.mMplus[idx + 1] = Eplus[i]; cov->mpp.mM[idx + 1] = RF_NA; } if (cov->mpp.moments >= 2) { for (i=0; impp.mM[idx + 2] = M2[i]; cov->mpp.mMplus[idx + 2] = M2plus[i]; } } } cov->loggiven = loggiven; cov->fieldreturn = fieldreturn; //cov->mpp.loc_done = true; cov->origrf = false; cov->rf = NULL; return NOERROR; } void do_mppplus(cov_model *cov, gen_storage *s) { cov_model *sub; double subselect = UNIFORM_RANDOM; int i, subnr, vdim = cov->vdim[0]; assert(cov->vdim[0] == cov->vdim[1]); for (subnr=0; (subselect -= PARAM0(cov->sub[subnr], PLUS_P)) > 0; subnr++); cov->q[0] = (double) subnr; sub = cov->sub[subnr]; CovList[sub->nr].Do(sub, s); // nicht gatternr for (i=0; impp.maxheights[i] = sub->mpp.maxheights[i]; cov->fieldreturn = sub->fieldreturn; cov->loggiven = sub->loggiven; } ////////////////////////////////////////////////////////////////////// // PROCESSES ////////////////////////////////////////////////////////////////////// int structSproc(cov_model *cov, cov_model **newmodel) { // printf("entering\n"); cov_model *next = cov->sub[DOLLAR_SUB], *Scale = cov->kappasub[DSCALE], *Aniso = cov->kappasub[DAUSER]; int dim = Gettimespacedim(cov), newdim = dim, err; // cov_model *sub; assert(isDollarProc(cov)); if ((Aniso != NULL && !Aniso->deterministic) || (Scale != NULL && !Scale->deterministic) ) { SERR1("complicated models including arbitrary functions for '%s' cannot be simulated yet", KNAME(DAUSER)); } switch (cov->role) { case ROLE_GAUSS : ASSERT_NEWMODEL_NULL; if (cov->key != NULL) COV_DELETE(&(cov->key)); if (PrevLoc(cov)->distances) SERR("distances do not allow for more sophisticated simulation methods"); if (Aniso!= NULL) { //A // crash(); TransformLoc(cov, false, true, true); newdim = Aniso->vdim[0]; if (newdim != dim) ERR("change of dimension in struct S not programmed yet"); location_type *loc = Loc(cov); // do not move before TransformLoc!! int bytes = newdim * sizeof(double); long i, total = loc->totalpoints; // PMI(Aniso); // printf("%d\n", dim); double *v = NULL, *x = loc->x, *xnew = x; // not correct for newdim != dim; // instead partial_loc_set should be used to reset loc assert(x != NULL); assert(!loc->grid); if ((v = (double*) MALLOC(bytes)) == NULL) return ERRORMEMORYALLOCATION; for (i=0; inr == TBM_PROC_INTERN); int gridexpand = next->nr == TBM_PROC_INTERN || next->nr == NUGGET || next->nr == NUGGET_USER || next->nr == NUGGET_INTERN ? false : GRIDEXPAND_AVOID; //print("here %d %d\n", (int) gridexpand, (int) GRIDEXPAND_AVOID); TransformLocReduce(cov, true /* timesep*/, gridexpand, true /* involveddollar */); newdim = Gettimespacedim(cov); //APMI(cov); } // APMI(cov); if ((err = covCpy(&(cov->key), next)) != NOERROR) return err; if (!isGaussProcess(cov->key)) addModel(&(cov->key), GAUSSPROC); SetLoc2NewLoc(cov->key, PLoc(cov)); cov_model *key; key = cov->key; assert(key->calling == cov); //dim = PrevLoc(key)->timespacedim; if ((err = CHECK_NO_TRAFO(key, newdim, newdim, ProcessType, XONLY, CoordinateSystemOf(cov->Sdollar->isoown), cov->vdim[0], cov->role)) != NOERROR) { return err; } err = STRUCT(key, NULL); // MERR(err); // APMI(key); return err; default : SERR2("%s: changes in scale/variance not programmed yet for '%s'", NICK(cov), ROLENAMES[cov->role]); } return NOERROR; } int initSproc(cov_model *cov, gen_storage *s){ // am liebsten wuerde ich hier die Koordinaten transformieren; // zu grosser Nachteil ist dass GetDiameter nach trafo // grid def nicht mehr ausnutzen kann -- umgehbar?! //cov_model *next = cov->sub[DOLLAR_SUB]; //mppinfotype *info = &(s->mppinfo); // location_type *loc = cov->prevloc; cov_model *key = cov->key; //*sub = key == NULL ? next : key; location_type *prevloc = PrevLoc(cov); int prevdim = prevloc->timespacedim, dim = Gettimespacedim(cov), err = NOERROR; assert(key != NULL); if ((err = INIT(key, 0, s)) != NOERROR) { return err; } key->simu.active = true; assert(s != NULL); cov->fieldreturn = true; // APMI(cov->calling->calling->calling->calling->calling->calling); // printf("%d, %d %d\n",cov->ownloc != NULL, Loc(cov)->totalpoints, prevloc->totalpoints); if ((cov->origrf = cov->ownloc != NULL && prevdim > dim)) { // printf("hier\n"); if (cov->vdim[0] != cov->vdim[1]) BUG; cov->rf = (double*) MALLOC(sizeof(double) * cov->vdim[0] * prevloc->totalpoints); DOLLAR_STORAGE; int d, *proj = PINT(DPROJ), bytes = prevdim * sizeof(int), *cumsum = cov->Sdollar->cumsum = (int*) MALLOC(bytes), *total = cov->Sdollar->total = (int*) MALLOC(bytes), *len = cov->Sdollar->len = (int*) MALLOC(bytes); cov->Sdollar->nx = (int*) MALLOC(bytes); if (prevloc->grid) { for (d=0; dxgr[d][XLENGTH]; } if (proj != NULL) { int nproj = cov->nrow[DPROJ]; d = 0; assert(proj[d] > 0); cumsum[proj[d] - 1] = 1; for (d = 1; d < nproj; d++) { cumsum[proj[d] - 1] = cumsum[proj[d - 1] - 1] * len[d-1]; } } else { int i, iold = 0, nrow = cov->nrow[DANISO], ncol = cov->ncol[DANISO]; double *A = P(DANISO); for (d=0; d 0) { cumsum[i] = cumsum[iold] * len[d-1]; } else { // d ==0 cumsum[i] = 1; } iold = i; for (i++; i < nrow; i++) if (A[i] != 0.0) BUG; // just a check } } } else { // !prevloc->grid if (!prevloc->Time) goto Standard; len[0] = prevloc->spatialtotalpoints; len[1] = prevloc->T[XLENGTH]; int nproj = cov->nrow[DPROJ]; if (proj[0] != prevdim) { // spatial for (d=1; dcalling->calling->calling->calling->calling->calling, 0); APMI(cov); } else { if (nproj != 1) goto Standard; cumsum[0] = 0; cumsum[1] = 1; //pmi(cov->calling->calling->calling->calling->calling->calling, 0); //PMI(cov); } prevdim = 2; } for (d=0; dorigrf = false; cov->rf = cov->key->rf; //printf("cumsum %d\n", cov->Sdollar->cumsum[1]); //PMI(cov); return NOERROR; } void doSproc(cov_model *cov, gen_storage *s){ int i, vdim = cov->vdim[0]; if (hasMaxStableRole(cov) || hasPoissonRole(cov)) { assert(vdim == 1); cov_model *next = cov->sub[DOLLAR_SUB]; cov_model *varM = cov->kappasub[DVAR], *scaleM = cov->kappasub[DSCALE]; assert(cov->vdim[0] == cov->vdim[1]); if (varM != NULL && !varM->deterministic) { assert(!PisNULL(DVAR) && isRandom(varM)); VTLG_R(NULL, varM, P(DVAR)); } if (scaleM != NULL && !scaleM->deterministic) { // remote could be deterministic although local ist not assert(!PisNULL(DSCALE)); VTLG_R(NULL, scaleM, P(DSCALE)); } DO(next, s);// nicht gatternr for (i=0; impp.maxheights[i] = next->mpp.maxheights[i] * P0(DVAR); } else if (cov->role == ROLE_GAUSS) { assert(cov->key != NULL); double *res = cov->key->rf, sd = SQRT(P0(DVAR)); int totalpoints = Gettotalpoints(cov), totptsvdim = totalpoints * vdim; DO(cov->key, s); cov_model *varM = cov->kappasub[DVAR]; if (varM != NULL && !isRandom(varM)) { ALLOC_NEW(Sdollar, var, totptsvdim, var); Fctn(NULL, cov, var); for (i=0; iorigrf) { // es wird in cov->key->rf nur // der projezierte Teil simuliert. Dieser Teil // muss auf das gesamte cov->rf hochgezogen werden //if (vdim != 1) BUG; int zaehler, d, dim = PrevLoc(cov)->grid ? PrevLoc(cov)->timespacedim : 2, prevtotalpts = PrevLoc(cov)->totalpoints, owntotalpts = Loc(cov)->totalpoints, *cumsum = cov->Sdollar->cumsum, *nx = cov->Sdollar->nx, *len = cov->Sdollar->len, *total = cov->Sdollar->total; assert(cov->key != NULL); assert(nx != NULL && total != NULL && cumsum != NULL); for (d=0; drf + v * prevtotalpts, *rf = cov->key->rf + v * owntotalpts; while (true) { res[i++] = rf[zaehler]; d = 0; nx[d]++; zaehler += cumsum[d]; while (nx[d] >= len[d]) { nx[d] = 0; zaehler -= total[d]; if (++d >= dim) break; nx[d]++; zaehler += cumsum[d]; } if (d >= dim) break; } } } } int checkplusmalproc(cov_model *cov) { cov_model *sub; int i, err, dim = cov->tsdim, xdim = cov->xdimown, role = cov->role; Types type = ProcessType; domain_type dom = cov->domown; isotropy_type iso = cov->isoown; assert(cov->Splus != NULL); for (i=0; insub; i++) { sub = cov->Splus->keys[i]; if (sub == NULL) SERR("named submodels are not given in a sequence."); if (!TypeConsistency(type, sub, 0)) { return ERRORTYPECONSISTENCY; } if ((err= CHECK(sub, dim, xdim, type, dom, iso, SUBMODEL_DEP, role)) != NOERROR) { return err; } if (i==0) { cov->vdim[0]=sub->vdim[0]; // to do: inkonsistent mit vorigen Zeilen !! cov->vdim[1]=sub->vdim[1]; // to do: inkonsistent mit vorigen Zeilen !! } else { if (cov->vdim[0] != sub->vdim[0] || cov->vdim[1] != sub->vdim[1]) { SERR("multivariate dimensionality must be equal in the submodels"); } } } return NOERROR; } int checkplusproc(cov_model *cov) { int err; if ((err = checkplusmalproc(cov)) != NOERROR) { return err; } return NOERROR; } int structplusmalproc(cov_model *cov, cov_model VARIABLE_IS_NOT_USED**newmodel){ int m, err, dim = Gettimespacedim(cov); // bool plus = cov->nr == PLUS_PROC ; switch(cov->role) { case ROLE_GAUSS : { location_type *loc = Loc(cov); NEW_STORAGE(plus); plus_storage *s =cov->Splus; for (m=0; mnsub; m++) { cov_model *sub = cov->sub[m]; if (s->keys[m] != NULL) COV_DELETE(s->keys + m); if ((err = covCpy(s->keys + m, sub)) != NOERROR) { return err; } assert(s->keys[m] != NULL); assert(s->keys[m]->calling == cov); if (PL >= PL_STRUCTURE) { LPRINT("plus: trying initialisation of submodel #%d (%s).\n", m+1, NICK(sub)); } isotropy_type newiso = UpgradeToCoordinateSystem(cov->isoprev); //!prev if (newiso == ISO_MISMATCH) { SERR2("'%s' for '%s' cannot be upgraded to a coordinate system", NAME(sub), ISONAMES[cov->isoown]); } addModel(s->keys + m, isTrend(sub->typus) ? TRENDEVAL : GAUSSPROC); if (isTrend(sub->typus) && sub->Spgs == NULL) { if ((err = alloc_cov(sub, dim, sub->vdim[0], sub->vdim[1])) != NOERROR) return err; } s->keys[m]->calling = cov; if ((err = CHECK(s->keys[m], loc->timespacedim, loc->timespacedim, ProcessType, XONLY, newiso, cov->vdim, ROLE_GAUSS)) != NOERROR) { return err; } if ((s->struct_err[m] = err = STRUCT(s->keys[m], NULL)) > NOERROR) { //PMI(s->keys[m]); // XERR(err); return err; } } return NOERROR; } default : SERR2("role '%s' not allowed for '%s'", ROLENAMES[cov->role], NICK(cov)); } return NOERROR; } int structplusproc(cov_model *cov, cov_model **newmodel){ assert(cov->nr == PLUS_PROC); return structplusmalproc(cov, newmodel); } int structmultproc(cov_model *cov, cov_model **newmodel){ assert(CovList[cov->nr].check == checkmultproc); return structplusmalproc(cov, newmodel); } int initplusmalproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ int i, err, vdim = cov->vdim[0]; assert(cov->vdim[0] == cov->vdim[1]); bool plus = cov->nr == PLUS_PROC ; for (i=0; impp.maxheights[i] = RF_NA; if (cov->Splus == NULL) BUG; if (cov->role == ROLE_GAUSS) { for (i=0; insub; i++) { cov_model *sub = cov->Splus == NULL ? cov->sub[i] : cov->Splus->keys[i]; if (!plus && (sub->nr == CONST //|| CovList[sub[0]->nr].check == checkconstant || // (isDollar(sub) && CovList[sub->sub[0]->nr].check == checkconstant) )) continue; assert(cov->sub[i]->Sgen==NULL); cov->sub[i]->Sgen = (gen_storage *) MALLOC(sizeof(gen_storage)); if ((err = INIT(sub, 0, cov->sub[i]->Sgen)) != NOERROR) { return err; } sub->simu.active = true; } cov->simu.active = true; return NOERROR; } else { BUG; } return ERRORFAILED; } int initplusproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ int err; if ((err = initplusmalproc(cov, s)) != NOERROR) return err; if (cov->role == ROLE_GAUSS) { cov->fieldreturn = cov->Splus != NULL; cov->origrf = false; if (cov->Splus != NULL) cov->rf = cov->Splus->keys[0]->rf; return NOERROR; } else { BUG; } return ERRORFAILED; } void doplusproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { int m, i, total = Loc(cov)->totalpoints * cov->vdim[0]; double *res = cov->rf; assert(cov->vdim[0] == cov->vdim[1]); if (cov->role == ROLE_GAUSS && cov->method==SpectralTBM) { ERR("error in doplus with spectral"); } assert(cov->Splus != NULL); for (m=0; mnsub; m++) { cov_model *key = cov->Splus->keys[m], *sub = cov->sub[m]; double *keyrf = key->rf; // PMIL(key, 2); DO(key, sub->Sgen); if (m > 0) for(i=0; irole == ROLE_GAUSS) { FieldReturn(cov); return NOERROR; } else { BUG; } return ERRORFAILED; } void domultproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) { double *res = cov->rf; assert(cov->vdim[0] == cov->vdim[1]); int m, i, c, idx, vdim = cov->vdim[0], // vdimSq= vdim * vdim, total = Loc(cov)->totalpoints, totalvdim = total * vdim, copies = GLOBAL.special.multcopies, factors = 0; if (cov->role == ROLE_GAUSS && cov->method==SpectralTBM) { ERR("error in do_mult with spectral"); } if (cov->nsub==2 && ((cov->sub[0]->nr==PROD) xor (idx=cov->sub[1]->nr==PROD)) && cov->sub[0]->nr != CONST && cov->sub[1]->nr != CONST) { // koennte noch allgemeiner gemacht werden in verbindung mit CONST; todo copies = 1; cov->sub[idx]->Sgen->prodproc_random = false; } /// APMI(cov); assert(cov->Splus != NULL); SAVE_GAUSS_TRAFO; for (c=0; cnsub; m++) { if (PL > PL_RECURSIVE) { PRINTF("\rcopies=%d sub=%d\n", c, m); } cov_model *key = cov->Splus->keys[m], *sub = cov->sub[m]; double *keyrf = key->rf; if (sub->nr == CONST) { double cc = isTrend(sub->typus) ? PARAM0(sub, CONST_C) : SQRT(PARAM0(sub, CONST_C)); for(i=0; isub[0] : sub; if (CovList[Check->nr].check == checkconstant) { if (dollar) { double var = PARAM0(sub, DVAR); bool random = false; if (sub->kappasub[DVAR] != NULL) { if (random = isRandom(sub->kappasub[DVAR])) { Do(sub->kappasub[DVAR], sub->Sgen); } else { ALLOC_EXTRA2(VarMem, totalvdim); F ct n(NULL, sub->kappasub[DVAR], VarMem); } } if (var != 1.0) { double sd = SQRT(var); for(i=0; iSgen); for(i=0; irf[i] += res[i]; } } double f; f = 1 / SQRT((double) copies); for(i=0; irf[i] *= f; } void rangemultproc(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range){ range->min[MULTPROC_COPIES] = 1.0; range->max[MULTPROC_COPIES] = RF_INF; range->pmin[MULTPROC_COPIES] = 1.0; range->pmax[MULTPROC_COPIES] = 1000; range->openmin[MULTPROC_COPIES] = false; range->openmax[MULTPROC_COPIES] = true; } // $power void PowSstat(double *x, cov_model *cov, double *v){ logPowSstat(x, cov, v, NULL); } void logPowSstat(double *x, cov_model *cov, double *v, double *Sign){ cov_model *next = cov->sub[POW_SUB]; double factor, var = P0(POWVAR), scale =P0(POWSCALE), p = P0(POWPOWER), invscale = 1.0 / scale; int i, vdim = cov->vdim[0], vdimSq = vdim *vdim, xdimown = cov->xdimown; assert(cov->vdim[0] == cov->vdim[1]); ALLOC_DOLLAR(z, xdimown); for (i=0; i < xdimown; i++) z[i] = invscale * x[i]; if (Sign==NULL) { COV(z, next, v); factor = var * POW(scale, p); for (i=0; isub[POW_SUB]; double factor, var = P0(POWVAR), scale =P0(POWSCALE), p = P0(POWPOWER), invscale = 1.0 / scale; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim, xdimown = cov->xdimown; assert(cov->vdim[0] == cov->vdim[1]); ALLOC_DOLLARY(z1, z2, xdimown); for (i=0; isub[POW_SUB]; int i, vdim = cov->vdim[0], vdimSq = vdim * vdim; double y, scale =P0(POWSCALE), p = P0(POWPOWER), var = P0(POWVAR); assert(cov->vdim[0] == cov->vdim[1]); y= *x / (var * POW(scale, p)); // inversion, so variance becomes scale if (CovList[next->nr].inverse == ErrCov) BUG; INVERSE(&y, next, v); for (i=0; ivdim[0] != 1) SERR("Taylor only known in the unvariate case"); cov_model *next = cov->sub[POW_SUB]; int i; double scale = PisNULL(POWSCALE) ? 1.0 : P0(POWSCALE); cov->taylorN = next->taylorN; for (i=0; itaylorN; i++) { cov->taylor[i][TaylorPow] = next->taylor[i][TaylorPow]; cov->taylor[i][TaylorConst] = next->taylor[i][TaylorConst] * P0(POWVAR) * POW(scale, P0(POWPOWER) - next->taylor[i][TaylorPow]); } cov->tailN = next->tailN; for (i=0; itailN; i++) { cov->tail[i][TaylorPow] = next->tail[i][TaylorPow]; cov->tail[i][TaylorExpPow] = next->tail[i][TaylorExpPow]; cov->tail[i][TaylorConst] = next->tail[i][TaylorConst] * P0(POWVAR) * POW(scale, P0(POWPOWER) - next->tail[i][TaylorPow]); cov->tail[i][TaylorExpConst] = next->tail[i][TaylorExpConst] * POW(scale, -next->tail[i][TaylorExpPow]); } return NOERROR; } int checkPowS(cov_model *cov) { // hier kommt unerwartet ein scale == nan rein ?!! cov_model *next = cov->sub[POW_SUB]; int err, tsdim = cov->tsdim, xdimown = cov->xdimown, xdimNeu = xdimown; if (!isCartesian(cov->isoown)) return ERRORNOTCARTESIAN; kdefault(cov, POWVAR, 1.0); kdefault(cov, POWSCALE, 1.0); kdefault(cov, POWPOWER, 0.0); if ((err = checkkappas(cov)) != NOERROR) { return err; } if ((err = CHECK(next, tsdim, xdimNeu, cov->typus, cov->domown, cov->isoown, SUBMODEL_DEP, cov->role)) != NOERROR) { return err; } setbackward(cov, next); if ((err = TaylorPowS(cov)) != NOERROR) return err; DOLLAR_STORAGE; return NOERROR; } bool TypePowS(Types required, cov_model *cov, int depth) { cov_model *next = cov->sub[0]; return (isShape(required) || isTrend(required) || isProcess(required)) && TypeConsistency(required, next, depth-1); } void rangePowS(cov_model *cov, range_type* range){ range->min[POWVAR] = 0.0; range->max[POWVAR] = RF_INF; range->pmin[POWVAR] = 0.0; range->pmax[POWVAR] = 100000; range->openmin[POWVAR] = false; range->openmax[POWVAR] = true; range->min[POWSCALE] = 0.0; range->max[POWSCALE] = RF_INF; range->pmin[POWSCALE] = 0.0001; range->pmax[POWSCALE] = 10000; range->openmin[POWSCALE] = true; range->openmax[POWSCALE] = true; range->min[POWPOWER] = RF_NEGINF; range->max[POWPOWER] = RF_INF; range->pmin[POWPOWER] = -cov->tsdim; range->pmax[POWPOWER] = +cov->tsdim; range->openmin[POWPOWER] = true; range->openmax[POWPOWER] = true; } void PowScaleToLoc(cov_model *to, cov_model *from, int VARIABLE_IS_NOT_USED depth) { assert(!PARAMisNULL(to, LOC_SCALE) && !PARAMisNULL(from, POWSCALE)); PARAM(to, LOC_SCALE)[0] = PARAM0(from, POWSCALE); } int structPowS(cov_model *cov, cov_model **newmodel) { cov_model *next = cov->sub[POW_SUB], *scale = cov->kappasub[POWSCALE]; int err; if (!next->deterministic) SERR("random shapes not programmed yet"); switch (cov->role) { case ROLE_SMITH : case ROLE_GAUSS : ASSERT_NEWMODEL_NOT_NULL; if ((err = STRUCT(next, newmodel)) > NOERROR) return err; addModel(newmodel, POWER_DOLLAR); if (!PisNULL(POWVAR)) kdefault(*newmodel, POWVAR, P0(POWVAR)); if (!PisNULL(POWSCALE)) kdefault(*newmodel, POWSCALE, P0(POWSCALE)); if (!PisNULL(POWPOWER)) kdefault(*newmodel, POWPOWER, P0(POWPOWER)); break; case ROLE_MAXSTABLE : { ASSERT_NEWMODEL_NOT_NULL; if ((err = STRUCT(next, newmodel)) > NOERROR) return err; if (!isRandom(scale)) SERR("unstationary scale not allowed yet"); addModel(newmodel, LOC); addSetDistr(newmodel, scale, PowScaleToLoc, true, MAXINT); } break; default : SERR2("'%s': changes in scale/variance not programmed yet for '%s'", NICK(cov), ROLENAMES[cov->role]); } return NOERROR; } int initPowS(cov_model *cov, gen_storage *s){ // am liebsten wuerde ich hier die Koordinaten transformieren; // zu grosser Nachteil ist dass GetDiameter nach trafo // grid def nicht mehr ausnutzen kann -- umgehbar?! cov_model *next = cov->sub[POW_SUB], *varM = cov->kappasub[POWVAR], *scaleM = cov->kappasub[POWSCALE]; int vdim = cov->vdim[0], nm = cov->mpp.moments, nmvdim = (nm + 1) * vdim, err = NOERROR; bool maxstable = hasExactMaxStableRole(cov);// Realisationsweise assert(cov->vdim[0] == cov->vdim[1]); assert(cov->key == NULL || ({PMI(cov);false;}));// if (hasAnyShapeRole(cov)) { // !! ohne maxstable selbst !! double var[MAXMPPVDIM], p = P0(POWPOWER), scale = P0(POWSCALE); int i, intp = (int) p, dim = cov->tsdim; // Achtung I-NIT_RANDOM ueberschreibt mpp.* !! if (varM != NULL) { int nm_neu = nm == 0 && !maxstable ? 1 : nm; if ((err = INIT_RANDOM(varM, nm_neu, s, P(POWVAR))) != NOERROR) return err; int nmP1 = varM->mpp.moments + 1; for (i=0; impp.mM[idx + 1]; } } else for (i=0; impp.moments == 1); scale = maxstable ? P0(DSCALE) : scaleM->mpp.mM[1]; } if ((err = INIT(next, nm, s)) != NOERROR) return err; for (i=0; i < nmvdim; i++) { cov->mpp.mM[i] = next->mpp.mM[i]; cov->mpp.mMplus[i] = next->mpp.mMplus[i]; } if (varM != NULL && !maxstable) { int j, nmP1 = varM->mpp.moments + 1; for (j=0; jmpp.mM[i] *= varM->mpp.mM[idx + i]; cov->mpp.mMplus[i] *= varM->mpp.mMplus[idx + i]; } } } else { int j, k; double pow_var; for (k=j=0; jmpp.mM[k] *= pow_var; cov->mpp.mMplus[k] *= pow_var; } } } if (scaleM != NULL && !maxstable) { if (dim + nm * intp < 0 || dim + intp * nm > scaleM->mpp.moments) SERR("moments cannot be calculated"); assert(scaleM->vdim[0] == 1 && scaleM->vdim[1] == 1 ); for (i=0; i <= nm; i++) { int idx = dim + i * intp; cov->mpp.mM[i] *= scaleM->mpp.mM[idx]; cov->mpp.mMplus[i] *= scaleM->mpp.mMplus[idx]; } } else { int j,k; double pow_scale, pow_s = POW(scale, dim), pow_p = POW(scale, p); for (k=j=0; jmpp.mM[k] *= pow_scale; cov->mpp.mMplus[k] *= pow_scale; } } } if (R_FINITE(cov->mpp.unnormedmass)) { if (vdim > 1) BUG; cov->mpp.unnormedmass = next->mpp.unnormedmass * var[0] / POW(scale, p); } else { double pp = POW(scale, -p); for (i=0; impp.maxheights[i] = next->mpp.maxheights[i] * var[i] * pp; } } else if (cov->role == ROLE_GAUSS) { if ((err=INIT(next, 0, s)) != NOERROR) return err; } else if (cov->role == ROLE_BASE) { if ((err=INIT(next, 0, s)) != NOERROR) return err; } else SERR("Initiation of scale and/or variance failed"); if ((err = TaylorPowS(cov)) != NOERROR) return err; return NOERROR; } void doPowS(cov_model *cov, gen_storage *s){ if (hasAnyShapeRole(cov)) { cov_model *next = cov->sub[POW_SUB]; DO(next, s);// nicht gatternr double factor = P0(POWVAR) / POW(P0(POWSCALE), P0(POWPOWER)); int i, vdim = cov->vdim[0]; assert(cov->vdim[0] == cov->vdim[1]); for (i=0; impp.maxheights[i] = next->mpp.maxheights[i] * factor; return; } BUG; } RandomFields/src/cubicsolver.h0000644000176200001440000000021713074763020016103 0ustar liggesusers#ifndef CUBICSOLVER_H #define CUBICSOLVER_H int cubicsolver(double a, double b, double c, double d, double roots[][2]); #endif // CUBICSOLVER RandomFields/src/kleinkram.cc0000644000176200001440000006530113074763020015703 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 -- 2016 Martin Schlather, Reinhard Furrer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "kleinkram.h" void strcopyN(char *dest, const char *src, int n) { if (n > 1) { n--; strncpy(dest, src, n); } dest[n] = '\0'; } double scalar(double *A, double *B, int N) { double ANS; SCALAR_PROD(A, B, N, ANS); return ANS; } void AtA(double *a, int nrow, int ncol, double *C) { // C = A^T %*% A #ifdef DO_PARALLEL //#pragma omp parallel for num_threads(2) schedule(dynamic) if (MULTIMINSIZE(ncol)) #pragma omp parallel for schedule(dynamic) if (MULTIMINSIZE(ncol)) #endif for (int i=0; imax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(dummy=allocVector(INTSXP, n)); for (int i=0; imax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(dummy=allocVector(LGLSXP, n)); for (int i=0; imax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(dummy=allocVector(REALSXP, n)); for (int i=0; imax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(dummy=allocVector(REALSXP, n)); for (int i=0; imax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(dummy=allocVector(STRSXP, n)); for (int i=0; imax) { int nn[2]; nn[0] = row; nn[1] = col; return TooLarge(nn, 2); } SEXP dummy; PROTECT(dummy=allocMatrix(REALSXP, row, col)); for (int i=0; imax) { int nn[2]; nn[0] = row; nn[1] = col; return TooLarge(nn, 2); } SEXP dummy; PROTECT(dummy=allocMatrix(REALSXP, row, col)); for (int k=0, j=0; jmax) { int nn[2]; nn[0] = row; nn[1] = col; return TooLarge(nn, 2); } SEXP dummy; PROTECT(dummy=allocMatrix(INTSXP, row, col)); for (int i=0; imax) { int nn[3]; nn[0] = row; nn[1] = col; nn[2] = depth; return TooLarge(nn, 3); } SEXP dummy; PROTECT(dummy=alloc3DArray(REALSXP, depth, row, col)); for (int j=0; jmax) return TooLarge(&n, 1); if (n<0) return TooSmall(); PROTECT(str = allocVector(STRSXP, n)); for (int i=0; i= n) j=0; } return; } int Integer(SEXP p, char *name, int idx, bool nulltoNA) { if (p != R_NilValue) { assert(idx < length(p)); switch(TYPEOF(p)) { case INTSXP : return INTEGER(p)[idx]; case REALSXP : double value; value = REAL(p)[idx]; if (ISNAN(value)) { return NA_INTEGER; } if (value == TRUNC(value)) return (int) value; else { ERR2("%s: integer value expected. Got %e.", name, value); } case LGLSXP : return LOGICAL(p)[idx]==NA_LOGICAL ? NA_INTEGER : (int) LOGICAL(p)[idx]; default : {} } } else if (nulltoNA) return NA_INTEGER; ERR2("%s: unmatched type of parameter [type=%d]", name, TYPEOF(p)); return NA_INTEGER; // compiler warning vermeiden } int Integer(SEXP p, char *name, int idx) { return Integer(p, name, idx, false); } void Integer(SEXP el, char *name, int *vec, int maxn) { if (el == R_NilValue) { ERR1("'%s' cannot be transformed to integer.\n",name); } int n = length(el); for (int j=0, i=0; i= n) j=0; } } void Integer2(SEXP el, char *name, int *vec) { int n; if (el == R_NilValue || (n = length(el))==0) { ERR1("'%s' cannot be transformed to integer.\n",name); } vec[0] = Integer(el, name, 0); if (n==1) vec[1] = vec[0]; else { vec[1] = Integer(el, name, n-1); if (n > 2) { int v = vec[0] + 1; for (int i = 1; i maxlen) { ERR1("number of variable names exceeds %d. Take abbreviations?", maxlen); } type = TYPEOF(el); // printf("type=%d %d %d %d\n", TYPEOF(el), INTSXP, REALSXP, LGLSXP); if (type == CHARSXP) { for (int i=0; i0.0) { num=0.0; WARN1("%s which has been positive is set 0.\n",name); } return num; } double PositiveInteger(SEXP el, char *name) { int num; num = INT; if (num<=0) { num=0; WARN1("'%s' which has been negative is set 0.\n",name); } return num; } double PositiveReal(SEXP el, char *name) { double num; num = NUM; if (num<=0.0) { num=0.0; WARN1("%s which has been negative is set 0.\n",name); } return num; } SEXP ExtendedInteger(double x) { return ScalarInteger(R_FINITE(x) ? x : NA_INTEGER); } SEXP ExtendedBoolean(double x) { return ScalarLogical(ISNAN(x) ? NA_LOGICAL : x != 0.0); } SEXP ExtendedBooleanUsr(usr_bool x) { return ScalarLogical((int) x); } int Match(char *name, name_type List, int n) { // == -1 if no matching name is found // == -2 if multiple matching names are found, without one matching exactly unsigned int ln; int Nr; Nr=0; ln=STRLEN(name); // print("Match %d %d %s %s %d\n", Nr, n, name, List[Nr], ln); while ( Nr < n && STRNCMP(name, List[Nr], ln)) { Nr++; } if (Nr < n) { if (ln==STRLEN(List[Nr])) // exactmatching -- take first -- changed 1/7/07 return Nr; // a matching function is found. Are there other functions that match? int j; bool multiplematching=false; j=Nr+1; // if two or more covariance functions have the same name // the last one is taken while (j maxlen_ans) ERR2("option '%s' is too long. Maximum length is %d.", name, maxlen_ans); if (TYPEOF(el) == STRSXP) { for (k=0; k= 0) { ans[0] = defaultvalue; for (k=1; k #include //#include #include //#include #include "RF.h" #include "Operator.h" int check_specificGauss(cov_model *cov) { #define nsel 4 cov_model *key = cov->key, *next=cov->sub[0]; int err ; // taken[MAX DIM], // direct_param *gp = &(GLOBAL.direct); // ROLE_ASSERT(ROLE_GAUSS); if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if (CovList[next->nr].Specific == MISMATCH) SERR1("specific method for '%s' not known", NAME(next)); // APMI(cov); //assert(false); if (key == NULL) { #define SPEC_TYPES 4 Types type[SPEC_TYPES] = {PosDefType, PosDefType, VariogramType, TrendType}; int i, max = SymmetricOf(cov->isoown), iso[SPEC_TYPES] = {max, max, max, CoordinateSystemOf(cov->isoown)}, dom[SPEC_TYPES] = {XONLY, KERNEL, XONLY, XONLY}; // APMI(cov->calling); for (i=0; itsdim, cov->tsdim, type[i], dom[i], iso[i], SUBMODEL_DEP, ROLE_COV)) == NOERROR) break; } if (err != NOERROR) return err; if (next->pref[Specific] == PREF_NONE) return ERRORPREFNONE; } else { if ((err = CHECK(key, cov->tsdim, cov->tsdim, ProcessType, XONLY, cov->isoown, SUBMODEL_DEP, ROLE_GAUSS)) != NOERROR) { return err; } //APMI(key); } cov_model *sub = cov->key == NULL ? next : key; setbackward(cov, sub); cov->vdim[0] = sub->vdim[0]; cov->vdim[1] = sub->vdim[1]; if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; //PMI(cov); return NOERROR; } int struct_specificGauss(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel) { cov_model *next = cov->sub[0]; location_type *loc = PrevLoc(cov); int err; // PMI(cov); //assert(false); if (next->pref[Specific] == PREF_NONE) { return ERRORPREFNONE; } ROLE_ASSERT_GAUSS; assert(CovList[next->nr].Specific >= 0); if (cov->key != NULL) COV_DELETE(&(cov->key)); if ((err = covCpy(&(cov->key), next)) != NOERROR) return err; if ((err = CHECK(cov->key, next->tsdim, next->xdimprev, next->typus, next->domprev, next->isoprev, next->vdim, next->role))!= NOERROR) { //PMI(cov->key); XERR(err); //printf("specific ok\n"); // crash(); return err; } cov->key->nr = CovList[cov->key->nr].Specific ; cov->key->role = ROLE_GAUSS; cov->key->typus = ProcessType; // APMI(cov); //PMI(cov->key); // APMI(cov->key); if ((err = STRUCT(cov->key, NULL)) != NOERROR) { return err; } // APMI(cov->key); if ((err = CHECK(cov->key, loc->timespacedim, cov->xdimown, ProcessType, XONLY, CoordinateSystemOf(cov->isoown), cov->vdim, ROLE_GAUSS)) != NOERROR) { //PMI(cov->key); XERR(err); //printf("specific ok\n"); // crash(); return err; } //APMI(cov->key); // if (next->nr == PLUS) AERR(err); return err; } void range_specificGauss(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ GAUSS_COMMON_RANGE; } int init_specificGauss(cov_model *cov, gen_storage *S) { cov_model *key = cov->key; int err; assert(key != NULL); if (cov->role == ROLE_COV) { return NOERROR; } ROLE_ASSERT_GAUSS; cov->method = Specific; if ((err = INIT(key, 0, S)) != NOERROR) return err; key->simu.active = true; cov->fieldreturn = true; cov->origrf = false; cov->rf = key->rf; return err; } void do_specificGauss(cov_model *cov, gen_storage *S) { cov_model *key = cov->key; double *res = cov->rf; SAVE_GAUSS_TRAFO; assert(key != NULL); DO(key, S); BOXCOX_INVERSE; } RandomFields/src/extremes.cc0000644000176200001440000015237313074763020015570 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de simulation of max-stable random fields Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "RF.h" #include "Operator.h" #define POISSON_INTENSITY 0 #define RANDOMCOIN_INTENSITY (COMMON_GAUSS + 1) #define RANDOMCOIN_METHOD (COMMON_GAUSS + 2) /* not used double GetTotal(cov_model* cov) { cov_fct *C = CovList + cov->nr; double v = 1.0; int i, nsub = cov->nsub, kappas = C->kappas; if (C->Type == RandomType) { if (cov->total_n >= 0) { int VARIABLE_IS_NOT_USED old_n = cov->total_n; if (cov->total_n < GLOBAL.distr.repetitions) { double *r = (double*) MALLOC(cov->xdimown * sizeof(double)); while(cov->total_n < GLOBAL.distr.repetitions) { DORANDOM(cov, r); assert(cov->total_n > cov->total_n); } FREE(r); } v *= cov->total_sum / (double) cov->total_n; } } else { for (i=0; isub[i]); } for (i=0; ikappasub[i] != NULL) v *= GetTotal(cov->kappasub[i]); } } return v; } */ int addStandard(cov_model **Cov) { cov_model *cov = (*Cov)->calling, *next = *Cov; int err, dim = next->xdimprev, vdim = next->vdim[0], role = next->role; assert(cov->vdim[0] == cov->vdim[1]); addModel(Cov, STANDARD_SHAPE); cov_model *key = *Cov; SetLoc2NewLoc(key, PLoc(cov)); assert(key->calling == cov); assert(key->sub[PGS_LOC] == NULL && key->sub[PGS_FCT] != NULL); #define checkstandardnext\ if ((err = CHECK(key, dim, dim, PointShapeType, XONLY, \ CoordinateSystemOf(cov->isoown), \ vdim, role)) != NOERROR) return err checkstandardnext; if (!CallingSet(*Cov)) BUG; if (hasPoissonRole(cov)) { addModel(key, PGS_LOC, UNIF); PARAMALLOC(key->sub[PGS_LOC], UNIF_MIN, dim, 1); PARAMALLOC(key->sub[PGS_LOC], UNIF_MAX, dim, 1); } else { if ((err = STRUCT(key, key->sub + PGS_LOC)) != NOERROR) return err; key->sub[PGS_LOC]->calling = key; } if (!CallingSet(*Cov)) BUG; checkstandardnext; return NOERROR; } void range_mpp(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { // assert(cov != NULL); range->min[GEV_XI] = RF_NEGINF; range->max[GEV_XI] = RF_INF; range->pmin[GEV_XI] = -10; range->pmax[GEV_XI] = 10; range->openmin[GEV_XI] = true; range->openmax[GEV_XI] = true; range->min[GEV_MU] = RF_NEGINF; range->max[GEV_MU] = RF_INF; range->pmin[GEV_MU] = -1000; range->pmax[GEV_MU] = 1000; range->openmin[GEV_MU] = true; range->openmax[GEV_MU] = true; range->min[GEV_S] = 0; range->max[GEV_S] = RF_INF; range->pmin[GEV_S] = 0.001; range->pmax[GEV_S] = 1000; range->openmin[GEV_S] = true; range->openmax[GEV_S] = true; } int init_mpp(cov_model *cov, gen_storage *S) { cov_model *sub = cov->key != NULL ? cov->key : cov->sub[0] != NULL ? cov->sub[0] : cov->sub[1]; if (sub == NULL) SERR("substructure could be detected"); location_type *loc = Loc(cov); //window_info *w = &(S->window); int err, // dim = cov->tsdim, role = cov->role, maxstable = hasMaxStableRole(cov); pgs_storage *pgs; if (!maxstable && !hasPoissonRole(cov)) ILLEGAL_ROLE; if (!isPointShape(sub)) SERR1("%s is not shape/point function", NICK(sub)); if (loc->distances) return ERRORFAILED; if ((err = INIT(sub, maxstable ? 1 : role == ROLE_POISSON ? 0 : 2, S)) != NOERROR) return err; pgs = sub->Spgs; assert(pgs != NULL); GetDiameter(loc, pgs->supportmin, pgs->supportmax, pgs->supportcentre); if (maxstable) { if (!R_FINITE(sub->mpp.mMplus[1]) || sub->mpp.mMplus[1] <= 0.0) { // APMI(sub); // printf("mplus %s %f\n", NICK(sub), sub->mpp.mMplus[1]); // crash(); SERR("integral of positive part of submodel unkown"); } //PMI(sub, "sub"); if (!R_FINITE(pgs->zhou_c) && !R_FINITE(pgs->sum_zhou_c)) SERR("maximal height of submodel unkown or the set of locations exceeds possibilities of the programme"); } else if (role == ROLE_POISSON_GAUSS) { if (ISNAN(sub->mpp.mM[2]) || !R_FINITE(sub->mpp.mM[2] || sub->mpp.mM[2] <=0.0)){ SERR("second moment unkown"); } } // else role == ROLE_POISSON -- nothing to do if ((err = FieldReturn(cov)) != NOERROR) { // must be later than INIT ! return err; } cov->simu.active = err == NOERROR; return err; } #define SET_SUB { \ sub = (cov->key != NULL) ? cov->key : /* if changed, change do_max_pgs! */ \ cov->sub[0] != NULL ? cov->sub[0] : cov->sub[1]; \ if (sub == NULL) ERR("substructure could be detected"); \ pgs = sub->Spgs; \ assert(pgs != NULL); \ gridlen = pgs->gridlen; \ end = pgs->end; \ start = pgs->start; \ delta = pgs->delta; \ nx = pgs->nx; \ xstart = pgs->xstart; /* nach DO gesetzt */ \ x = pgs->x; /* nach DO gesetzt */ \ inc = pgs->inc;} void dompp(cov_model *cov, gen_storage *s, double *simuxi) { // printf("here\n"); assert(cov->simu.active); location_type *loc = Loc(cov); if (loc->caniso != NULL) BUG; cov_model *sub = NULL; pgs_storage *pgs = NULL; long spatial = loc->totalpoints; int d, err, *gridlen = NULL, *end = NULL, *start = NULL, *delta = NULL, *nx = NULL, dim = cov->tsdim, every = GLOBAL.general.every, // nthreshold = (every>0) ? every : MAXINT, // covrole = cov->role, subrole = ROLE_FAILED, deltathresh = nthreshold; double logdens, factor, summand, Sign[2], value[2], logthreshold, *xstart = NULL, // nach DO gesetzt *x = NULL, // nach DO gesetzt *inc = NULL, *rf = NULL, //M1 = RF_NA, logM2 = RF_NA, gumbel = RF_NA, frechet = RF_NA, threshold = RF_NA, poisson=0.0; double *res = cov->rf; assert(res != NULL); ext_bool fieldreturn; bool compoundpoisson, poissongauss, maxstable = hasMaxStableRole(cov), simugrid = loc->grid, partialfield = false, // AVERAGE braucht Sonderbehandlung: randomcoin = cov->method == RandomCoin //only for ROLE_ POISSON_ GAUSS ; long k, i, zaehler, n, cumgridlen[MAXMPPDIM +1], Total_n, total_pts = loc->totalpoints, vdim = cov->vdim[0], vdimtot = total_pts * vdim, control = 0; assert(cov->vdim[0] == cov->vdim[1]); cov_model *key = cov->key; ext_bool loggiven; double Minimum = RF_NEGINF; // -10 // TO DO // printf("A\n");if (PL == 107) BUG; if (vdim != 1) ERR("Poisson point process based methods only work in the univariate case"); SET_SUB; //printf("B\n");if (PL == 108) BUG; if (!isPointShape(sub)) BUG; subrole = sub->role; compoundpoisson = subrole == ROLE_POISSON; poissongauss = subrole == ROLE_POISSON_GAUSS; Total_n = maxstable ? -1 : rpois(pgs->intensity); assert(maxstable || Total_n > 0); loggiven = key == NULL ? cov->sub[0]->loggiven : key->loggiven; if (!loggiven) Minimum =EXP(Minimum); if (simugrid) { cumgridlen[0] = 1; for (d=0; dxgr[d][XSTEP]; gridlen[d] = (int) loc->xgr[d][XLENGTH]; cumgridlen[d+1] = gridlen[d] * cumgridlen[d]; // printf("set d=%d inc=%f gridlen=%d cum=%d\n", d, inc[d], gridlen[d], (int) cumgridlen[d]); } } // printf("maxstable=%d\n", maxstable);if (PL == 109) BUG; if (maxstable) { if (loggiven) { for (i=0; impp.moments < 1 || !R_FINITE(sub->mpp.mMplus[1]) || sub->mpp.mMplus[1] == 0.0) ERR("integral of positive part of the submodel is unknown or not finite"); // M1 = sub->mpp.mMplus[1]; threshold = logthreshold = RF_INF; pgs->globalmin = Minimum; pgs->currentthreshold = loggiven ? pgs->globalmin - threshold : pgs->globalmin / threshold; if (simuxi != NULL) { // to do : RPstudent, extremal t process } } else if (compoundpoisson){ assert(simuxi == NULL); for (i=0; impp.mM[2]); pgs->currentthreshold = GLOBAL.mpp.about_zero; } // APMI(sub); for(n=0; ; n++) { // if (n % 1000 == 0) // printf("n=%d tot=%d contr=%d: %f < %f; res[0]=%f\n", (int) n, (int) Total_n, (int) control, res[control], threshold, res[0]); // assert(n <= 10); // printf("n=%ld\n", n);;if (PL == 110) BUG; // assert(n < 1200); // assert(res[0] < 1e-4); // assert(res[0] < 80); if (!maxstable && (n >= Total_n)) break; // for (d=0; dmin[d] = info->max[d] = 0.0; //assert(n < 2 ); // printf("XX.\n"); APMI(sub); if (!sub->deterministic && (err = REINIT(sub, sub->mpp.moments, s)) != NOERROR) BUG; DO(sub, s); //printf("PL =%d\n", PL);;if (PL == 111) BUG; // APMI(sub); if (!sub->deterministic) SET_SUB; // printf("here!!!\n"); // PMI(sub); fieldreturn = sub->fieldreturn; // MARCO: hattest Du dies reingenommen? // if (subrole == ROLE_BROWNRESNICK) { // assert(sub->SBR != NULL); // n += sub->SBR->hatnumber; // } //printf("log_den %f\n", pgs->log_density); logdens = pgs->log_density; if (!R_FINITE(logdens)) { // PMI(sub); BUG; // get_shape = CovList[sub->gatternr].cov; // get_logshape = CovList[sub->gatternr].log; } if (compoundpoisson) { summand = 0.0; } else if (poissongauss) { summand = -0.5 * (logdens + logM2); } else { // max-stable field assert(subrole == ROLE_SMITH || subrole == ROLE_SCHLATHER || subrole == ROLE_BROWNRESNICK); if (n >= GLOBAL.extreme.maxpoints) { PRINTF("'maxpoints' (= %d) exceeded. Simulation is likely to be a rough approximation only. Consider increasing 'maxpoints'.\n", GLOBAL.extreme.maxpoints ); break; } poisson += rexp(1.0); frechet =POW(poisson, - 1.0 / pgs->alpha); gumbel = -LOG(poisson); summand = gumbel - logdens; //@MARTIN: Warum taucht logdens nicht in threshold auf? (s. unten) threshold = logthreshold = (double) (gumbel +LOG(sub->mpp.maxheights[0])); //Gumbel //@MARTIN: logdens beruecksichtigen? if (!loggiven) { threshold =EXP(threshold); // Frechet } // // APMI(sub); // printf("Max = %f gumbel=%f %f %d logdens=%f\n", sub->mpp.maxheights[0], gumbel, threshold, loggiven, logdens);;if (PL == 112) BUG; //printf("for thres=%e %d res=%e zhou=%f(%f) logden=%f gumbel=%f loggiven=%d summand=%f\n", threshold, (int) control, res[control], pgs->zhou_c, sub->mpp.maxheights[0], logdens, gumbel, loggiven, summand);// assert(false); // assert(R_FINITE(threshold )); // { int i; for (i=0; i=threshold)) { // print("control: %d %f %f\n", control, res[control], threshold); assert(false); control++; } if (control >= total_pts) { break; } // printf("n=%d every =%d %d %d\n", (int) n, GLOBAL.extreme.check_every, PL, PL_STRUCTURE); if (n % GLOBAL.extreme.check_every == 0) { pgs->globalmin = res[control]; for (i=control + 1; iglobalmin) pgs->globalmin = res[i]; if (pgs->globalmin < Minimum) pgs->globalmin = Minimum; if (PL >= PL_STRUCTURE) PRINTF("control: %ld %f %f global=%f n=%ld every=%d %f log.max=%f\n", control, res[control], threshold, pgs->globalmin, n, GLOBAL.extreme.check_every, sub->mpp.maxheights[0], LOG(sub->mpp.maxheights[0])); } pgs->currentthreshold = loggiven ? pgs->globalmin - gumbel : pgs->globalmin / frechet; //printf("loggiven =%d %e %f cur.thr=%e\n", loggiven, pgs->globalmin, gumbel, pgs->currentthreshold);;if (PL == 113) BUG; } // maxstable factor =EXP(summand); // printf("factor %4.4f sumd=%4.4f logdens=%4.4f logM2=%4.4f th=%4.4f %d<%d \n", factor, summand, logdens, logM2, threshold, (int) control, (int) total_pts); // assert(false); // printf("dim=%d loggiven=%d maxstable=%d simugrid=%d randomcoin=%d\n", dim, loggiven, maxstable, simugrid, randomcoin);// assert(false); //printf("A=%d\n", n); zaehler = 0; if (simugrid) { partialfield = false; for (d=0; dsupportmin[d] - loc->xgr[d][XSTART]) / step - 1e-8); start[d] = dummy < 0 ? 0 : dummy > gridlen[d] ? gridlen[d] : (int)dummy; partialfield |= start[d] > 0; dummy = TRUNC(1.00000001 + ((pgs->supportmax[d] - loc->xgr[d][XSTART]) / step )); end[d] = dummy < 0 ? 0 : dummy > gridlen[d] ? gridlen[d] : (int) dummy; partialfield |= end[d] < gridlen[d]; // printf("window [%f %f] [%d %d] %d %d\n", pgs->supportmin[d], pgs->supportmax[d], start[d], end[d], gridlen[d], partialfield); //assert(n < 150); //APMI(cov); if (start[d] >= end[d]) { // // printf("broken %d %d %d supp=%f %f, loc.start=%f %f\n", d, start[d], end[d], pgs->supportmin[d], pgs->supportmax[d], loc->xgr[d][XSTART], inc[d]); break; } delta[d] = (end[d] - start[d]) * cumgridlen[d]; nx[d] = start[d]; zaehler += start[d] * cumgridlen[d]; x[d] = xstart[d] = loc->xgr[d][XSTART] + (double) start[d] * inc[d]; if (false || zaehler < 0) { PRINTF("d=%d start=%d, end=%d xstart=%f %f pgs=[%4.3f, %4.3f] xgr=%f %f %f inc=%3.2f\n", d, start[d], end[d], xstart[d], pgs->xstart[d], pgs->supportmin[d], pgs->supportmax[d], loc->xgr[d][XSTART], loc->xgr[d][XSTEP], loc->xgr[d][XLENGTH], inc[d]); // assert(false); } } if (d < dim) { //printf("cont: d=%d\n", d); continue; } } // //printf("simugrid %d\n", simugrid); // assert(false); // APMI(cov); #define STANDARDINKREMENT_ZAEHLER \ d = 0; \ nx[d]++; \ x[d] += inc[d]; \ zaehler += cumgridlen[d]; \ while (nx[d] >= end[d]) { \ nx[d] = start[d]; \ x[d] = xstart[d]; \ zaehler -= delta[d]; /* delta is positive */ \ if (++d >= dim) break; \ nx[d]++; \ x[d] += inc[d]; \ zaehler += cumgridlen[d]; \ } \ if (d >= dim) { break;} // end define StandardInkrement #define GET SHAPE(x, sub, value); /*printf("%f : %f fctr=%f %ld \n", x[0], *value, factor, zaehler); // */ #define LOGGET LOGSHAPE(x, sub, value, Sign); #define LOGGETPOS LOGGET if (Sign[0] > 0) #define GETRF *value = (double) (rf[zaehler]); // printf("%d\n", total_pts); assert(false); #define RFMAX(OP) { \ rf = sub->rf; \ for (i=0; irf; \ for (i=0; i=0 && zaehler=total_pts) { PMI(cov); printf("//z=%d n=%d\n", zaehler, n); } */ \ GET { \ OP; \ /* assert( {if (*value > sub->mpp.maxheights[0] *EXP(gumbel) * (1+1e-15)) { printf("//r=%f %f delta=%e %d %e\n", *value /EXP(gumbel), sub->mpp.maxheights[0], *value /EXP(gumbel) - sub->mpp.maxheights[0], loggiven, factor); };true;}); */ \ /*assert(loggiven || *value <= sub->mpp.maxheights[0] *EXP(gumbel) * (1+1e-15)); */ \ if (res[zaehler] < *value) res[zaehler] = *value; \ } #define SUMAPPLY(GET,OP) GET; res[zaehler] += OP; #define APPLY(GET, OP, WHAT) { \ if (simugrid) { \ while(true) { \ WHAT(GET, OP); \ STANDARDINKREMENT_ZAEHLER; \ } \ } else { \ for(x=loc->x; zaehler=0 && zaehler < total_pts); \ int jj, idx, index=0; \ for (jj=0; jj= pgs->own_grid_len[jj]) break; \ index += pgs->own_grid_cumsum[jj] * idx; \ } \ if (jj >= dim) { OP; } else if (false) printf("%d %f %f %f len=%f %d %d\n", jj, x[jj], ogstart[jj], ogstep[jj], pgs->own_grid_len[jj], pgs->own_grid_cumsum[jj], idx); /* // */ \ #define OG_MAXAPPLY(NONE, OP) \ rf = sub->rf; \ OG_BASIC(*value = rf[index]; \ OP; if (res[zaehler] < *value) res[zaehler]=*value;) #define OG_SUMAPPLY(NONE, OP) \ rf = sub->rf; \ OG_BASIC(*value = rf[index]; res[zaehler] += OP;) // OWNGRIDAPPLY(OP, OG_SUMAPPLY_BASIC) #define OWNGRIDAPPLY(NONE, OP, WHAT) { \ double *ogstart = pgs->own_grid_start, \ *ogstep = pgs->own_grid_step; \ APPLY(NONE, OP, WHAT); \ } #define ALL_APPLY(APPLY, MGET, MAPPLY, SGET, SAPPLY, NONLOGGET) \ if (loggiven == true) { \ if (maxstable) APPLY(MGET, (*value) += summand, MAPPLY) \ else APPLY(SGET, Sign[0] *EXP(*value + summand), SAPPLY); \ } else { /* not loggiven */ \ if (sub->loggiven){ \ if (maxstable) \ APPLY(MGET, *value=Sign[0] *EXP(*value+summand), MAPPLY) \ else APPLY(SGET, Sign[0] *EXP(*value + summand), SAPPLY); \ } else { \ assert(R_FINITE(factor)); \ if (maxstable) APPLY(NONLOGGET, (*value) *= factor, MAPPLY) \ else APPLY(NONLOGGET, *value * factor, SAPPLY); \ } \ } #define AVEAPPLY(G,OP0,OP1) { \ warning(" * timescale ?!"); \ if (simugrid) { \ while (true) { \ long zt; \ double zw,inct, segt, ct, st, A, cit, sit; \ inct = sub->q[AVERAGE_YFREQ] * loc->xgr[dim][XSTEP]; \ cit = COS(inct); \ sit = SIN(inct); \ G; \ segt = OP1; \ A = OP0; \ ct = A * COS(segt); \ st = A * SIN(segt); \ for (zt = zaehler; zt < total_pts; zt += spatial) { \ res[zt] += (double) ct; \ zw = ct * cit - st * sit; \ st = ct * sit + st * cit; \ ct = zw; \ res[zaehler] += zw; \ } \ STANDARDINKREMENT_ZAEHLER; \ } \ } else { /* not a grid */ \ x=loc->x; \ /* the following algorithm can greatly be improved ! */ \ /* but for ease, just the stupid algorithm */ \ for (; zaehlerloggiven); // todo : !simugrid! && Bereiche einengen!! // *atomdependent rfbased/not; (( recurrent/dissipative: min/max gesteuert)) if (poissongauss && !randomcoin) { // AVERAGE if (sub->loggiven) { AVEAPPLY(LOGGET, Sign[0] *EXP(value[0] + summand), Sign[1] *EXP(value[1])); } else AVEAPPLY(GET, value[0] * factor, value[1]); } else { assert(subrole == ROLE_SMITH || subrole == ROLE_SCHLATHER || subrole ==ROLE_BROWNRESNICK || subrole==ROLE_POISSON || subrole==ROLE_POISSON_GAUSS); if (fieldreturn == HUETCHEN_OWN_GRIDSIZE) { // atomdependent rfbased/not; ALL_APPLY(OWNGRIDAPPLY, NULL, OG_MAXAPPLY, NULL, OG_SUMAPPLY, NULL); } else if (fieldreturn == true) { // extended boolean // todo : !simugrid! && Bereiche einengen!! // note ! no Sign may be given currently when fieldreturn and loggiven!! if (partialfield) { //!! Windows if (!simugrid) BUG; ALL_APPLY(APPLY, GETRF, MAXAPPLY, GETRF, SUMAPPLY, GETRF); } else { // !partialfield if (sub->loggiven) { if (maxstable) RFMAX(rf[i] + summand) else RFSUM(EXP(rf[i] + summand)); } else { // Linux if (maxstable) RFMAX(rf[i] * factor) else RFSUM(rf[i] * factor); } } } else if (fieldreturn == false) { // not field return ALL_APPLY(APPLY, LOGGETPOS, MAXAPPLY, LOGGET, SUMAPPLY, GET); } else BUG; // neither HUETCHEN_OWN_GRIDSIZE, nor true nor false } if (n >= nthreshold) { if (maxstable) { LPRINT("%d-th pos.: value=%1.3f threshold=%1.3f gu=%1.3f %1.3f %d (%d %d)\n", control, (double) res[control], (double) threshold, gumbel, logdens, loggiven, n, nthreshold); //, deltathresh); nthreshold += deltathresh; } else { PRINTF("n=%d Total=%d\n", (int) (n / 1000), (int)(Total_n)); } } R_CheckUserInterrupt(); // printf("n=%d %f %f %f 0:%f\n", (int) n, res[0], res[1], res[2], res[3]);;if (PL == n) BUG; // assert(res[0] < 80); }// for(n,... -- while control < total_pts //printf("n=%d %f %f %f 3::%f\n", n, res[0], res[1], res[2], res[3]); // Trafo to margins // printf("%d frechet\n", sub->loggiven);if (PL == 10000) BUG; if (maxstable){ double meansq, var, mean = RF_NA, n_min = RF_INF, eps = GLOBAL.extreme.eps_zhou; if (pgs->alpha != 1.0) { if (loggiven) for (k=0; kalpha; else for (k=0; kalpha); } if (pgs->estimated_zhou_c) { if (PL > 5) PRINTF("zhou_c: %ld %d",pgs->n_zhou_c, GLOBAL.extreme.min_n_zhou); while (pgs->n_zhou_c < GLOBAL.extreme.min_n_zhou) { if ((err = REINIT(sub, sub->mpp.moments, s)) != NOERROR) BUG; DO(sub, s); SET_SUB; } while (pgs->n_zhou_c < n_min) { for (k=0; k<10; k++) { if ((err = REINIT(sub, sub->mpp.moments, s)) != NOERROR) BUG; DO(sub, s); SET_SUB; } mean = (double) (pgs->sum_zhou_c / (long double) pgs->n_zhou_c); meansq = mean * mean; var = (double) (pgs->sq_zhou_c / (long double) pgs->n_zhou_c - meansq); n_min = var / (meansq * eps * eps); if (n_min > GLOBAL.extreme.max_n_zhou) n_min =GLOBAL.extreme.max_n_zhou; // if (PL > 5) PRINTF(" n=%ld, min=%f %f mean=%f zhou=%f eps=%f\n", pgs->n_zhou_c, n_min, (double) pgs->sum_zhou_c, mean, pgs->zhou_c, eps); } // } else { mean = pgs->zhou_c; } // mean /= M1; // printf(" n=%ld, min=%f, mean=%f zhou=%f eps=%f %f max=%f\n", pgs->n_zhou_c, n_min, (double) pgs->sum_zhou_c, mean, pgs->zhou_c, eps, sub->mpp.maxheights[0]); // printf("loggiven = %d %f %f\n", loggiven, mean, pgs->zhou_c); double xi = P0(GEV_XI); // printf("xi=%f %d logmean=%d %f\n", xi, loggiven, pgs->logmean, mean); if (loggiven) { // 3.6.13 sub->loggiven geaendert zu loggiven if (!pgs->logmean) mean =LOG(mean); for (k=0; kkappasub[GEV_S] != NULL) { ERR1("'%s' cannot be chosen as a function yet.", KNAME(GEV_S)); // check whether s is positive !! } else { double ss = xi == 0 ? P0(GEV_S) : (P0(GEV_S) / xi); //printf("s=%f\n", ss); if (ss != 1.0) for (k=0; kkappasub[GEV_MU] != NULL) { ERR1("'%s' cannot be chosen as a function yet.", KNAME(GEV_MU)); } else { double mu = P0(GEV_MU); // printf("mu=%f xi=%f %f\n", mu, xi, s); //printf("mu=%f\n", mu); if (mu != 0.0) for (k=0; k= PL_DETAILSUSER) { PRINTF("number of shape functions used: %ld\n", n); } return; } // end dompp void dompp(cov_model *cov, gen_storage *s) { dompp(cov, s, NULL); } //void calculate_integral(int d, double R, cov_model *cov, // integral_type *integral) { // //} //////////////////////////////////////////////////////////////////// // Poisson int check_poisson(cov_model *cov) { cov_model *next=cov->sub[0], *key = cov->key, *sub = key == NULL ? next : key; int err, dim = cov->tsdim; // taken[MAX DIM], mpp_param *gp = &(GLOBAL.mpp); Types type = sub == key ? PointShapeType : ShapeType; //print("eee\n"); cov->role = ROLE_POISSON; kdefault(cov, POISSON_INTENSITY, gp->intensity[dim]); if ((err = checkkappas(cov, true)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if ((err = CHECK(sub, dim, dim, type, XONLY, CoordinateSystemOf(cov->isoown), SUBMODEL_DEP, cov->role)) != NOERROR) return err; setbackward(cov, sub); return NOERROR; } void range_poisson(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { range->min[POISSON_INTENSITY] = RF_NEGINF; range->max[POISSON_INTENSITY] = RF_INF; range->pmin[POISSON_INTENSITY] = -10; range->pmax[POISSON_INTENSITY] = 10; range->openmin[POISSON_INTENSITY] = true; range->openmax[POISSON_INTENSITY] = true; } int struct_poisson(cov_model *cov, cov_model **newmodel){ cov_model *next=cov->sub[0]; location_type *loc = Loc(cov); ASSERT_NEWMODEL_NULL; if (cov->role != ROLE_POISSON) SERR1("'%s' not called as random coin", NICK(cov)); if (cov->key != NULL) COV_DELETE(&(cov->key)); if (loc->Time || (loc->grid && loc->caniso != NULL)) { TransformLoc(cov, false, GRIDEXPAND_AVOID, false); SetLoc2NewLoc(next, PLoc(cov)); // passt das? } if (!isPointShape(next)) { int err; if ((err = covCpy(&(cov->key), next)) != NOERROR) return err; if ((err = addStandard(&(cov->key))) != NOERROR) return err; } return NOERROR; } int init_poisson(cov_model *cov, gen_storage *S) { // location_type *loc = Loc(cov); // mpp_storage *s = &(S->mpp); cov_model *key=cov->key; int err; if ((err = init_mpp(cov, S)) != NOERROR) { return err; } if (!isPointShape(key)) SERR("no definition of a shape function found"); key->Spgs->intensity = key->Spgs->totalmass * P0(POISSON_INTENSITY); return err; } //////////////////////////////////////////////////////////////////// // Schlather void extremalgaussian(double *x, cov_model *cov, double *v) { // schlather process cov_model *next = cov->sub[0]; if (cov->role == ROLE_SCHLATHER) COV(x, next, v) else { COV(x, next, v); *v = 1.0 - SQRT(0.5 * (1.0 - *v)); } } //#define MPP_SHAPE 0 //#define MPP_TCF 1 int SetGEVetc(cov_model *cov, int role) { int err; extremes_param *ep = &(GLOBAL.extreme); if (cov->role != ROLE_COV) cov->role = role; if (cov->sub[MPP_TCF] != NULL && cov->sub[MPP_SHAPE]!=NULL) SERR2("either '%s' or '%s' must be given", SNAME(MPP_TCF), SNAME(MPP_SHAPE)); if ((err = checkkappas(cov, false)) != NOERROR) return err; kdefault(cov, GEV_XI, ep->GEV_xi); kdefault(cov, GEV_S, P0(GEV_XI) == 0.0 ? 1.0 : FABS(P0(GEV_XI))); kdefault(cov, GEV_MU, P0(GEV_XI) == 0.0 ? 0.0 : 1.0); // print("xi s mu %f %f %f\n", P0(GEV_XI), P0(GEV_S), P0(GEV_MU)); assert(false); if ((err = checkkappas(cov, true)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) { return ERRORDIM; } return NOERROR; } int check_schlather(cov_model *cov) { //print("check schlather\n"); if (!((cov->sub[MPP_TCF] == NULL) xor (cov->sub[MPP_SHAPE] == NULL))) SERR("two submodels given instead of one."); cov_model *key = cov->key, *next = cov->sub[cov->sub[MPP_TCF] != NULL ? MPP_TCF : MPP_SHAPE]; int err, dim = cov->tsdim; // taken[MAX DIM], // mpp_param *gp = &(GLOBAL.mpp); double v; bool schlather = CovList[cov->nr].Init == init_mpp; // printf("A \n"); ASSERT_ONE_SUBMODEL(cov); /// printf("B A \n"); if ((err = SetGEVetc(cov, ROLE_SCHLATHER)) != NOERROR) return err; // printf("CA \n"); cov_model *sub = cov->key==NULL ? next : key; // printf("GA \n"); if (key == NULL) { // printf("key=NULL\n"); int role = isVariogram(sub) ? ROLE_COV //Marco, 29.5.13 : isShape(sub) && schlather ? ROLE_SCHLATHER : isGaussProcess(sub) ? ROLE_GAUSS : isBernoulliProcess(sub) && schlather ? ROLE_BERNOULLI : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(sub); if ((err = isPosDef(next) ? CHECK(next, dim, dim, PosDefType, XONLY, //err IsotropicOf(cov->isoown), SCALAR, role) : CHECK(next, dim, dim, ProcessType, XONLY, //err, CoordinateSystemOf(cov->isoown), SCALAR, role)) != NOERROR) return err; if (sub->vdim[0] != 1) SERR("only univariate processes are allowed"); assert(cov->vdim[0] == cov->vdim[1]); setbackward(cov, sub); if (role==ROLE_COV) { if (next->pref[Nothing] == PREF_NONE) return ERRORPREFNONE; COV(ZERO, next, &v); if (v != 1.0) SERR2("a correlation function is required as submodel, but '%s' has variance %f.", NICK(next), v); } } else { // key != NULL //printf("key!=NULL\n"); if ( (err = CHECK(key, dim, dim, PointShapeType, XONLY, CoordinateSystemOf(cov->isoown), SUBMODEL_DEP, ROLE_SCHLATHER)) != NOERROR) { //APMI(cov); return err; } setbackward(cov, sub); } //print("end check schlather\n"); return NOERROR; } int struct_schlather(cov_model *cov, cov_model **newmodel){ cov_model *sub = cov->sub[cov->sub[MPP_TCF] != NULL ? MPP_TCF : MPP_SHAPE]; int err, role, ErrNoInit; bool schlather = CovList[cov->nr].Init == init_mpp; // else opitz if (cov->role != ROLE_SCHLATHER) BUG; ASSERT_NEWMODEL_NULL; if (cov->key != NULL) COV_DELETE(&(cov->key)); if (cov->sub[MPP_TCF] != NULL) { if ((err = STRUCT(sub, &(cov->key))) > NOERROR) return err; cov->key->calling = cov; } else { if ((err = covCpy(&(cov->key), sub)) != NOERROR) return err; } assert(cov->key->calling == cov); if (cov->key->nr != GAUSSPROC && !isBernoulliProcess(cov->key)) { if (isVariogram(cov->key)) addModel(&(cov->key), GAUSSPROC); else { if (isGaussProcess(cov->key)) { SERR("invalid model specification"); } else SERR2("'%s' currently only allowed for gaussian processes %s", NICK(cov), schlather ? "and binary gaussian processes" : ""); } } assert(cov->key->calling == cov); role = cov->key->nr == GAUSSPROC ? ROLE_GAUSS //Marco, 29.5.13 : isBernoulliProcess(cov->key) ? ROLE_BERNOULLI : ROLE_UNDEFINED; //PMI(cov->key, "role "); ASSERT_ROLE_DEFINED(cov->key); if ((err = CHECK(cov->key, cov->tsdim, cov->xdimown, ProcessType, cov->domown, cov->isoown, cov->vdim, role)) != NOERROR) return err; // APMI(cov->key); if ((ErrNoInit = STRUCT(cov->key, NULL)) > NOERROR) return ErrNoInit; //err addModel(&(cov->key), STATIONARY_SHAPE); if ((err = CHECK(cov->key, cov->tsdim, cov->xdimown, PointShapeType, cov->domown, cov->isoown, cov->vdim, ROLE_SCHLATHER)) != NOERROR) return err; return ErrNoInit; } #define OPITZ_ALPHA (LAST_MAXSTABLE + 1) int init_opitzprocess(cov_model *cov, gen_storage *S) { int err; if ( (err = init_mpp(cov, S)) != NOERROR) return err; cov_model *key = cov->key; assert(key != NULL); assert(key->mpp.moments == 1); pgs_storage *pgs = key->Spgs; assert(pgs != NULL); key->mpp.mMplus[1] = INVSQRTTWOPI *POW(2, 0.5 * P0(OPITZ_ALPHA) - 0.5) * gammafn(0.5 * P0(OPITZ_ALPHA) + 0.5); pgs->zhou_c = 1.0 / key->mpp.mMplus[1]; pgs->alpha = P0(OPITZ_ALPHA); return NOERROR; } void range_opitz(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { // assert(cov != NULL); range_mpp(cov, range); range->min[OPITZ_ALPHA] = 0; range->max[OPITZ_ALPHA] = RF_INF; range->pmin[OPITZ_ALPHA] = 0.1; range->pmax[OPITZ_ALPHA] = 5; range->openmin[OPITZ_ALPHA] = true; range->openmax[OPITZ_ALPHA] = true; } //////////////////////////////////////////////////////////////////// // Smith // siegburg 7:47, 7:54; 8:19, Bus 611 8:32; 8:41 Immenburg void param_set_identical(cov_model *to, cov_model *from, int depth) { assert(depth >= 0); assert(to != NULL && from != NULL); assert(STRCMP(NICK(from), NICK(to)) == 0); // minimal check int i; assert(from->qlen == to->qlen); if (from->q != NULL) MEMCOPY(to->q, from->q, sizeof(double) * from->qlen); for (i=0; i 0) { for (i=0; isub[i] != NULL) param_set_identical(to->sub[i], from->sub[i], depth - 1); } } } int PointShapeLocations(cov_model *key, cov_model *shape) { // fuegt im max-stabilen Fall diegleiche Funktion als // intensitaetsfunktion fuer die Locationen ein; random scale // wird mitbeachtet // // fuegt im coin fall die ge-powerte Shape-Fkt als // intensitaetsfunktion fuer die Locationen ein; random scale // wird mitbeachtet // // fuegt assert(key != NULL); // printf("fx \n"); int err, i, dim = key->xdimown, nr = key->nr; assert(isPointShape(key)); if (key->sub[PGS_LOC] != NULL) return NOERROR; if ((err = covCpy(key->sub + PGS_FCT, shape)) != NOERROR) return err; if (nr == PTS_GIVEN_SHAPE) { //printf("here %ld %d %d %d\n", key->sub[PGS_LOC], ScaleOnly(shape), // !shape->deterministic, shape->sub[0]->deterministic); key->nsub = 2; if (key->sub[PGS_LOC] != NULL) BUG; bool randomscale = ScaleOnly(shape) && !shape->deterministic && shape->sub[0]->deterministic; if ((err = covCpyWithoutRandomParam(key->sub + PGS_LOC, randomscale ? shape->sub[0] : shape)) != NOERROR) return err; if (shape->role == ROLE_POISSON_GAUSS) { assert(dim <= MAXMPPDIM); addModel(key, PGS_LOC, POW); assert(key->nsub == 2); kdefault(key->sub[PGS_LOC], POW_ALPHA, GLOBAL.mpp.shape_power); addModel(key, PGS_LOC, SCATTER); PARAMALLOC(key, SCATTER_MAX, dim, 1); for (i=0; irole != ROLE_MAXSTABLE) BUG; if (!randomscale && !shape->deterministic) { addSetDistr(key->sub + PGS_LOC, key->sub[PGS_FCT], param_set_identical, true, MAXINT); } addModel(key, PGS_LOC, RECTANGULAR); if (randomscale) { addModel(key, PGS_LOC, LOC); addSetDistr(key->sub + PGS_LOC, shape, ScaleDollarToLoc, true, 0); } } else if (nr == STANDARD_SHAPE) { assert(key != NULL && shape != NULL); if ((err = STRUCT(shape, key->sub + PGS_LOC)) != NOERROR) return err; key->sub[PGS_LOC]->calling = key; if (key->sub[PGS_LOC] == NULL) SERR("simple enlarging of the simulation window does not work"); } else BUG; // APMI(key); return NOERROR; } int addPointShape(cov_model **Key, cov_model *shape, cov_model *pts, cov_model *local_pts, int dim, int vdim) { // versucht die automatische Anpassung einer PointShapeType-Funktion; // derzeit wird // * PGS und // * STANDARD_SHAPE (weiss nicht mehr wieso -> coins?) // versucht; inklusive Init #define PGS_N 2 int i, err = NOERROR, pgs[PGS_N] = {PTS_GIVEN_SHAPE, STANDARD_SHAPE}; #define msgN 200 char msg[PGS_N][LENERRMSG]; assert(shape != NULL); assert(*Key == NULL); // to do: strokorbball: raeumlich waere Standard/Uniform besser; // praeferenzen programmieren? for (i=0; i 0) { FinalErrorMSG(err, msg[i-1]); XERR(err); } // if (i > 0) XERR(err); assert(i ==0); if (*Key != NULL) COV_DELETE(Key); assert(shape->calling != NULL); addModel(Key, pgs[i], shape->calling); assert((*Key)->sub[PGS_LOC] == NULL && (*Key)->sub[PGS_FCT] == NULL); // PMI(shape); // PMI(pts); if (pts != NULL) { if ((err = covCpy((*Key)->sub + PGS_FCT, shape)) != NOERROR || (err = covCpy((*Key)->sub + PGS_LOC, pts)) != NOERROR ) return err; Ssetcpy((*Key)->sub[PGS_FCT], (*Key)->sub[PGS_LOC], shape, pts); Ssetcpy((*Key)->sub[PGS_LOC], (*Key)->sub[PGS_FCT], pts, shape); // PMI((*Key)->sub[PGS_FCT]); // APMI((*Key)->sub[PGS_LOC]); } else { // if ((err = PointShapeLocations(*Key, shape)) != NOERROR) continue; if (local_pts != NULL) { // only in plusmalS.cc if ((*Key)->nr != PTS_GIVEN_SHAPE) continue; cov_model *local, *dummy; if ((err = covCpy(&local, false, local_pts, shape->prevloc, NULL, true, true, false)) != NOERROR) return err; local->calling = (*Key)->calling; dummy = local; while (dummy->sub[DOLLAR_SUB] != NULL) dummy = dummy->sub[DOLLAR_SUB]; if (dummy->nr != LOC) BUG; dummy->sub[DOLLAR_SUB] = *Key; (*Key)->calling = dummy; } } (*Key)->calling = shape->calling; (*Key)->sub[PGS_FCT]->calling = (*Key)->sub[PGS_LOC]->calling = *Key; //PMI((*Key)->calling); assert((*Key)->sub[PGS_LOC] != NULL && (*Key)->sub[PGS_FCT] != NULL); (*Key)->nsub = 2; // APMI(*Key); // printf(">>>>>>> KEY start %d %s \n", i, NICK((*Key))); if ((err = CHECK(*Key, dim, dim, PointShapeType, XONLY, CoordinateSystemOf(shape->isoown), vdim, ROLE_MAXSTABLE)) != NOERROR) { // printf(">>>>>>> KEY break %d %s %d\n", i, Nick(*Key), dim); //PMI(*Key); XERR(err); continue; } NEW_COV_STORAGE(*Key, gen); if ((err = INIT(*Key, 1, (*Key)->Sgen)) == NOERROR) break; } // for i_pgs if (err != NOERROR) { errorMSG(err, msg[i-1]); SPRINTF(ERRORSTRING, "no method found to simulate the given model:\n\tpgs: %s\n\tstandard: %s)", msg[0], msg[1]); return ERRORM; } return NOERROR; } int addPointShape(cov_model **Key, cov_model *shape, cov_model *pts, int dim, int vdim) { return addPointShape(Key, shape, pts, NULL, dim, vdim); } int struct_ppp_pts(cov_model **Key, cov_model *shape, cov_model *calling, int tsdim, int vdim) { // Ruft S TRUCT(shape, Key) auf und verarbeitet weiter, je nachdem // was nun in Key steht: pgs, shape, random, nichts. cov_model *dummy = NULL; int err = NOERROR; if ((err = STRUCT(shape, Key)) == NOERROR && *Key != NULL) { // todo: IN WELCHEM FALL laeuft man hier rein? (*Key)->calling = calling; Types type = TypeConsistency(PointShapeType, *Key, 0) ? PointShapeType : TypeConsistency(RandomType, *Key, 0) ? RandomType : TypeConsistency(ShapeType, *Key, 0) ? ShapeType : OtherType; if (type == RandomType) { // random locations given; // so, it must be of pgs type (or standard): if ((err = CHECK_R(*Key, shape->tsdim)) != NOERROR) { goto ErrorHandling; } dummy = *Key; *Key = NULL; if ((err = addPointShape(Key, shape, dummy, tsdim, vdim)) != NOERROR) goto ErrorHandling; if (*Key == NULL) BUG; (*Key)->calling = calling; // APMI(cov); } else { if ((err = CHECK(*Key, shape->tsdim, shape->xdimprev, type, shape->domprev, shape->isoprev, shape->vdim, ROLE_MAXSTABLE)) != NOERROR) { goto ErrorHandling; } if (type==PointShapeType) { if ((err = PointShapeLocations(*Key, shape)) != NOERROR) goto ErrorHandling; } else if (type == ShapeType) { dummy = *Key; *Key = NULL; // suche nach geeigneten locationen if ((err = addPointShape(Key, dummy, NULL, tsdim, vdim)) != NOERROR) goto ErrorHandling; //printf("e ddd\n"); } else BUG; } // ! randomtype } else { // S-TRUCT does not return anything int err2; //assert(false); // XERR(err); // APMI(*Key); if ((err2 = addPointShape(Key, shape, NULL, tsdim, vdim)) != NOERROR) { if (err == NOERROR) err = err2; goto ErrorHandling; } err = NOERROR; } ErrorHandling: if (dummy != NULL) COV_DELETE(&dummy); return err; } int check_smith(cov_model *cov) { cov_model *shape = cov->sub[MPP_SHAPE], *TCF = cov->sub[MPP_TCF], *next = shape != NULL ? shape : TCF, *key = cov->key, *sub = (key==NULL) ? next : key; ; int err, role, dim = cov->tsdim; // taken[MAX DIM], //Types type; ASSERT_ONE_SUBMODEL(cov); if ((err = SetGEVetc(cov, ROLE_SMITH)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim !=cov->xdimown) return ERRORDIM; if (key != NULL) { if ((err = CHECK(key, dim, dim, PointShapeType, XONLY, CoordinateSystemOf(cov->isoown), SUBMODEL_DEP, ROLE_SMITH)) != NOERROR) return err; } else { // key == NULL if (next == TCF) { if ((err = CHECK(next, dim, dim, TcfType, XONLY, ISOTROPIC, SCALAR, ROLE_SMITH)) != NOERROR) { return err; } if ((dim == 1 && next->rese_derivs < 1) || (dim >= 2 && dim <= 3 && next->rese_derivs < 2) || dim > 3) { //printf("dim = %d\n", dim); //APMI(next); SERR("submodel does not have enough derivatives (programmed)."); } } else { // shape role = // (isVariogram(sub) && !isPosDef(sub)) ? ROLE_COV //Marco, 29.5.13 isShape(sub) ? ROLE_MAXSTABLE // 23.4.14 : isPointShape(sub) ? ROLE_SMITH : isGaussProcess(sub) ? ROLE_GAUSS : isBernoulliProcess(sub) ? ROLE_BERNOULLI : ROLE_UNDEFINED; ASSERT_ROLE_DEFINED(sub); if ((err = CHECK(next, dim, dim, ShapeType, XONLY, CoordinateSystemOf(cov->isoown), SCALAR, role)) != NOERROR) { return err; } if (next->full_derivs < 0) SERR1("'%s' requires an explicit submodel.", NICK(cov)); } } setbackward(cov, next); return NOERROR; } int struct_smith(cov_model *cov, cov_model **newmodel){ cov_model *tmp_shape = NULL, *shape = cov->sub[MPP_SHAPE], *tcf = cov->sub[MPP_TCF], *tcf_shape = NULL, *sub = shape != NULL ? shape : tcf; location_type *loc = Loc(cov); int err = NOERROR; //APMI(shape); if (cov->role != ROLE_SMITH) BUG; if (loc->Time || (loc->grid && loc->caniso != NULL)) { TransformLoc(cov, false, GRIDEXPAND_AVOID, false); SetLoc2NewLoc(sub, PLoc(cov)); } if (cov->key != NULL) COV_DELETE(&(cov->key)); ASSERT_NEWMODEL_NULL; if (tcf != NULL) { // to do: ausbauen if ((err = covCpy(&tcf_shape, sub)) != NOERROR) goto ErrorHandling; addModel(&tcf_shape, STROKORB_MONO); if ((err = CHECK(tcf_shape, tcf->tsdim, tcf->xdimprev, ShapeType, tcf->domprev, tcf->isoprev, tcf->vdim, ROLE_MAXSTABLE)) != NOERROR) goto ErrorHandling; tmp_shape = tcf_shape; } else { tmp_shape = shape; } // APMI(tmp_shape); if ((err = struct_ppp_pts(&(cov->key), tmp_shape, cov, cov->tsdim, cov->vdim[0])) != NOERROR) goto ErrorHandling; // APMI(cov); err = NOERROR; ErrorHandling: if (tcf_shape != NULL && tmp_shape != NULL) COV_DELETE(&tmp_shape); return err; } typedef double (*logDfct)(double *data, double gamma); double HueslerReisslogD(double *data, double gamma) { double g = SQRT(2.0 * gamma), logy2y1 =LOG(data[1] / data[0]); return -pnorm(0.5 * g + logy2y1 / g, 0.0, 1.0, true, false) / data[0] -pnorm(0.5 * g - logy2y1 / g, 0.0, 1.0, true, false) / data[1]; } double schlatherlogD(double *data, double gamma) { double sum = data[0] + data[1], prod = data[0] * data[1]; return 0.5 * sum / prod * (1.0 + SQRT(1.0 - 2.0 * (2.0 - gamma) * prod / (sum * sum))); } #define LL_AUTO 0 #define LL_FULL 1 #define LL_COMPOSITE 2 #define LL_SELECTION 3 #define LL_UNKNOWN ERR("unknown value for 'likelihood' -- please contact author"); void loglikelihoodMaxstable(double *data, cov_model *cov, logDfct logD, double *v) { cov_model *sub = cov; while (isProcess(sub)) sub = sub->key != NULL ? sub->key : sub->sub[0]; if (cov->q == NULL) { location_type *loc = Loc(cov); long len = loc->totalpoints; QALLOC(len); if (loc->grid || loc->Time) TransformLoc(sub, false, true, false); } location_type *loc = Loc(cov); double *x, *y; int dim = cov->xdimown; long i, j, len = loc->totalpoints; if (data != NULL) { double xi = P0(GEV_XI), mu = P0(GEV_MU), s = P0(GEV_S); if (xi == 0) { for (i=0; iq[i] =EXP((data[i] - mu) / s); } else { double xiinv = 1.0 / xi, xis = xi / s; for (i=0; iq[i] =POW(1.0 + xis * (data[i] - mu), xiinv); } } switch(GLOBAL.fit.likelihood) { case LL_AUTO: case LL_COMPOSITE: double z[2], gamma, gamma0; COV(ZERO, sub, &gamma0); x = loc->x; for (i=0; iq[i]; z[1] = cov->q[j]; *v += logD(z, gamma0 - gamma); } } break; case LL_FULL: ERR("full MLE not available for Brown Resnick"); break; case LL_SELECTION: NotProgrammedYet("LL_SELECTION"); default : LL_UNKNOWN; } } void loglikelihoodBR(double *data, cov_model *cov, double *v) { loglikelihoodMaxstable(data, cov, HueslerReisslogD, v); } void loglikelihoodSchlather(double *data, cov_model *cov, double *v) { loglikelihoodMaxstable(data, cov, schlatherlogD, v); } ////////////////////////////////////////////////////////////////////// // Random Coin ////////////////////////////////////////////////////////////////////// int check_randomcoin(cov_model *cov) { cov_model *pdf = cov->sub[COIN_COV], *shape = cov->sub[COIN_SHAPE], *next = shape != NULL ? shape : pdf, *key = cov->key; int err, dim = cov->tsdim; // taken[MAX DIM], mpp_param *gp = &(GLOBAL.mpp); //extremes_param *ep = &(GLOBAL.extreme); SERR("'random coin' method does not work for the current version"); INTERNAL; ASSERT_ONE_SUBMODEL(cov); ROLE_ASSERT(ROLE_POISSON_GAUSS || (cov->role==ROLE_GAUSS && cov->key!=NULL)); kdefault(cov, RANDOMCOIN_INTENSITY, gp->intensity[dim]); kdefault(cov, RANDOMCOIN_METHOD, 0); if ((err = checkkappas(cov, false)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim !=cov->xdimown) return ERRORDIM; if (key != NULL) { // note: key calls first function to simulate the points // if this is true then AverageIntern/RandomCoinIntern calls Average/RandomCoin cov_model *intern = cov; while (intern != NULL && intern->nr!=AVERAGE_INTERN && isAnyDollar(intern)) intern = intern->key != NULL ? intern->key : intern->sub[0]; if (intern == NULL) { BUG; } if ((err = cov->role == ROLE_BASE || cov->role == ROLE_GAUSS // internal coin ? CHECK(key, dim, dim, ProcessType, XONLY, //err CoordinateSystemOf(cov->isoown), SUBMODEL_DEP, ROLE_POISSON_GAUSS) // info wird von do_mpp verwendet : cov->role == ROLE_POISSON_GAUSS ? CHECK(key, dim, dim, PointShapeType, XONLY, //err CoordinateSystemOf(cov->isoown), SUBMODEL_DEP, ROLE_POISSON_GAUSS) : ERRORFAILED ) != NOERROR) { return err; } } else { // key == NULL if (next == pdf) { if ((err = CHECK(next, dim, dim, PosDefType, XONLY, SYMMETRIC, SCALAR, ROLE_POISSON_GAUSS)) != NOERROR) { return err; } if ((pdf->pref[Average] == PREF_NONE) + (pdf->pref[RandomCoin] == PREF_NONE) !=1){ //APMI(pdf); //assert(false); return ERRORPREFNONE; } } else { // shape != NULL if ((err = CHECK(next, dim, dim, ShapeType, XONLY, CoordinateSystemOf(cov->isoown), SCALAR, ROLE_POISSON)) != NOERROR) { //POISS_GAUSS ?? return err; } // APMI(cov); } } setbackward(cov, key != NULL ? key : next); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov, false)) != NOERROR) return err; return NOERROR; } void range_randomcoin(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { GAUSS_COMMON_RANGE; range->min[RANDOMCOIN_INTENSITY] = RF_NEGINF; range->max[RANDOMCOIN_INTENSITY] = RF_INF; range->pmin[RANDOMCOIN_INTENSITY] = -10; range->pmax[RANDOMCOIN_INTENSITY] = 10; range->openmin[RANDOMCOIN_INTENSITY] = true; range->openmax[RANDOMCOIN_INTENSITY] = true; range->min[RANDOMCOIN_METHOD] = 0; range->max[RANDOMCOIN_METHOD] = 1; range->pmin[RANDOMCOIN_METHOD] = 0; range->pmax[RANDOMCOIN_METHOD] = 1; range->openmin[RANDOMCOIN_METHOD] = false; range->openmax[RANDOMCOIN_METHOD] = false; } int struct_randomcoin(cov_model *cov, cov_model **newmodel){ cov_model *tmp_shape = NULL, *pdf = cov->sub[COIN_COV], *shape = cov->sub[COIN_SHAPE]; location_type *loc = Loc(cov); int err, dim = cov->tsdim; // taken[MAX DIM], ROLE_ASSERT(ROLE_POISSON_GAUSS); if (loc->Time || (loc->grid && loc->caniso != NULL)) { TransformLoc(cov, true, GRIDEXPAND_AVOID, false); SetLoc2NewLoc(pdf == NULL ? shape : pdf, PLoc(cov)); } if (cov->key != NULL) COV_DELETE(&(cov->key)); ASSERT_NEWMODEL_NULL; if (pdf != NULL) { if ((err = CHECK(pdf, dim, dim, PosDefType, XONLY, SYMMETRIC, SCALAR, ROLE_POISSON_GAUSS)) != NOERROR) { //sicherstellen, dass pdf von der richtigen Form, insb. role_poisson_gauss return err; } if (pdf->pref[Average] == PREF_NONE && pdf->pref[RandomCoin]==PREF_NONE) { // if (pdf->nr > LASTDOLLAR) AERR(ERRORPREFNONE); return ERRORPREFNONE; } if ((err = STRUCT(pdf, &tmp_shape)) != NOERROR) goto ErrorHandling; //&(cov->key) if (tmp_shape == NULL) GERR("no structural information for random coins given"); tmp_shape->calling = cov; if ((err = CHECK(tmp_shape, dim, dim, ShapeType, XONLY, CoordinateSystemOf(cov->isoown), SCALAR, ROLE_POISSON_GAUSS)) != NOERROR) { goto ErrorHandling; } } else { tmp_shape = shape; // if ((err = covCpy(&(cov->key), shape)) > NOERROR) { // return err; // } } // if ((err = STRUCT(cov, NULL)) != NOERROR) return err; ????? SERR("Sorry, 'random coin' does not work currently."); assert(false); // todo switch(P0INT(RANDOMCOIN_METHOD)) { case 0: { // Alternativ?! // if ((err = addPointShape(&(cov->key), shape, NULL, tsdim, vdim)) != NOERROR) if ((err = struct_ppp_pts(&(cov->key), tmp_shape, cov, cov->tsdim, cov->vdim[0])) != NOERROR) goto ErrorHandling; break; } case 1: { if ((err = covCpy(&(cov->key), shape)) != NOERROR) goto ErrorHandling; addModel(&(cov->key), RANDOMSIGN, cov); addModel(&(cov->key), MCMC_PGS, cov); cov_model *key = cov->key; if ((err = covCpy(key->sub + PGS_LOC, shape)) != NOERROR) goto ErrorHandling; addModel(key, PGS_LOC, POW); kdefault(key->sub[PGS_LOC], POW_ALPHA, GLOBAL.mpp.shape_power); addModel(key, PGS_LOC, SCATTER); PARAMALLOC(key, SCATTER_MAX, dim, 1); for (int i=0; ikey), MCMC, cov); break; } default: BUG; } if ((err = CHECK(cov->key, dim, dim, PointShapeType, XONLY, CoordinateSystemOf(cov->isoown), cov->vdim[0], cov->role)) != NOERROR) goto ErrorHandling; ErrorHandling: if (pdf != NULL && tmp_shape != NULL) COV_DELETE(&tmp_shape); return err; } int init_randomcoin(cov_model *cov, gen_storage *S) { cov_model *covshape = cov->sub[ cov->sub[COIN_SHAPE] != NULL ? COIN_SHAPE : COIN_COV], *key = cov->key, *sub = key == NULL ? covshape : key; char name[] = "Poisson-Gauss"; location_type *loc = Loc(cov); //mpp_storage *s = &(S->mpp); int err = NOERROR; SPRINTF(ERROR_LOC, "%s process: ", name); if (cov->role != ROLE_POISSON_GAUSS) { // PMI(cov->calling, "init_randomcoin"); ILLEGAL_ROLE; } cov->method = covshape->pref[Average] == PREF_NONE ? RandomCoin : Average; if (cov->method == Average && loc->caniso != NULL) { bool diag, quasidiag, semiseparatelast, separatelast; int idx[MAXMPPDIM]; assert(loc->timespacedim <= MAXMPPDIM); analyse_matrix(loc->caniso, loc->cani_nrow, loc->cani_ncol, &diag, &quasidiag, idx, &semiseparatelast, &separatelast); if (!separatelast) SERR("not a model where time is separated"); } if ((err = init_mpp(cov, S)) != NOERROR) { //PMI(cov); AERR(err); return err; } sub->Spgs->intensity = sub->Spgs->totalmass * P0(RANDOMCOIN_INTENSITY); sub->Spgs->log_density =LOG(P0(RANDOMCOIN_INTENSITY)); // PMI(cov, "randmcoin"); assert(sub->mpp.moments >= 2); if (!R_FINITE(sub->Spgs->totalmass) || !R_FINITE(sub->mpp.mM[2])) SERR("Moments of submodels not known"); sub->role = ROLE_POISSON_GAUSS; return NOERROR; } void do_randomcoin(cov_model *cov, gen_storage *s) { assert(cov->simu.active); SAVE_GAUSS_TRAFO; double *res = cov->rf; dompp(cov, cov->Sgen==NULL ? s : cov->Sgen);// letzteres falls shape gegeben BOXCOX_INVERSE; } RandomFields/src/kleinkram.h0000644000176200001440000001225513074763020015545 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef kleinkram_rfutils_h #define kleinkram_rfutils_h 1 #include #include "Local.h" typedef char name_type[][MAXCHAR]; void strcopyN(char *dest, const char *src, int n); usr_bool UsrBool(SEXP p, char *name, int idx); #define INT Integer(el, name, 0) #define LOGI Logical(el, name, 0) #define NUM Real(el, name, 0) #define USRLOG UsrBool(el, name, 0) #define CHR Char(el, name) #define STR(X, N) strcopyN(X, CHAR(STRING_ELT(el, 0)), N); #define POS0INT NonNegInteger(el, name) /* better: non-negative */ #define POS0NUM NonNegReal(el, name) #define NEG0NUM NonPosReal(el, name) #define POSINT PositiveInteger(el, name) /* better: non-negative */ #define POSNUM PositiveReal(el, name) SEXP Logic(bool* V, int n, int max) ; SEXP Num(double* V, int n, int max) ; SEXP Int(int *V, int n, int max) ; SEXP Char(const char **V, int n, int max) ; SEXP Mat(double* V, int row, int col, int max); SEXP Mat_t(double* V, int row, int col, int max); SEXP MatInt(int* V, int row, int col, int max) ; SEXP Array3D(int** V, int depth, int row, int col, int max) ; SEXP String(char *V); SEXP Logic(bool* V, int n) ; SEXP Num(double* V, int n) ; SEXP Int(int *V, int n) ; SEXP Char(const char **V, int n) ; SEXP Mat(double* V, int row, int col); SEXP Mat_t(double* V, int row, int col); SEXP MatInt(int* V, int row, int col) ; SEXP Array3D(int** V, int depth, int row, int col) ; SEXP String(char V[][MAXCHAR], int n, int max); SEXP String(int *V, const char * List[], int n, int endvalue); SEXP TooLarge(int *n, int l); SEXP TooSmall(); double Real(SEXP p, char *name, int idx); void Real(SEXP el, char *name, double *vec, int maxn) ; int Integer(SEXP p, char *name, int idx, bool nulltoNA) ; int Integer(SEXP p, char *name, int idx); void Integer(SEXP el, char *name, int *vec, int maxn) ; void Integer2(SEXP el, char *name, int *vec) ; bool Logical(SEXP p, char *name, int idx); char Char(SEXP el, char *name) ; double NonNegInteger(SEXP el, char *name) ; double NonNegReal(SEXP el, char *name) ; double NonPosReal(SEXP el, char *name) ; double PositiveInteger(SEXP el, char *name) ; double PositiveReal(SEXP el, char *name) ; void String(SEXP el, char *name, char names[][MAXCHAR], int maxlen); #define MULTIPLEMATCHING -2 #define NOMATCHING -1 #define MATCHESINTERNAL -3 int Match(char *name, const char * List[], int n); int Match(char *name, name_type List, int n); SEXP ExtendedInteger(double x); SEXP ExtendedBoolean(double x); SEXP ExtendedBooleanUsr(usr_bool x); double XkCXtl(double *X, double *C, int nrow, int dim, int k, int l); void XCXt(double *X, double *C, double *V, int nrow, int dim); void AtA(double *a, int nrow, int ncol, double *A); void xA(double *x, double*A, int nrow, int ncol, double *y); void xA(double *x1, double *x2, double*A, int nrow, int ncol, double *y1, double *y2); void Ax(double *A, double*x, int nrow, int ncol, double *y); void Ax(double *A, double*x1, double*x2, int nrow, int ncol, double *y1, double *y2); double xUy(double *x, double *U, double *y, int dim); double xUxz(double *x, double *U, int dim, double *z); double x_UxPz(double *x, double *U, double *z, int dim); double xUx(double *x, double *U, int dim); void matmult(double *A, double *B, double *C, int l, int m, int n); void matmulttransposed(double *A, double *B, double *C, int m, int l, int n); void matmult_2ndtransp(double *A, double *B, double *C, int m, int l, int n); void matmult_tt(double *A, double *B, double *C, int m, int l, int n); double * matrixmult(double *m1, double *m2, int dim1, int dim2, int dim3); void GetName(SEXP el, char *name, const char * List[], int n, int defaultvalue, int endvalue, int *ans, int maxlen_ans); int GetName(SEXP el, char *name, const char * List[], int n) ; int GetName(SEXP el, char *name, const char * List[], int n, int defaultvalue) ; #define SCALAR_PROD(A, B, N, ANS) { \ int k_ =0, \ end_ = N - 4; \ ANS = 0.0; \ for (; k_ #include "RF.h" #include "Operator.h" /* simplifying functions turn vector of x into length ||x|| and similar reduces C(x,y) to C(x - y) needs preceeding analysis of submodels! (same for preferred methods; bottom-up-analysis needed) */ // keep always the orderung ////////////////////////////////////////////////////////////////////// // Earth coordinate systems : stay within the system ////////////////////////////////////////////////////////////////////// double mod(double x, double modulus) { return (x - FLOOR(x / modulus) * modulus); } double isomod(double x, double modulus) { double twomodulus = 2.0 * modulus; return modulus - FABS(Mod(x, twomodulus) - modulus); } double lonmod(double x, double modulus) { double halfmodulus = 0.5 * modulus, y = x + halfmodulus; return Mod(y, modulus) - halfmodulus; } double latmod(double x, double modulus) { double halfmodulus = 0.5 * modulus, twomodulus = 2.0 * modulus, y = x - halfmodulus; return FABS(Mod(y, twomodulus) - modulus) - halfmodulus; } #define STATMOD(ZZ, X, lon, lat) \ ALLOC_NEW(Searth, X, dim+1, X); \ STATMODE_BASE(X, ZZ, lon, lat); \ for (d = 2; d < dim; d++) X[d] = ZZ[d] void statmod2(double *x, double lon, double lat, double *y) { STATMODE_BASE(y, x, lon, lat); } #define piD180 (M_PI * 0.00555555555555555555555) #define H80Dpi (180.0 * INVPI) #define ESnonstat2iso(x, y) \ int d, dim=cov->xdimgatter; \ ALLOC_NEW(Searth, X, dim+1, X); \ double xx[2] = {x[0], x[1]}, \ yy[2] = {y[0], y[1]}, \ cosine = SIN(xx[1]) * SIN(yy[1]) + \ (COS(xx[0]) * COS(yy[0]) + SIN(xx[0]) * SIN(yy[0])) * \ COS(xx[1]) * COS(yy[1]); \ cosine = cosine <= 1.0 ? (cosine < -1.0 ? -1.0 : cosine) : 1.0; \ X[0] = ACOS(cosine); \ for (d = 2; d < dim; d++) X[d-1] = x[d] - y[d]; #define ISOMOD(ZZ, X, maxangle) \ int d, dim=cov->xdimgatter; \ ALLOC_NEW(Searth, X, dim+1, X); \ X[0]=isomod(ZZ[0], maxangle); \ for (d = 1; d < dim; d++) X[d] = ZZ[d] void EarthIso2EarthIso(double *x, cov_model *cov, double *v) { ISOMOD(x, X, 180); CovList[cov->nr].cov(X, cov, v); // nicht gatternr } void logEarthIso2EarthIso(double *x, cov_model *cov, double *v, double *Sign) { ISOMOD(x, X, 180); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void NonstatEarth2EarthIso(double *x, double *y, cov_model *cov, double *v) { ESnonstat2iso(piD180 * x, piD180 * y); X[0] *= H80Dpi; CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logNonstatEarth2EarthIso(double *x, double *y, cov_model *cov, double *v, double *Sign) { ESnonstat2iso(piD180 * x, piD180 * y); X[0] *= H80Dpi; CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void Earth2Earth(double *x, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(x, X, 360, 180); CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logEarth2Earth(double *x, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(x, X, 360, 180); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void NonstatEarth2Earth(double *x, double *y, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(x, X, 360, 180); STATMOD(y, Y, 360, 180); CovList[cov->nr].nonstat_cov(X, Y, cov, v);// nicht gatternr } void logNonstatEarth2Earth(double *x, double *y, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(x, X, 360, 180); STATMOD(y, Y, 360, 180); CovList[cov->nr].nonstatlog(X, Y, cov, v, Sign);// nicht gatternr } // BERRETH :: sphere2earth void Sphere2Earth(double *x, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(H80Dpi * x, X, 360, 180); CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void EarthIso2SphereIso(double *x, cov_model *cov, double *v) { ISOMOD(piD180 * x, X, M_PI); CovList[cov->nr].cov(X, cov, v); // nicht gatternr } void logEarthIso2SphereIso(double *x, cov_model *cov, double *v, double *Sign) { ISOMOD(piD180 * x, X, M_PI); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void NonstatEarth2SphereIso(double *x, double *y, cov_model *cov, double *v) { ESnonstat2iso(piD180 * x, piD180 * y); CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logNonstatEarth2SphereIso(double *x, double *y, cov_model *cov, double *v, double *Sign) { ESnonstat2iso(piD180 * x, piD180 * y); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void Earth2Sphere(double *x, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; // STATMOD(piD180 * x, X, M_2_PI, M_PI); // PMI(cov->calling); ALLOC_NEW(Searth, X, dim+1, X); STATMODE_BASE(X, piD180 * x, M_2_PI, M_PI); for (d = 2; d < dim; d++) X[d] = piD180 * x[d]; CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logEarth2Sphere(double *x, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(piD180 * x, X, M_2_PI, M_PI); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void NonstatEarth2Sphere(double *x, double *y, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(piD180 * x, X, M_2_PI, M_PI); STATMOD(piD180 * y, Y, M_2_PI, M_PI); CovList[cov->nr].nonstat_cov(X, Y, cov, v);// nicht gatternr } void logNonstatEarth2Sphere(double *x, double *y, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(piD180 * x, X, M_2_PI, M_PI); STATMOD(piD180 * y, Y, M_2_PI, M_PI); CovList[cov->nr].nonstatlog(X, Y, cov, v, Sign);// nicht gatternr } void SphereIso2SphereIso(double *x, cov_model *cov, double *v) { ISOMOD(x, X, M_PI); CovList[cov->nr].cov(X, cov, v); // nicht gatternr } void logSphereIso2SphereIso(double *x, cov_model *cov, double *v, double *Sign) { ISOMOD(x, X, M_PI); CovList[cov->nr].log(X, cov, v, Sign);// nic+ht gatternr } void NonstatSphere2SphereIso(double *x, double *y, cov_model *cov, double *v) { ESnonstat2iso(x, y); CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logNonstatSphere2SphereIso(double *x, double *y, cov_model *cov, double *v, double *Sign) { ESnonstat2iso(x, y); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void Sphere2Sphere(double *x, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(x, X, M_2_PI, M_PI); CovList[cov->nr].cov(X, cov, v);// nicht gatternr } void logSphere2Sphere(double *x, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(x, X, M_2_PI, M_PI); CovList[cov->nr].log(X, cov, v, Sign);// nicht gatternr } void NonstatSphere2Sphere(double *x, double *y, cov_model *cov, double *v) { int d, dim=cov->xdimgatter; STATMOD(x, X, M_2_PI, M_PI); STATMOD(y, Y, M_2_PI, M_PI); CovList[cov->nr].nonstat_cov(X, Y, cov, v);// nicht gatternr } void logNonstatSphere2Sphere(double *x, double *y, cov_model *cov, double *v, double *Sign) { int d, dim=cov->xdimgatter; STATMOD(x, X, M_2_PI, M_PI); STATMOD(y, Y, M_2_PI, M_PI); CovList[cov->nr].nonstatlog(X, Y, cov, v, Sign);// nicht gatternr } ////////////////////////////////////////////////////////////////////// // Earth coordinate systems : change to cartesian system ////////////////////////////////////////////////////////////////////// #define EARTH_LONGITUDE 0 #define EARTH_LATITUDE 1 #define EARTH_HEIGHT 2 #define pi180 0.017453292519943295474 #define EARTH_TRAFO(X, ZZ, raequ, rpol) \ Rcos = (raequ) * COS(ZZ[EARTH_LATITUDE] * pi180); \ X[0] = Rcos * COS(ZZ[EARTH_LONGITUDE] * pi180); \ X[1] = Rcos * SIN(ZZ[EARTH_LONGITUDE] * pi180); \ X[2] = (rpol) * SIN(ZZ[EARTH_LATITUDE] * pi180) #define earth2cartInner(RAEQU, RPOL) \ assert(cov->xdimprev >= 2 && cov->xdimgatter >=2);/*not necessarily equal*/ \ int origdim=cov->xdimprev; \ bool Time = Loc(cov)->Time, \ height = origdim > 2 + (int) Time; \ double Rcos, X[4], Y[4]; \ EARTH_TRAFO(X, x, height ? ((RAEQU) + x[EARTH_HEIGHT]) : (RAEQU), \ height ? ((RPOL) + x[EARTH_HEIGHT]) : (RPOL)); \ EARTH_TRAFO(Y, y, height ? ((RAEQU) + y[EARTH_HEIGHT]) : (RAEQU), \ height ? ((RPOL) + y[EARTH_HEIGHT]) : (RPOL)); \ if (Time) X[3] = x[origdim - 1]; // !!! if anything is changed here change also structtrafoproc !!!! #define earth2cartInnerStatX(RAEQU, RPOL) \ assert(cov->xdimprev >= 2 && cov->xdimgatter >= 2); \ int origdim=cov->xdimprev; \ bool Time = Loc(cov)->Time, \ height = origdim > 2 + (int) Time; \ double Rcos; \ EARTH_TRAFO(X, x, height ? ((RAEQU) + x[EARTH_HEIGHT]) : (RAEQU), \ height ? ((RPOL) + x[EARTH_HEIGHT]) : (RPOL)); \ if (Time) X[3] = x[origdim - 1]; #define earth2cartInnerStat(RAEQU, RPOL) \ double X[4]; \ earth2cartInnerStatX(RAEQU, RPOL) void Earth2Cart(double *x, cov_model *cov,double RAEQU, double RPOL, double *X){ // !!! if anything is changed here change also structtrafoproc !!!! earth2cartInnerStatX(RAEQU, RPOL) } void EarthKM2CartStat(double *x, cov_model *cov, double *v) { earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); CovList[cov->secondarygatternr].cov(X, cov, v);// nicht gatternr } void logEarthKM2CartStat(double *x, cov_model *cov, double *v, double *Sign) { earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); CovList[cov->secondarygatternr].log(X, cov, v, Sign);// nicht gatternr } void EarthKM2Cart(double *x, double *y, cov_model *cov, double *v) { //PMI(cov->calling); earth2cartInner(radiuskm_aequ, radiuskm_pol); CovList[cov->secondarygatternr].nonstat_cov(X, Y, cov, v);// nicht gatternr } void logEarthKM2Cart(double *x, double *y, cov_model *cov, double *v, double *Sign) { earth2cartInner(radiuskm_aequ, radiuskm_pol); CovList[cov->secondarygatternr].nonstatlog(X, Y, cov, v, Sign);// nicht gatternr } void EarthMiles2CartStat(double *x, cov_model *cov, double *v) { earth2cartInnerStat(radiusmiles_aequ, radiusmiles_pol); CovList[cov->secondarygatternr].cov(X, cov, v);// nicht gatternr } void logEarthMiles2CartStat(double *x, cov_model *cov, double *v, double *Sign) { earth2cartInnerStat(radiusmiles_aequ, radiusmiles_pol); CovList[cov->secondarygatternr].log(X, cov, v, Sign);// nicht gatternr } void EarthMiles2Cart(double *x, double *y, cov_model *cov, double *v) { earth2cartInner(radiusmiles_aequ, radiusmiles_pol); CovList[cov->secondarygatternr].nonstat_cov(X, Y, cov, v);// nicht gatternr } void logEarthMiles2Cart(double *x, double *y, cov_model *cov, double *v, double *Sign) { earth2cartInner(radiusmiles_aequ, radiusmiles_pol); CovList[cov->secondarygatternr].nonstatlog(X, Y, cov, v, Sign);// nicht gatternr } #define QP 0 #define QZenit 9 #define Qtotal 12 int checkEarth(cov_model *cov){ // ACHTUNG! KEIN AUFRUF VON SUB[0] ! if (cov->domprev == XONLY// 20.2.14: warum war es vorher cov->domown == XONLY? && isSymmetric(cov->isoprev)) { // darf nie auf "XONLY-stat" transformiert sein. Es kann aber zB bei 'shape' // sein, dass ein XONLY ankommt. return ERRORKERNEL; } COND_NEW_STORAGE(earth, X); if (cov->gatternr >= FIRST_PLANE && cov->gatternr <= LAST_PLANE) { assert(cov->tsdim>=2 && cov->xdimown == cov->tsdim); // oder 3, 4 !! regeln! if (!R_FINITE(GLOBAL.coords.zenit[0]) || !R_FINITE(GLOBAL.coords.zenit[1])){ if (GLOBAL.internal.warn_zenit) { GLOBAL.internal.warn_zenit = false; char msg[255]; SPRINTF(msg, "tried to use non-finite values of '%s' in a coordinate transformation\n", coords[ZENIT]); warning(msg); } SERR1("'%s' not finite!", coords[ZENIT]); } if (cov->gatternr == EARTHKM2GNOMONIC || cov->gatternr == EARTHMILES2GNOMONIC) { int d; double Rcos, X[4]; if (cov->Searth == NULL) NEW_STORAGE(earth); if (cov->gatternr == EARTHKM2GNOMONIC) { EARTH_TRAFO(X, GLOBAL.coords.zenit, radiuskm_aequ, radiuskm_pol); } else { EARTH_TRAFO(X, GLOBAL.coords.zenit, radiusmiles_aequ, radiusmiles_pol); } double Rsq = 0.0, *zenit = cov->Searth->cart_zenit; for (d=0; d<=2; d++) Rsq += X[d] * X[d]; for (d=0; d<=2; d++) { zenit[d] = X[d] / Rsq; } } double Zenit[2] = { GLOBAL.coords.zenit[0] * pi180, GLOBAL.coords.zenit[1] * pi180}, sin0 = SIN(Zenit[0]), sin1 = SIN(Zenit[1]), cos0 = COS(Zenit[0]), cos1 = COS(Zenit[1]), *P = cov->Searth->P; P[0] = -sin0; P[1] = cos0; P[2] = 0.0; P[3] = -cos0 * sin1; P[4] = -sin0 * sin1; P[5] = cos1; P[6] = cos0 * cos1; P[7] = sin0 * cos1; P[8] = sin1; } else { assert(cov->gatternr >= EARTHKM2CART && cov->gatternr <= EARTHMILES2CART); } return NOERROR; } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// // Orthogonal #define orthDefStat \ int d, k, m, \ dim=cov->xdimgatter; \ assert(dim >= 2); \ ALLOC_NEW(Searth, U, dim+1, U); \ double *P = cov->Searth->P #define orthTrafoStat \ for (m=d=0; d<3; d++) { \ U[d] = 0.0; \ for(k=0; k<3; k++, m++) { \ U[d] += P[m] * X[k]; \ } \ } \ if (U[2] < 0.0) ERR("location(s) not in direction of the zenit");\ for (d = 2; dgatternr == EARTHKM2ORTHOGRAPHIC); earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); // results in X[0], X[1] orthDefStat; orthTrafoStat; CovList[cov->secondarygatternr].cov(U, cov, v);// nicht gatternr } void logEarthKM2OrthogStat(double *x, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHKM2ORTHOGRAPHIC); earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); orthDefStat; orthTrafoStat; CovList[cov->secondarygatternr].log(U, cov, v, Sign);// nicht gatternr } void EarthKM2Orthog(double *x, double *y, cov_model *cov, double *v) { assert(cov->gatternr == EARTHKM2ORTHOGRAPHIC); earth2cartInner(radiuskm_aequ, radiuskm_pol); orthDef; orthTrafo; CovList[cov->secondarygatternr].nonstat_cov(U, V, cov, v);// nicht gatternr } void logEarthKM2Orthog(double *x, double *y, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHKM2ORTHOGRAPHIC); earth2cartInner(radiuskm_aequ, radiuskm_pol); orthDef; orthTrafo; CovList[cov->secondarygatternr].nonstatlog(U, V, cov, v, Sign);// nicht gatternr } void EarthMiles2OrthogStat(double *x, cov_model *cov, double *v) { assert(cov->gatternr == EARTHMILES2ORTHOGRAPHIC); earth2cartInnerStat(radiusmiles_aequ, radiusmiles_pol); // results in X[0], X[1] orthDefStat; orthTrafoStat; CovList[cov->secondarygatternr].cov(U, cov, v);// nicht gatternr } void logEarthMiles2OrthogStat(double *x, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHMILES2ORTHOGRAPHIC); earth2cartInnerStat(radiusmiles_aequ, radiusmiles_pol); orthDefStat; orthTrafoStat; CovList[cov->secondarygatternr].log(U, cov, v, Sign);// nicht gatternr } void EarthMiles2Orthog(double *x, double *y, cov_model *cov, double *v) { assert(cov->gatternr == EARTHMILES2ORTHOGRAPHIC); earth2cartInner(radiusmiles_aequ, radiusmiles_pol); orthDef; orthTrafo; CovList[cov->secondarygatternr].nonstat_cov(U, V, cov, v);// nicht gatternr } void logEarthMiles2Orthog(double *x, double *y, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHMILES2ORTHOGRAPHIC); earth2cartInner(radiusmiles_aequ, radiusmiles_pol); orthDef; orthTrafo; CovList[cov->secondarygatternr].nonstatlog(U, V, cov, v, Sign);// nicht gatternr } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// // Gnomonic #define GnomonicStat \ double factor = 0.0, \ *cart_zenit = cov->Searth->cart_zenit; \ for (d=0; d<3; d++) factor += cart_zenit[d] * X[d]; \ if (factor <= 0.0) \ ERR1("locations not on the half-sphere given by the '%s'.", coords[ZENIT]);\ for (d=0; d<3; d++) X[d] /= factor #define Gnomonic \ double factor = 0.0, \ factorY = 0.0, \ *cart_zenit = cov->Searth->cart_zenit; \ for (d=0; d<3; d++) { \ factor += cart_zenit[d] * X[d]; \ factorY += cart_zenit[d] * Y[d]; \ } \ if (factor <= 0.0 || factorY <= 0.0) \ ERR1("locations not on the half-sphere given by the '%s'.", coords[ZENIT]);\ for (d=0; d<3; d++) { \ X[d] /= factor; \ Y[d] /= factorY; \ } void Earth2GnomonicStat(double *x, cov_model *cov, double *v) { assert(cov->gatternr == EARTHKM2GNOMONIC || cov->gatternr == EARTHMILES2GNOMONIC); earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); // results in X[0], X[1] orthDefStat; GnomonicStat; orthTrafoStat; CovList[cov->secondarygatternr].cov(U, cov, v);// nicht gatternr } void logEarth2GnomonicStat(double *x, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHKM2GNOMONIC || cov->gatternr == EARTHMILES2GNOMONIC); earth2cartInnerStat(radiuskm_aequ, radiuskm_pol); orthDefStat; GnomonicStat; orthTrafoStat; CovList[cov->secondarygatternr].log(U, cov, v, Sign);// nicht gatternr } void Earth2Gnomonic(double *x, double *y, cov_model *cov, double *v) { assert(cov->gatternr == EARTHKM2GNOMONIC || cov->gatternr == EARTHMILES2GNOMONIC); earth2cartInner(radiuskm_aequ, radiuskm_pol); orthDef; Gnomonic; orthTrafo; CovList[cov->secondarygatternr].nonstat_cov(U, V, cov, v);// nicht gatternr } void logEarth2Gnomonic(double *x, double *y, cov_model *cov, double *v, double *Sign) { assert(cov->gatternr == EARTHKM2GNOMONIC || cov->gatternr == EARTHMILES2GNOMONIC); earth2cartInner(radiuskm_aequ, radiuskm_pol); orthDef; Gnomonic; orthTrafo; CovList[cov->secondarygatternr].nonstatlog(U, V, cov, v, Sign);// nicht gatternr } bool is_any(isofct iso, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (iso(C->Isotropy[i])) return true; return false; } bool is_all(isofct iso, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (!iso(C->Isotropy[i])) return false; return true; } bool is_any(typusfct t, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (t(C->Typi[i])) return true; return false; } bool is_all(typusfct t, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (!t(C->Typi[i])) return false; return true; } bool isIsotropic(isotropy_type iso) { return iso == ISOTROPIC; } bool isAnyIsotropic(isotropy_type iso) { return iso == ISOTROPIC || iso == EARTH_ISOTROPIC || iso == SPHERICAL_ISOTROPIC; } bool isSpaceIsotropic(isotropy_type iso) { return iso <= SPACEISOTROPIC; } bool isZeroSpaceIsotropic(isotropy_type iso) { return iso <= ZEROSPACEISO; } bool isVectorIsotropic(isotropy_type iso) { return iso == VECTORISOTROPIC; } bool isSymmetric(isotropy_type iso) { return iso <= SYMMETRIC; } bool isCartesian(isotropy_type iso) { return iso <= LAST_CARTESIAN; } bool isSpherical(isotropy_type iso) { return iso >= SPHERICAL_ISOTROPIC && iso <= SPHERICAL_COORDS; } bool isEarth(isotropy_type iso) { return iso >= EARTH_ISOTROPIC && iso <= EARTH_COORDS ; } bool isAnySpherical(isotropy_type iso) { // printf("any %d < %d <= %d\n", LAST_CARTESIAN, iso, LAST_SPHERICAL); return iso > LAST_CARTESIAN && iso <= LAST_ANYSPHERICAL; } bool isAnySphericalIso(isotropy_type iso) { return iso == SPHERICAL_ISOTROPIC || iso == EARTH_ISOTROPIC; } bool isAnySphericalNotIso(isotropy_type iso) { return iso != SPHERICAL_ISOTROPIC && iso != EARTH_ISOTROPIC ; } bool isPrevModelI(cov_fct *C){ bool is = C->Isotropy[0] == PREVMODELI; // assert(!is || C->variants == 1 || // (C->variants == 2 && C->Isotropy[0] == C->Isotropy[1])); return is; } bool isUnreduced(cov_fct *C){ bool is = C->Isotropy[0] == UNREDUCED; assert(!is || C->variants == 1); return is; } bool isCoordinateSystem(isotropy_type iso){ return iso == CARTESIAN_COORD || iso == SPHERICAL_COORDS || iso == EARTH_COORDS; } bool atleastSpecialised(isotropy_type iso, isotropy_type as) { // printf("ATLEAST '%s' at least specialised as '%s'? \n", ISONAMES[iso], ISONAMES[as]); bool less = iso <= as; if (isCartesian(as)) return less; // also iso < 0 OK if (isSpherical(as)) return isSpherical(iso) && less; // if (isEarth(as)) { // printf("YYY %s %d \n", ISONAMES[iso], isAnySpherical(iso)); if (isEarth(iso)) return less; if (isSpherical(iso)) { //printf("iso=%d %d %d %d %d %d\n", iso, as, EARTH_COORDS, SPHERICAL_COORDS, as - EARTH_COORDS + SPHERICAL_COORDS, iso <= as - EARTH_COORDS + SPHERICAL_COORDS); return iso <= as - EARTH_COORDS + SPHERICAL_COORDS; } if (isCartesian(iso)) { return (as == EARTH_COORDS && iso == CARTESIAN_COORD) || (as == EARTH_SYMMETRIC && iso == SYMMETRIC); } return false; } if (as == UNREDUCED) { return isCoordinateSystem(iso); } if (as == PREVMODELI) return true; // PRINTF("'%s' not at least specialised as %s\n", ISONAMES[iso], ISONAMES[as]); // crash(); BUG; } bool isCylinder(isotropy_type iso) { BUG; return iso == CYLINDER_COORD; } bool equal_coordinate_system(isotropy_type iso1, isotropy_type iso2) { return (isCartesian(iso1) && isCartesian(iso2)) || (isAnySpherical(iso1) && isAnySpherical(iso2)) // || (isCylinder(iso1) && isCylinder(iso2)) || iso1==UNREDUCED; } bool equal_coordinate_system(isotropy_type iso1, isotropy_type iso2, bool refined) { if (!refined) return equal_coordinate_system(iso1, iso2); return (isCartesian(iso1) && isCartesian(iso2)) || (isSpherical(iso1) && isSpherical(iso2)) || (isEarth(iso1) && isEarth(iso2)) // || (isCylinder(iso1) && isCylinder(iso2)) || iso1==UNREDUCED; } isotropy_type UpgradeToCoordinateSystem(isotropy_type iso) { return iso == ZEROSPACEISO || iso == VECTORISOTROPIC|| iso == SYMMETRIC ? CARTESIAN_COORD : iso == EARTH_SYMMETRIC ? EARTH_COORDS : iso == SPHERICAL_SYMMETRIC ? SPHERICAL_COORDS : isCoordinateSystem(iso) ? iso : ISO_MISMATCH; } isotropy_type CoordinateSystemOf(isotropy_type iso) { return isCartesian(iso) ? CARTESIAN_COORD : isEarth(iso) ? EARTH_COORDS : isSpherical(iso) ? SPHERICAL_COORDS : ISO_MISMATCH; } isotropy_type IsotropicOf(isotropy_type iso) { return isCartesian(iso) ? ISOTROPIC : isEarth(iso) ? EARTH_ISOTROPIC : isSpherical(iso) ? SPHERICAL_ISOTROPIC : ISO_MISMATCH; } isotropy_type SymmetricOf(isotropy_type iso) { return isCartesian(iso) ? SYMMETRIC : isEarth(iso) ? EARTH_SYMMETRIC : isSpherical(iso) ? SPHERICAL_SYMMETRIC : ISO_MISMATCH; } int change_coord_system(isotropy_type callingisoown, isotropy_type isoprev, int tsdimprev, int xdimprev, int *nr, isotropy_type *newisoprev, int *newtsdim, int *newxdim, bool time) { // isoprev is replaced by a coordinate transformation and a nwe switch(callingisoown) { case EARTH_COORDS : case EARTH_SYMMETRIC: if (isCartesian(isoprev)) { if (xdimprev != tsdimprev) SERR("reduced coordinates not allowed"); if (STRCMP(GLOBAL.coords.newunits[0], UNITS_NAMES[units_km]) == 0){ *nr = isoprev == GNOMONIC_PROJ ? EARTHKM2GNOMONIC : isoprev == ORTHOGRAPHIC_PROJ ? EARTHKM2ORTHOGRAPHIC : EARTHKM2CART; } else if (STRCMP(GLOBAL.coords.newunits[0], UNITS_NAMES[units_miles]) == 0) { *nr = isoprev == GNOMONIC_PROJ ? EARTHMILES2GNOMONIC : isoprev == ORTHOGRAPHIC_PROJ ? EARTHMILES2ORTHOGRAPHIC :EARTHMILES2CART; } else { SERR4("only units '%s' and '%s' are allowed. Got '%s' (user's '%s').", UNITS_NAMES[units_km], UNITS_NAMES[units_miles], GLOBAL.coords.newunits[0], GLOBAL.coords.curunits[0]); } if (isoprev == GNOMONIC_PROJ || isoprev == ORTHOGRAPHIC_PROJ) { *newtsdim = tsdimprev; *newxdim = xdimprev; *newisoprev = isoprev; } else if (isCartesian(isoprev)) { *newisoprev = callingisoown == EARTH_COORDS ? CARTESIAN_COORD : callingisoown == EARTH_SYMMETRIC ? SYMMETRIC : ISO_MISMATCH; if (tsdimprev == 2) { //assert(xdimprev == 2); *newtsdim = *newxdim = 3; } else if (tsdimprev == 3 && time) { *newtsdim = *newxdim = 4; } else { *newtsdim = *newxdim = xdimprev; } } else { BUG; } } else { //if (!isSpherical(callingisoown) && callingisoown != EARTH_ISOTROPIC) { // printf("%s --> %s\n", ISONAMES[callingisoown], ISONAMES[isoprev]); //BUG; // } return ERRORODDCOORDTRAFO; // NotProgrammedYet(""); } break; case EARTH_ISOTROPIC : case SPHERICAL_ISOTROPIC : // if (!isSpherical(callingisoown) && callingisoown != EARTH_ISOTROPIC) { // printf("\n\n%s --> %s\n", ISONAMES[callingisoown], ISONAMES[isoprev]); // BUG; // } return ERRORWRONGISO; default: // printf("\n\n\n\n\n\n%s --> %s\n", ISONAMES[callingisoown], ISONAMES[isoprev]); return ERRORODDCOORDTRAFO; // NotProgrammedYet(""); } //assert(*newtsdim == 4); return NOERROR; } int SetGatter(domain_type domprev, domain_type domnext, isotropy_type isoprev, isotropy_type isonext, // bool first, int *nr, int *delflag) { if (domprev < domnext) SERR2("Cannot call more complex models ('%s') from simpler ones ('%s')", DOMAIN_NAMES[(int) domnext], DOMAIN_NAMES[(int) domprev]); if (isAnySpherical(isonext)) { if(!isAnySpherical(isoprev)) BUG; //to do?: back from cartesian not possible // currently if (isoprev == UNREDUCED) { if (isoprev != isonext || domprev != domnext) SERR("unclear transformation of earth/spherical coordinates"); *nr = isEarth(isoprev) ? E2E : Sph2Sph; } if (domnext == XONLY) { if (isAnySphericalIso(isonext)) { if ( (isAnySphericalNotIso(isoprev) && domprev != KERNEL) || (isAnySphericalIso(isoprev) && domprev != XONLY)) SERR("impossible spherical trafo"); *nr = isEarth(isoprev) ? (isSpherical(isonext) ? E2SphIso : E2EIso) : (isSpherical(isonext) ? Sph2SphIso : ISO_MISMATCH); } else { // next: xonly, not iso; e.g. for shape functions assert(isAnySphericalNotIso(isonext)); if (domprev == KERNEL) SERR("earth trafo not possible"); // mathemati- // cally likely not correct assert(domprev == XONLY); if (!isAnySphericalNotIso(isoprev)) SERR("mathematically not correct coordinate transformation"); // mathematically likely not correct. to do *nr = isEarth(isoprev) ? (isSpherical(isonext) ? E2Sph : E2E) : (isSpherical(isonext) ? Sph2Sph : ISO_MISMATCH); } } else { // domnext == KERNEL assert(isAnySphericalNotIso(isonext)); assert(domprev == KERNEL); assert(isAnySphericalNotIso(isoprev)); *nr = isEarth(isoprev) ? (isSpherical(isonext) ? E2Sph : E2E) : (isSpherical(isonext) ? Sph2Sph : ISO_MISMATCH); } return NOERROR; } if (isoprev == CYLINDER_COORD || isonext == CYLINDER_COORD) SERR("general spherical coordinates not programmed yet"); ////////////// // cartesian ////////////// assert(isCartesian(isonext)); bool isoOK = isoprev == isonext || (isoprev > isonext && isonext <= CARTESIAN_COORD); // keine Trafo innerhalb // der projektionen -- bislang zumindest. ? to do if (!isoOK) SERR2("cannot call more complex models ('%s') from simpler ones ('%s')", ISONAMES[(int) domnext], ISONAMES[(int) domprev]); // if (isoprec == GNOMONIC_PROJ && if (domnext == XONLY && (domprev == KERNEL || isoprev == CARTESIAN_COORD || isoprev == SYMMETRIC || isoprev == VECTORISOTROPIC || isoprev == GNOMONIC_PROJ || isoprev == ORTHOGRAPHIC_PROJ || isoprev == ZEROSPACEISO)) { switch (isonext) { case ISOTROPIC : *nr = S2ISO; break; case SPACEISOTROPIC : *nr = S2SP; break; case ZEROSPACEISO: case VECTORISOTROPIC: case SYMMETRIC: case CARTESIAN_COORD: case GNOMONIC_PROJ: case ORTHOGRAPHIC_PROJ: *nr = S2S; // *delflag = DEL_COV - 5; /// break; case UNREDUCED: *nr = SId; break; default: BUG; } } else { if (domprev == XONLY) { switch(isoprev) { case ISOTROPIC : *nr = ISO2ISO; break; case SPACEISOTROPIC : *nr = (isonext == ISOTROPIC) ? SP2ISO : SP2SP; break; default: PRINTF("SetGatter prev=%s; %s\n next=%s %s\n", DOMAIN_NAMES[domprev], ISONAMES[isoprev], DOMAIN_NAMES[domnext], ISONAMES[isonext]); BUG; } } else { // KERNEL domprev und domnext *nr = SId; *delflag = DEL_COV - 4;// } } return NOERROR; } RandomFields/src/metropolis.cc0000644000176200001440000001122213074763020016114 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Metropolis-Hasting for drawing from the spectral density Copyright (C) 2000 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include #include "RF.h" void metropolis(cov_model *cov, gen_storage *S, double *x) { spec_properties *s = &(S->spec); spectral_density density = s->density; int i,d, dim = cov->tsdim, n = s->nmetro; double p, proposal[MAXTBMSPDIM], dx, *E = s->E, sigma = s->sigma; if (dim >= MAXTBMSPDIM) BUG; //ERR("too high dimension for metropolis."); for (i=0; i=1 || UNIFORM_RANDOM < p) { for (d=0; dspec); double Sigma[maxSearch], x[MAXTBMSPDIM], oldx[MAXTBMSPDIM], log_s, p, prop_factor = S->Sspectral.prop_factor, factor = Factor; int n, i, j, d, ungleich, zaehler, //Z[maxSearch], D[maxSearch], min, mintol, minzaehler, optzaehler, maxzaehler, err=NOERROR, dim = cov->tsdim; s->nmetro = 1; if (s->sigma <= 0.0) { s->sigma = 1.0; optzaehler = (int) (nBase1 * percent); minzaehler = (int) (optzaehler * nBase1percent); if (minzaehler < 10) GERR("internal variables insufficient. Please contact author."); // GERR("please increase 'spectral.percent' and/or nBase1"); maxzaehler = nBase1 - minzaehler; if (maxzaehler < minzaehler) GERR("Internal variables insufficient. Please contact author."); //GERR("please decrease 'spectral.percent'"); min = nBase1 + 1; for (i=0; i < maxSearch; i++) { Sigma[i] = s->sigma; for (d=0; dE[d] = oldx[d] = 0.0; zaehler = 0; for (j=0; j= PL_DETAILS) PRINTF("s=%f: z=%d < %d [%d, %d] fact=%f D=%d %d\n", Sigma[i], zaehler, minzaehler, maxzaehler, optzaehler, factor, D[i], min); if (zaehler < minzaehler || zaehler > maxzaehler) { if (factor > 1.0) factor = 1.0 / factor; else break; s->sigma = factor; } else { s->sigma *= factor; } } if (i >= maxSearch) GERR("Metropolis search algorithm for optimal sd failed\n -- check whether the scale of the problem has been chosen appropriately"); n = 0; log_s = 0.0; mintol = (int) (bestfactor * min); for (j =0; j= PL_DETAILS) PRINTF("%d. sigma=%f D=%d %d\n", j, Sigma[j], D[j], mintol); n++; log_s += LOG(Sigma[j]); } } s->sigma = EXP(log_s / (double) n); if (PL >= PL_DETAILS) PRINTF("optimal sigma=%f \n", s->sigma); } // ****** searching for optimal n for (d=0; dE[d] = oldx[d] = 0.0; zaehler = 0; for (j=0; jnmetro = 1 + (int) FABS(prop_factor / LOG(p)); if (PL >= PL_DETAILS) for (d=0; dE[d]); if (PL >= PL_DETAILS) PRINTF("opt.sigma=%f opt.n=%d (p=%f, id=%e, zaehler=%d, dim=%d)\n", s->sigma, s->nmetro, p, prop_factor, zaehler, cov->tsdim); ErrorHandling: return err; } RandomFields/src/getNset.cc0000644000176200001440000027560713074763020015353 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de (library for simulation of random fields) Copyright (C) 2001 -- 2015 Martin Schlather, This program is free software; you can redist ribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include //#include #include #include #include "RF.h" #include "primitive.h" #include "Coordinate_systems.h" void LOC_SINGLE_NULL(location_type *loc, int len) { int d; loc->spatialdim = loc->timespacedim = loc->lx = loc->ly = loc->xdimOZ = -1; for (d=0; dxgr[d] = loc->ygr[d] = NULL; } loc->totalpoints = loc->spatialtotalpoints = 0; loc->grid = loc->distances = loc->Time = false; loc->delete_x = loc->delete_y = true; loc->x = loc->y = loc->caniso = NULL; loc->T[0] = loc->T[1] = loc->T[2] = 0.0; loc->i_row = loc->i_col = I_COL_NA; loc->cani_ncol = loc->cani_nrow = NA_INTEGER; loc->len = len; } void LOC_NULL(location_type **Loc, int len) { int i; for (i=0; ilen >= 1 && loc[0]->len <= 1e6); return loc; } void LOCLIST_CREATE(cov_model *cov, int n) { cov->ownloc = LOCLIST_CREATE(n); } void LOC_SINGLE_DELETE(location_type **Loc) { location_type *loc = *Loc; if (loc != NULL) { if (loc->x != NULL) { //printf("single %d\n", loc->delete_x); if (loc->delete_y) FREE(loc->y); if (loc->delete_x) { //printf("single del x %ld\n", loc->x); assert(loc->x != NULL); UNCONDFREE(loc->x); } //printf("don LOC_SINGLE_DEL\n"); } FREE(loc->caniso); // it may happen that both are set ! Especially after calling // partial_loc_set in variogramAndCo.cc if (loc->spatialdim>0) { if (loc->delete_y) FREE(loc->ygr[0]); /// if (loc->delete_x) FREE(loc->xgr[0]); /// } UNCONDFREE(*Loc); } } void LOC_DELETE(location_type ***Loc) { if (*Loc == NULL) return; int i, len = (*Loc)[0]->len; //printf("len=%d %ld %ld\n", len, (*Loc) + 0 , (*Loc) + 1); assert(len <= 2); for (i=0; ilpx = (double **) CALLOC(len, sizeof(double *)); q->ncol = (int*) CALLOC(len, sizeof(int)); q->nrow = (int*) CALLOC(len, sizeof(int)); q->deletelist = true; q->len = len; q->type = type; return q; } void LIST_DELETE(listoftype **x) { if (x == NULL) return; listoftype *q = *x; if (q != NULL) { // printf("list-delete %ld %d\n", (long int) q, q->len); assert(q->lpx != NULL); if (q->deletelist) { for (int i=0; ilen; i++) { //printf("list_del %d q-len=%d\n", i, q->len); FREE(q->lpx[i]); } FREE(q->lpx); FREE(q->ncol); FREE(q->nrow); } FREE(*x); } } void listpt(listoftype **To, listoftype *p, int len, SEXPTYPE type, bool force_allocating) { if (*To == NULL || force_allocating) { *To = (listoftype *) MALLOC(sizeof(listoftype)); } listoftype *q = *To; q->lpx = p->lpx; q->ncol = p->ncol; q->nrow = p->nrow; q->deletelist = false; q->len = len; q->type = type; } void listcpy(listoftype **To, listoftype *p, bool force_allocating) { // force_allocating in case of "c ovcpy" int size, len = p->len, sizeint = len * sizeof(int); if (p->type == LISTOF + REALSXP) { size = sizeof(double); } else BUG; if (*To == NULL || force_allocating) *To = LIST_CREATE(len, p->type); listoftype *q = *To; for (int j=0; jnrow[j] * p->ncol[j]; //printf("list cpy j=%d %d\n", j, n); if (q->lpx[j] == NULL) q->lpx[j] = (double*) MALLOC(n); MEMCOPY(q->lpx[j], p->lpx[j], n); } MEMCOPY(q->nrow, p->nrow, sizeint); MEMCOPY(q->ncol, p->ncol, sizeint); } //void GLOBAL_NULL() { // ReSetGlobal(); //} // //void SetTemporarilyGlobal(globalparam *gp) { // if (!GLOBALORIG.set) { // MEMCOPY(&(GLOBALORIG.param), &GLOBAL, sizeof(globalparam)); // GLOBALORIG.set = true; // } // MEMCOPY(&GLOBAL, gp, sizeof(globalparam)); //} // //void ReSetGlobal() { // if (GLOBALORIG.set) { // MEMCOPY(&GLOBAL, &(GLOBALORIG.param), sizeof(globalparam)); // GLOBALORIG.set = false; // } //} // Achtung! removeonly muss zwingend mit dem originalen SUB + i aufgerufen // werden. Der **Cov ueberschrieben wird. Ansonsten muessen die // Kommentarzeilen geloescht werden ! void removeOnly(cov_model **Cov) { cov_model *cov = *Cov, *next = cov->sub[0]; if (cov->calling == NULL) next->calling = NULL; else { cov_model *calling = cov->calling; // for (i=0; isub[i] == cov) break; // assert (isub[i] = cov->sub[0]; next->calling = calling; } *Cov = next; COV_DELETE_WITHOUTSUB(&cov); } void MPPPROPERTIES_NULL(mpp_properties *Mpp) { // Mpp->refradius= int i; for (i=0; imaxheights[i] = RF_INF; Mpp->unnormedmass = RF_NA; Mpp->mM = Mpp->mMplus = NULL; // Mpp->refsd = //Mpp->totalmass = RF_NA; //Mpp->methnr = -1; //Mpp->loc_done = false; } void MPPPROPERTIES_DELETE(mpp_properties *Mpp) { FREE(Mpp->mM); FREE(Mpp->mMplus); } void COV_DELETE_WITHOUTSUB(cov_model **Cov) { cov_model *cov = *Cov; //printf("deleting %s\n", NAME(cov)); assert(cov != NULL); int i, j, last = (cov->nr < 0) ? MAXPARAM : CovList[cov->nr].kappas; for (i=0; inr].kappatype[i]; if (!PisNULL(i)) { if (isRObject(type)) { sexp_type *S = PSEXP(i); if (S->Delete) R_ReleaseObject(S->sexp); } else if (type >= LISTOF) { // printf("cov_delete_without %s %d; %d %d %d\n", NAME(*Cov), cov->zaehler, NROW(i), NCOL(i), i); // printf("cov_delete_without %s %d %d\n", NAME(*Cov), ((listoftype *) (cov->px[i]))->deletelist, i); //if (PLIST(i)->deletelist) { LIST_DELETE((listoftype **) (cov->px + i)); //} } PFREE(i); cov->ncol[i] = cov->nrow[i] = SIZE_NOT_DETERMINED; // ==0 } } MPPPROPERTIES_DELETE(&(cov->mpp)); if (cov->ownkappanames != NULL) { int kappas = CovList[cov->nr].kappas; for (j=0; jownkappanames[j]); UNCONDFREE(cov->ownkappanames); } QFREE; // important check in combination with above; can be easily removed or // generalised !!!! FREE(cov->MLE); //MPPPROPERTIES_DELETE(&(cov->mpp)); cov->prevloc = NULL; LOC_DELETE(&(cov->ownloc)); if (cov->key != NULL) { // printf("deleting key %s\n", CovList[cov->key->nr].name); COV_DELETE(&(cov->key)); } if (cov->rf != NULL && cov->origrf) UNCONDFREE(cov->rf); ce_DELETE(&(cov->Sce)); localCE_DELETE(&(cov->SlocalCE)); approxCE_DELETE(&(cov->SapproxCE)); direct_DELETE(&(cov->Sdirect)); hyper_DELETE(&(cov->Shyper)); mixed_DELETE(&(cov->Smixed)); nugget_DELETE(&(cov->Snugget)); plus_DELETE(&(cov->Splus)); sequ_DELETE(&(cov->Ssequ)); // SPECTRAL_DELETE(&(cov->Sspectral)); trend_DELETE(&(cov->Strend)); tbm_DELETE(&(cov->Stbm)); br_DELETE(&(cov->Sbr)); get_DELETE(&(cov->Sget)); pgs_DELETE(&(cov->Spgs)); set_DELETE(&(cov->Sset)); polygon_DELETE(&(cov->Spolygon)); rect_DELETE(&(cov->Srect)); dollar_DELETE(&(cov->Sdollar)); gatter_DELETE(&(cov->Sgatter)); earth_DELETE(&(cov->Searth)); extra_DELETE(&(cov->Sextra)); RU_solve_DELETE(&(cov->Ssolve)); biwm_DELETE(&(cov->Sbiwm)); inv_DELETE(&(cov->Sinv)); scatter_DELETE(&(cov->Sscatter)); mcmc_DELETE(&(cov->Smcmc)); // SELECT_DELETE(&(cov->Sselect)); gen_DELETE(&(cov->Sgen)); likelihood_DELETE(&(cov->Slikelihood)); covariate_DELETE(&(cov->Scovariate)); simu_type *simu = &(cov->simu); simu->active = simu->pair = false; simu->expected_number_simu = 0; UNCONDFREE(*Cov); } void COV_DELETE_WITHOUT_LOC(cov_model **Cov) { cov_model *cov = *Cov; int i, nsub = CovList[cov->nr].maxsub; if (cov == NULL) { warning("*cov is NULL in COV_DELETE"); return; } //printf("COV_DEL %s\n", NAME(*Cov)); // PMI(cov, "delete"); assert(cov != NULL); for (i=0; isub[i] // seit 1.10.07: luecken erlaubt // bei PSgen ! if (cov->kappasub[i] != NULL) { // printf("%d %d %ld\n",i, MAXPARAM, cov->kappasub[i]); //PMI(cov); //assert(false); COV_DELETE_WITHOUT_LOC(cov->kappasub + i); } } for (i=0; isub[i] // seit 1.10.07: luecken erlaubt // bei PSgen ! // Achtung nach nsub koennen "blinde" Untermodelle kommen, die // nicht geloescht werden duerfen!! if (cov->sub[i] != NULL) COV_DELETE_WITHOUT_LOC(cov->sub + i); } COV_DELETE_WITHOUTSUB(Cov); } void COV_DELETE_(cov_model **Cov) { cov_model *cov = *Cov; // if (*Cov == NULL) crash(*Cov); assert(*Cov != NULL); // BUG;PMI(cov); // printf("del %s\n", NAME(cov)); if (cov->calling == NULL) LOC_DELETE(&(cov->prevloc)); COV_DELETE_WITHOUT_LOC(Cov); *Cov = NULL; } void SIMU_NULL(simu_type *simu) { simu->pair = simu->active = false; simu->expected_number_simu =0; } static int CovZaehler = 0; void COV_ALWAYS_NULL(cov_model *cov) { cov->zaehler = CovZaehler++; cov->calling = NULL; cov->prevloc = cov->ownloc = NULL; cov->checked = false; cov->MLE = NULL; cov->key = NULL; cov->rf = NULL; cov->mpp.mM = cov->mpp.mMplus = NULL; cov->mpp.moments = MISMATCH; cov->Sce = NULL; cov->SlocalCE = NULL; cov->SapproxCE = NULL; cov->Sdirect = NULL; cov->Shyper = NULL; cov->Smixed = NULL; cov->Snugget = NULL; cov->Splus = NULL; cov->Ssequ = NULL; cov->Stbm = NULL; cov->Strend = NULL; cov->Sbr = NULL; cov->Sget = NULL; cov->Spgs = NULL; cov->Sset = NULL; cov->Spolygon = NULL; cov->Srect = NULL; cov->Sdollar = NULL; cov->Sgatter = NULL; cov->Searth = NULL; cov->Sextra = NULL; cov->Ssolve = NULL; cov->Sbiwm = NULL; cov->Sinv = NULL; cov->Sscatter = NULL; cov->Smcmc = NULL; //cov->Sselect = NULL; cov->Sgen = NULL; cov->Slikelihood = NULL; cov->Scovariate = NULL; cov->Sbistable = NULL; cov->fieldreturn = cov->origrf = false; cov->initialised = false; } void COV_NULL(cov_model *cov) { int i, j; COV_ALWAYS_NULL(cov); cov->nr = cov->gatternr = cov->secondarygatternr = MISMATCH; for (i=0; incol[i] = cov->nrow[i] = 0; cov->kappasub[i] = NULL; } for (i=0; itaylor[i][j] = cov->tail[i][j] = 0.0; for ( ; j<=(int) TaylorExpPow; j++) cov->tail[i][j] = 0.0; } cov->q = NULL; cov->qlen = 0; for (i=0; isub[i] = NULL; cov->nsub = 0; cov->user_given = ug_internal; // to know which models are given by the // user and which ones have been added internally cov->role = ROLE_UNDEFINED; cov->typus = UndefinedType; cov->method = Forbidden; cov->tsdim = cov->xdimprev = cov->xdimown =cov->maxdim = cov->xdimgatter = UNSET; cov->vdim[0] = cov->vdim[1] = MISMATCH; cov->ownkappanames = NULL; cov->domown = cov->domprev = DOMAIN_MISMATCH; cov->isoown = cov->isoprev = ISO_MISMATCH; cov->logspeed = RF_NA; cov->delflag = 0; cov->full_derivs = cov->rese_derivs = MISMATCH; cov->ptwise_definite = pt_undefined; cov->deterministic = true; cov->monotone = MISMATCH; // cov->total_n = MISMATCH; // cov->total_sum = 0.0; cov->finiterange = cov->loggiven = // cov->diag = cov->semiseparatelast = cov->separatelast = cov->matrix_indep_of_x = false; cov->hess = cov->tbm2num = NOT_IMPLEMENTED; for (i=0; i<=Nothing; i++) cov->pref[i] = PREF_BEST; // mpp und extrG muessen auf NONE sein ! for (; i<=Forbidden; i++) cov->pref[i] = PREF_NONE; cov->taylorN = cov->tailN = 0; MPPPROPERTIES_NULL(&(cov->mpp)); SIMU_NULL(&(cov->simu)); // cov->localcov=NULL; } void FFT_NULL(FFT_storage *FFT) { if (FFT == NULL) return; FFT->work = NULL; FFT->iwork = NULL; } void FFT_destruct(FFT_storage *FFT) { FREE(FFT->iwork); FREE(FFT->work); FFT_NULL(FFT); } void ce_DELETE(ce_storage **S) { ce_storage *x = *S; if (x != NULL) { int l, vdim = x->vdim, vdimSQ = vdim * vdim; if (x->c!=NULL) { for(l=0; lc[l]); UNCONDFREE(x->c); } if (x->d!=NULL) { for(l=0; ld[l]); UNCONDFREE(x->d); } FFT_destruct(&(x->FFT)); FREE(x->aniso); FREE(x->gauss1); FREE(x->gauss2); UNCONDFREE(*S); } } void ce_NULL(ce_storage* x){ if (x == NULL) return; FFT_NULL(&(x->FFT)); x->positivedefinite = FALSE; x->trials = -1; x->c = x->d = NULL; x->smallestRe = x->largestAbsIm = RF_NA; x->aniso = NULL; x->stop = false; // cur_call_odd = false; // new_simulation_next = true; x->gauss1 = x->gauss2 = NULL; // int i; //for (i=0; i[i] = NULL; } void localCE_DELETE(localCE_storage**S) { localCE_storage* x = *S; if (x!=NULL) { FREE(x->correction); UNCONDFREE(*S); } } void localCE_NULL(localCE_storage* x){ // int i; for (i=0; icorrection = NULL; } void approxCE_DELETE(approxCE_storage **S) { approxCE_storage* x = * S; if (x != NULL) { FREE(x->idx); UNCONDFREE(*S); } } void approxCE_NULL(approxCE_storage* x){ if (x == NULL) return; x->idx = NULL; } void direct_DELETE(direct_storage ** S) { direct_storage *x = *S; if (x!=NULL) { FREE(x->G); UNCONDFREE(*S); } } void direct_NULL(direct_storage *x) { if (x == NULL) return; x->G = NULL; } void hyper_DELETE(hyper_storage **S) { hyper_storage *x = *S; if (x != NULL) { UNCONDFREE(*S); } } void hyper_NULL(hyper_storage* x) { if (x == NULL) return; } void mixed_DELETE(mixed_storage ** S) { mixed_storage *x = *S; if (x!=NULL) { FREE(x->Xb); FREE(x->mixedcov); UNCONDFREE(*S); } } void mixed_NULL(mixed_storage* x) { x->Xb = NULL; x->mixedcov = NULL; x->initialized = false; } void nugget_NULL(nugget_storage *x){ if (x == NULL) return; x->pos = NULL; x->red_field = NULL; } void nugget_DELETE(nugget_storage ** S) { nugget_storage *x = *S; if (x != NULL) { FREE(x->pos); FREE(x->red_field); UNCONDFREE(*S); } } void plus_NULL(plus_storage *x){ if (x != NULL) { int i; for (i=0; ikeys[i] = NULL; } } void plus_DELETE(plus_storage ** S){ plus_storage *x = *S; if (x != NULL) { int i; for (i=0; ikeys[i] != NULL) COV_DELETE(x->keys + i); UNCONDFREE(*S); } } void sequ_NULL(sequ_storage *x){ if (x == NULL) return; x->U11 = NULL; x->U22 = NULL; x->MuT = NULL; x->G = NULL; x->Cov21 = NULL; x->Inv22 = NULL; x->res0 = NULL; } void sequ_DELETE(sequ_storage ** S){ sequ_storage *x = *S; if (x!=NULL) { FREE(x->U11); FREE(x->U22); FREE(x->MuT); FREE(x->G); FREE(x->Cov21); FREE(x->Inv22); FREE(x->res0); UNCONDFREE(*S); } } void spectral_DELETE(spectral_storage **S) { spectral_storage *x = *S; if (x!=NULL) { // do NOT delete cov --- only pointer // spectral_storage *x; x = *((spectral_storage**)S); UNCONDFREE(*S); } } void spectral_NULL(spectral_storage *x) { if (x!=NULL) { } } void trend_DELETE(trend_storage ** S) { trend_storage *x = *S; if (x!=NULL) { FREE(x->x); FREE(x->xi); FREE(x->evalplane); FREE(x->powmatrix); UNCONDFREE(*S); } } void trend_NULL(trend_storage* x) { x->x = NULL; x->xi = NULL; x->evalplane = NULL; x->powmatrix = NULL; } void tbm_DELETE(tbm_storage **S) { tbm_storage *x = *S; if (x!=NULL) { UNCONDFREE(*S); } } void tbm_NULL(tbm_storage* x) { if (x == NULL) return; x->ce_dim = 0; x->err = ERRORFAILED; } void BRTREND_DELETE(double **BRtrend, int trendlen) { int j; if (BRtrend == NULL) return; for (j=0; jtrend != NULL) { BRTREND_DELETE(brS->trend, brS->trendlen); UNCONDFREE(brS->trend); } FREE(brS->shiftedloc); FREE(brS->loc2mem); if (brS->countvector != NULL) { for (i=0; ivertnumber; i++) FREE(brS->countvector[i]); UNCONDFREE(brS->countvector); } FREE(brS->areamatrix); FREE(brS->logvertnumber); FREE(brS->locindex); FREE(brS->suppmin); FREE(brS->suppmax); FREE(brS->locmin); FREE(brS->locmax); FREE(brS->loccentre); FREE(brS->mem2loc); FREE(brS->newx); if (brS->vario != NULL) COV_DELETE(&(brS->vario)); FREE(brS->lowerbounds); if (brS->submodel != NULL) COV_DELETE(&(brS->submodel)); UNCONDFREE(*S); } } void br_NULL(br_storage *brS) { brS->trend = NULL; brS->trendlen = 0; brS->next_am_check = NA_INTEGER; brS->shiftedloc = NULL; brS->mem2loc = brS->locindex = brS->loc2mem = NULL; brS->memcounter = 0; brS->newx = brS->suppmin = brS->suppmax = brS->locmin = brS->locmax = brS->loccentre = NULL; int i; for (i=0; isub[i] = NULL; } brS->lowerbounds = NULL; brS->vario = brS->submodel = NULL; brS->countvector = NULL; brS->areamatrix = NULL; brS->logvertnumber = NULL; } void pgs_DELETE(pgs_storage **S) { pgs_storage *x = *S; if (x!=NULL) { // Huetchen FREE(x->v); FREE(x->y); FREE(x->xgr[0]); FREE(x->pos); FREE(x->min); FREE(x->max); FREE(x->single); FREE(x->total); FREE(x->halfstepvector); FREE(x->localmin); FREE(x->localmax); FREE(x->minmean); FREE(x->maxmean); // rf_interface.cc FREE(x->supportmin); FREE(x->supportmax); FREE(x->supportcentre); FREE(x->own_grid_start); FREE(x->own_grid_step); FREE(x->own_grid_len); FREE(x->gridlen); FREE(x->end); FREE(x->start); FREE(x->delta); FREE(x->nx); FREE(x->xstart); FREE(x->x); FREE(x->inc); // variogramAndCo.cc: FREE(x->endy); FREE(x->startny); FREE(x->ptrcol); FREE(x->ptrrow); FREE(x->C0x); FREE(x->C0y); FREE(x->cross); FREE(x->z); FREE(x->Val); if (x->cov != NULL) { cov_model *dummy = x->cov; if (x->cov->Spgs != NULL && x->cov->Spgs->cov != NULL && x->cov->Spgs->cov->Spgs == x) { x->cov->Spgs->cov = NULL;// um "Unendlich"-Schleife zu vermeiden! } else { assert(x->cov->Spgs == NULL || x->cov->Spgs->cov == NULL || x->cov->Spgs->cov->Spgs == x); } x->cov = NULL; // Sicherheitshalber COV_DELETE(&(dummy)); } UNCONDFREE(*S); } } void pgs_NULL(pgs_storage* x) { if (x == NULL) return; x->log_density = x->intensity = x->globalmin = x->currentthreshold = RF_NEGINF; x->flat = x->estimated_zhou_c = x->logmean = false; x->totalmass = RF_NA; x->alpha = 1.0; // !! standard x->size = x->rowscols = -1; x->zhou_c = RF_NA; x->sq_zhou_c = x->sum_zhou_c = 0; x->n_zhou_c = 0; // Huetchen x->v = x->y = x->xgr[0] = NULL; x->pos = x->min = x->max = NULL; x->single = x->total = x->halfstepvector = NULL; x->localmin = x->localmax =x->minmean = x->maxmean = NULL; // rf_interface.cc x->supportmin = x->supportmax = x->supportcentre = // x->own_grid_start = x->own_grid_step = x->own_grid_len = NULL; // x->gridlen = x->end = x->start = x->delta = x->nx = NULL; // x->xstart = x->x = x->inc = NULL; // variogramAndCo.cc x->endy = x->startny = x->ptrcol = x->ptrrow = NULL; x->C0x = x->C0y = x->cross = x->z = NULL; x->Val = NULL; //x->param_set = NULL; x->cov = NULL; } void set_DELETE(set_storage **S) { set_storage *x = *S; if (x!=NULL) { UNCONDFREE(*S); } } void set_NULL(set_storage* x) { if (x == NULL) return; x->remote = NULL; x->set = NULL; x->variant = 0; } void polygon_DELETE(polygon_storage **S) { polygon_storage *x = *S; if (x != NULL) { if (x->vdual != NULL) { int i; for (i=0; in_vdual; i++) FREE(x->vdual[i]); UNCONDFREE(x->vdual); } FREE(x->vprim); if (x->P != NULL) { freePolygon(x->P); UNCONDFREE(x->P); } } UNCONDFREE(*S); } void polygon_NULL(polygon_storage* x) { if (x == NULL) return; x->vprim = NULL; x->vdual = NULL; x->n_vdual = x->n_vertex = x->n_v = 0; polygon *P = x->P; if (P == NULL) BUG; P->e = NULL; P->v = NULL; P->n = 0; } void rect_DELETE(rect_storage **S){ rect_storage *x = *S; if (x!=NULL) { FREE(x->value); FREE(x->weight); FREE(x->tmp_weight); FREE(x->right_endpoint); FREE(x->ysort); FREE(x->z); FREE(x->squeezed_dim); FREE(x->asSign); FREE(x->i); UNCONDFREE(*S); } } void rect_NULL(rect_storage* x) { if (x == NULL) return; x->tmp_n = x->nstep = -999; x->value = x->weight = x->tmp_weight = x->right_endpoint = x->ysort = x->z = NULL; // for PMI // x->inner = x->inner_const = x->inner_pow = x->outer = // x->outer_const = x->outer_pow = x->outer_pow_const = x->step = RF_NA; x->squeezed_dim = x->asSign = x->i = NULL; } void dollar_DELETE(dollar_storage **S) { dollar_storage *x = *S; if (x!=NULL) { FREE(x->z); FREE(x->z2); FREE(x->y); FREE(x->y2); FREE(x->save_aniso); FREE(x->inv_aniso); FREE(x->var); FREE(x->nx); FREE(x->len); FREE(x->total); FREE(x->cumsum); UNCONDFREE(*S); } } void dollar_NULL(dollar_storage* x) { if (x == NULL) return; x->z = x->z2 = x->y = x->y2 = x->save_aniso = x->inv_aniso = x->var = NULL; x->cumsum = x->nx = x->total = x->len = NULL; x->proj = 0; } void gatter_DELETE(gatter_storage **S) { gatter_storage *x = *S; if (x!=NULL) { FREE(x->z); UNCONDFREE(*S); } } void gatter_NULL(gatter_storage* x) { if (x == NULL) return; x->z = NULL; // x->zsys = NULL; } void earth_DELETE(earth_storage **S) { earth_storage *x = *S; if (x!=NULL) { FREE(x->X); FREE(x->Y); FREE(x->U); FREE(x->V); UNCONDFREE(*S); } } void earth_NULL(earth_storage* x) { if (x == NULL) return; x->X = x->Y = x->U = x->V = NULL; } void extra_DELETE(extra_storage **S) { extra_storage *x = *S; if (x!=NULL) { FREE(x->a); FREE(x->b); FREE(x->c); LOC_DELETE(&(x->loc)); UNCONDFREE(*S); } } void extra_NULL(extra_storage* x) { if (x == NULL) return; x->a = x->b = x->c = NULL; x->loc =NULL; } void biwm_DELETE(biwm_storage **S) { biwm_storage *x = *S; if (x!=NULL) { UNCONDFREE(*S); } } void biwm_NULL(biwm_storage* x) { if (x == NULL) return; } void bistable_DELETE(bistable_storage **S) { bistable_storage *x = *S; if (x!=NULL) { UNCONDFREE(*S); } } void bistable_NULL(bistable_storage* x) { if (x == NULL) return; } void inv_DELETE(inv_storage **S) { inv_storage *x = *S; if (x!=NULL) { FREE(x->v); FREE(x->wert); UNCONDFREE(*S); } } void inv_NULL(inv_storage* x) { if (x == NULL) return; x->v = NULL; x->wert = NULL; } void scatter_DELETE(scatter_storage **S) { scatter_storage *x = *S; if (x!=NULL) { FREE(x->nx); FREE(x->min); FREE(x->max); FREE(x->step); FREE(x->x); FREE(x->xmin); FREE(x->value); UNCONDFREE(*S); } } void scatter_NULL(scatter_storage* x) { if (x == NULL) return; x->dim = x->vdim = -1; x->min = x->max = x->nx = NULL; x->step = x->value = x->xmin = x->x = NULL; } void mcmc_DELETE(mcmc_storage **S) { mcmc_storage *x = *S; if (x!=NULL) { FREE(x->pos); FREE(x->deltapos); FREE(x->propdelta); FREE(x->proposed); UNCONDFREE(*S); } } void mcmc_NULL(mcmc_storage* x) { if (x == NULL) return; x->pos = x->deltapos = x->propdelta = x->proposed = NULL; //x->done = false; x->integral = 0.0; } void get_NULL(get_storage *s){ s->orig = s->get_cov = NULL; s->idx = NULL; s->param_nr = -1; } void get_DELETE(get_storage **S){ get_storage *x = *S; if (x != NULL) { FREE(x->idx); UNCONDFREE(*S); } } void gen_NULL(gen_storage *x) { int d; if (x == NULL) return; // x->mpp.newx = NULL; // for (d=0; dwindow.min[d] = x->window.max[d] = x->window.centre[d] = RF_NA; x->check = x->prodproc_random = x->dosimulate = true; x->Sspectral.phistep2d = x->Sspectral.phi2d = x->Sspectral.prop_factor = RF_NA; x->Sspectral.grid = false; x->spec.nmetro = -1; x->spec.sigma = -1.0; x->spec.density = NULL; for (d=0; dspec.E[d] = x->spec.sub_sd_cum[d] = RF_NA; } } void gen_DELETE(gen_storage **S) { gen_storage *x = *S; if (x != NULL) { UNCONDFREE(*S); } } void likelihood_info_DELETE(likelihood_info *x) { // nicht: Var, ptvariance ! FREE(x->Matrix); } void likelihood_info_NULL(likelihood_info *x) { if (x == NULL) return; x->varmodel = model_undefined; x->Var = NULL; // DO NOT FREE x->Matrix = x->pt_variance = NULL; // DO NOT FREE x->globalvariance = x->trans_inv = x->isotropic = false; x->newxdim = x->neffect = 0; for (int i=0; ieffect[i] = 0; x->nas[i] = 0; } } void likelihood_NULL(likelihood_storage *x) { if (x == NULL) return; x->datasets = NULL; x->X = x->YhatWithoutNA = NULL; x->XtX = x->XCY = x->XitXi = x->C = x->CinvXY = x->matrix = x->betavec = x->sumY = x->work = x->Cwork = x->Xwork = NULL; x->sets = x->fixedtrends = x->dettrends = x->random = x->max_total_data = x->maxbeta = 0; for (int i=0; ibetas[i] = x->nas[i] = x->nas_det[i] = x->nas_fixed[i] = x->nas_random[i] = x->nas_boxcox = x->nas_boxcox_mu = 0; x->cov_fixed[i] = x->cov_det[i] = x->cov_random[i] = NULL; // DO NOT FREE } x->where_fixed = NULL; x->data_nas = NULL; x->dettrend_has_nas = x->fixedtrend_has_nas = x->random_has_nas = x->betas_separate = x->ignore_trend = x->data_has_nas = false; for (int i=0; ibetanames[i]=NULL; } likelihood_info_NULL(&(x->info)); } void likelihood_DELETE(likelihood_storage **S) { likelihood_storage *x = *S; if (x != NULL) { //printf("likelihood del\n"); LIST_DELETE(&(x->datasets)); if (x->X != NULL) for (int i=0; isets; i++) FREE(x->X[i]); FREE(x->X); if (x->YhatWithoutNA != NULL) for (int i=0; isets; i++) FREE(x->YhatWithoutNA [i]); FREE(x->YhatWithoutNA); FREE(x->XCY); FREE(x->XtX); FREE(x->XitXi); FREE(x->C); FREE(x->CinvXY); FREE(x->Cwork); FREE(x->Xwork); FREE(x->matrix); FREE(x->betavec); FREE(x->work); //FREE(x->Yhat); FREE(x->where_fixed); FREE(x->sumY); FREE(x->data_nas); int end = x->betas[x->fixedtrends]; for (int i=0; ibetanames[i]); likelihood_info_DELETE(&(x->info)); UNCONDFREE(*S); } } /* likelihood_storage * likelihood_CREATEXXX(int n) { /// obsolete likelihood_storage * x = (likelihood_storage*) MALLOC(sizeof(likelihood_storage)); likelihood_NULL(x); x->datasets = LIST_CREATE(n, LISTOF + REALSXP); // x->withoutdet = LIST_CREATE(n, LISTOF + REALSXP); if ((x->X = (double**) CALLOC(n, sizeof(double*))) == NULL || (x->XtX = (double*) CALLOC(n, sizeof(double))) == NULL || (x->XitXi = (double*) CALLOC(n, sizeof(double))) == NULL || (x->CinvXY = (double*) CALLOC(n, sizeof(double))) == NULL || (x->data_nas = (bool*) CALLOC(n, sizeof(bool))) == NULL) err or("Memory allocation error for 'likelihood'"); x->sets = n; } */ void covariate_NULL(covariate_storage *x) { if (x == NULL) return; x->loc = NULL; x->matrix_err = MATRIX_NOT_CHECK_YET; } void covariate_DELETE(covariate_storage **S) { covariate_storage *x = *S; if (x != NULL) { if (x->loc != NULL) LOC_DELETE(&(x->loc)); UNCONDFREE(*S); } } void addModel(cov_model **pcov, int covnr, cov_model *calling, bool nullOK) { cov_model *cov; int i; // printf("addmodel: %s %ld\n", CovList[covnr].name, (long int) *pcov); cov = (cov_model*) MALLOC(sizeof(cov_model)); COV_NULL(cov); //assert(cov->calling == NULL); cov->nr = covnr; if (*pcov != NULL) { cov->nsub = 1; cov->calling = (*pcov)->calling; (*pcov)->calling = cov; cov->sub[0] = *pcov; for (i=0; i<=Forbidden; i++) { // cov->user[i] = cov->sub[0]->user[i]; cov->pref[i] = cov->sub[0]->pref[i]; // printf(">> %s %s %d %d\n", NAME(cov), NAME(cov->sub[0]), i, cov->pref[i]); } } // if (calling != NULL) //printf("addmodel calling %s cov %s\n", NAME(calling), NAME(cov)); if (calling != NULL) cov->calling = calling; else if (!nullOK && *pcov == NULL) { PRINTF("Missing link for model '%s'.\n", NICK(cov)); BUG; } *pcov = cov; } void addModel(cov_model **pcov, int covnr) { addModel(pcov, covnr, NULL, false); } void addModel(cov_model *pcov, int subnr, int covnr) { assert(pcov != NULL); bool newsub = pcov->sub[subnr] == NULL; addModel(pcov->sub + subnr, covnr, pcov, false); pcov->nsub += (int) newsub; } void addModelKappa(cov_model *pcov, int subnr, int covnr) { assert(pcov != NULL); addModel(pcov->kappasub + subnr, covnr, pcov, false); } void addModel(cov_model **pcov, int covnr, cov_model *calling) { addModel(pcov, covnr, calling, false); } int setgrid(coord_type xgr, double *x, long lx, int spatialdim) { if (lx!=3) { // PRINTF("%d\n", lx); // crash(); SERR("Problem with the coordinates (non-integer number of locations or non-positive step)") } int d; unsigned long totalBytes = sizeof(double) * lx * spatialdim; // nothing necessary for time if (xgr[0] == NULL && (xgr[0] =(double*) MALLOC(totalBytes))==NULL) return ERRORMEMORYALLOCATION; //printf(" %ld %d, %d %d, \n", x, lx, spatialdim, totalBytes); //printf("setgrid %d\n", totalBytes); MEMCOPY(xgr[0], x, totalBytes); // folgende Zeile nur beim ersten Mal zu setzen, aber egal for (d=1; d GLOBAL.internal.examples_reduced) { warning("the size of the example has been reduced"); xgr[d][XLENGTH] = GLOBAL.internal.examples_reduced; } } } */ return NOERROR; } int partial_loc_set(location_type *loc, double *x, double *y, long lx, long ly, bool dist, int xdimOZ, double *T, bool grid, bool cpy){ int d, err; unsigned long totalBytes; if (lx >= MAXINT || ly >= MAXINT) SERR("too many points"); STRCPY(ERROR_LOC, "setting the locations:"); if (((loc->x != NULL) && ((loc->y == NULL) xor (ly==0))) || ((loc->xgr[0] != NULL) && ((loc->ygr[0] == NULL) xor (ly==0)))) { // 28783440 51590192 0; 0 0 0 dist=0 //printf("%ld %ld %d; %ld %ld %d dist=%d\n", (long int) loc->x, (long int)loc->y, ly, (long int) loc->xgr[0], (long int) loc->ygr[0], ly, loc->distances); SERR("domain structure of the first and second call do not match"); } assert(x != NULL); /* if (GLOBAL.internal.examples_reduced) { if (lx > GLOBAL.internal.examples_reduced) { // lx = GLOBAL.internal.examples_reduced; warning("The size of the example has been reduced."); } if (ly > GLOBAL.internal.examples_reduced) { ly = GLOBAL.internal.examples_reduced; warning("The size of y-coordinates in the example has been reduced."); } } */ loc->xdimOZ = xdimOZ; // ohne Zeit !! loc->lx = lx; loc->ly = ly; if (ly > 0) { //crash(); if (dist) { SERR("distances are not allowed if y is given"); } } // printf("partial_loc_set grid=%d dim=%d %f %f %f\n %f %f %f\n", grid, xdimOZ + (T!=NULL), x[0],x[1],x[2],x[3],x[4],x[5]); loc->grid = grid; loc->distances = dist; if (loc->delete_y && loc->y != loc->x) FREE(loc->y); if (loc->delete_x) FREE(loc->x); loc->delete_x = loc->delete_y = cpy; if (lx == 0) return NOERROR; if (grid) { loc->delete_x = true; if ((err = setgrid(loc->xgr, x, lx, loc->spatialdim)) !=NOERROR) return err; if (ly>0) { if (x == y) { for(d=0; dspatialdim; d++) loc->ygr[d] = loc->xgr[d]; loc->delete_y = false; } else { if ((err = setgrid(loc->ygr, y, ly, loc->spatialdim)) !=NOERROR) return err; } } double len = 1.0; for (d=0; dspatialdim; d++) len *= loc->xgr[d][XLENGTH]; assert(len == (int) len); if (len < MAXINT) loc->totalpoints = loc->spatialtotalpoints = (int) len; else SERR("too many locations"); } else if (dist) { // lx : anzahl der Puntke involviert, d.h. x muss die Laenge lx ( lx -1) / 2 // haben. if (lx > 0) { if (cpy) { totalBytes = sizeof(double) * lx * (lx - 1) / 2 * xdimOZ; if ((loc->x=(double*) MALLOC(totalBytes))==NULL){ return ERRORMEMORYALLOCATION; } MEMCOPY(loc->x, x, totalBytes); } else { loc->x = x; } } loc->totalpoints = loc->spatialtotalpoints = lx; // (int) (1e-9 + 0.5 * (1.0 + SQRT(1.0 + 8.0 * lx))); // if (0.5 * (loc->totalpoints * (loc->totalpoints - 1.0)) != lx) { //printf("tot=%d %d %d\n", loc->totalpoints, (int) ( 0.5 * (loc->totalpoints * (loc->totalpoints - 1.0))), (int) lx); assert(false); // SERR("distances do not have expected size"); //} } else { // not grid, not distances if (cpy) { totalBytes = sizeof(double) * lx * loc->xdimOZ; // assert(x != NULL); // printf("PARTIAL : "); assert(loc != NULL && loc->x == NULL); //printf("\ntotalbyets %d %ld %d\n", totalBytes, lx, loc->xdimOZ); if ((loc->x=(double*) MALLOC(totalBytes)) == NULL){ return ERRORMEMORYALLOCATION; } assert(loc->x != NULL); // MEMCOPY(loc->x, x, totalBytes); // for (int k=0; kxdimOZ; k++) loc->x[k] = x[k]; // for (int k=0; k<10; printf("%f ", x[k++])); if (loc->ly>0) { if (x == y) { loc->y = loc->x; loc->delete_y = false; } else { totalBytes = sizeof(double) * ly * loc->xdimOZ; //printf("totalbytes y %d %ld %d\n", totalBytes, ly, loc->xdimOZ); if ((loc->y=(double*) MALLOC(totalBytes))==NULL){ return ERRORMEMORYALLOCATION; } MEMCOPY(loc->y, y, totalBytes); } } } else { loc->x = x; loc->y = y; } //printf("getnset %d\n", lx); loc->totalpoints = loc->spatialtotalpoints = lx; // just to say that considering these values does not make sense } if ((loc->Time) xor (T!=NULL)) { //cov_model *cov; crash(cov); // AERR(1); SERR("partial_loc: time mismatch"); } if (loc->Time) { MEMCOPY(loc->T, T, sizeof(double) * 3); if (grid) { loc->xgr[loc->spatialdim] = loc->T; if (ly>0) loc->ygr[loc->spatialdim] = loc->T; } if (loc->T[XLENGTH] <= 0) { //crash(); SERR1("The number of temporal points is not positive. Check the triple definition of 'T' in the man pages of '%s'.", CovList[SIMULATE].nick); } /* else if (GLOBAL.internal.examples_reduced && loc->T[XLENGTH] > GLOBAL.internal.examples_reduced) { loc->T[XLENGTH] = GLOBAL.internal.examples_reduced; warning("The length of the tiem component in the example has been reduced."); } */ if ((double) loc->totalpoints * loc->T[XLENGTH] >= MAXINT) SERR("too many space-time locations"); loc->totalpoints *= (int) loc->T[XLENGTH]; } return NOERROR; } int loc_set(double *x, double *y, double *T, int spatialdim, /* spatial dim only ! */ int xdimOZ, long lx, long ly, bool Time, bool grid, bool distances, location_type **Loc) { int err; //unsigned long totalBytes; // preference lists, distinguished by grid==true/false and dimension // lists must end with Nothing! //printf("%d %d\n", spatialdim, Time); if (xdimOZ < spatialdim) { if (distances) { if (xdimOZ != 1) SERR("reduced dimension is not one"); } else { SERR3("dim (%d) of 'x' does not fit the spatial dim (%d); Time=%d", xdimOZ,spatialdim, Time); } } else if (xdimOZ > spatialdim) { SERR3("mismatch of dimensions (xdim=%d > space=%d; Time=%d)", xdimOZ, spatialdim, Time); } int len = *Loc == NULL ? 1 : (*Loc)->len; if (*Loc != NULL && (*Loc)->lx > 0) { BUG; LOC_SINGLE_DELETE(Loc); *Loc = (location_type*) MALLOC(sizeof(location_type)); } location_type *loc = *Loc; LOC_SINGLE_NULL(loc, len); loc->timespacedim = spatialdim + (int) Time; loc->spatialdim = spatialdim; loc->Time = Time; if (spatialdim<1 || loc->timespacedim>MAXSIMUDIM) return ERRORDIM; assert(x != NULL); if ((err = partial_loc_set(*Loc, x, y, lx, ly, distances, xdimOZ, Time ? T : NULL, grid, true)) != NOERROR) XERR(err); return NOERROR; } int loc_set(double *x, double *y, double *T, int spatialdim, /* spatial dim only ! */ int xdimOZ, long lx, long ly, bool Time, bool grid, bool distances, cov_model *cov) { int err, store = GLOBAL.general.set; GLOBAL.general.set = 0; // print("XXXXXXXXXXx\n"); // pmi(cov, 1); LOC_DELETE(&(cov->ownloc)); assert(cov->ownloc == NULL); LOCLIST_CREATE(cov, 1); // locown assert(cov->ownloc != NULL); assert(PLoc(cov) != cov->prevloc); // PMI(cov); // print("%ld %ld; %ld %f,%f,%f lx=%d %d time=%d grid=%d, %d %ld\n", cov->prevloc, cov->ownloc, x, x[0], x[1], x[2], lx, ly, Time , grid, distances, PLoc(cov)); err = loc_set(x, y, T, spatialdim, xdimOZ, lx, ly, Time, grid, distances, PLoc(cov)); // Errorhandling: GLOBAL.general.set = store; return err; } int loc_set(double *x, double *T, int spatialdim, // spatial dim only ! int xdimOZ, // original ! long lx, bool Time, bool grid, bool distances, location_type **Loc) { return loc_set(x, NULL, T, spatialdim, xdimOZ, lx, 0, Time, grid, distances, Loc); } int loc_set(double *x, double *T, int spatialdim, /* spatial dim only ! */ int xdimOZ, /* original ! */ long lx, bool Time, bool grid, bool distances, cov_model *cov) { return loc_set(x, NULL, T, spatialdim, xdimOZ, lx, 0, Time, grid, distances, cov); } location_type ** loc_set(SEXP xlist, bool distances_ok){ bool listoflists = (TYPEOF(xlist) == VECSXP && TYPEOF(VECTOR_ELT(xlist, 0)) == VECSXP); int lx, err, spatialdim, xdimOZ = -1, sets = !listoflists ? 1 : length(xlist); bool Time = false, distances = false; location_type **loc; // printf("sets %d \n", sets); loc = LOCLIST_CREATE(sets); for (int i=0; iownloc == NULL) { LOCLIST_CREATE(cov, 1); Loc(cov)->delete_ x = false; } else { loc = Loc(cov); if (loc->xgr[0] != NULL || loc->x != NULL) BUG; } loc->totalpoints = totalpoints; return NOERROR; } */ void analyse_matrix(double *aniso, int row, int col, bool *diag, bool *quasidiag, int *idx, bool *semiseparatelast, bool *separatelast) { // diag, falls durch einfuegen von spalten diag-Matrix erhalten // werden kann // see also Type -- can it be unified ???? /* -> i | * 0 0 j 0 0 * 0 * 0 */ bool notquasidiag=true, *taken=NULL; int j, k, startidx, i; if (aniso == NULL) { *diag = *quasidiag = *separatelast = *semiseparatelast = true; for (i=0; i= row; } if (!(*semiseparatelast = *diag)) { /* * * 0 * * 0 * * * */ int last = col * row - 1; for (k=last - row + 1; k= 0) return match; return Match(name, CovNames, currentNrCov); } void MultiDimRange(int set, cov_model *cov, double *natscale) { int wave, i, redxdim, d, idx, xdimprev = cov->xdimprev, vdim = cov->vdim[0], store = GLOBAL.general.set, err = NOERROR; double y, yold, x[MAXGETNATSCALE], threshold, natsc, factor, Sign, newx, xsave, newy, *dummy = NULL, rel_threshold = 0.05; bool domain = cov->domown ==XONLY; // covfct cf=NULL; // nonstat_covfct ncf=NULL; assert(MAXGETNATSCALE <= MAXCOVDIM); // ZERO redxdim = cov->xdimown; GLOBAL.general.set = set; if (redxdim > MAXGETNATSCALE) { err = -1; goto ErrorHandling; } if ((dummy = (double*) MALLOC(sizeof(double) * vdim * vdim)) == NULL) { err = -2; goto ErrorHandling; } if (cov->full_derivs < 0) { err=ERRORNOTDEFINED; goto ErrorHandling; } if (domain) { COV(ZERO, cov, dummy); } else { NONSTATCOV(ZERO, ZERO, cov, dummy); } threshold = rel_threshold * dummy[0]; for (d=0; d threshold) { factor = 2.0; Sign = 1.0; } else { factor = 0.5; Sign = -1.0; } double otherx; x[idx] *= factor; if (domain) COV(x, cov, dummy) else NONSTATCOV(ZERO, x, cov, dummy); y = dummy[0]; while (Sign * (y - threshold) > 0) { if (yold10) { err=ERRORWAVING; goto ErrorHandling; } } yold = y; x[idx] *= factor; if (x[idx]>1E30) { err=ERRORRESCALING; goto ErrorHandling; } if (domain) COV(x, cov, dummy) else NONSTATCOV(ZERO, x, cov, dummy); y = dummy[0]; } otherx = x[idx] / factor; for (i=0; i<3 /* good choice?? */ ;i++) { if (y==yold) { err=ERRORWAVING; goto ErrorHandling; } newx = x[idx] + (x[idx]-otherx)/(y-yold)*(threshold-y); xsave = x[idx]; x[idx] = newx; if (domain) COV(x, cov, dummy) else NONSTATCOV(ZERO, x, cov, dummy); newy = dummy[0]; x[idx] = xsave; if (Sign * (newy - threshold) > 0) { otherx = newx; yold = newy; } else { x[idx] = newx; y = newy; } } if (y==yold) { err=ERRORWAVING; goto ErrorHandling; } natsc = 1.0 / ( x[idx] + (x[idx]-otherx)/(y-yold)*(threshold-y) ); if (redxdim == xdimprev || d==0) { natscale[d] = natsc; } else { int beg, end; if (redxdim == 2) { if (d==0) { beg = 0; end = xdimprev-1; } else { beg = end = xdimprev-1; } } else { beg = 0; end = xdimprev; } for (i=beg; inr; // nicht gatternr *natscale = 0.0; if (C->maxsub!=0) XERR(ERRORFAILED); if (!is_any(ISOTROPIC, C) || cov->isoown != ISOTROPIC || C->domain != XONLY || !isPosDef(cov->typus) || C->vdim != SCALAR) ERR("anisotropic function not allowed"); if (C->finiterange == true) { *natscale = 1.0; return; } if (C->inverse!=NULL) { C->inverse(&GLOBAL.gauss.approx_zero, cov, natscale); *natscale = 1.0 / *natscale; if (ISNAN(*natscale) || *natscale != 0.0) { return; } } if (NS != NATSCALE_ORNUMERIC) XERR(ERRORRESCALING); if ((C->cov)==nugget) XERR(ERRORRESCALING); // already calculated ? // parami=KAPPA; // do not compare mean,variance, etc. // if (oldcovnr==*covnr) { // for (; parami<=LASTKAPPA; parami++) { // if (oldp[parami]!=p[parami]) { // break; // } // } // if (parami > LASTKAPPA) { // *natscale=OldNatScale; // return; // } // } // for (; parami<=LASTKAPPA; parami++) {oldp[parami]=p[parami];} /* ************************************** Now, find a quick and good solution for NewInvScale -- */ assert(cov->xdimown == 1); MultiDimRange(0, cov, natscale); } void Getxsimugr(coord_type x, double *aniso, int timespacedim, double **xsimugr) { // bisher nur fuer Diagonalmatrizen int n, i, w; if (aniso == NULL) { for(w=0; wtaylorN = from->taylorN; to->tailN = from->tailN; for(i=0; itaylorN; i++) { for (j=0; j<=TaylorPow; j++) to->taylor[i][j] = from->taylor[i][j]; } for(i=0; itailN; i++) { for (j=0; j<=TaylorExpPow; j++) to->tail[i][j] = from->tail[i][j]; } } void paramcpy(cov_model *to, cov_model *from, bool freeing, // of all the parameters bool force_allocating, // in "c ovcpy" notwendig bool copy_lists, // die Unterlisten der LISTOF-Parameter bool recursive, bool copy_mpp) { cov_fct *C = CovList + from->nr; // nicht gatternr double **pto = to->px, **pfrom = from->px; int i, v, n = -1, *to_col = to->ncol, *to_row = to->nrow, *from_col = from->ncol, *from_row = from->nrow; bool same_model = std::abs(to->nr - from->nr) <= 1 || (isDollar(to) && isDollar(from)); if (!same_model) { BUG; } for (i=0; ikappatype[i] >= LISTOF) { int len = from_row[i]; listoftype *p = PARAMLIST(from, i); //printf("paramcpy %d %d %d %ld %d\n", copy_lists, from->zaehler, to->zaehler, (long int) (pto + i), pto[i] == NULL); if (copy_lists) { listcpy((listoftype **) (pto + i), p, force_allocating); } else { listpt((listoftype **) (pto + i), p, len, C->kappatype[i], force_allocating); } } else if (isRObject(C->kappatype[i])) { n = sizeof(sexp_type); if (pto[i] == NULL || force_allocating) pto[i] = (double*) MALLOC(n); MEMCOPY(pto[i], pfrom[i], n); ((sexp_type *) pto[i])->Delete = false; } else { if (C->kappatype[i]==REALSXP) { n = sizeof(double); } else if (C->kappatype[i]==INTSXP) { n = sizeof(int); } else BUG; n *= from_row[i] * from_col[i]; // printf("i=%d to=%s %s from=%s %s %d\n", i, //NICK(to), CovList[to->nr].kappanames[i], // NICK(from), CovList[from->nr].kappanames[i], n); if (pto[i] == NULL || force_allocating) pto[i] = (double*) MALLOC(n); MEMCOPY(pto[i], pfrom[i], n); } } if (copy_mpp) { // PMI(to); PMI(from); if (to->mpp.moments < 0 && alloc_mpp_M(to, from->mpp.moments)!=NOERROR) ERR("error in allocating memory for Poisson point process data"); if (to->mpp.moments != from->mpp.moments) BUG; //printf("size = %d\n", sizeof(mpp_properties)); assert(sizeof(mpp_properties) == 96); mpp_properties *To = &(to->mpp), *From=&(from->mpp); assert(To != NULL && From != NULL); // To->sum_zhou_c = From->sum_zhou_c; // To->sq_zhou_c = From->sq_zhou_c; int vdim = from->vdim[0]; for (v=0; vmaxheights[v] = From->maxheights[v]; To->unnormedmass = From->unnormedmass; // To->zhou_c = From->zhou_c; assert(To->mM != NULL && To->mMplus != NULL); int nmP1 = To->moments + 1; MEMCOPY(To->mM, From->mM, nmP1 * sizeof(double)); MEMCOPY(To->mMplus, From->mMplus, nmP1 * sizeof(double)); if (to->qlen != from->qlen) BUG; if (from->qlen > 0) { assert(to->q != NULL); MEMCOPY(to->q, from->q, (to->qlen)* sizeof(double)); } } if (recursive) { for (i=0; isub[i] != NULL) { assert(to->sub[i] != NULL); paramcpy(to->sub[i], from->sub[i], freeing, force_allocating, copy_lists, recursive, copy_mpp); } } //PMI(to, "to"); } int covCpy(cov_model **localcov, bool sub, cov_model *cov, // err location_type **prevloc, location_type **ownloc, bool copy_lists, bool copy_randomparam, bool allowCopyingInterface) { assert(cov != NULL); int i, n = -1; //cov_fct *C = CovList + cov->nr; // nicht gatternr //PMI(cov); if ((*localcov = (cov_model*) MALLOC(sizeof(cov_model)))==0) return ERRORMEMORYALLOCATION; cov_model *current = *localcov; MEMCOPY(current, cov, sizeof(cov_model)); // replaces COV_NULL(*localcov); COV_ALWAYS_NULL(current); current->calling = NULL; //printf("covCpy!\n"); paramcpy(current, cov, false, true, copy_lists, false, false); if (cov->ownkappanames != NULL) { int nkappas = CovList[cov->nr].kappas; current->ownkappanames = (char**) CALLOC(nkappas, sizeof(char*)); for (i=0; iownkappanames[i] != NULL) { current->ownkappanames[i] = (char*) MALLOC(sizeof(char) * (1 + STRLEN(cov->ownkappanames[i]))); STRCPY(current->ownkappanames[i], cov->ownkappanames[i]); } } } if (cov->q != NULL) { n = sizeof(double) * current->qlen; current->q = (double*) MALLOC(n); // QALLOC NOT APPROPRIATE MEMCOPY(current->q, cov->q, n); } else assert(current->qlen==0); current->prevloc = ownloc != NULL ? ownloc : cov->prevloc == prevloc ? prevloc : NULL; if (current->prevloc == cov->prevloc && cov->calling==NULL) { if (!isInterface(cov)) { BUG; } if (!allowCopyingInterface) {PRINTF("\n\n***** unallowed copying ******\n"); BUG;} } for (i=0; ikappasub[i] = NULL; if (cov->kappasub[i] == NULL || !copy_randomparam) continue; err = covCpy(current->kappasub + i, true, cov->kappasub[i], prevloc, ownloc, copy_lists, copy_randomparam, false); if (err != NOERROR) return err; current->kappasub[i]->calling = current; } if (sub) { for (i=0; isub[i] = NULL; if (cov->sub[i] == NULL) continue; err = covCpy(current->sub + i, sub, cov->sub[i], prevloc, ownloc, copy_lists, copy_randomparam, false); if (err != NOERROR) return err; current->sub[i]->calling = current; } } else { for (i=0; isub[i] = NULL; } // PMI(*localcov, "end err=covCpy"); return NOERROR; } int covCpy(cov_model **localcov, cov_model *cov) { //err bool cov2key = &(cov->key)==localcov; // PMI(cov); int err = covCpy(localcov, true, cov, cov->prevloc, NULL, false, true, false);//err // PMI(*localcov); if (err == NOERROR) (*localcov)->calling = cov2key || cov->calling==NULL ? cov : cov->calling; // falls !cov2key && cov->calling == NULL; dann gibt es nur einen Verweis // rueckwaerts! Muss aber sein, da sonst LOC_DELETE bei cov->calling==NULL // versucht cov->prevloc zu loeschen. oder es muesste prevloc auf NULL // gesetzt zu werden. Dies scheint eher contraproduktiv zu sein. return err; } int covCpyWithoutRandomParam(cov_model **localcov, cov_model *cov) {//err bool cov2key = &(cov->key)==localcov; int err = covCpy(localcov, true, cov, cov->prevloc, NULL, false, false, false); if (err == NOERROR) (*localcov)->calling = cov2key || cov->calling==NULL ? cov : cov->calling; // falls !cov2key && cov->calling == NULL; dann gibt es nur einen Verweis // rueckwaerts! Muss aber sein, da sonst LOC_DELETE bei cov->calling==NULL // versucht cov->prevloc zu loeschen. oder es muesste prevloc auf NULL // gesetzt zu werden. Dies scheint eher contraproduktiv zu sein. return err; } int covCpy(cov_model **localcov, cov_model *cov, bool copy_lists) {//err bool cov2key = &(cov->key)==localcov; int err = covCpy(localcov, true, cov, cov->prevloc, NULL, copy_lists, true, false); if (err == NOERROR) (*localcov)->calling = cov2key || cov->calling==NULL ? cov : cov->calling; // falls !cov2key && cov->calling == NULL; dann gibt es nur einen Verweis // rueckwaerts! Muss aber sein, da sonst LOC_DELETE bei cov->calling==NULL // versucht cov->prevloc zu loeschen. oder es muesste prevloc auf NULL // gesetzt zu werden. Dies scheint eher contraproduktiv zu sein. return err; } int covCpy(cov_model **localcov, cov_model *cov, //err double *x, double *T, int spatialdim, int xdimOZ, long lx, bool Time, bool grid, bool distances) { bool cov2key = &(cov->key)==localcov; int err; location_type **loc = LOCLIST_CREATE(1); err = loc_set(x, T, spatialdim, xdimOZ, lx, Time, grid, distances, loc); if (err != NOERROR) return err; if ((err = covCpy(localcov, true, cov, loc, NULL, false, true, false)) != NOERROR) return err; (*localcov)->prevloc = cov->prevloc; (*localcov)->ownloc = loc; (*localcov)->calling = cov2key || cov->calling==NULL ? cov : cov->calling; return NOERROR; } cov_model *getRemote(cov_model *remotecov, cov_model *rmt, cov_model *target) { cov_model *found; int i; if (rmt == target) return remotecov; for (i=0; ikappasub[i] != NULL) { if (remotecov->kappasub[i] == NULL) BUG; found = getRemote(remotecov->kappasub[i], rmt->kappasub[i], target); if (found != NULL) return found; } } for (i=0; isub[i] != NULL) { if (remotecov->sub[i] == NULL) BUG; found = getRemote(remotecov->sub[i], rmt->sub[i], target); if (found != NULL) return found; } } return NULL; } void Ssetcpy(cov_model *localcov, cov_model *remotecov, cov_model *cov, cov_model *rmt) { int i; if (cov->Sset != NULL) { localcov->Sset = (set_storage*) MALLOC(sizeof(set_storage)); MEMCOPY(localcov->Sset, cov->Sset, sizeof(set_storage)); localcov->Sset->remote = getRemote(remotecov, rmt, cov->Sset->remote); if (localcov->Sset->remote == NULL) BUG; } for (i=0; ikappasub[i] != NULL) { if (localcov->kappasub[i] == NULL) BUG; Ssetcpy(localcov->kappasub[i], remotecov, cov->kappasub[i], rmt); } } for (i=0; isub[i] != NULL) { if (localcov->sub[i] == NULL) BUG; Ssetcpy(localcov->sub[i], remotecov, cov->sub[i], rmt); } } } int newmodel_covCpy(cov_model **localcov, int model, cov_model *cov, //err double *x, double *y, double *T, int spatialdim, /* spatial dim only ! */ int xdimOZ, long lx, long ly, bool Time, bool grid, bool distances) { Types type = CovList[model].Typi[0]; assert(type == InterfaceType && CovList[model].variants == 1); // anderes z.zt nicht benutzt int i, err; assert(*localcov == NULL); addModel(localcov, model, NULL, true); cov_model *neu = *localcov; assert(neu->ownloc==NULL && neu->prevloc==NULL); if (type == InterfaceType) neu->prevloc = LOCLIST_CREATE(1); // locown else BUG; assert(cov->prevloc != NULL); assert(PLoc(cov) == cov->prevloc); loc_set(x, y, T, spatialdim, xdimOZ, lx, ly, Time, grid, distances, neu); if ((err = covCpy(neu->sub + 0, cov)) != NOERROR) return err; // PMI(neu, "hier"); neu->sub[0]->calling = neu; // PMI(neu); //printf("newmodel %s %s\n", NICK(cov), TYPENAMES[CovList[cov->nr].Type]); for (i=0; i<2; i++) { if ((err = CHECK(neu, cov->tsdim, cov->xdimprev, // CovList[cov->nr].Type,Martin:changed 27.11.13 //cov->typus,// auch nicht 20.5.14 type, type == InterfaceType ? XONLY : cov->domprev, type == InterfaceType ? CARTESIAN_COORD : cov->isoprev, cov->vdim, ROLE_BASE)) != NOERROR) { return err; } if (i==0 && (err = STRUCT(neu, NULL)) != NOERROR) return err; } return NOERROR; } int newmodel_covCpy(cov_model **localcov, int model, cov_model *cov) {//err int err, store = GLOBAL.general.set; GLOBAL.general.set = 0; location_type *loc = Loc(cov); err = newmodel_covCpy(localcov, model, cov, loc->grid ? loc->xgr[0] : loc->x, loc->grid ? loc->ygr[0] : loc->y, loc->grid ? loc->xgr[0] + 3 * loc->spatialdim : loc->T, loc->spatialdim, loc->xdimOZ, loc->grid ? 3 : loc->totalpoints, loc->ly == 0 ? 0 : loc->grid ? 3 : loc->totalpoints, loc->Time, loc->grid, loc->distances); GLOBAL.general.set = store; return err; } double *getAnisoMatrix(cov_model *cov, bool null_if_id, int *nrow, int *ncol) { int origdim = PrevLoc(cov)->timespacedim; if (!isAnyDollar(cov) && null_if_id) { // probably not used anymore *nrow = *ncol = origdim; return NULL; } double *ani, *aniso = P(DANISO), a = PisNULL(DSCALE) ? 1.0 : 1.0 / P0(DSCALE); int i, total, *proj = PINT(DPROJ), dimP1 = origdim + 1; if (aniso != NULL) { total = origdim * cov->ncol[DANISO]; int bytes = total * sizeof(double); ani = (double *) MALLOC(bytes); MEMCOPY(ani, aniso, bytes); for (i=0; inrow[DANISO]; *ncol = cov->ncol[DANISO]; } else if (proj != NULL) { int projs = cov->nrow[DPROJ]; total = origdim * projs; ani = (double *) CALLOC(total, sizeof(double)); for (i=0; inrow[DPROJ]; } else { if (a == 1.0 && null_if_id) { *nrow = *ncol = origdim; return NULL; } total = origdim * origdim; ani = (double *) CALLOC(total, sizeof(double)); for (i=0; itimespacedim, spatialdim = loc->spatialdim; double distsq, dummy, *lx=NULL, *sx=NULL, diameter=0.0; if (loc->grid) { double *origmin = (double*) MALLOC(origdim * sizeof(double)), *origmax = (double*) MALLOC(origdim * sizeof(double)), *origcenter = (double*) MALLOC(origdim * sizeof(double)); for (d=0; dxgr[d][XSTEP] > 0) { origmin[d] = loc->xgr[d][XSTART]; origmax[d] = loc->xgr[d][XSTART] + loc->xgr[d][XSTEP] * (loc->xgr[d][XLENGTH] - 1.0); } else { origmin[d] = loc->xgr[d][XSTART] + loc->xgr[d][XSTEP] * (double) (loc->xgr[d][XLENGTH] - 1.0); origmax[d] = loc->xgr[d][XSTART]; } origcenter[d] = 0.5 * (origmin[d] + origmax[d]); } if (!docaniso || loc->caniso == NULL) { for (d=0; dcaniso, origdim, spatialdim, center); for (d=0; dcaniso, origdim, spatialdim, sx); // suche maximale Distanz von center zu transformierter Ecke distsq = 0.0; for (d=0; d sx[d]) min[d] = sx[d]; if (max[d] < sx[d]) max[d] = sx[d]; dummy = center[d] - sx[d]; distsq += dummy * dummy; } if (distsq > diameter) diameter = distsq; } UNCONDFREE(j); UNCONDFREE(lx); UNCONDFREE(sx); } UNCONDFREE(origmin); UNCONDFREE(origmax); UNCONDFREE(origcenter); } else { // not loc->grid if (loc->caniso != NULL) BUG; double *xx=loc->x; int i, endfor = loc->spatialtotalpoints * spatialdim; for (d=0; d max[d]) max[d] = xx[i]; } } if (loc->Time) { assert(d == origdim - 1); if (loc->T[XSTEP] > 0) { min[d] = loc->T[XSTART]; max[d] = loc->T[XSTART] + loc->T[XSTEP] * (loc->T[XLENGTH] - 1.0); } else { min[d] = loc->T[XSTART] + loc->T[XSTEP] * (loc->T[XLENGTH] - 1.0); max[d] = loc->T[XSTART]; } } for (diameter=0.0, d=0; dtimespacedim; dummymin = (double*) MALLOC(origdim * sizeof(double)); dummymax = (double*) MALLOC(origdim * sizeof(double)); dummycenter = (double*) MALLOC(origdim * sizeof(double)); diam = GetDiameter(loc, dummymin, dummymax, dummycenter, true); UNCONDFREE(dummymin); UNCONDFREE(dummymax); UNCONDFREE(dummycenter); return diam; } bool ok_n(int n, int *f, int nf) // taken from fourier.c of R { int i; for (i = 0; i < nf; i++) while(n % f[i] == 0) if ((n /= f[i]) == 1) return TRUE; return n == 1; } int nextn(int n, int *f, int nf) // taken from fourier.c of R { while(!ok_n(n, f, nf)) { n++; } return n; } #define F_NUMBERS1 3 #define F_NUMBERS2 3 bool HOMEMADE_NICEFFT=false; unsigned long NiceFFTNumber(unsigned long n) { unsigned long i,ii,j,jj,l,ll,min, m=1; if (HOMEMADE_NICEFFT) { int f[F_NUMBERS1]={2,3,5}; if (n<=1) return n; for (i=0; i10000)) { m*=f[i]; n/=f[i]; } if (n>10000) { while (n>10000) {m*=10; n/=10;} n++; } min = 10000000; for (i=0, ii=1; i<=14; i++, ii<<=1) { // 2^14>10.000 if (ii>=n) { if (ii10.000 if (jj>=n) { if (jj10.000 //if (kk>=n) { if (kk10.000 // instead of (if 7 is included) for (l=0, ll=jj; l<=6; l++, ll*=5) {// 5^5>10.000 if (ll>=n) { if (ll=xgr[i][XLENGTH]) { yi[i]=0; y[i] = xgr[i][XSTART]; if (i nrow) { for (i=ncol * ncol; i < endfor; i++) if (m[i]!= 0.0) return TypeMany; ncol = nrow; // !! } for (k=0; k type) type = newtype; k++; m += nrow; continue; TimeInvestigation: if (k == ncol - 1) return TypeMany; type = TypeMtimesep; k = ncol - 1; m = M + k * nrow; } return type; } void TransformLocExt(cov_model *cov, bool timesep, int gridexpand, // false, true, GRIDEXPAND_AVOID bool same_nr_of_points, double **grani, double **SpaceTime, double **caniso, int *Nrow, int *Ncol,//caniso obsolete bool *Time, bool *grid, int *newdim, bool takeX, bool involvedollar) { // this fctn transforms the coordinates according to the anisotropy matrix // tbm TransformLoc-Aufruf im prinzip kritisch location_type *loc = Loc(cov); bool isdollar = isAnyDollar(cov) && involvedollar; matrix_type type; int nrow = -1, ncol = -1, origdim = loc->caniso == NULL ? loc->timespacedim : loc->cani_nrow, dim = (isdollar ? (!PisNULL(DANISO) ? cov->ncol[DANISO] : !PisNULL(DPROJ) ? cov->nrow[DPROJ] : origdim ) : origdim); double *aniso, *T = loc->T, *x = takeX ? loc->x : loc->y; coord_type *xgr= takeX ? &(loc->xgr) : &(loc->ygr); if (x==NULL && (*xgr)[0] ==NULL) ERR("locations are all NULL"); *newdim = dim; // printf("dim %d %d %d\n", dim , origdim, loc->spatialdim); *caniso = NULL; *Nrow = *Ncol = -1; *grani = NULL; *SpaceTime = NULL; if (isdollar) { aniso = getAnisoMatrix(cov, true, &nrow, &ncol); } else { aniso = NULL; nrow = ncol = PrevLoc(cov)->timespacedim; } if (loc->caniso != NULL) { if (aniso == NULL) { unsigned long bytes = sizeof(double) * loc->cani_nrow * loc->cani_ncol; aniso =(double*) MALLOC(bytes); MEMCOPY(aniso, loc->caniso, bytes); nrow = loc->cani_nrow; ncol = loc->cani_ncol; } else { double *aniso_old = aniso; assert(loc->cani_ncol == nrow); aniso = matrixmult(loc->caniso, aniso_old, loc->cani_nrow, nrow, ncol); nrow = loc->cani_nrow; UNCONDFREE(aniso_old); } } type = aniso == NULL ? TypeMiso : Type(aniso, origdim, dim); // printf("type = %d\n", type); *Time = loc->Time; *grid = false; assert(origdim == nrow); assert(dim == ncol); if (loc->grid) { assert(*xgr != NULL); if (gridexpand==true || (gridexpand==GRIDEXPAND_AVOID && !isMproj(type))) { if (timesep && isMtimesep(type) && *Time) { // space //print("%ld %d %d;\n", aniso, nrow, ncol); // printf("aniso=%f %f %f\n %f %f %f\n %f %f %f\n; %d %d\n", aniso[0], aniso[1],aniso[2], aniso[3], aniso[4], aniso[5], aniso[6], aniso[7], aniso[8], nrow, ncol); expandgrid(*xgr, SpaceTime, aniso, nrow - 1, nrow, ncol - 1); // time grid2grid(*xgr + loc->spatialdim, grani, aniso == NULL ? NULL : aniso + nrow * (ncol-1), 1, 1); } else { *Time = false;// time is also expanded, if given expandgrid(*xgr, SpaceTime, aniso, nrow, nrow, ncol); } } else if (isMproj(type) && (!same_nr_of_points || ncol==nrow)) { // grid wird multipliziert und/oder umsortiert grid2grid(*xgr, grani, aniso, nrow, ncol); *grid = true; *Time = false; // no need to have time extra } else { // !gridexpand, !isMproj, but still grid // z.B. plusmalS.cc falls TBM_INTERN // nur aniso auf grid multipliziert int i,d,k; (*grani) = (double *) MALLOC(sizeof(double) * 3 * origdim); for (k=d=0; dcalling->calling->calling->calling->calling->calling); // APMI(cov); // printf("Time = %d %d %d type=%d %d\n", *Time, timesep, isMtimesep(type), type,TypeMtimesepproj); // printf("aniso %f %f %f\n", aniso[0], aniso[1], aniso[2]); //if (dim==1) BUG; if (! *Time) { // no grid no time x2x(x, loc->spatialtotalpoints, SpaceTime, aniso, nrow, nrow, ncol); } else if (timesep && isMtimesep(type)) { // no grid, but timesep //PMI(cov); //printf("%d %d %d\n", same_nr_of_points && ncol, nrow); if (same_nr_of_points && ncol!=nrow) { // do not reduce x2x(x, loc->spatialtotalpoints, SpaceTime, aniso, nrow, nrow-1, ncol-1); grid2grid(&T, grani, aniso==NULL ? NULL : aniso + nrow*ncol - 1, 1, 1); } else if (aniso != NULL && aniso[nrow * ncol - 1]==0.0) {//no time comp x2x(x, loc->spatialtotalpoints, SpaceTime, aniso, nrow, nrow - 1, ncol); *Time = false; } else { // both time and space are left, and time is separated x2x(x, loc->spatialtotalpoints, SpaceTime, aniso, nrow, nrow - 1, ncol - 1); grid2grid(&T, grani, aniso==NULL ? NULL : aniso + nrow*ncol - 1, 1, 1); } } else if (ncol == 1 && type == TypeMproj && aniso[nrow - 1] && !same_nr_of_points) { //only time component left assert(nrow != ncol); *Time = false; *grid = true; grid2grid(&T, grani, aniso==NULL ? NULL : aniso + nrow*ncol - 1, 1, 1); } else { // no grid, but time, no timesep || not isMtimesep(type) xtime2x(x, loc->spatialtotalpoints, T, SpaceTime, aniso, nrow, ncol); *Time = false; } } FREE(aniso); // printf("NCOL %d\n", *ncol); } void TransformCovLoc(cov_model *cov, bool timesep, int gridexpand, bool same_nr_of_points, bool involvedollar) { location_type *loc = PrevLoc(cov); // transform2nogrid assert(loc != NULL); bool Time, grid; int err, spacedim=-1, nrow=-1, ncol=-1; double *xgr=NULL, *x = NULL, *caniso = NULL; //printf("%s %s %d\n", NAME(cov), NAME(cov->sub[0]), Loc(cov)->spatialdim); if ((loc->y != NULL && loc->y != loc->x) || (loc->ygr[0] != NULL && loc->ygr[0] != loc->xgr[0])) { ERR("unexpected y coordinates"); } assert(cov->prevloc != NULL); TransformLocExt(cov, timesep, gridexpand, same_nr_of_points, &xgr, &x, &caniso, &nrow, &ncol, &Time, &grid, &spacedim, true, involvedollar); if (Time) spacedim--; assert(cov->ownloc == NULL); if (spacedim > 0) { // pmi(cov,0); printf("%d %d time=%d %d\n", grid, spacedim, Time, loc->totalpoints); err = loc_set(grid ? xgr : x, grid ? xgr + 3 * spacedim : xgr, spacedim, spacedim, grid ? 3 : loc->spatialtotalpoints, Time, grid, false, cov); } else { assert(Time); err = loc_set(xgr, NULL, 1, 1, 3, false, true, false, cov); } // falls not gridexpand und nicht diag bzw. proj location_type *ownloc = Loc(cov); assert(ownloc->caniso == NULL); ownloc->caniso = caniso; ownloc->cani_nrow = nrow; ownloc->cani_ncol = ncol; caniso = NULL; FREE(x); FREE(xgr); if (err != NOERROR) ERR("error when transforming to no grid"); } void TransformLoc(cov_model *cov, bool timesep, int gridexpand, bool involvedollar) { TransformCovLoc(cov, timesep, gridexpand, true, involvedollar); } void TransformLocReduce(cov_model *cov, bool timesep, int gridexpand, bool involvedollar) { TransformCovLoc(cov, timesep, gridexpand, false, involvedollar); } int TransformLoc(cov_model *cov, double **xx, bool involvedollar) { bool Time, grid; int newdim, nrow, ncol; double *caniso = NULL, *SpaceTime = NULL; TransformLocExt(cov, false, true, true, &SpaceTime, xx, &caniso, &nrow, &ncol, &Time, &grid, &newdim, true, involvedollar); assert(caniso == NULL && SpaceTime ==NULL); return newdim; } int TransformLoc(cov_model *cov, double **xx, double **yy, bool involvedollar) { location_type *loc = Loc(cov); bool Time, grid; int newdim, nrow, ncol; double *caniso = NULL, *SpaceTime = NULL; TransformLocExt(cov, false, true, true, &SpaceTime, xx, &caniso,&nrow, &ncol, &Time, &grid, &newdim, true, involvedollar); assert(caniso == NULL && SpaceTime ==NULL); if (loc->y == NULL && loc->ygr[0] == NULL) *yy = NULL; else TransformLocExt(cov, false, true, true, &SpaceTime, yy, &caniso, &nrow, &ncol, &Time, &grid, &newdim, false, involvedollar); assert(caniso == NULL && SpaceTime ==NULL); return newdim; } double *selectlines(double *m, int *sel, int nsel, int nrow, int ncol) { // selects lines in matrix m according to sel int j; double *red_matrix, *Red_Matrix = (double *) MALLOC(sizeof(double) * nsel * ncol), *endfor = Red_Matrix + nsel * ncol; for (red_matrix=Red_Matrix; red_matrixnr; // nicht gatternr // printf("entering TC %s requiredtype=%s undefined!\n", NAME(cov), TYPENAMES[requiredtype]); if (isUndefined(C)) { assert(C->TypeFct != NULL); // printf(" undefined!\n"); int tc = C->TypeFct(requiredtype, cov, depth); // printf("tc=%d %s\n", tc, NAME(cov)); return tc; } int i; for (i=0; ivariants; i++) { // printf("TC %d %s: %d %s %s %d %d \n", i, NAME(cov), TypeConsistency(requiredtype, C->Typi[i]), TYPENAMES[requiredtype], TYPENAMES[C->Typi[i]], depth, depth<=0 ); if (TypeConsistency(requiredtype, C->Typi[i]) && (depth <= 0 || atleastSpecialised(cov->isoown, C->Isotropy[i])) ) { // printf("ok ? %d \n", i +1); return i + 1; } } // printf("not ok %s\n", NAME(cov)); return false; } int get_internal_ranges(cov_model *cov, cov_model *min, cov_model *max, cov_model *pmin, cov_model *pmax, cov_model *openmin, cov_model *openmax) { cov_fct *C = CovList + cov->nr; // nicht gatternr int err = NOERROR, k = 0, i = 0, // compiler dummy values kappas = C->kappas ; range_type range; rangefct getrange = C->range; SEXPTYPE *type = C->kappatype; // print("entry %s \n", NAME(cov)); //PMI(cov, "gir"); if (kappas > 0) { getrange(cov, &range); // PMI(cov); assert (cov->maxdim < 0 || cov->maxdim >= cov->tsdim); err = NOERROR; for (i=0; incol[i] * cov->nrow[i]; double dmin, dmax, dpmin, dpmax, dopenmin, dopenmax, value = RF_NA; dpmin = range.pmin[i]; dpmax = range.pmax[i]; dmin = range.min[i]; dmax = range.max[i]; dopenmin = (double) range.openmin[i]; dopenmax = (double) range.openmax[i]; // unsigned int xxx = POW(2, 32) - 1; // signed int yyy = (signed int) (double) xxx; // print("%u %d NA=%d %f NA_LOG=%d '%s'\n", xxx, yyy, NA_INTEGER, (double) NA_INTEGER, NA_LOGICAL, NA_STRING); BUG; if (type[i] == INTSXP) { if (dmin < -MAXINT) { #ifdef RANDOMFIELDS_DEBUGGING PRINTF("%s MAXINT) { #ifdef RANDOMFIELDS_DEBUGGING PRINTF("%s >max %s\n", NICK(cov), KNAME(i)); BUG; #else dmax = (double) MAXINT; #endif } } // printf("%s %d %d %d %d\n", NAME(cov), i, type[i], REALSXP, INTSXP); for (k=0; kdeletelist) { int j, lenj = p->nrow[k] * p->ncol[k]; double *qmin = PARAMLIST(min, i)->lpx[k], *qmax = PARAMLIST(max, i)->lpx[k], *ppmin = PARAMLIST(pmin, i)->lpx[k], *ppmax = PARAMLIST(pmax, i)->lpx[k], *omin = PARAMLIST(openmin, i)->lpx[k], *omax = PARAMLIST(openmax, i)->lpx[k]; for (j=0; j dmax || (range.openmin[i] && value == dmin) || (range.openmax[i] && value == dmax) ) { SPRINTF(ERRORSTRING, "value (%f) of '%s' in '%s' not within interval %s%f,%f%s", value, C->kappanames[i], NICK(cov), range.openmin[i] ? "(" : "[", dmin, dmax, range.openmax[i] ? ")" : "]" ); return ERRORM; } } // for k } // for i in kappas; } // if (kappa > 0) for (i=0; ikappasub[i] != NULL) { err = get_internal_ranges(cov->kappasub[i], min->kappasub[i], max->kappasub[i], pmin->kappasub[i], pmax->kappasub[i], openmin->kappasub[i], openmax->kappasub[i]); if (err != NOERROR) return err; } } for (i=0; isub[i] != NULL) { err = get_internal_ranges(cov->sub[i], min->sub[i], max->sub[i], pmin->sub[i], pmax->sub[i], openmin->sub[i], openmax->sub[i]); if (err != NOERROR) return err; } } return NOERROR; } void strround(double x, char *s){ if (x==RF_INF) SPRINTF(s, "Inf"); else if (x==RF_NEGINF) SPRINTF(s, "-Inf"); else if (x == FLOOR(x + 0.5)) SPRINTF(s, "%d", (int) x); else SPRINTF(s, "%f", x); } void addmsg(double value, const char *Sign, double y, char *msg) { char str1[30], str2[30]; if ( FABS(value - y) <= 1e-8 * y) { SPRINTF(msg, "%12.12e %s %12.12e", value, Sign, y); } else { strround(value, str1); strround(y, str2); SPRINTF(msg, "%s %s %s", str1, Sign, str2); } } void addone(char *str, double x) { char str2[30]; strround(x, str2); SPRINTF(str, "%s, %s", str, str2); } void addpair(char *str, double x, double y) { if (x == FLOOR(x + 0.5) && y==floor(y + 0.5)) SPRINTF(str, "%s, (%d,%d)", str, (int) x, int(y)); else SPRINTF(str, "%s, (%f,%f)", str, x, y); } int check_within_range(cov_model *cov, bool NAOK) { // sets also maxdim and finiterange in cov ! cov_fct *C = CovList + cov->nr; //nicht gatternr int len, err = NOERROR, k = 0, i = 0, // compiler dummy values kappas = C->kappas; range_type range; SEXPTYPE *type = C->kappatype; rangefct getrange = C->range; char Msg[255] = ""; double min, max, value= RF_NA; if (GLOBAL_UTILS->basic.skipchecks) return NOERROR; getrange(cov, &range); if (cov->maxdim >=0 && cov->maxdim < cov->tsdim) { GERR2("Max. dimension is %d. Got %d", cov->maxdim, cov->tsdim); } for (i=0; ikappasub[i] != NULL) continue; if (!STRCMP(C->kappanames[i], FREEVARIABLE)) { // i.e. equal if (PisNULL(i)) continue; } if (type[i] >= LISTOF) { // to simplify things -- otherwise in simu.cc // code must also be changed. assert(range.min[i] == RF_NEGINF && range.max[i]==RF_INF); continue; } // full range !! len = cov->ncol[i] * cov->nrow[i]; min = range.min[i]; max = range.max[i]; // print("%s i=%d [%f, %f] size=%d %s\n", // C->name, i, range.min[i], range.max[i], len, C->kappanames[i]); for (k=0; kkappanames[i], k+1); if (ISNAN(value)) { if (NAOK) { continue; } else GERR2("%s[%d] is not finite.", C->kappanames[i], k+1); } // print("k=%d %f\n", k, value); // print("range %d %d %d op=%d %f %f %f\n", // kappas, i, k, range.openmin[i], value, min, max); err = ERRORUNSPECIFIED; if (range.openmin[i] && value <= min) { addmsg(value, ">", min, Msg); goto ErrorHandling; } else if (value < min) { addmsg(value, ">=", min, Msg); goto ErrorHandling; } if (range.openmax[i] && value >= max) { addmsg(value, "<", max, Msg); goto ErrorHandling; } else if (value > max) { addmsg(value, "<=", max, Msg); goto ErrorHandling; } err = NOERROR; } } // kappas ErrorHandling: // PMI(cov, "range"); if (err != NOERROR) { if (PL>PL_ERRORS) PRINTF("error in check range: %s kappa%d err=%d ('%s' does not hold.)\n", C->name, i+1, err, Msg); if (err == ERRORUNSPECIFIED) SERR4("%s[%d] = %s does not hold (dim=%d).", C->kappanames[i], k+1, Msg, cov->tsdim); // + return } return err; } int get_ranges(cov_model *cov, cov_model **min, cov_model **max, cov_model **pmin, cov_model **pmax, cov_model **openmin, cov_model **openmax) { int err; // returns a reliable value only in the very first // entry of each parameter vector/matrix int err; if ((err = covCpy(min, cov, true)) != NOERROR) return err; if ((err = covCpy(max, cov, true)) != NOERROR) return err; if ((err = covCpy(pmin, cov, true)) != NOERROR) return err; if ((err = covCpy(pmax, cov, true)) != NOERROR) return err; if ((err = covCpy(openmin, cov, true)) != NOERROR) return err; if (( err = covCpy(openmax, cov, true)) != NOERROR) return err; (*min)->calling = (*max)->calling = (*pmin)->calling = (*pmax)->calling = (*openmin)->calling = (*openmax)->calling = cov; // (*min)->calling = NULL; ja nicht auf NULL setzen, da sonst angenommen // wird, dass prevloc ein Original ist return get_internal_ranges(cov, *min, *max, *pmin, *pmax, *openmin, *openmax); } int FieldReturn(cov_model *cov) { location_type *loc = Loc(cov); if (cov->rf != NULL) { //PMI(cov, "fieldreturn"); assert(cov->fieldreturn && cov->origrf); if (cov->origrf) { UNCONDFREE(cov->rf); } } if ((cov->rf = (double*) MALLOC(sizeof(double) * loc->totalpoints * cov->vdim[0])) == NULL) return ERRORMEMORYALLOCATION; cov->fieldreturn = cov->origrf = true; return NOERROR; } void SetLoc2NewLoc(cov_model *cov, location_type **loc) { int i, maxsub = CovList[cov->nr].maxsub; if (cov->ownloc != NULL) { return; } for (i=0; ikappasub[i] != NULL) SetLoc2NewLoc(cov->kappasub[i], loc); } cov->prevloc = loc; for (i=0; isub[i] != NULL) SetLoc2NewLoc(cov->sub[i], loc); } if (cov->key != NULL) SetLoc2NewLoc(cov->key, loc); } bool verysimple(cov_model *cov) { assert(cov != NULL); cov_fct *C = CovList + cov->nr; // kein gatternr, da isotrop int i, k, total, kappas = C->kappas; for (k=0; kkappasub[k] != NULL) return false; total = cov->ncol[k] * cov->nrow[k]; if (C->kappatype[k] == REALSXP) { for (i=0; ikappatype[k] == INTSXP) { for (i=0; i #include //#include //#include #include #include #include #include "RF.h" #include "Operator.h" //#include "Operator.h" #include "Coordinate_systems.h" #define MAXNN 100000000.0 /* max number of points simulated on a line */ #define TBM_LINES (COMMON_GAUSS + 4) #define TBM_LINESIMUFACTOR (COMMON_GAUSS + 5) #define TBM_LINESIMUSTEP (COMMON_GAUSS + 6) #define TBM_CENTER (COMMON_GAUSS + 7) #define TBM_POINTS (COMMON_GAUSS + 8) #define TBM_COV 0 #define BUFFER 4.0 void unitvector3D(int projectiondim, double *deltax, double *deltay, double *deltaz) { switch (projectiondim) { // create random unit vector case 1 : *deltax= 2.0 * UNIFORM_RANDOM - 1.0; *deltaz = *deltay = 0.0; break; case 2 : *deltaz = 0.0; *deltax= 2.0 *UNIFORM_RANDOM - 1.0;// see Martin's tech rep for details *deltay= SQRT(1.0 - *deltax * *deltax) * SIN(UNIFORM_RANDOM*TWOPI); break; case 3 : double dummy; *deltaz = 2.0 * UNIFORM_RANDOM - 1.0; // ir case of multivariate dummy = SQRT(1.0 - *deltaz * *deltaz); *deltay = UNIFORM_RANDOM * TWOPI; *deltax = COS(*deltay) * dummy; *deltay = SIN(*deltay) * dummy; break; default : BUG; } } cov_model* get_user_input(cov_model *cov) { // loc_user sind nicht die prevloc data, sondern, die die der Nutzer // eingegeben hatte !! Zumindest in erster Naehrung // Problem hier falls intern aufgerufen wurde -- Abhilfe: layer muss // zwingend gesetzt sein cov_model *user=cov; while (user->calling != NULL) user = user->calling; return user; } int get_subdim(cov_model *cov, bool Time, bool *ce_dim2, int *ce_dim, int *effectivedim) { cov_model *next = cov->sub[TBM_COV]; int fulldim = P0INT(TBM_FULLDIM); double layers = P0(TBM_LAYERS); *effectivedim = cov->tsdim; if (Time) { *ce_dim2 = (!ISNA(layers) && layers) || next->isoown==SPACEISOTROPIC || *effectivedim == 1 + fulldim; *effectivedim -= *ce_dim2; if (*ce_dim2 && !ISNA(layers) && !layers) { SERR1("value of '%s' does not match the situation", KNAME(TBM_LAYERS)) } } else { *ce_dim2 = false; } if (*effectivedim > fulldim) return ERRORWRONGDIM; *ce_dim = 1 + (int) *ce_dim2; return NOERROR; } void tbm_kappasproc(int i, cov_model *cov, int *nr, int *nc){ kappaGProc(i, cov, nr, nc); int dim = cov->tsdim; // printf("tbm kappas %d %d %d\n", i, TBM_CENTER, dim); if (i==TBM_CENTER) *nr = dim; } void rangetbmproc(cov_model *cov, range_type *range){ GAUSS_COMMON_RANGE; rangetbm_common(cov, range, false); range->min[TBM_LINES] = 1.0; range->max[TBM_LINES] = RF_INF; range->pmin[TBM_LINES] = 1.0; range->pmax[TBM_LINES] = 10000; range->openmin[TBM_LINES] = false; range->openmax[TBM_LINES] = true; range->min[TBM_LINESIMUFACTOR] = 0.0; range->max[TBM_LINESIMUFACTOR] = RF_INF; range->pmin[TBM_LINESIMUFACTOR] = 0.0; range->pmax[TBM_LINESIMUFACTOR] = 10.0; range->openmin[TBM_LINESIMUFACTOR] = false; range->openmax[TBM_LINESIMUFACTOR] = true; range->min[TBM_LINESIMUSTEP] = 0.0; range->max[TBM_LINESIMUSTEP] = RF_INF; range->pmin[TBM_LINESIMUSTEP] = 0.0; range->pmax[TBM_LINESIMUSTEP] = 10.0; range->openmin[TBM_LINESIMUSTEP] = false; range->openmax[TBM_LINESIMUSTEP] = true; // range->min[TBM_GRID] = 0; //range->max[TBM_GRID] = 1; // range->pmin[TBM_GRID] = 0; // range->pmax[TBM_GRID] = 1; // range->openmin[TBM_GRID] = false; // range->openmax[TBM_GRID] = false; range->min[TBM_CENTER] = RF_NEGINF; range->max[TBM_CENTER] = RF_INF; range->pmin[TBM_CENTER] = -1000000; range->pmax[TBM_CENTER] = 1000000; range->openmin[TBM_CENTER] = false; range->openmax[TBM_CENTER] = true; range->min[TBM_POINTS] = 0; range->max[TBM_POINTS] = RF_INF; range->pmin[TBM_POINTS] = 0; range->pmax[TBM_POINTS] = 1000; range->openmin[TBM_POINTS] = false; range->openmax[TBM_POINTS] = true; } int checktbmproc(cov_model *cov) { #define NSEL 2 cov_model *next=cov->sub[TBM_COV], *key =cov->key, *sub = key==NULL ? next : key; int i, err = NOERROR, isoselect[NSEL+1]={ISOTROPIC, SPACEISOTROPIC, SYMMETRIC}, nsel = NSEL, dim = cov->tsdim; // taken[MAX DIM], tbm_param *gp = &(GLOBAL.tbm); ASSERT_CARTESIAN; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if (GLOBAL.general.vdim_close_together && cov->vdim[0] > 1) SERR1("TBM only allowed if '%s=FALSE'", general[GENERAL_CLOSE]); ROLE_ASSERT(ROLE_GAUSS); // printf("%s fulldim %d %d\n", NICK(cov), fulldim, 0); // printf("%s fulldim %d %d\n", NICK(cov), // fulldim, gp->lines[fulldim-1]);assert(false); //PMI(cov); kdefault(cov, TBM_FULLDIM, gp->fulldim); kdefault(cov, TBM_FULLDIM, PisNULL(TBM_TBMDIM) || gp->tbmdim >= 0 ? gp->fulldim : P0INT(TBM_TBMDIM) - gp->tbmdim); kdefault(cov, TBM_TBMDIM, gp->tbmdim > 0 ? gp->tbmdim : P0INT(TBM_FULLDIM) + gp->tbmdim); kdefault(cov, TBM_LAYERS, gp->layers); int tbmdim = P0INT(TBM_TBMDIM), fulldim = P0INT(TBM_FULLDIM); if (tbmdim >= fulldim) { SERR4("'%s' (=%d) must be less than '%s' (=%d)", KNAME(TBMOP_TBMDIM), tbmdim, KNAME(TBM_FULLDIM), fulldim); } kdefault(cov, TBM_LINES, gp->lines[fulldim-1]); kdefault(cov, TBM_LINESIMUFACTOR, gp->linesimufactor); kdefault(cov, TBM_LINESIMUSTEP, gp->linesimustep); // kdefault(cov, TBM_GRID, gp->grid); // if ( P0INT(TBM_GRID)) // warning("grid parameter for tbm not programmed yet"); if (PisNULL(TBM_CENTER)) { PALLOC(TBM_CENTER, dim, 1); for (i=0; icenter[i]; } } else { if (cov->nrow[TBM_CENTER] < dim) SERR1("vector for '%s' too short", KNAME(TBM_CENTER)); } // kdefault(cov, TBM_POINTS, gp->points); // printf("%d\n", gp->points); // PMI(cov); if ((err = checkkappas(cov, false)) != NOERROR) return err; // PMI(cov); //printf("key/next/sub %ld %ld %ld\n", key, next, sub);// assert(false); if (key == NULL && isVariogram(sub)) { // Abfolge Tbm $(Aniso) iso-model braucht Moeglichkeit des // anisotropen Modells if (cov->role == ROLE_BASE) nsel++; for (i=0; irole == ROLE_BASE ? KERNEL : XONLY); // PMI(sub); if ((err = CHECK(sub, dim, dim, VariogramType, cov->role == ROLE_BASE ? KERNEL : XONLY, // wegen // nutzer eingabe aniso und dem allerersten check isoselect[i], SUBMODEL_DEP, ROLE_COV)) == NOERROR) break; } // assert(false); if (i==nsel) { // // printf("%d %d %d\n", cov->role, ROLE_BASE, nsel); //APMI(cov); // SPRINTF(ERROR_LOC, "%s: ", NICK(cov)); SERR("Its submodel could not be identified as isotropic or space-isotropic and positive definite function."); } } else { // sub->nr > FIRSTGAUSSPROC || key != NULL bool dummy; int dummydim, newdim; if (key != NULL) { // falls hier gelandet, so ruft TBMINTERN TBM auf!! if (cov->nr == TBM_PROC_USER) { cov_model *intern = sub; while (intern != NULL && //intern->nr != TBM_PROC_INTERN && (isAnyDollar(intern) || intern->nr == TBM_PROC_USER // )) intern = intern->key != NULL ? intern->key : intern->sub[0]; if (intern == NULL) { // APMI(key); BUG; } else if (intern != cov) paramcpy(intern, cov, true, true, false, false, false); } } if (cov->nr == TBM_PROC_USER) newdim = dim; else if ((err = get_subdim(cov, PrevLoc(get_user_input(cov))->Time, &dummy, &newdim, &dummydim)) != NOERROR) return err; //PMI(sub); printf("nd %d\n", newdim); assert(newdim == 1); //PMI(sub); if ((err = CHECK(sub, newdim, newdim, ProcessType, XONLY, CARTESIAN_COORD, SUBMODEL_DEP, cov->role == ROLE_BASE ? cov->role : ROLE_GAUSS)) != NOERROR) { return err; } } setbackward(cov, sub); cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov)) != NOERROR) return err; // PMI(cov); // //printf("OK\n"); return NOERROR; } int struct_tbmproc(cov_model *cov, cov_model **newmodel) { cov_model *next = cov->sub[TBM_COV]; ASSERT_NEWMODEL_NULL; if (next->pref[TBM] == PREF_NONE) { return ERRORPREFNONE; } // PMI(cov, "start struct tbmproc"); assert(false); assert(cov->nr == TBM_PROC_INTERN); cov_model *user = get_user_input(cov); location_type *loc_user = PrevLoc(user); double linesimufactor, tbm_linesimustep = P0(TBM_LINESIMUSTEP), tbm_linesimufactor = P0(TBM_LINESIMUFACTOR); int d, err=NOERROR, // tbm_lines = P0INT(TBM_LINES), fulldim = P0INT(TBM_FULLDIM), tbmdim = P0INT(TBM_TBMDIM), // endaniso = origdim * origdim - 1, *points = PINT(TBM_POINTS), user_dim = loc_user->timespacedim; long user_spatialpoints = loc_user->spatialtotalpoints, user_spatialdim = loc_user->spatialdim // the isotropic part (i.e. time might be not considered) ; bool ce_dim2=false; if (cov->role != ROLE_GAUSS && cov->role != ROLE_BASE){ return ERRORFAILED; } /****************************************************************/ /* Determination of the dimensions */ /****************************************************************/ // einfache checks // extraktion von covarianzfunktion mit gleichartiger anisotropie // time-komponente wird nicht ge-checked da letzter parameter true // bereitstellung von param, quotient, multiply /* in tbm, time component must be ALWAYS alone, i.e. matrix looks like * * 0 * * 0 * * x -- this is checked late on here x may be any constant. In case x is zero (for all matrices (0..actcov-1), the last dimension vanishes (performed in the next step) the asterixes build submatrices for (v=1..actcov-1) that are multiple of the submatrix for v=0, already checked by Check */ if (tbmdim != 1 || (fulldim != 2 && fulldim != 3)) SERR5("'%s' only works for %s =1 and %s=2 or 3. Got %d %d", NICK(cov), KNAME(TBM_TBMDIM), KNAME(TBM_FULLDIM), tbmdim, fulldim); if (cov->tsdim > MAXTBMSPDIM) return ERRORMAXDIMMETH; // in theory it works also for variograms! if (!isVariogram(next->typus) || next->domown != XONLY) return ERRORNOVARIOGRAM; if (user_dim == 1) SERR("dimension must currently be at least 2 and at most 4 for TBM"); NEW_STORAGE(tbm); tbm_storage *s = cov->Stbm; if ((err=get_subdim(cov, loc_user->Time, &ce_dim2, &(s->ce_dim), &(s->simuspatialdim))) != NOERROR) return err; /****************************************************************/ /* determine grid distance for the line */ /****************************************************************/ // sort out which finer grid should be used in the spatial domain for // low dimensional simulation if (PL>=PL_STRUCTURE) PRINTF("\ndetermining the length of line segment..."); // PrintMethodInfo(meth); // minimum distance between the points linesimufactor = -1.0; if (tbm_linesimustep > 0.0) linesimufactor = 1.0 / tbm_linesimustep; else if (tbm_linesimufactor > 0) { double mindelta = RF_INF; int spDim = user_dim - (int) ce_dim2; // eigentlich muesste man // es das Urbild der Zeitachse abziehen... Egal. Fuer den Ausbau reicht es. if (loc_user->grid) { // if linesimufactor, the fine grid scale is proportional to smallest // distance in the grid. for (d=0; dxgr[d][XSTEP]xgr[d][XSTEP]>0)) { mindelta=loc_user->xgr[d][XSTEP]; } } } else { long j, i, k0, k1, k2; if (user_spatialpoints > 10000) { SERR1("too many points to determine smallest distance between the points in a reasonable time; try '%s' with a positive value", KNAME(TBM_LINESIMUSTEP)); /* algorithmus kann verbessert werden, so dass diese Fehlermeldung nicht mehr notwendig ist! */ } double diff, dist; for (k0=i=0; ix[k1++] - loc_user->x[k2++]; dist += diff * diff; } if (dist>0 && distTime) { mindelta += loc_user->T[XSTEP] * loc_user->T[XSTEP]; } mindelta = SQRT(mindelta); } linesimufactor = tbm_linesimufactor / mindelta; } else { // both, tbm_linesimustep and tbm_linesimufactor are zeror or negative if (*points < BUFFER) { SERR("if linesimufactor and linesimustep are naught then TBM.points must be at least 4 (better between 100 and 10000)"); } } // multiplication der x-skalenparameter so dass letztendlich // auf der TBM-Geraden mit Abstand 1 der Punkte simuliert werden kann // mit dem Vorteil des einfachen Zugriffs auf die simulierten Werte /****************************************************************/ /* determine length and resolution of the band */ /****************************************************************/ location_type *loc = Loc(cov); assert(cov->ownloc == NULL); if ((loc->Time && !ce_dim2)) { TransformLoc(cov, ce_dim2, false, false); loc = Loc(cov); } int spdim = loc->timespacedim - ce_dim2, dim = loc->timespacedim, ens = GLOBAL.general.expected_number_simu; double diameter, min[MAXTBMSPDIM], max[MAXTBMSPDIM], Center[MAXTBMSPDIM], *timecomp = loc->grid ? loc->xgr[dim - 1] : loc->T, min_center = 0.0, max_center = 0.0; GetDiameter(loc, min, max, Center, true); for (d=0; d max_center ? min_center : max_center); // print("diam %f pts=%d %f %f\n", diameter, *points, BUFFER, linesimufactor ); //assert(false); // 4.231878 0 3.000000 1054.407676 if (linesimufactor < 0) { // i.e. points given directly by user linesimufactor = (*points - BUFFER) / diameter; } s->linesimufactor = linesimufactor; diameter = TRUNC(BUFFER + diameter * linesimufactor); // in pts // print("diam %f %f\n", diameter, linesimufactor); if ( *points > 0) { if (diameter > *points) { // never happens if linesimufactor has been < 0 PRINTF("tbm points minimum=%f, but tbm_points is %d.\n", diameter, *points); SERR( "given number of points to simulate on the TBM line is too small"); } else diameter = (double) *points; } // print("diam %f %f %d %d\n", diameter, linesimufactor, *points, GLOBAL.tbm.points); if (diameter > MAXNN) { // printf("diamter = %f %d\n", diameter, MAXNN); // PMI(cov); SERR("The number of points on the line is too large. Check your parameters and make sure that none of the locations are given twice"); } else if (diameter < 10) { SERR2("too few points on the line -- modify '%s' or '%s'", KNAME(TBM_LINESIMUFACTOR), KNAME(TBM_LINESIMUSTEP)); } // only needed for nongrid ! s->spatialtotalpts = loc->totalpoints; if (s->ce_dim == 2) { s->spatialtotalpts /= timecomp[XLENGTH]; // assert(false); } /****************************************************************/ /* determine the center */ /****************************************************************/ double *tbm_center = P(TBM_CENTER); bool setable = !isDollar(cov->calling) && user_dim == loc->timespacedim && user_spatialdim == loc->spatialdim; GetDiameter(loc, min, max, Center, false); if (!ISNAN(tbm_center[0])) { assert(cov->calling != NULL); if (!setable) SERR1("'%s' can be set only for isotropic fields", KNAME(TBM_CENTER)); for (d=0; d < user_dim; d++) { if (!R_FINITE(tbm_center[d])) SERR("center contains non finite values"); } for (d=0; dcenter[d] = Center[d]; if (loc->grid) s->center[d] -= loc->xgr[d][XSTART]; else if (loc->Time && d==loc->timespacedim-1 && ce_dim2) { s->center[d] -= loc->T[XSTART]; } } /****************************************************************/ /* set up the covariance function on the line */ /****************************************************************/ if (PL>=PL_STRUCTURE) { PRINTF("\nrestructing tbm "); PRINTF(ce_dim2 ? "plane...\n" : "line...\n"); } cov_model *modelB1; if (cov->key != NULL) COV_DELETE(&(cov->key)); if ((err = covCpy(&(cov->key), next)) != NOERROR) return err; modelB1 = cov->key; while (isGaussProcess(modelB1)) modelB1 = modelB1->sub[0]; if (modelB1 == cov->key) { addModel(&(cov->key), GAUSSPROC); modelB1 = cov->key; } else { modelB1 = modelB1->calling; } addModel(modelB1, 0, DOLLAR); if (modelB1->nr==BROWNIAN){ // &(cov->key))->calling = key; kdefault(cov, DVAR, 1.0 + PARAM0(next, BROWN_ALPHA) / tbmdim); } else { cov_model *dollar = modelB1->sub[0]; dollar->tsdim = dollar->xdimprev = s->ce_dim; kdefault(dollar, DVAR, 1.0); PARAMALLOC(dollar, DANISO, s->ce_dim, s->ce_dim); PARAM(dollar, DANISO)[0] = 1.0 / linesimufactor; if (s->ce_dim == 2) { PARAM(dollar, DANISO)[1] = PARAM(dollar, DANISO)[2] = 0.0; PARAM(dollar, DANISO)[3] = loc->T[XSTEP]; } addModel(modelB1, 0, TBM_OP); if (!PisNULL(TBMOP_TBMDIM)) kdefault(modelB1->sub[0], TBMOP_TBMDIM, P0INT(TBM_TBMDIM)); if (!PisNULL(TBMOP_FULLDIM)) kdefault(modelB1->sub[0], TBMOP_FULLDIM, P0INT(TBM_FULLDIM)); if (!PisNULL(TBMOP_LAYERS)) kdefault(modelB1->sub[0], TBMOP_LAYERS, P0(TBM_LAYERS)); } /****************************************************************/ /* set up the process on the line */ /****************************************************************/ if (PL>=PL_STRUCTURE) { PRINTF("\nsetting up the process on the "); PRINTF(ce_dim2 ? "plane..." : "line..."); } // xline[XEND]: number of points on the TBM line double xline[3]; xline[XSTART] = 1.0; xline[XSTEP] = 1.0; s->xline_length = xline[XLENGTH] = (double) diameter;// diameter > MAXNN must be first since // risk of overflow ! // printf("length %f %f\n", diameter, 1.0 / linesimufactor); assert(false); // 4465 0.000948 //printf("xline %f %f %f\n", xline[XSTART], xline[XSTEP], xline[XLENGTH]); err = loc_set(xline, timecomp, 1, 1, 3, ce_dim2 /* time */, true /* grid */, false, cov->key); cov_model *key = cov->key; if (err != NOERROR) goto ErrorHandling; //APMI(cov); // APMI(cov->key); GLOBAL.general.expected_number_simu = 100; if ((err = CHECK(key, 1 + (int) ce_dim2, 1 + (int) ce_dim2, ProcessType, XONLY, CARTESIAN_COORD, cov->vdim, ROLE_GAUSS)) != NOERROR) { goto ErrorHandling; } //printf("dims %d %d\n", cov->key->xdimown, s->ce_dim); assert(key->xdimown == s->ce_dim); if ((err = STRUCT(key, NULL)) != NOERROR) goto ErrorHandling; if (!key->initialised) { if (key->key != NULL && (err = CHECK(key, 1 + (int) ce_dim2, 1 + (int) ce_dim2, PosDefType, XONLY, SYMMETRIC, SUBMODEL_DEP, ROLE_GAUSS)) != NOERROR) { // PMI(key); goto ErrorHandling; } if (PL >= PL_DETAILS) { PRINTF("\n\nCheckModel Internal (%s, #=%d), after 2nd check:", NICK(key), key->gatternr); // ok } } NEW_STORAGE(gen); if ((err = INIT(key, 0, cov->Sgen)) != NOERROR) goto ErrorHandling; s->err = err; ErrorHandling : //cov->initialised = err==NOERROR && key->initialised; GLOBAL.general.expected_number_simu = ens; return err; } // aufpassen auf ( * * 0 ) // ( * * 0 ) // ( 0 0 1 ) int init_tbmproc(cov_model *cov, gen_storage *S) { location_type *loc = Loc(cov); int err=NOERROR; errorloc_type errorloc_save; cov_model *key = cov->key; // == NULL ? cov->sub[0] : cov->key; assert(key != NULL); tbm_storage *s = cov->Stbm; // PMI(cov); // crash(); assert(s != NULL); STRCPY(errorloc_save, ERROR_LOC); SPRINTF(ERROR_LOC, "%s %s: ", errorloc_save, NAME(cov)); cov->method = TBM; ROLE_ASSERT_GAUSS; if (s->err==NOERROR) { err = INIT(key, 0, S); } else { assert(s->err < NOERROR); } STRCPY(ERROR_LOC, errorloc_save); if (err != NOERROR) return err; if (loc->distances) return ERRORFAILED; err = FieldReturn(cov); // APMI(cov); cov->simu.active = err == NOERROR; if (PL>= PL_STRUCTURE) PRINTF("\n'%s' is now initialized.\n", NAME(cov)); return err; } void GetE(int fulldim, tbm_storage *s, int origdim, bool Time, double *phi, double deltaphi, double *aniso, double *offset, double *ex, double *ey, double *ez, double *et) { double sube[MAXTBMSPDIM], e[MAXTBMSPDIM]; int d, j, idx, k, spatialdim = s->simuspatialdim; // total = spatialdim * dim; // dim is the users's dim of the field // this might be reduced by zonal anisotropies leading to spatialdim // printf("gete fulldim=%d %d %d\n", fulldim, origdim, spatialdim); // for debugging only for(d=0; d= spatialdim); if (fulldim == 2) { if (deltaphi!=0.0) (*phi) += deltaphi; else (*phi) = UNIFORM_RANDOM * M_2_PI; // not pi, when multivariate sube[0] = SIN(*phi); sube[1] = COS(*phi); } else if (fulldim == 3) { unitvector3D(spatialdim, sube, sube +1, sube + 2); // print("spatdim=%d %d sube=%f %f %f\n", // spatialdim, s->simuspatialdim, sube[0], sube[1], sube[2]); } else ERR("wrong full dimension"); *offset = 0.5 * s->xline_length; // print("\noffset %f %f aniso=%d %f %f fact=%f\n", *offset, s->xline_length, aniso==NULL, s->center[0], s->center[1], s->linesimufactor); if (aniso == NULL) { for (d=0; dlinesimufactor; *offset -= s->center[d] * e[d]; // printf("d=%d %f sube=%f %f %f %f\n", d, e[d], sube[d],s->linesimufactor, s->center[d], *offset); // } // for (d=0; dcenter[d], s->linesimufactor, s->ce_dim); // } idx = spatialdim; if (Time && s->ce_dim==1) { *et = e[--idx]; } switch (idx) { case 4 : BUG; case 3 : *ez = e[--idx]; case 2 : *ey = e[--idx]; case 1 : *ex = e[--idx]; break; default: BUG; } } void do_tbmproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S) { cov_model *key = cov->key; assert(key != NULL); // == NULL ? cov->sub[0] : cov->key; location_type *loc = Loc(cov), *keyloc = Loc(key); tbm_storage *s = cov->Stbm; int vdim = cov->vdim[0]; double nn = keyloc->spatialtotalpoints; long ntot = keyloc->totalpoints * vdim, totvdim = loc->totalpoints * vdim; //printf("%d\n", ntot);// assert(false); // assert(ntot > 4000); // APMI(cov->key); int origdim = loc->caniso == NULL ? cov->tsdim : loc->cani_nrow, simuspatialdim = s->simuspatialdim, // for non-grids only every = GLOBAL.general.every, tbm_lines = P0INT(TBM_LINES); double *res = cov->rf, *simuline = key->rf; assert(res != NULL); assert(simuline != NULL); double phi, deltaphi, stepx, stepy, stepz, stept, incx=0.0, incy=0.0, incz=0.0, inct=0.0; long n; int v, nt, idx, gridlent, fulldim = P0INT(TBM_FULLDIM); SAVE_GAUSS_TRAFO; assert(cov->Sgen != NULL); // printf("%d %d\n", P0INT(TBM_FULLDIM), s->ce_dim); // APMI(cov); for (n=0; ngrid) { int nx, ny, nz, gridlenx, gridleny, gridlenz; long zaehler; double xoffset, yoffset, zoffset, toffset; stepx = stepy = stepz = stept = 0.0; gridlenx = gridleny = gridlenz = gridlent = 1; idx = origdim; if (s->ce_dim==2) { gridlent = (int) loc->xgr[--idx][XLENGTH]; // could be one !! stept = loc->xgr[idx][XSTEP]; inct = nn; // wegen assert unten } else if (loc->Time) { idx--; gridlent = (int) loc->T[XLENGTH]; // could be one !! stept = loc->T[XSTEP]; } switch (idx) { case 4 : BUG; case 3 : gridlenz = (int) loc->xgr[--idx][XLENGTH]; stepz = loc->xgr[idx][XSTEP]; // no break; case 2 : gridleny = (int) loc->xgr[--idx][XLENGTH]; stepy = loc->xgr[idx][XSTEP]; // no break; case 1 : gridlenx = (int) loc->xgr[--idx][XLENGTH]; stepx = loc->xgr[idx][XSTEP]; break; default: BUG; } for (n=0; n0 && n > 0 && (n % every == 0)) PRINTF("%ld \n", n); GetE(fulldim, s, origdim, loc->Time, &phi, deltaphi, loc->caniso, &inittoffset, &incx, &incy, &incz, &inct); incx *= stepx; incy *= stepy; incz *= stepz; if (s->ce_dim == 1) inct *= stept; inittoffset += UNIFORM_RANDOM - 0.5; DO(key, cov->Sgen); zaehler = 0; for (v=0; v= ntot || longxoffset < 0) { PRINTF("xx ntot %ld %ld %ld -- offsets %f %f %f %f\n x:%d %d y:%d %d z:%d %d t:%d %d n:%d\n", ntot, longxoffset, zaehler, xoffset, yoffset, zoffset, toffset, nx, gridlenx, ny, gridleny, nz, gridlenz, nt, gridlent, n ); // continue;# //APMI(key); BUG; } res[zaehler++] += simuline[longxoffset]; xoffset += incx; } yoffset += incy; } zoffset += incz; } toffset += inct; } inittoffset += s->xline_length; } // vdim } // n } else { // not loc->grid // assert(false); // not grid, could be time-model! // both old and new form included double offset, offsetinit; int i, spatialdim = loc->spatialdim; long xi, totpoints = s->spatialtotalpts, end = spatialdim * totpoints; #define TBMST(INDEX) { \ for (n=0; n0 && (n % every == 0)) PRINTF("%ld \n",n); \ GetE(fulldim, s, origdim, loc->Time, &phi, deltaphi, \ loc->caniso, &offsetinit, &incx, &incy, &incz, &inct); \ offset += UNIFORM_RANDOM - 0.5; \ DO(key, cov->Sgen); \ for (i=v=0; v= ntot || index < 0) { \ PRINTF("\n %f %f %f (%f %f %f))\n", \ loc->x[xi], loc->x[xi+1] , loc->x[xi+2], \ incx, incy, incz); \ PRINTF("n=%ld index=%ld nn=%f ntot=%ld xi=%ld nt=%d\n", \ n, index, nn, ntot, xi, (int) nt); \ PRINTF("OFF=%f IDX=%f inct=%flenT=%d spatialdim=%d\n", \ offset, INDEX, inct, gridlent, spatialdim); \ BUG; /* to do: kann irgendwann mal rausgenommen werden, wenn's stabil laeuft */ \ } \ res[i++] += simuline[index]; \ } \ offset += inct; \ } \ offsetinit += s->xline_length; \ } \ } \ } inct = nn; // number of spatial points gridlent = loc->Time ? loc->T[XLENGTH] : 1; assert(gridlent * nn * vdim == ntot); switch (simuspatialdim) { case 1 : //see Martin's techrep f. details TBMST(loc->x[xi] * incx); break; case 2: TBMST(loc->x[xi] * incx + loc->x[xi+1] * incy); // break; case 3: TBMST(loc->x[xi] * incx + loc->x[xi+1] * incy + loc->x[xi+2] * incz); break; default : BUG; } } // end not grid // {double z; int i; for(i=0, z=0.0; i #include "RandomFields.h" #include "auxiliary2.h" static R_NativePrimitiveArgType one_int[] = { INTSXP }, intdouble[] = {INTSXP, REALSXP }, intintdouble[] = {INTSXP, INTSXP, REALSXP }, charint[] = { STRSXP, INTSXP}, inttwochar[] = {INTSXP, STRSXP, STRSXP }, two_int[] = { INTSXP, INTSXP }, three_int[] = { INTSXP, INTSXP, INTSXP}, attr_arg[] = { INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP }; // static R_NativeArgStyle argin[] = {R_ARG_IN}, // argout[] = {R_ARG_OUT}, // hostarg[] = {R_ARG_OUT, R_ARG_OUT}; static const R_CMethodDef cMethods[] = { {"GetAttr", (DL_FUNC) &GetAttr, 14, attr_arg}, {"GetModelName", (DL_FUNC) &GetModelName, 3, inttwochar}, {"GetModelNr", (DL_FUNC) &GetModelNr, 2, charint}, {"GetCurrentNrOfModels", (DL_FUNC) &GetCurrentNrOfModels, 2, two_int}, {"GetNrParameters", (DL_FUNC) &GetNrParameters, 2, two_int}, {"PrintModelList", (DL_FUNC) &PrintModelList, 3, three_int}, {"PutValuesAtNA", (DL_FUNC) &PutValuesAtNAnoInit, 2, intdouble}, {"PutValuesAtNAnoInit", (DL_FUNC) &PutValuesAtNAnoInit, 2, intdouble}, {"expliciteDollarMLE", (DL_FUNC) &expliciteDollarMLE, 2, intdouble}, {"MultiDimRange", (DL_FUNC) &MultiDimRange, 3, intintdouble}, {"GetModelRegister", (DL_FUNC) &GetModelRegister, 2, charint}, {"ResetWarnings", (DL_FUNC) &ResetWarnings, 1, one_int}, {"NoCurrentRegister", (DL_FUNC) &NoCurrentRegister, 0}, {"GetCurrentRegister", (DL_FUNC) &GetCurrentRegister, 1, one_int}, {"PutGlblVar", (DL_FUNC) &PutGlblVar, 2, intdouble}, {"DeleteKey", (DL_FUNC) &DeleteKey, 1, one_int}, {"detachRFoptionsRandomFields", (DL_FUNC) &detachRFoptionsRandomFields, 0}, {"attachRFoptionsRandomFields", (DL_FUNC) &attachRFoptionsRandomFields, 0}, {"RelaxUnknownRFoption", (DL_FUNC) &RelaxUnknownRFoption, 1, one_int}, // {"attachRFoptionsUtils", (DL_FUNC) &attachRFoptionsUtils, 0, NULL, NULL}, // {"detachRFoptionsUtils", (DL_FUNC) &detachRFoptionsUtils, 0, NULL, NULL}, {NULL, NULL, 0, NULL} }; #define CALLDEF_DO(name, n) {#name, (DL_FUNC) &name, n} static R_CallMethodDef callMethods[] = { // in die respectiven C-Dateien muss RandomFieldsUtils.h eingebunden sein CALLDEF_DO(GetParameterNames, 1), CALLDEF_DO(GetSubNames, 1), CALLDEF_DO(GetAllModelNames, 0), CALLDEF_DO(GetCoordSystem, 3), CALLDEF_DO(GetExtModelInfo, 4), CALLDEF_DO(GetModel, 6), CALLDEF_DO(Init, 4), CALLDEF_DO(EvaluateModel, 2), CALLDEF_DO(GetProcessType, 2), CALLDEF_DO(empiricalvariogram, 10), CALLDEF_DO(empvarioXT, 13), CALLDEF_DO(fftVario3D, 14), CALLDEF_DO(boxcounting, 5), CALLDEF_DO(detrendedfluc, 5), CALLDEF_DO(periodogram, 6), CALLDEF_DO(minmax, 5), CALLDEF_DO(VariogramIntern, 1), CALLDEF_DO(CovLoc, 6), //CALLDEF_DO(GetNAPositions, 5), CALLDEF_DO(SetAndGetModelInfo, 10), CALLDEF_DO(SetAndGetModelLikeli, 3), CALLDEF_DO(Take2ndAtNaOf1st, 8), CALLDEF_DO(countelements, 3), CALLDEF_DO(countneighbours, 5), CALLDEF_DO(getelements, 5), CALLDEF_DO(getneighbours, 5), CALLDEF_DO(set_boxcox, 1), CALLDEF_DO(get_boxcox, 0), // CALLDEF_DO(BoxCox_inverse, 2), CALLDEF_DO(BoxCox_trafo, 4), CALLDEF_DO(get_logli_residuals, 1), CALLDEF_DO(get_likeliinfo, 1), CALLDEF_DO(simple_residuals, 1), CALLDEF_DO(get_linearpart, 2), CALLDEF_DO(vectordist, 2), // CALLDEF_DO(), {NULL, NULL, 0} }; void R_init_RandomFields(DllInfo *dll) { R_registerRoutines(dll, cMethods, callMethods, NULL, // .Fortran NULL // extended ); R_useDynamicSymbols(dll, FALSE); } void R_unload_RandomFields(DllInfo *info) { /* Release resources. */ } RandomFields/src/shape_processes.h0000644000176200001440000004461513074763020016763 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef RandomShape_H #define RandomShape_H 1 //----------------------------------------------------------------- // MPP operator void kappamppplus(int i, cov_model *cov, int *nr, int *nc); int checkmppplus(cov_model *cov); void rangempplus(cov_model *cov, range_type *range); int struct_mppplus(cov_model *plus, cov_model **newmodel); int init_mppplus(cov_model *cov, gen_storage *s); void do_mppplus(cov_model *cov, gen_storage *s); void mppplus(double *x, cov_model *cov, double *v); //void logmppplus(double *x, cov_model *cov, double *v, double *Sign); void mcmc_pgs(double *x, cov_model *cov, double *v); void logmcmc_pgs(double *x, cov_model *cov, double *v, double *Sign); int check_mcmc_pgs(cov_model *cov); int struct_mcmc_pgs(cov_model *cov, cov_model **newmodel); int init_mcmc_pgs(cov_model *cov, gen_storage *S); void do_mcmc_pgs(cov_model *cov, gen_storage *S); void range_mcmc_pgs(cov_model *cov, range_type *range); void pts_given_shape(double *x, cov_model *cov, double *v); void logpts_given_shape(double *x, cov_model *cov, double *v, double *Sign); int check_pts_given_shape(cov_model *cov); int struct_pts_given_shape(cov_model *cov, cov_model **newmodel); int init_pts_given_shape(cov_model *cov, gen_storage *S); void do_pts_given_shape(cov_model *cov, gen_storage *S); void range_pts_given_shape(cov_model *cov, range_type *range); void standard_shape(double *x, cov_model *cov, double *v); void logstandard_shape(double *x, cov_model *cov, double *v, double *Sign); int check_standard_shape(cov_model *cov); int struct_standard_shape(cov_model *cov, cov_model **newmodel); int init_standard_shape(cov_model *cov, gen_storage *S); void do_standard_shape(cov_model *cov, gen_storage *S); void stationary_shape(double *x, cov_model *cov, double *v); void logstationary_shape(double *x, cov_model *cov, double *v, double *Sign); int check_stationary_shape(cov_model *cov); int struct_stationary_shape(cov_model *cov, cov_model **newmodel); int init_stationary_shape(cov_model *cov, gen_storage *S); void do_stationary_shape(cov_model *cov, gen_storage *S); //----------------------------------------------------------------- // Trends void mixed(double *x, cov_model *cov, double *v); void MLEmixed(double *x, cov_model *cov, double *v); void mixed_nonstat(double *x, double *y, cov_model *cov, double *v); void MLEmixed_nonstat(double *x, double *y, cov_model *cov, double *v); void kappamixed(int i, cov_model *cov, int *nr, int *nc); int checkmixed(cov_model *cov); void rangemixed(cov_model *cov, range_type* ra); int initmixed(cov_model *cov, gen_storage *s); void domixed(cov_model *cov, gen_storage *s); void covmatrix_mixed(cov_model *cov, double *v); char iscovmatrix_mixed(cov_model *cov); void trend(double *x, cov_model *cov, double *v); void trend_nonstat(double *x, double *y, cov_model *cov, double *v); int checktrend(cov_model *cov); int checktrendproc(cov_model *cov); void rangetrend(cov_model *cov, range_type* ra); int init_trend(cov_model *cov, gen_storage *s); void do_trend(cov_model *cov, gen_storage *s); void GetInternalMean(cov_model *cov, int vdim, double *mean); void kappatrend(int i, cov_model *cov, int *nr, int *nc); //----------------------------------------------------------------- // shapes void kappa_ave(int i, cov_model *cov, int *nr, int *nc); void ave(double *x, cov_model *cov, double *v); int checkave(cov_model *cov); void rangeave(cov_model *cov, range_type* ra); //void sd_standard(mpp_storage *s, cov_model *cov); int structAve(cov_model *cov, cov_model **newmodel); int check_shapeave(cov_model *cov); int init_shapeave(cov_model *cov, gen_storage *s); void do_shapeave(cov_model *cov, gen_storage *s); void logshapeave(double *x, cov_model *cov, double *v, double *Sign); void ball(double *x, cov_model *cov, double *v); int init_ball(cov_model *cov, gen_storage *s); void do_ball(cov_model *cov, gen_storage *s); int struct_ball(cov_model *cov, cov_model **newmodel); void Inverseball(double *x, cov_model *cov, double *v); void kappa_EAxxA(int i, cov_model *cov, int *nr, int *nc); void EAxxA(double *x, cov_model *cov, double *v); int checkEAxxA(cov_model *cov); void rangeEAxxA(cov_model *cov, range_type* ra); void minmaxEigenEAxxA(cov_model *cov, double *mm); void kappa_EtAxxA(int i, cov_model *cov, int *nr, int *nc); void EtAxxA(double *x, cov_model *cov, double *v); int checkEtAxxA(cov_model *cov); void rangeEtAxxA(cov_model *cov, range_type* ra); void minmaxEigenEtAxxA(cov_model *cov, double *mm); void Polygon(double *x, cov_model *cov, double *v); int check_polygon(cov_model *cov); void range_polygon(cov_model *cov, range_type *range); int init_polygon(cov_model *cov, gen_storage *s); int struct_polygon(cov_model *cov, cov_model **newmodel); void Inversepolygon(double *x, cov_model *cov, double *v); void InversepolygonNonstat(double *v, cov_model *cov, double *x, double *y); void kappa_rotat(int i, cov_model *cov, int *nr, int *nc); void rotat(double *x, cov_model *cov, double *v); int checkrotat(cov_model *cov); void rangerotat(cov_model *cov, range_type* ra); void minmaxEigenrotat(cov_model *cov, double *mm); void kappa_Rotat(int i, cov_model *cov, int *nr, int *nc); void Rotat(double *x, cov_model *cov, double *v); int checkRotat(cov_model *cov); void rangeRotat(cov_model *cov, range_type* ra); void kappa_rational(int i, cov_model *cov, int *nr, int *nc); void minmaxEigenrational(cov_model *cov, double *mm); void rational(double *x, cov_model *cov, double *v); int checkrational(cov_model *cov); void rangerational(cov_model *cov, range_type* ra); void kappa_stp(int i, cov_model *cov, int *nr, int *nc); void stp(double *x, double *y, cov_model *cov, double *v); int checkstp(cov_model *cov); void rangestp(cov_model *cov, range_type* ra); int structStp(cov_model *cov, cov_model **newmodel); int check_shapestp(cov_model *cov); int init_shapestp(cov_model *cov, gen_storage *s); void do_shapestp(cov_model *cov, gen_storage *s); void logshapestp(double *x, double *u, cov_model *cov, double *v, double *); void truncsupport(double *x, cov_model *cov, double *v); int checktruncsupport(cov_model *cov); void truncsupportInverse(double *x, cov_model *cov, double *v); void rangetruncsupport(cov_model *cov, range_type *range); int struct_truncsupport(cov_model *cov, cov_model **newmodel); int init_truncsupport(cov_model *cov, gen_storage *s); void do_truncsupport(cov_model *cov, gen_storage *s); void randomSign(double *x, cov_model *cov, double *v); void lograndomSign(double *x, cov_model *cov, double *v, double *Sign); void randomSignInverse(double *x, cov_model *cov, double *v); void randomSignNonstatInverse(double *v, cov_model *cov, double *x, double *y); int check_randomSign(cov_model *cov); void range_randomSign(cov_model *cov, range_type *range); int init_randomSign(cov_model *cov, gen_storage *s); int struct_randomSign(cov_model *cov, cov_model **newmodel); void do_randomSign(cov_model *cov, gen_storage *s); //----------------------------------------------------------------- // Gauss Methods void kappa_ce(int i, cov_model *cov, int *nr, int *nc); int check_ce(cov_model *cov); void range_ce(cov_model *cov, range_type *range); int init_circ_embed(cov_model *cov, gen_storage *s); void do_circ_embed(cov_model *cov, gen_storage *s); int struct_ce_approx(cov_model *cov, cov_model **newmodel); int init_ce_approx(cov_model *cov, gen_storage *S); void do_ce_approx(cov_model *cov, gen_storage *S); void kappa_localproc(int i, cov_model *cov, int *nr, int *nc); int check_co_proc(cov_model *cov); int check_co_intern(cov_model *cov); void range_co_proc(cov_model *cov, range_type* ra); void distrD(double *x, cov_model *cov, double *v); void distrP(double *x, cov_model *cov, double *v); void distrQ(double *x, cov_model *cov, double *v); void distrR(double *x, cov_model *cov, double *v); void kappa_distr(int i, cov_model *cov, int *nr, int *nc); int check_distr(cov_model *cov); int init_distr(cov_model *cov, gen_storage *s); void do_distr(cov_model *cov, gen_storage *s); void range_distr(cov_model *cov, range_type *range); void range_intrinCE(cov_model *cov, range_type* ra); int check_local_proc(cov_model *cov); int check_directGauss(cov_model *cov); void range_direct(cov_model *cov, range_type *range); int init_directGauss(cov_model *cov, gen_storage *s); void do_directGauss(cov_model *cov, gen_storage *s); int check_hyperplane(cov_model *cov); int check_hyperplane_intern(cov_model *cov); void range_hyperplane(cov_model *cov, range_type *range); int struct_hyperplane(cov_model *cov, cov_model **newmodel); int init_hyperplane(cov_model *cov, gen_storage *s); void do_hyperplane(cov_model *cov, gen_storage *s); int check_nugget_proc(cov_model *cov); void range_nugget_proc(cov_model *cov, range_type *range); int init_nugget(cov_model *cov, gen_storage *s); void do_nugget(cov_model *cov, gen_storage *s ); int struct_nugget(cov_model *cov, cov_model **newmodel); int check_randomcoin(cov_model *cov); void range_randomcoin(cov_model *cov, range_type *range); //void coin(double *x, cov_model *cov, double *v); int init_randomcoin(cov_model *cov, gen_storage *s); int struct_randomcoin(cov_model *cov, cov_model **newmodel); //void coinInverse(double *x, cov_model *cov, double *v); int struct_randomcoin_extract(cov_model *cov, cov_model **newmodel); int check_sequential(cov_model *cov) ; void range_sequential(cov_model *cov, range_type *range) ; int init_sequential(cov_model *cov, gen_storage *s); void do_sequential(cov_model *cov, gen_storage *s); int check_spectral(cov_model *cov) ; void range_spectral(cov_model *cov, range_type *range) ; int init_spectral(cov_model *cov, gen_storage *s); void do_spectral(cov_model *cov, gen_storage *s ); int struct_spectral(cov_model *plus, cov_model **newmodel); int check_specificGauss(cov_model *cov); int struct_specificGauss(cov_model *cov, cov_model **newmodel); int init_specificGauss(cov_model *cov, gen_storage *S); void do_specificGauss(cov_model *cov, gen_storage *S); void range_specificGauss(cov_model *cov, range_type *range); void tbm_kappasproc(int i, cov_model *cov, int *nr, int *nc); int checktbmproc(cov_model *cov); void rangetbmproc(cov_model *cov, range_type* ra); int struct_tbmproc(cov_model *cov, cov_model **newmodel); int init_tbmproc(cov_model *cov, gen_storage *s); void do_tbmproc(cov_model *cov, gen_storage *s); //void tbm2num(double *x, cov_model *cov, double *v); //----------------------------------------------------------------- // MPP Methods int init_BRorig(cov_model *cov, gen_storage *s); void do_BRorig(cov_model *cov, gen_storage *s); int init_BRshifted(cov_model *cov, gen_storage *s); void do_BRshifted(cov_model *cov, gen_storage *s); int check_BRmixed(cov_model *cov); int init_BRmixed(cov_model *cov, gen_storage *s); void do_BRmixed(cov_model *cov, gen_storage *s); void range_BRmixed(cov_model *cov, range_type *range); void kappaBRmixed(int i, cov_model *cov, int *nr, int *nc); int initBRuser (cov_model *cov, gen_storage *S); int structBRuser(cov_model *cov, cov_model **newmodel); int structBRintern(cov_model *cov, cov_model **newmodel); //----------------------------------------------------------------- // Processes // checkSproc by checkS int structSproc(cov_model *cov, cov_model **newmodel); int initSproc(cov_model *cov, gen_storage *s); void doSproc(cov_model *cov, gen_storage *s); int checkplusproc(cov_model *cov); int structplusproc(cov_model *cov, cov_model **newmodel); int initplusproc(cov_model *cov, gen_storage *s); void doplusproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) ; int checkmultproc(cov_model *cov); int structmultproc(cov_model *cov, cov_model **newmodel); void rangemultproc(cov_model *cov, range_type *range); int initmultproc(cov_model *cov, gen_storage *s); void domultproc(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s) ; void kappa_binaryprocess(int i, cov_model *cov, int *nr, int *nc); void binary(double *x, cov_model *cov, double *v); int checkbinaryprocess(cov_model *cov); void rangebinaryprocess(cov_model *cov, range_type *range); int struct_binaryprocess(cov_model *cov, cov_model **newmodel); int init_binaryprocess(cov_model *cov, gen_storage *s); void do_binaryprocess(cov_model *cov, gen_storage *s); void BrownResnick(double *x, cov_model *cov, double *v); int checkBrownResnickProc(cov_model *cov); int structBrownResnick(cov_model *cov, cov_model **newmodel); int initBrownResnick(cov_model *cov, gen_storage *s); void doBrownResnick(cov_model *cov, gen_storage *s); void loglikelihoodBR(double *data, cov_model *cov, double *v); void kappaGProc(int i, cov_model *cov, int *nr, int *nc); int checkgaussprocess(cov_model *cov); void rangegaussprocess(cov_model *cov, range_type *range); int struct_gaussprocess(cov_model *cov, cov_model **newmodel); int init_gaussprocess(cov_model *cov, gen_storage *s); void do_gaussprocess(cov_model *cov, gen_storage *s); void gaussprocessDlog(double *x, cov_model *cov, double *v); int struct_gauss_logli(cov_model *cov); SEXP gauss_linearpart(SEXP model_reg, SEXP Set); void gauss_predict(cov_model *predict, cov_model *Cov, double *v); void gauss_trend(cov_model *predict, cov_model *cov, double *v, int set); int struct_extractdollar(cov_model *cov, cov_model **newmodel); int check_poisson(cov_model *cov); int struct_poisson(cov_model *cov, cov_model **newmodel); void range_poisson(cov_model *cov, range_type *range); int init_poisson(cov_model *cov, gen_storage *S); void extremalgaussian(double *x, cov_model *cov, double *v); int check_schlather(cov_model *cov); int struct_schlather(cov_model *cov, cov_model **newmodel); void loglikelihoodSchlather(double *data, cov_model *cov, double *v); int struct_smith(cov_model *cov, cov_model **newmodel); int check_smith(cov_model *cov); int struct_smith_pts(cov_model **Key, cov_model *shape, cov_model *calling, int tsdim, int vdim); int checkchisqprocess(cov_model *cov) ; void rangechisqprocess(cov_model *cov, range_type *range) ; int struct_chisqprocess(cov_model *cov, cov_model **newmodel) ; int init_chisqprocess(cov_model *cov, gen_storage *s) ; void do_chisqprocess(cov_model *cov, gen_storage *s); void rangetprocess(cov_model *cov, range_type *range) ; void do_tprocess(cov_model *cov, gen_storage *s); int init_opitzprocess(cov_model *cov, gen_storage *s); void range_opitz(cov_model *cov, range_type *range); void dompp(cov_model *cov, gen_storage *S); int init_mpp(cov_model *cov, gen_storage *S); void range_mpp(cov_model *cov, range_type *range); int SetGEVetc(cov_model *cov, int type); //----------------------------------------------------------------- // Interfaces void simulate(double *x, cov_model *cov, double *v); int check_simulate(cov_model *cov); void range_simulate(cov_model *cov, range_type *range); int struct_simulate(cov_model *cov, cov_model **newmodel); int init_simulate(cov_model *cov, gen_storage *S); // void do_simulate(cov_model *cov, gen_storage *S); void range_simulate(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range); void density(double *x, cov_model *cov, double *v); int check_density(cov_model *cov); void range_density(cov_model *cov, range_type *range); int struct_density(cov_model *cov, cov_model **newmodel); int init_density(cov_model *cov, gen_storage *S); // void do_density(cov_model *cov, gen_storage *S); void range_density(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range); void kappalikelihood(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc); void likelihood(double *data, cov_model *cov, double *v); int check_likelihood(cov_model *cov); int struct_likelihood(cov_model *cov, cov_model **newmodel); void range_likelihood(cov_model *cov, range_type* range); void linearpart(double *data, cov_model *cov, double *v); int check_linearpart(cov_model *cov); int struct_linearpart(cov_model *cov, cov_model **newmodel); //void range_linearpart(cov_model *cov, range_type* range); void predict(double VARIABLE_IS_NOT_USED *x, cov_model *cov, double *v); int check_predict(cov_model *predict); int struct_predict(cov_model *cov, cov_model VARIABLE_IS_NOT_USED **newmodel); void range_predict(cov_model VARIABLE_IS_NOT_USED *cov, range_type* range); void Cov(double *x, cov_model *cov, double *value) ; int check_cov(cov_model *cov) ; int struct_cov(cov_model *cov, cov_model **newmodel); void FctnIntern(cov_model *cov, cov_model *covVdim, cov_model *sub, double *value, bool ignore_y); void Fctn(double *x, cov_model *cov, double *value); int check_fctn(cov_model *cov); void CovMatrix(double *x, cov_model *cov, double *value); int check_covmatrix(cov_model *cov) ; void EvalDistr(double *x, cov_model *cov, double *v); void kappa_EvalDistr(int i, cov_model *cov, int *nr, int *nc); int check_EvalDistr(cov_model *cov); void range_EvalDistr(cov_model *cov, range_type *range); int struct_EvalDistr(cov_model *cov, cov_model **newmodel); int init_EvalDistr(cov_model *cov, gen_storage *S); // void do_EvalDistr(cov_model *cov, gen_storage *S); void RFget(double *x, cov_model *cov, double *v); int SearchParam(cov_model *cov, get_storage *s) ; int check_RFget(cov_model *cov) ; void range_RFget(cov_model *cov, range_type* range); int struct_RFget(cov_model *cov, cov_model **newmodel); void Variogram(double *x, cov_model *cov, double *value) ; void Pseudovariogram(double *x, cov_model *cov, double *value) ; int check_vario(cov_model *cov); int struct_variogram(cov_model *cov, cov_model **newmodel); void Dummy(double *x, cov_model *cov, double *value); int check_dummy(cov_model *cov); int struct_dummy(cov_model *cov, cov_model **newmodel); int checkTrendEval(cov_model *cov); int init_TrendEval(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s); void do_TrendEval(cov_model *cov, gen_storage *s); void range_TrendEval(cov_model *cov, range_type *range); //----------------------------------------------------------------- // unsorted #endif /* RandomShape_H */ RandomFields/src/D.H.cc0000644000176200001440000002151613074763020014277 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de calculation of the Hurst coefficient and the fractal dimension of the graph of a random field Copyright (C) 2002 - 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "RF.h" SEXP boxcounting(SEXP Z, // data SEXP LX, // basic length of data SEXP Repet, // "independent" repetitions of data SEXP Factor, // rescalin of data values by factor SEXP Eps // box lengths ) { // in sum, the boxcounting result for the first lx data values is given // according to the box lengths given by eps; then the boxes are counted // for the next lx data values, etc. Hence, sum must have dimension int *eps = INTEGER(Eps), leps = length(Eps), repet = INTEGER(Repet)[0], lx = INTEGER(LX)[0]; long i, k, j, e, r, lastbox, s, // 0 to leps * repet -1 truelx = 2 + lx, total = repet * truelx; double zz, min, max, f, *sum, factor = REAL(Factor)[0], *z = REAL(Z); SEXP Sum; PROTECT(Sum = allocVector(REALSXP, leps * repet)); sum = REAL(Sum); // boxcounting expects that the first and the last values are repeated // in the first dimension, see D.H.R; accordingly the total length in // the first direction is increased by 2: for (s=r=0; r max) max = z[i]; assert(i <= r + lx + 1); if ((zz = 0.5 * (z[i-1] + z[i])) < min) min = zz; else if (zz > max) max = zz; f = factor / (double) e; sum[s] += FLOOR(max * f) - FLOOR(min * f) + 1.0; } } } UNPROTECT(1); return Sum; } SEXP periodogram(SEXP Dat, // data SEXP Len, // basic length of data SEXP Repet, // # of "independent" repetitions SEXP FFTM, // fftm[0] >=1 not >=1 (R indexing assumed) // interval of the vector given by fft of part SEXP Part, // not the basic length but only a part is // transformed SEXP Shift // part is then shifted by shift until end of // vector is reached; fft values are averaged // over all these parts ){ int *fftm = INTEGER(FFTM), part = INTEGER(Part)[0]; assert((fftm[0]>=1) && (fftm[1] <=part) && (fftm[1] >= fftm[0])); long seg_dat, k, j, total_seg, segment_r, repet = INTEGER(Repet)[0], start_k = 2 * (fftm[0] - 1), // of complex numbers end_k = 2 * (fftm[1] - 1), // of complex numbers segm_l, r, delta_l = fftm[1] - fftm[0] + 1, end_l = delta_l * repet, err = ERRORFAILED, len = INTEGER(Len)[0], lenMpart = len - part, shift = INTEGER(Shift)[0]; assert(lenMpart >= 0); assert(shift>=1); double taper_fact = SQRT( 2.0 / (3.0 * ((double) part + 1.0)) ), cos_factor = 2.0 * PI / ((double) part + 1.0), *compl_number = NULL, *taper = NULL, *lambda = NULL, n_inv = 1.0 / (double) ((int) (1.0 + lenMpart / (double) shift)), *dat = REAL(Dat), factor = LOG(2.0 * PI * len) ; FFT_storage FFT; SEXP Lambda; PROTECT(Lambda = allocVector(REALSXP, end_l)); lambda = REAL(Lambda); for (j=0; j 1); double var, a, b, residual, Yt, realm, sumt, meanY, t, VarMeth_old, VarMeth_mean, VarMeth_var, delta, realnbox, *lvar, *dat = REAL(Dat); SEXP Lvar; // ## rbind(l.varmeth.var, l.dfa.var) 2 * (repet * ldfa) PROTECT(Lvar = allocMatrix(REALSXP, 2, ldfa * repet)); lvar = REAL(Lvar); for (e = r = 0; r < total; r += lx, e+=ldfa) { last = r + lx; for (j=r+1; j 1) { VarMeth_mean = dat[ex - 1] / (realnbox); VarMeth_old = 0; VarMeth_var = 0; for (j=r+m-1; j max) max = dat[idx]; } count[cb] += max - min; } count[cb] = LOG(count[cb] / (double) epsilon); } // b } // r UNPROTECT(1); return Count; } RandomFields/src/MLE.cc0000644000176200001440000012273713074763020014352 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de library for simulation of random fields Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. RO This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include //#include #include #include "RF.h" #include "primitive.h" #include "Coordinate_systems.h" bool is_top(cov_model *cov) { if (cov == NULL) BUG; return isInterface(cov) || isProcess(cov); } int GetNAPosition(cov_model *cov, int *NAs, naptr_type mem, // int *elmnts, elptr_type mem_elmnts, NAname_type names, sortsofparam *sorts, int *vdim1, int *vdim2, bool *isnan, bool *bayesian, covptr_type covModels, int *covzaehler, int allowforintegerNA, int SHORTlen, int printing, int depth, bool no_variance, bool excludetrends ) { // if (*NAs == 0) printf("\n\ngetnapos %s\n\n", NAME(cov)); /* printing <= 0 nothing 1 only NA, NaN 2 others as "*" 3 others as value mem[0..NAs] : addresse wo (neue) NA position im Speicher sorts[0..NAs] : see sortsofparam in RF.h isnan[0..NAs] : NA or NaN */ // PMI(cov); // if (SHORTlen < 2) BUG; SPRINTF(ERROR_LOC, "'%s' : ", NICK(cov)); cov_model *sub; int i, c, r, namenr = 1, *nrow = cov->nrow, *ncol = cov->ncol; // double *lastmem = NULL; char shortname[255], shortD[255]; cov_fct *C = CovList + cov->nr, // nicht gatternr *CC = C; SEXPTYPE *type = C->kappatype; if (SHORTlen >= 255) SHORTlen = 254; // C is pointer to true model; CC points to the first model passed // in initNerror.cc by IncludeModel or IncludePrim while(STRNCMP(CC->name, InternalName, STRLEN(InternalName)) ==0) CC--; covzaehler[cov->nr]++; // // print("SHORT %d %s\n", SHORTlen, CC->name); strcopyN(shortname, CC->nick + 2, SHORTlen); if (covzaehler[cov->nr] >= 2) { char dummy[255]; strcopyN(dummy, shortname, SHORTlen-1); SPRINTF(shortname, "%s%d", dummy, covzaehler[cov->nr]); } if (printing>0) PRINTF("%s\n", CC->name); // CC needed below for the kappa.names which are given // print("%d:%s %d %s\n", cov->nr, CC->name, covzaehler[cov->nr], shortname); depth++; for (i=0; ikappas; i++) { /* if (i==0 && type[i] == INTSXP && STRCMP(C->kappanames[i], ELEMENT) == 0){ if (*elmnts >= MAX_MLE_ELMNTS ) ERR("maximum number of models with variable elements reached"); if (P0INT(i) == NA_INTEGER) ERR1("'%s' may not be NA", ELEMENT); mem_elmnts[(*elmnts)++] = PINT(i); // to do!! covModels[*NAs] hierher uebertragen !! s.u. //printf("elmnts %s %d %s %d\n", CC->name, i, C->kappanames[i], *elmnts); continue; } */ if ((sub = cov->kappasub[i]) == NULL || isRandom(sub)) { // printf("elmnts %s %d %s\n", C->name, i, C->kappanames[i]); if (nrow[i] == 0 || ncol[i] == 0) continue; if (sub != NULL) { int size = nrow[i] * ncol[i]; for (r =0; r < size; P(i)[r++] = RF_NA); // pmi(cov, 0); //printf("nas %d \n", *NAs); } if (printing > 0) { leer(depth); PRINTF("%s\n", C->kappanames[i]); } for (r=0; r= MAX_NA) SERR("maximum number of NA reached"); for (c=0; c= MAX_NA) SERR("maximum number of NA reached"); vdim1[*NAs] = r + 1; vdim2[*NAs] = c + 1; bayesian[*NAs] = sub != NULL; // print("NAs=%d, %d %d %s\n", *NAs, i, idx, C->kappanames[i]); if (type[i] == REALSXP) { v = P(i)[idx]; mem[*NAs] = P(i) + idx; covModels[*NAs] = cov; } else if (type[i] == INTSXP) { v = PINT(i)[idx] == NA_INTEGER ? RF_NA : (double) PINT(i)[idx]; if (ISNAN(v) && !allowforintegerNA) { // crash(cov); SERR("integer variables currently not allowed to be 'NA'"); // !!! } // mem[*NAs] = (*double) &(P0INT(i])[idx]); } else if (type[i] == LISTOF + REALSXP) { listoftype *q = PLIST(i); double *p = q->lpx[r]; int j, end = q->nrow[r] * q->ncol[r]; for (j=0; j 0) { if (nv>1 || (c>0 && printing > 1)) PRINTF(", "); else leer(depth+1); } if (isDollar(cov)) { // shortD partial name for R level cov_model *next = cov->sub[0]; while(isDollar(next) || isNatsc(next)) next = next->sub[0];// ok if (covzaehler[next->nr] == 0) { // next wurde noch nicht // untersucht, somit ist covzaehler[next->nr] um 1 niedriger // als covzaehler[cov->nr] ! strcopyN(shortD, NICK(next) + 2, SHORTlen); } else { char dummy[255]; strcopyN(dummy, NICK(next) + 2, SHORTlen-1); SPRINTF(shortD, "%s%d", dummy, covzaehler[next->nr]+1); // print("$$ > %d:%s %d %s\n", next->nr, NICK(to), // covzaehler[next->nr], shortD); } // printf("cov %s %s\n", NICK(cov), shortD); // assert(DANISO == DSCALE + 1); if (i==DVAR) { vdim1[*NAs] = vdim2[*NAs] = r + 1; cov_model *call = cov->calling; if (call == NULL) BUG; if (!is_top(call) && call->nr == MIXEDEFFECT) { sorts[*NAs] = !is_top(call->calling) && (call->calling->nr == PLUS)// ||call->calling->nr == SELECT) && is_top(call->calling->calling) ? MIXEDVAR : ANYPARAM; } else { while (!is_top(call) && (call->nr ==PLUS)//||call->nr==SELECT) ) call = call->calling; if (call == NULL) BUG; sorts[*NAs] = is_top(call) ? (next->nr == NUGGET ? NUGGETVAR : VARPARAM) : ANYPARAM; } //printf("bsorts %s %d %d %d %s\n", NAME(cov), sorts[*NAs], no_variance, is_top(call), NAME(call)); if (no_variance && sorts[*NAs] <= SIGNEDSDPARAM) sorts[*NAs] = ANYPARAM; //printf("sorts %s %d %d\n", NAME(cov),sorts[*NAs],no_variance); SPRINTF(names[*NAs], sorts[*NAs] <= SIGNEDSDPARAM || sorts[*NAs] ==NUGGETVAR || sorts[*NAs]==MIXEDVAR ? "%s.var" : "%s.vx", shortD); // for R level only } else { if (i==DSCALE) { // lastmem = mem[*NAs]; // used for all diagonal elements of // aniso sorts[*NAs] = SCALEPARAM; SPRINTF(names[*NAs], "%s.s", shortD);// for R level only } else { assert(i == DANISO); // no lastmem here ! if (cov->q != NULL && cov->q[0] != 0.0) { // print("sdfasdf\n"); SERR("naturalscaling only allowed for isotropic setting"); } if (r==c) { sorts[*NAs] = DIAGPARAM; SPRINTF(names[*NAs], "%s.d.%d", shortD, r);// R level only } else { sorts[*NAs] = ANISOPARAM; SPRINTF(names[*NAs], "%s.d.%d.%d", shortD, r, c);// R level } } } } else { // not $ //printf("entering non $\n"); // standard setting ! if (ParamIsTrend(cov, i)) { // || cov->nr==MLEMIXEDEFFECT) assert(type[i] == REALSXP); if (r == 0 && c==0) { int rr, rowcol = nrow[i] * ncol[i]; for (rr=0; rnr, C // print("%s k=%d no_var=%d, %d \n", C->name, i, // no_variance, sorts[*NAs]); if (no_variance && sorts[*NAs] <= SIGNEDSDPARAM) sorts[*NAs] = ANYPARAM; } } char kappashort[255]; strcopyN(kappashort, CC->kappanames[i], SHORTlen); SPRINTF(names[*NAs], "%s.%s", shortname, kappashort); // printf("NAs %d %s\n", *NAs, names[*NAs]); if (*NAs > 0 && 0== STRNCMP(names[*NAs], names[*NAs-1], STRLEN(names[*NAs]))){ if (namenr == 1) { SPRINTF(names[*NAs-1], "%s.%s.%d", shortname, kappashort, namenr); } namenr++; SPRINTF(names[*NAs], "%s.%s.%d", shortname, kappashort,namenr); } else namenr=1; } if (printing > 0) { if (printing <= 2) PRINTF("%d",*NAs + 1); else PRINTF("!%d", *NAs + 1); } // print("added %d %ld\n", *NAs, mem[*NAs]); //printf("mem: %d %s %s\n", *NAs, NAME(cov), KNAME(i)); (*NAs)++; nv++; } else { // not is.na(v) // kein NA an der Position; somit nur Anzeige if (printing > 1) { if (c>0) PRINTF(", "); else leer(depth+1); if (printing <= 2) PRINTF("*"); else { if (type[i]== REALSXP) PRINTF("%6.2e", v); else PRINTF("%5d", (int) v); } } } // else kein NA } //c if ((printing > 0 && nv > 0) || (printing > 1 && ncol[i] > 0)) PRINTF("\n"); } // r } // sub == NULL || isRandom(sub); KEIN ELSE !! if (sub != NULL) { if (printing > 0) { leer(depth); PRINTF("%s\n", C->kappanames[i]); } if (printing > 0) { leer(depth); PRINTF("%s = ", C->subnames[i]); } int err = GetNAPosition(sub, NAs, mem,// elmnts, mem_elmnts, names, sorts, vdim1, vdim2, isnan, bayesian, covModels, covzaehler, allowforintegerNA, SHORTlen, printing, depth, SortOf(cov, -i-1, 0, 0) != VARPARAM, excludetrends); if (err != NOERROR) return err; continue; } } // i for (i=0; isub[i]; if (sub != NULL) { // printf("cur %s sub=%s\n", NAME(cov), NAME(sub)); if (printing > 0) { leer(depth); PRINTF("%s = ", C->subnames[i]); } int err = GetNAPosition(sub, NAs, mem, //elmnts, mem_elmnts, names, sorts, vdim1, vdim2, isnan, bayesian, covModels, covzaehler, allowforintegerNA, SHORTlen, printing, depth, false, excludetrends); if (err != NOERROR) return err; } } return NOERROR; } /* wird (derzeit) nicht verwenden !! */ SEXP GetNAPositions(SEXP model_reg, SEXP model, SEXP spatialdim, SEXP Time, SEXP xdimOZ, SEXP integerNA, SEXP Print) { int i, NAs, //elmnts, vdim1[MAX_NA], vdim2[MAX_NA], covzaehler[MAXNRCOVFCTS]; naptr_type mem; // elptr_type mem_elmnts; covptr_type covModels; sortsofparam sorts[MAX_NA]; bool isnan[MAX_NA], bayesian[MAX_NA]; NAname_type names; currentRegister = INTEGER(model_reg)[0]; bool skipchecks = GLOBAL_UTILS->basic.skipchecks; GLOBAL_UTILS->basic.skipchecks = true; CheckModelInternal(model, ZERO, ZERO, ZERO, INTEGER(spatialdim)[0], INTEGER(xdimOZ)[0], 1, 1, false, false, LOGICAL(Time)[0], R_NilValue, KEY + currentRegister); SPRINTF(ERROR_LOC, "getting positions with NA: "); // print("global=%d\n", GLOBAL.fit.lengthshortname); GLOBAL_UTILS->basic.skipchecks = skipchecks; NAs = 0; for (i=0; inrow, *ncol = cov->ncol; cov_fct *C = CovList + cov->nr; // nicht gatternr SEXPTYPE *type = C->kappatype; count= 0; for (i=0; ikappas; i++) { if (cov->kappasub[i] != NULL) { count += countnas(cov->kappasub[i], excludetrend, level + 1); } // print(">> %s %d %d %d excl=%d %d\n", NAME(cov), level, isTrend(cov->typus), if (excludetrend && (level == 0 || (level == 1 && cov->calling->nr == MULT)) && ParamIsTrend(cov, i) //&& !PisNULL(i) // wichtig, da ja noch der Parameter durch ein Modell ) // gegeben sein koennte continue; int pt = SortOf(cov, i, 0, 0); if (nrow[i] == 0 || ncol[i] == 0 || pt == IGNOREPARAM || pt == DONOTRETURNPARAM || pt == FORBIDDENPARAM) continue; endfor = nrow[i] * ncol[i]; if (type[i] == REALSXP) { //printf("%s %s %f\n", NAME(cov), KNAME(i), P0(i)); double *p = P(i); for (r=0; rsub[i]; if (sub == NULL) continue; count += countnas(sub, excludetrend, level + 1); } // print("<< %d %d\n", level, count); return count; } void Take21internal(cov_model *cov, cov_model *cov_bound, double **bounds_pointer, int *NBOUNDS) { /* determine the bounds for the parameters that are to be estimated */ int i, c, r, nv=0, // zaehlt NAs *nrow = cov->nrow, *ncol = cov->ncol, *nrow2 = cov_bound->nrow, *ncol2 = cov_bound->ncol; cov_fct *C = CovList + cov->nr; // nicht gatternr SEXPTYPE *type = C->kappatype; if (STRCMP(Nick(cov), Nick(cov_bound)) != 0) { // print("%s %s\n", CovList[cov->nr].nick, CovList[cov_bound->nr].nick); ERR("models do not match."); } // print("\n\n\n ======================= \n"); // print("%s %d %s\n", C->name, C->kappas, CovList[cov_bound->nr].name); for (i=0; ikappas; i++) { // print("i=%d %s %s alt=%s\n", i, C->name, C->kappanames[i], //CovList[cov_bound->nr].name); if (cov->kappasub[i] != NULL) { Take21internal(cov->kappasub[i], cov_bound->kappasub[i], bounds_pointer, NBOUNDS); continue; } if (ParamIsTrend(cov, i)) continue; int pt = SortOf(cov, i, 0, 0); if (C->kappatype[i] >= LISTOF || pt == IGNOREPARAM || pt == DONOTRETURNPARAM || pt == FORBIDDENPARAM) continue; if (nrow[i] != nrow2[i] || ncol[i] != ncol2[i]) { PRINTF("%s i: %d, nrow1=%d, nrow2=%d, ncol1=%d, ncol2=%d\n", C->name, i, nrow[i], nrow2[i], ncol[i], ncol2[i]); ERR("lower/upper/user does not fit the model (size of matrix)"); } for (r=0; rq == NULL) || // ! natscaling i == DANISO ) // aniso ?? ABfrage OK ?? { // print("%s %s, r=%d, c=%d: %d name, C->kappanames[i], r, c, nv, *NBOUNDS); if (nv >= *NBOUNDS) { PRINTF("%s %s, r=%d, c=%d: %d >= %d\n", C->name, C->kappanames[i], r, c, nv, *NBOUNDS); ERR("lower/upper/user does not fit the model (number parameters)"); } (*bounds_pointer)[nv] = w; nv++; } } //ISNA } //c } // r } // i *NBOUNDS = *NBOUNDS - nv; (*bounds_pointer) += nv; for (i=0; isub[i] != NULL) { Take21internal(cov->sub[i], cov_bound->sub[i], bounds_pointer, NBOUNDS); } } } SEXP Take2ndAtNaOf1st(SEXP model_reg, SEXP model, SEXP model_bound, SEXP spatialdim, SEXP Time, SEXP xdimOZ, SEXP nbounds, SEXP skipchecks) { // MAXMLEDIM double *bounds_pointer; int m, NBOUNDS_INT =INTEGER(nbounds)[0], *NBOUNDS= &NBOUNDS_INT, nr[2] = {INTEGER(model_reg)[0], MODEL_BOUNDS}; SEXP bounds, models[2] = {model, model_bound}; bool oldskipchecks = GLOBAL_UTILS->basic.skipchecks; if (nr[0] == nr[1]) ERR("do not use register 'model bounds'"); NAOK_RANGE = true; if (LOGICAL(skipchecks)[0]) GLOBAL_UTILS->basic.skipchecks = true; for (m=1; m>=0; m--) { // 2er Schleife !! // assert(m==1); CheckModelInternal(models[m], ZERO, ZERO, ZERO, INTEGER(spatialdim)[0], INTEGER(xdimOZ)[0], 1, 1, false, false, LOGICAL(Time)[0], R_NilValue, KEY + nr[m]); GLOBAL_UTILS->basic.skipchecks = oldskipchecks; } NAOK_RANGE = false; PROTECT(bounds = allocVector(REALSXP, *NBOUNDS)); bounds_pointer = NUMERIC_POINTER(bounds); // PMI(KEY[nr[0]]); // PMI(KEY[nr[1]]); Take21internal(KEY[nr[0]], KEY[nr[1]], &bounds_pointer, NBOUNDS); if (*NBOUNDS != 0) ERR("lower/upper does not fit to model"); UNPROTECT(1); return bounds; } void GetNARanges(cov_model *cov, cov_model *min, cov_model *max, double *minpile, double *maxpile, int *NAs, bool dosimulations) { /* determine the ranges of the parameters to be estimated */ int i, r, *nrow = cov->nrow, *ncol = cov->ncol; cov_fct *C = CovList + cov->nr; // nicht gatternr SEXPTYPE *type = C->kappatype; double v, dmin, dmax; // print("\ngetnaranges %s %d %d\n", NAME(cov), *NAs, C->kappas); // PMI(cov); for (i=0; ikappas; i++) { cov_model *sub = cov->kappasub[i]; int end = nrow[i] * ncol[i]; // print("%s %d %d \n", KNAME(i), end, sub == NULL); if (end > 0 && (sub == NULL || isRandom(sub))) { if (type[i] == REALSXP) { dmin = PARAM0(min, i); dmax = PARAM0(max, i); } else if (type[i] == INTSXP) { dmin = PARAM0INT(min, i) == NA_INTEGER ? RF_NA : (double) PARAM0INT(min, i); dmax = PARAM0INT(max, i) == NA_INTEGER ? RF_NA : (double) PARAM0INT(max, i); } else if (type[i] == LISTOF + REALSXP) { int store = GLOBAL.general.set; GLOBAL.general.set = 0; dmin = LPARAM0(min, i); dmax = LPARAM0(max, i); GLOBAL.general.set = store; } else if (isRObject(type[i])) { dmin = 0.0; dmax = 0.0; } else { BUG; dmin = dmax = RF_NA; } if (sub != NULL && end == 1 && dosimulations) {// i.e. isRandom int simulations = 1000; double rr, minr = RF_INF, maxr = RF_NEGINF; for (int k=0; k rr) minr = rr; if (maxr < rr) maxr = rr; } // "printf("r = %f %f %f %f %s\n", minr, maxr, dmin,dmax, KNAME(i)); if (minr > dmin) dmin = minr; if (maxr < dmax) dmax = maxr; } int pt = SortOf(cov, i, 0, 0); if (pt == IGNOREPARAM || pt == DONOTRETURNPARAM || pt == FORBIDDENPARAM || cov->nr==MIXEDEFFECT || ParamIsTrend(cov, i)) continue; for (r=0; rkappanames[i],r, dmin, dmax); (*NAs)++; } // isna } // r } // sub == NULL | isRandom // print("end %s %d\n", KNAME(i), sub == NULL); if (sub != NULL) { // PMI(cov->kappasub[i]); GetNARanges(cov->kappasub[i], min->kappasub[i], max->kappasub[i], minpile, maxpile, NAs, dosimulations); } } // kappas for (i=0; isub[i] == NULL, // cov->sub[i] == NULL ? "xxxx" : NAME(cov->sub[i])); if (cov->sub[i] != NULL) { GetNARanges(cov->sub[i], min->sub[i], max->sub[i], minpile, maxpile, NAs, dosimulations); } } // print("end getnaranges %d\n", *NAs); } int check_recursive_range(cov_model *cov, bool NAOK) { /* called by "Set And GetModelInfo" */ int i, err, kappa = CovList[cov->nr].kappas; SPRINTF(ERROR_LOC, "'%s' : ", NICK(cov)); if ((err = check_within_range(cov, NAOK)) != NOERROR) return err; for (i=0; ikappasub[i] != NULL && (err = check_recursive_range(cov->kappasub[i], NAOK)) != NOERROR) return err; for (i=0; isub[i] != NULL && (err = check_recursive_range(cov->sub[i], NAOK)) != NOERROR) return err; } return NOERROR; } sortsofeffect getTrendEffect(cov_model *cov) { int nkappa = CovList[cov->nr].kappas; int j; for (j=0; jtypus)); if (ParamIsTrend(cov, j)) { if (!PisNULL(j)) { return ISNA(P0(j)) || ISNAN(P0(j)) ? FixedTrendEffect : DetTrendEffect; } else { if (cov->kappasub[j] == NULL) { return DetTrendEffect; // 30.4.15 vorher FixedTrendEffect } else if (isRandom(cov->kappasub[j])) return RandomEffect; else if (cov->nr == TREND && j == TREND_MEAN) return DetTrendEffect; else ERR("model too complex"); } } } // printf("here A \n"); return DetTrendEffect; } int CheckEffect(cov_model *cov) { int i,j,end, nr; bool na_var = false; double *p; cov_model *next; if (cov->nr == MIXEDEFFECT) { BUG; // cov->nr = MLEMIXEDEFFECT; if (cov->nsub == 0) { return (cov->nrow[MIXED_BETA] > 0 && ISNAN(P0(MIXED_BETA))) ? FixedEffect : DetTrendEffect; } next = cov->sub[0]; if (isDollar(next)) { if (next->ncol[DVAR] == 1 && next->nrow[DVAR] == 1) { na_var = ISNAN(PARAM0(next, DVAR)); } for (i=0; i<=DMAX; i++) { if (i!=DVAR) { end = next->ncol[i] * next->nrow[i]; p = PARAM(next, i); for (j=0; jsub[0]; // ok } int xx = na_var ? SpVarEffect : SpaceEffect; if (xx == SpVarEffect || xx == SpaceEffect) { BUG; //APMI(next); } return na_var ? SpVarEffect : SpaceEffect; } if (cov->nr == TREND) { int trend, param, effect = effect_error; bool isna ; #define TREND_END 999 for (trend = TREND_MEAN; trend != TREND_END; trend = trend == TREND_MEAN ? TREND_LINEAR : TREND_END) { if ((nr = cov->nrow[trend] * cov->ncol[trend]) > 0) { p = P(trend); isna = ISNAN(p[0]); if ((effect != effect_error) && ((effect==FixedTrendEffect) xor isna)) SERR1("do not mix deterministic effect with fixed effects in '%s'", NICK(cov)); for (i = 1; ikappasub[trend] != NULL) effect = DetTrendEffect; } for (trend = TREND_POLY, param = TREND_PARAM_POLY; trend != TREND_END; trend = trend == TREND_POLY ? TREND_FCT : TREND_END, param = TREND_PARAM_FCT){ if (cov->nrow[trend] > 0) { if (effect != effect_error) SERR("polynomials and free functions in trend may not be mixed with other trend definitions. Please use a sum of trends."); nr = cov->nrow[param] * cov->ncol[param]; if (nr > 0) { p = P(param); isna = ISNAN(p[0]); for (i = 1; itypus), getTrendEffect(cov)); if (isTrend(cov->typus)) { if (cov->nr == MULT) { sortsofeffect current = getTrendEffect(cov->sub[0]); // printf("current %d\n", current); for (i=1; insub; i++) { sortsofeffect dummy = getTrendEffect(cov->sub[i]); if (current != DetTrendEffect && dummy != DetTrendEffect) ERR("trend parameter to be estimated given twice"); if (current == DetTrendEffect) current = dummy; } if (current == effect_error) ERR("trend mismatch"); return current; } else return getTrendEffect(cov); } return RemainingError; } int GetEffect(cov_model *cov, likelihood_info *info) { if (isProcess(cov)) { assert(cov->key == NULL); assert(!PisNULL(GAUSS_BOXCOX)); int nas = 0, total = cov->nrow[GAUSS_BOXCOX] * cov->ncol[GAUSS_BOXCOX]; for (int i=0; i 0) { //printf("GetEffect %d %d\n", nas, info->neffect); BUG; info->nas[info->neffect] = nas; info->effect[info->neffect] = DataEffect; (info->neffect)++; } return GetEffect(cov->sub[0], info); } bool excludetrend = true, plus = cov->nr == PLUS; // || cov->nr == SELECT; int i, n = plus ? cov->nsub : 1; if (info->neffect >= MAX_LIN_COMP) ERR("too many linear components"); for (i=0; isub[i] : cov; // if (component->nr == TREND && component->kappasub[TREND_MEAN] != NULL) { // GetEffect(component->kappasub[TREND_MEAN], info->effect, info->nas, neffect); // continue; // } else if (component->nr == PLUS) { GetEffect(component, info); continue; } info->effect[info->neffect] = CheckEffect(component); // printf("i=%d %d %d %d\n", i,n, info->neffect, info->effect[0]); // pmi(component, 0); info->nas[info->neffect] = countnas(component, excludetrend, 0); // printf("info %d %d\n", info->neffect, info->nas[info->neffect]); if (info->effect[info->neffect] == effect_error) SERR("scaling parameter appears with constant matrix in the mixed effect part"); if (info->effect[info->neffect] > LastMixedEffect) { // printf("varmodel = %d %d %d %d\n", info->varmodel,model_undefined, // model_morethan1, info->effect); info->varmodel = info->varmodel == model_undefined ? info->neffect : model_morethan1; info->Var = component; } (info->neffect)++; } return NOERROR; } naptr_type MEMORY[MODEL_MAX+1]; covptr_type MEM_COVMODELS[MODEL_MAX+1]; double *MEM_PT_VARIANCE[MODEL_MAX+1]; //static elptr_type MEMORY_ELMNTS[MODEL_MAX+1]; int MEM_NAS[MODEL_MAX+1]; //int MEM_ELMNTS[MODEL_MAX+1]; int SetAndGetModelInfo(cov_model *key, int shortlen, int allowforintegerNA, bool excludetrend, // IN int newxdim, int globvar, // IN likelihood_info *info){ // OUT // bool *trans_inv, bool *isotropic, double **Matrix, //int *neffect, int effect[MAXSUB], //int *NAs, int nas[MAXSUB], NAname_type names) { int i, rows, mem_vdim1[MAX_NA], mem_vdim2[MAX_NA], covzaehler[MAXNRCOVFCTS], jump = -1, err = NOERROR; cov_model *cov = !isInterface(key) ? key : key->key == NULL ? key->sub[0] : key->key, *sub = !isProcess(cov) ? cov : cov->key == NULL ? cov->sub[0] : cov->key, *min=NULL, *max=NULL, *pmin=NULL, *pmax=NULL, *openmin=NULL, *openmax=NULL; sortsofparam mem_sorts[MAX_NA]; bool mem_isnan[MAX_NA], mem_bayesian[MAX_NA]; double mle_min[MAX_NA], mle_max[MAX_NA], mle_pmin[MAX_NA], mle_pmax[MAX_NA], mle_openmin[MAX_NA], mle_openmax[MAX_NA], *matrix = NULL; SPRINTF(ERROR_LOC, "checking model : "); if (PrevLoc(key)->timespacedim > MAXMLEDIM) ERR("dimension too high in MLE"); if (sub->pref[Nothing] == PREF_NONE) { err = ERRORINVALIDMODEL; goto ErrorHandling; } info->newxdim = newxdim; info->trans_inv = sub->domprev == XONLY && isNegDef(sub->typus); info->isotropic = isAnyIsotropic(sub->isoown); if (info->trans_inv && info->isotropic) { info->newxdim = 1; // removeOnly(KEY + modelnr); nicht wegnehmen // da derzeit negative distanczen in GLOBAL.CovMatrixMult auftreten -- obsolete ?! } // GLOBAL_UTILS->basic.skipchecks = skipchecks; check_recursive_range(key, true); if ((err = get_ranges(cov, &min, &max, &pmin, &pmax, &openmin, &openmax)) != NOERROR) goto ErrorHandling; // MEM_ELMNTS[currentRegister] = MEM_NAS[currentRegister] = 0; for (i=0; inames, mem_sorts, mem_vdim1, mem_vdim2, mem_isnan, mem_bayesian, MEM_COVMODELS[currentRegister], covzaehler, allowforintegerNA, shortlen, (PL >= PL_COV_STRUCTURE) + (PL >= PL_DETAILS) + (PL >= PL_SUBDETAILS), 0, false, excludetrend)) != NOERROR) goto ErrorHandling; SPRINTF(ERROR_LOC, "'%s' : ", NICK(key)); // PMI(sub); info->NAs = 0; GetNARanges(cov, min, max, mle_min, mle_max, &(info->NAs), false); //printf("A\n"); // PMI(cov); // print("XXz modelnr=%d %d\n",info->NAs, MEM_NAS[currentRegister]); if (info->NAs != MEM_NAS[currentRegister]) BUG; info->NAs = 0; GetNARanges(cov, pmin, pmax, mle_pmin, mle_pmax, &(info->NAs), true); //printf("AB\n"); //print("XX-------- amodelnr=%d\n",info->NAs); if (info->NAs != MEM_NAS[currentRegister]) BUG; info->NAs = 0; GetNARanges(cov, openmin, openmax, mle_openmin, mle_openmax, &(info->NAs), false); if (info->NAs != MEM_NAS[currentRegister]) BUG; // print("XX-------- amodelnr=%d %d\n",info->NAs, MEM_NAS[currentRegister]); BUG; assert(info->varmodel == model_undefined); assert(info->neffect == 0); // GetEffect ersetzt NA-variance durch 1.0 if ((err = GetEffect(cov, info)) != NOERROR) goto ErrorHandling; if (info->NAs != MEM_NAS[currentRegister]) BUG; // // print("XX-------- amodelnr=%d\n",info->NAs); BUG; rows = MEM_NAS[currentRegister]; // bevor NA-variance durch 1.0 ersetzt wird info->globalvariance = false; info->pt_variance = NULL; assert(cov->nr == GAUSSPROC || cov->role == ROLE_COV); //printf(">>>>>>>>>> %s role=%d gloabvar=%d %d varmodel=%d\n", // NAME(cov), cov->role, (int) globvar==NA_INTEGER, info->globalvariance, info->varmodel); if ((cov->nr == GAUSSPROC || cov->role == ROLE_COV) && (globvar == NA_INTEGER || globvar) && info->varmodel != model_undefined && info->varmodel != model_morethan1){ // does a global variance exist? if (isDollar(info->Var) && !PARAMisNULL(info->Var, DVAR) && info->Var->ncol[DVAR]==1 && info->Var->nrow[DVAR]==1) { double var = PARAM0(info->Var, DVAR); // printf("%f var=%f\n", var); // PMI(info->Var); if ((info->globalvariance = ISNA(var) || ISNAN(var)) && info->Var->kappasub[DVAR] == NULL) { info->pt_variance = PARAM(info->Var, DVAR); assert(info->pt_variance != NULL); *(info->pt_variance) = 1.0; (info->NAs)--; info->nas[info->varmodel]--; for (i=0; ipt_variance) { jump = i; for (int j=i+1; jnames[j-1],info->names[j]); } break; } } if (i >= rows) BUG; MEM_NAS[currentRegister]--; rows--; } } // printf("info %d %f\n", info->globalvariance, 1.0); info->globalvariance |= (globvar == true); } if (info->NAs != MEM_NAS[currentRegister]) BUG; MEM_PT_VARIANCE[currentRegister] = info->pt_variance; // PMI(cov); //printf("globalvar = %d\n", info->globalvariance); // assert(info->globalvariance); // assert(info->pt_variance != NULL); //PMI(cov); //print("XX-------- amodelnr=%d %d %d %d %d\n",info->NAs, MEM_NAS[currentRegister], info->globalvariance, globvar, info->varmodel); BUG; // pmi(cov, 1); // printf("%d\n", info->NAs); if (rows == 0) { info->Matrix = NULL; } else { info->Matrix = (double*) MALLOC(rows * MINMAX_ENTRIES * sizeof(double)); matrix = info->Matrix; for (int k=i=0; ibasic.skipchecks; int i, // NAs, // unp = 0, // effect[MAXSUB], nas[MAXSUB], //*pnas = nas, // neffect = 0, err = NOERROR; // double *Matrix = NULL; const char *colnames[MINMAX_ENTRIES] = {"pmin", "pmax", "type", "NAN", "min", "max", "omin", "omax", "col", "row", "bayes"}; SEXP matrix, nameAns, nameMatrix, RownameMatrix, ans=R_NilValue; bool do_not_del_info, isList_x = TYPEOF(x) == VECSXP; likelihood_info local, *info = NULL; // isListofList_x = isList_x; if (isList_x) { if (length(x) == 0) BUG; // isListofList_x = TYPEOF(VECTOR_ELT(x, 0)) == VECSXP; } //printf("init %d\n", xdimOZ); currentRegister = INTEGER(model_reg)[0]; NAOK_RANGE = true; CheckModelInternal(model, length(x) == 0 ? ZERO : isList_x ? NULL : REAL(x), length(x) == 0 ? ZERO : NULL, length(x) == 0 ? ZERO : NULL, spatialdim, xdimOZ, lx, ly, // lx, ly false, //grid distances, //distances Time, isList_x ? x : R_NilValue, KEY + currentRegister); NAOK_RANGE = false; cov_model *cov = KEY[currentRegister], *Likeli = cov; if (isInterface(Likeli)) { cov_model *process = cov->key != NULL ? Likeli->key : Likeli->sub[0]; // printf("%s %d %s %d\n", NAME(Likeli), Likeli->Slikelihood == NULL, NAME(process), isProcess(process)); if (Likeli->Slikelihood == NULL && isProcess(process)) Likeli = process; } // PMI(Likeli); if ((do_not_del_info = Likeli->Slikelihood != NULL)) { info = &(Likeli->Slikelihood->info); // pmi(cov,1); BUG; } else { info = &local; likelihood_info_NULL(info); err = SetAndGetModelInfo(cov, shortlen, allowforintegerNA, excludetrend, xdimOZ, GLOBAL.fit.estimate_variance, info); if (err != NOERROR) goto ErrorHandling; // pmi(Likeli, 1); BUG; } int rows; rows = MEM_NAS[currentRegister]; PROTECT(matrix = allocMatrix(REALSXP, rows, MINMAX_ENTRIES)); PROTECT(RownameMatrix = allocVector(STRSXP, rows)); PROTECT(nameMatrix = allocVector(VECSXP, 2)); #define total 7 PROTECT(ans = allocVector(VECSXP, total)); PROTECT(nameAns = allocVector(STRSXP, total)); //printf("%d\n", info->Matrix != NULL); if (rows > 0) { MEMCOPY(REAL(matrix), info->Matrix, rows * MINMAX_ENTRIES * sizeof(double)); for (i=0; i>%d %s\n", i, info->names[i]); SET_STRING_ELT(RownameMatrix, i, mkChar(info->names[i])); } } SET_VECTOR_ELT(nameMatrix, 0, RownameMatrix); SET_VECTOR_ELT(nameMatrix, 1, Char(colnames, MINMAX_ENTRIES)); setAttrib(matrix, R_DimNamesSymbol, nameMatrix); i = 0; SET_STRING_ELT(nameAns, i, mkChar("minmax")); SET_VECTOR_ELT(ans, i++, matrix); SET_STRING_ELT(nameAns, i, mkChar("trans.inv")); // !! SET_VECTOR_ELT(ans, i++, ScalarLogical(info->trans_inv)); SET_STRING_ELT(nameAns, i, mkChar("isotropic")); SET_VECTOR_ELT(ans, i++, ScalarLogical(info->isotropic)); SET_STRING_ELT(nameAns, i, mkChar("effect")); SET_VECTOR_ELT(ans, i++, Int(info->effect, info->neffect, MAXINT)); SET_STRING_ELT(nameAns, i, mkChar("NAs")); SET_VECTOR_ELT(ans, i++, Int(info->nas, info->neffect, MAXINT)); SET_STRING_ELT(nameAns, i, mkChar("xdimOZ")); SET_VECTOR_ELT(ans, i++, ScalarInteger(info->newxdim)); SET_STRING_ELT(nameAns, i, mkChar("matrix.indep.of.x")); SET_VECTOR_ELT(ans, i++, ScalarLogical(KEY[currentRegister]->matrix_indep_of_x)); setAttrib(ans, R_NamesSymbol, nameAns); assert(i==total); ErrorHandling: UNPROTECT(5); if (info != NULL && !do_not_del_info) likelihood_info_DELETE(info); return ans; } SEXP SetAndGetModelLikeli(SEXP model_reg, SEXP model, SEXP x) { return SetAndGetModelInfo(model_reg, model, x, 0, false, 0, 0, false, 0,// only dummy variables GLOBAL.fit.lengthshortname, LIKELI_NA_INTEGER, LIKELI_EXCLUDE_TREND); } SEXP SetAndGetModelInfo(SEXP model_reg, SEXP model, SEXP spatialdim, SEXP distances, SEXP ygiven, SEXP Time, SEXP xdimOZ, SEXP shortlen, SEXP allowforintegerNA, SEXP excludetrend) { return SetAndGetModelInfo(model_reg, model, R_NilValue, INTEGER(spatialdim)[0], LOGICAL(distances)[0], 1, LOGICAL(ygiven)[0] ? 1 : 0, LOGICAL(Time)[0], INTEGER(xdimOZ)[0], INTEGER(shortlen)[0], INTEGER(allowforintegerNA)[0], LOGICAL(excludetrend)[0]); } void expliciteDollarMLE(int* ModelNr, double *values) { // // userinterfaces.cc int i, un, modelnr = *ModelNr, NAs = MEM_NAS[modelnr]; // first get the naturalscaling values and devide the preceeding // scale model by this value if (NS==NATSCALE_MLE) { iexplDollar(KEY[modelnr], true); } // Then get the values out of the model for (un=i=0; unnr; if (i==0 || cov != MEM_COVMODELS[*reg][i-1]) { if (!isDummyInit(C->Init)) { // print("i=%d %s initalising (%f)\n", i, NAME(cov), MEMORY[*reg][i][0]); C->Init(cov, &s); // print("i=%d %s initalised (%f)\n", i, NICK(MEM_COVMODELS[*reg][i]), MEMORY[*reg][i][0]); } } // } //printf("done\n"); // int one = 1; setListElements(reg, &one, &one, &one); } void PutValuesAtNA(int *reg, double *values){ PutValuesAtNAintern(reg, values, true); } void PutValuesAtNAnoInit(int *reg, double *values){ PutValuesAtNAintern(reg, values, false); } /* void setListElements(int *reg, int *i, int *k, int* len_k) { int len = *len_k; if (*reg < 0 || *reg > MODEL_MAX) XERR(ERRORREGISTER); cov_model *cov = KEY[*reg]; if (cov==NULL) ERR("register is not initialised by 'RFfit'"); if (isInterface(cov)) { cov = cov->key == NULL ? cov->sub[0] : cov->key; } if (cov->nr == SELECT) { int j; if (len != cov->nrow[SELECT_SUBNR]) { PFREE(SELECT_SUBNR); PALLOC(SELECT_SUBNR, len, 1); } for (j=0; j #include #include #include #include #ifdef SCHLATHERS_MACHINE #undef SCHLATHERS_MACHINE #endif #ifdef RANDOMFIELDS_DEBUGGING #undef RANDOMFIELDS_DEBUGGING #endif #ifdef showfree #undef showfree #endif #ifdef DOPRINT #undef DOPRINT #endif #define MAXNRCOVFCTS 300 #define MAXUNITSCHAR 10 #define MAXINVERSIONS 2 #endif /* GSL_VS_R_H */ RandomFields/src/SpherModelsInitNerror.cc0000644000176200001440000000504013074763020020161 0ustar liggesusers/* Authors Christoph Berreth, cberreth@mail.uni-mannheim.de library for simulation of random fields on spheres -- init part and error messages Copyright (C) 2014 -- 2014 Christoph Berreth 2015 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* header files */ #include "RF.h" /* for struct cov_model, macro P0, enthält u.A. basic.h für vordefinierte Konstanten*/ #include "SpherModels.h" /* muss nach RF.h stehen, da cov_model enthalten. */ /* function to initialize the sperical models */ void SpherModelsinit( ){ /* ------ sinepower model ------ */ pref_type psinepower = {0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("sinepower", PosDefType, 1, NULL, XONLY, SPHERICAL_ISOTROPIC, checkOK, rangeSinePower, psinepower, SCALAR, 2, false, MONOTONE); kappanames("alpha", REALSXP); addCov(SinePower, NULL, NULL); /* ------ model of the multiquadratic family ------ */ pref_type pmultiquad = {0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("multiquad", PosDefType, 2, NULL, XONLY, SPHERICAL_ISOTROPIC, checkOK, rangeMultiquad, pmultiquad, SCALAR, 2, false, MONOTONE); kappanames("delta", REALSXP, "tau", REALSXP); addCov(Multiquad, NULL, NULL); /* ------ Choquet's representation ------ */ /* pref_type pchoquet = {0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("choquet", PosDefType, 0, 0, 1, kappa_choquet, XONLY, ISOTROPIC, checkChoquet, rangeChoquet, pchoquet, false, 1, INFDIM, true, MONOTONE); // IncludeModel: see startGetNset.cc kappanames("b", REALSXP); addCov(Choquet, NULL, NULL); //add_paramtype(paramtype_choquet); */ } RandomFields/src/initNerror.cc0000644000176200001440000033413713074763020016067 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de library for simulation of random fields -- init part and error messages Copyright (C) 2001 -- 2017 Martin Schlather This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // to do: V3.1+: Randverteilungen der RPs in cov, D etc implementieren; // do -> random part; init wird innerhalb von do aufgerufen, // falls nicht initialisiert oder random submodels?? // to do: MLE: random parameters einsammeln #include #include //#include #include #include //#include #include "RF.h" #include "Operator.h" #include "SpherModelsInitNerror.h" int gaussmethod[Forbidden+1]; cov_model *KEY[MODEL_MAX+1]; double ZERO[MAXSIMUDIM], ONE = 1 // *userdefinedCovMatrix[MAXDEFMATRIX][MAXMAKEEXPLICITE], // *OutX=NULL, // *OutY=NULL ; int NATSC_INTERN,NATSC_USER, GENERALISEDCAUCHY, STABLE, BROWNIAN, CAUCHY, GAUSS, NUGGET, PLUS, TBM2NR, BALL, ECF, MULT, GENNSST_INTERN, PROD, DISTRIBUTION, DETERM_DISTR, GAUSS_DISTR, SETPARAM, COVFCTN, COVMATRIX, RFGET, STROKORB_MONO, STROKORB_BALL_INNER, RECTANGULAR, CONST, BIND, POLYGON, SCATTER, MCMC_PGS, MCMC,LIKELIHOOD_CALL, LINEARPART_CALL, PREDICT_CALL, IDCOORD, MULT_INVERSE, GNEITING_INTERN, TRUNCSUPPORT, SHAPESTP, SHAPEAVE, BROWNRESNICK, UNIF, MPPPLUS, CUTOFF, STEIN, BRSHIFTED_USER, BRMIXED_USER, BRORIGINAL_USER, BRSHIFTED_INTERN, BRMIXED_INTERN, BRORIGINAL_INTERN, EXTREMALGAUSSIAN, RANDOMSIGN, ARCSQRT_DISTR, SHAPEPOW, POW, PTS_GIVEN_SHAPE, STATIONARY_SHAPE, STANDARD_SHAPE, LOC, SET_DISTR, SCALESPHERICAL, TBM_OP, USER,TREND, // TREND_PROC, COVARIATE, TRAFO, MIXEDEFFECT, // MLEMIXEDEFFECT, //DENSITY, VARIOGRAM_CALL, SIMULATE, MISSING_COV, NULL_MODEL, POWER_DOLLAR, DOLLAR_PROC, LASTDOLLAR, DOLLAR, PLUS_PROC, MPPPLUS_PROC, MULT_PROC, BINARYPROC, BROWNRESNICKPROC, GAUSSPROC, POISSONPROC, SCHLATHERPROC, SMITHPROC, CHI2PROC, EXTREMALTPROC, TPROC, TRENDEVAL, NUGGET_USER, NUGGET_INTERN, CIRCEMBED, SPECTRAL_PROC_USER, SPECTRAL_PROC_INTERN, DIRECT, SEQUENTIAL, SPECIFIC, SELECTNR, AVERAGE_USER, AVERAGE_INTERN, HYPERPLANE_USER, HYPERPLANE_INTERN, RANDOMCOIN_USER, CE_CUTOFFPROC_USER, CE_CUTOFFPROC_INTERN, CE_INTRINPROC_USER, CE_INTRINPROC_INTERN, TBM_PROC_USER, TBM_PROC_INTERN, VECTOR, ISO2ISO, SP2SP, SP2ISO, S2ISO, S2SP, S2S, SId, E2E, E2EIso, E2Sph, E2SphIso, Sph2Sph, Sph2SphIso, LASTGATTER, FIRST_PLANE, LAST_PLANE, EARTHKM2CART, EARTHMILES2CART, EARTHKM2GNOMONIC, EARTHMILES2GNOMONIC, EARTHKM2ORTHOGRAPHIC, EARTHMILES2ORTHOGRAPHIC, FIRST_TRAFO, LAST_TRAFO; // userdefinedCM_RC[MAXDEFMATRIX][MAXMAKEEXPLICITE], bool NAOK_RANGE=false; char CovNames[MAXNRCOVFCTS][MAXCHAR], CovNickNames[MAXNRCOVFCTS][MAXCHAR]; char NEWMSG[LENERRMSG]; cov_fct *CovList=NULL; int currentNrCov=-1; int currentRegister=-1; char *FREEVARIABLE= (char*) "..."; //globalorig GLOBALORIG = {false, {}}; int PrInL=-1; pref_type PREF_ALL = {PREF_BEST, PREF_BEST, PREF_BEST, PREF_BEST, PREF_BEST, PREF_BEST, PREF_BEST, PREF_NONE, PREF_BEST, PREF_BEST, PREF_BEST, PREF_BEST, PREF_NONE, // specific PREF_BEST, PREF_BEST}, PREF_NOTHING = {PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_BEST, // nothing PREF_NONE}, PREF_TREND = {PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_BEST, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_BEST, // nothing PREF_NONE}, PREF_AUX = {PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE, PREF_NONE}; /* record containing all user specified directions for choosing a simulation method. Currently only one element is contained. */ double GENERAL_PRECISION = 5e-15; double EIGENVALUE_EPS = 1e-15; int ERRORMODELNUMBER = -1; char ERRMSG[LENERRMSG], MSG[LENERRMSG], BUG_MSG[LENMSG], MSG2[LENERRMSG]; errorloc_type ERROR_LOC; errorstring_type ERRORSTRING; char PREF_FAILURE[100 * Nothing]; const char *METHODNAMES[Forbidden+1]={"circulant", //0 "cutoff", "intrinsic", "tbm", "spectral", //4 "direct", "sequential", "trend", "average", "nugget", //9 "coins", "hyperplane", "specific", "any method", // nothing "forbidden"}, *ROLENAMES[ROLE_LAST + 1] = { "", // 0 "covariance model", "Gauss", "max-stable", "BrownResnick", "Smith", // 5 "Schlather", "Poisson", "PoissonGauss", "Hyperplane", "Bernoulli", // 10 "distribution", "likelihood", "", ""}, *CAT_TYPENAMES[OtherType + 1] = { // TcfType, PosDefType, VariogramType, NegDefType, ProcessType, // GaussMethodType, BrMethodType, PointShapeType, RandomType, ShapeType, // TrendType, InterfaceType, RandomOrShape, UnDefinedType, MathDefinition, // OtherType "RM", "RM", "RM", "RM", "RP", "RP", "RP", "RM", "RR", "RM", "RM", "RF", "RM", "RM", "R.", "RO"}, *REGNAMES[MODEL_MAX+1] = {"reg0", "reg1", "reg2", "reg3", "reg4", "reg5", "reg6", "reg7", "reg8", "reg9", "user", "unused", "intern", "split", "gui", "mle", "mlesplit", "mletrend", "mlebounds", "kriging", "conditional", "error model"}, *POSITIVITY_NAMES[(int) pt_mismatch + 1] = {"pt-wise positive definite", "pt-wise indefinite", "pt-wise negative definite", "pt-wise zero", "pt-wise param dependent", "pt-wise submodel dependent", "pt-wise undefined", "pt-wise unknown", "pt-wise mismatch"}; // int SYS_TO_ISO[nr_coord_sys_proj] = {GNOMONIC_PROJ, ORTHOGRAPHIC_PROJ}; char STANDARDPARAM[MAXPARAM][MAXCHAR], STANDARDSUB[MAXSUB][MAXCHAR]; void errorMSG(int err, char* M, int len, bool final) { char m[LENERRMSG], m2[LENERRMSG]; if (err >= ERRORM && err <= ERRORMEND) err = ERRORM; switch (err) { case NOERROR : STRCPY(m,"none"); break; case NOERROR_REPEAT : STRCPY(m,"none; looking for further covariances applicable to the same method");break; case NOERROR_ENDOFLIST : STRCPY(m,"none; end of list");break; case ERRORDUMMY : STRCPY(m,"none (dummy)"); break; case ERRORNOTDEFINED : STRCPY(m,"specified method undefined for the given model or no simulation method found for the given model");break; case ERRORCARTESIAN : STRCPY(m,"only cartesian system allowed (currently)"); break; case ERRORNOTPROGRAMMEDYET : STRCPY(m,"Not programmed yet in RandomFields Version 3. Sorry."); break; case ERRORVDIMNOTPROGRAMMEDYET : STRCPY(m,"multivariate version not programmed yet. Sorry."); break; case ERRORTYPECONSISTENCY : STRCPY(m,"incorrect choice of submodel (type inconsistency)"); break; case ERRORFAILED: STRCPY(m,"algorithm failed (partially)");break; case ERRORMEMORYALLOCATION: STRCPY(m, "memory allocation error -- too much space demanded or non-positive number of bytes requested"); break; case ERRORNOTINITIALIZED: STRCPY(m,"not initialized or storing=FALSE");break; case ERRORDECOMPOSITION: STRCPY(m,"covariance function does not seem to be (strictly) positive definite");break; case ERRORNOMULTIVARIATE : STRCPY(m, "multivariate models not allowed (yet)"); break; case ERROR_MATRIX_SQUARE : STRCPY(m, "square matrix expected"); break; case ERROR_MATRIX_VDIM : STRCPY(m, "size of matrix is not a multiple of the multivariate dimension"); break; case ERROR_MATRIX_POSDEF : STRCPY(m, "matrix does not seem to be strictly positive definite"); break; // case ERROR_MATRIX_ : STRCPY(m, ""); break; case ERRORDIM: // // { printf("error dimension\n"); cov_model *cov; crash(cov); } SPRINTF(m,"dimension specification not in [1,%d] or dimension of coordinates larger than that the supposed spatio-temporal process", MAXSIMUDIM);break; case ERRORWAVING : STRCPY(m,"Rescaling not possible (waving or large nugget effect?)");break; case ERRORRESCALING: STRCPY(m,"practical range not defined"); break; case ERRORNOSTATMATCH : STRCPY(m,"no matching assumption found for the domains"); break; case ERRORANISO: STRCPY(m,"anisotropic call not allowed"); break; case ERRORUNKNOWNMETHOD: STRCPY(m,"Unknown method in this context or unallowed mixture of methods"); break; case ERRORWRONGDIM: STRCPY(m,"wrong dimension"); break; case ERRORUNKOWNSXPTYPE: STRCPY(m, "parameter value of unknown SXP type"); break; case ERROROUTOFMETHODLIST: char restrictive[100], info[150]; SPRINTF(restrictive, "Are the %s() too restrictive?", RFOPTIONS); SPRINTF(info, "\n You get (more) internal information if you set %s(%s=%d) before running your code.", RFOPTIONS, "cPrintlevel", PL_DETAILSUSER); SPRINTF(m, "Running out of list of methods. %s%s", GLOBAL_UTILS->basic.skipchecks ? "Did you try an invalid parameter combination?" : restrictive, PL <= 2 ? info : "" ); break; case ERRORREGISTER: STRCPY(m, "register number out of range"); break; case ERRORWRONGISO: STRCPY(m, "impossible sequence of isotropies or coordinate systems"); break; case ERRORKERNEL: STRCPY(m, "the mapping 'earth -> cartesian' keeps definiteness only if it is used as a kernel."); break; case ERRORM: STRCPY(m, ERRORSTRING); break; case ERRORWRONGVDIM: STRCPY(m, ERRORSTRING); break; case ERRORBADVDIM: STRCPY(m, "m-dimensionality could not be detected"); break; case ERRORNOTCARTESIAN: STRCPY(m, "Currently only cartesian coordinate systems are allowed"); break; case ERRORODDCOORDTRAFO: STRCPY(m, "coordinate transformation not possible or not programmed yet"); break; // extremes: case ERRORSUBMETHODFAILED: SPRINTF(m, "no good submethods exist"); case ERRORSTATVARIO: STRCPY(m, "negative definite function expected depending on 1 variable only"); break; case ERRORNOVARIOGRAM: STRCPY(m, "Variogram model not allowed in this context"); break; case ERRORNORMALMIXTURE: STRCPY(m, "only normal mixtures as first submodel allowed (Gneiting, 2002)"); break; case ERRORMAXDIMMETH: STRCPY(m, "maximal dimension of variables for the method exceeded"); break; case ERRORPREVDOLLAR: STRCPY(m, "method may not be initialised by preceding initS"); break; case ERRORSPECTRAL: STRCPY(m, "submodel does not have spectral representation"); break; case ERRORTBMCOMBI: STRCPY(m, "the given combination of 'fulldim' and 'reduceddim' is not possible yet."); break; case ERRORINVALIDMODEL : // gauss distribution, no method STRCPY(m, "Invalid covariance model: did you wrongly use an auxiliary function to construct the model?"); break; case ERRORODDMODEL : // gauss distribution, no method STRCPY(m, "Odd covariance model: the use of auxiliary functions and/or your choice of the parameters lead to a covariance model for which no simulation methods exist."); break; case ERRORANISO_T : SPRINTF(m, "'%s' may not be given at the same time with '%s' or '%s'", CovList[DOLLAR].kappanames[DANISO], CovList[DOLLAR].kappanames[DAUSER], CovList[DOLLAR].kappanames[DPROJ]); break; case ERRORDIAMETERNOTGIVEN: STRCPY(m, "Diameter must always be given"); break; case ERRORPREFNONE: STRCPY(m, "the simulaton method does not allow for the given model."); break; case ERRORPREFNONECOV: STRCPY(m, "the given model does not allow for calculation the covariance values."); break; // case : STRCPY(m,"");break; // // Poisson: case ERRORUNKNOWNMAXTYPE : STRCPY(m, "unknown type of max-stable process"); break; case ERRORATOMP : STRCPY(m, "p must be given everywhere or nowhere"); break; case ERRORKRIGETOL : STRCPY(m,"sigma must be at most KRIGE_TOLERANCE"); break; case MSGLOCAL_OK : STRCPY(m,"fine"); break; case MSGLOCAL_JUSTTRY : STRCPY(m, "unclear whether algorithm will work for specified parameters"); break; case MSGLOCAL_NUMOK : STRCPY(m,"fine. Algorithm should work for specified parameters"); break; case MSGLOCAL_ENDOFLIST : STRCPY(m,"end of list for variants of the algorithm"); break; case MSGLOCAL_SIGNPHI : STRCPY(m,"wrong sign of covariance function at break point"); break; case MSGLOCAL_SIGNPHIFST : STRCPY(m, "wrong sign of 1st derivative of the covariance function at the break point"); break; case MSGLOCAL_SIGNPHISND : STRCPY(m, "wrong sign of 2nd derivative of the covariance function at the break point"); break; case MSGLOCAL_INITINTRINSIC : STRCPY(m,"one of a2, b or a0+phi(0) has wrong sign"); break; case ERRORUNSPECIFIED : STRCPY(m,"(unspecified)"); break; default : PRINTF(" error=%d\n", err); // crash(); BUG; } if (final) SPRINTF(m2, "%s %s", ERROR_LOC, m); else STRCPY(m2, m); if (STRLEN(m) > (unsigned int) len && len > 6) { // printf("%s %d %d\n", m, STRLEN(m), len); m2[len-2] = m2[len-3] = m2[len-4] = '.'; m2[len-5] = ' '; m2[len-1] ='\0'; // printf("out %s %d %d\n", m, STRLEN(m), len); } strcopyN(M, m2, len); if (PL >= PL_ERRORS) { PRINTF("error code %d [%s]\n", err, m2); } } void errorMSG(int err, char* m) { errorMSG(err, m, LENERRMSG, false); } void FinalErrorMSG(int err, char* m) { errorMSG(err, m, LENERRMSG, true); } void ErrorStop(int err) { char m[LENERRMSG]; errorMSG(err, m); ERR(m); } int checkOK(cov_model VARIABLE_IS_NOT_USED *cov){ return NOERROR; } int checkMissing(cov_model *cov){ if (cov->calling == NULL) ERR("missing may not be called by the user"); char S[100]; cov_model *prev=cov->calling; SPRINTF(S, "'%s' does have not enough submodels", NICK(prev)); ERR(S); return ERRORFAILED; // damit compiler keine Warnung bringt } int checkNotOK(cov_model VARIABLE_IS_NOT_USED *cov){ return ERRORFAILED; } void ScaleOne(double *x, cov_model VARIABLE_IS_NOT_USED *cov, double *v){ *v = *x <= 0.05 ? 1.0 : RF_NA; } sortsofparam paramtypeAny(int VARIABLE_IS_NOT_USED k, int VARIABLE_IS_NOT_USED row, int VARIABLE_IS_NOT_USED col) { return ANYPARAM; } double *EinheitsMatrix(int dim) { // Einheitsmatrizen double *mem; if ((mem = (double*) CALLOC(dim * dim, sizeof(double))) != NULL) { int d; for (d=0; dnick, nr); if (!(C->Typi[0] != UndefinedType || C->TypeFct != NULL)) return false; for (int k=0; kkappas; k++) { if (C->kappanames[k][0] == ONEARGUMENT_NAME && C->kappanames[k][1] >= '0' && C->kappanames[k][1] <= '9') return false; } } return true; } void InitModelList() { assert(currentNrCov=-1); // otherwise something went wrong with the call assert(MODEL_MAX == 21); // otherwise change REGNAMES assert(ROLE_LAST == 14); // otherwise change ROLENAMES assert(OtherType == 15); // otherwise change TYPENAMES, // CAT_TYPENAMES[OtherType + 1] // TypeConsistency in getNset assert(LAST_ISO == 17); // otherwise change ISONAMES assert(MAXMPPDIM <= MAXSIMUDIM); // ZERO // assert(CUTOFF_THEOR == 4);/* do not change this value as used in RFmethods.Rd */ int i; for (i=0; i", OtherType, 1, 1, 0, NULL, PREVMODELD, PREVMODELI, checkEarth, NULL, pGatter, true, SUBMODEL_DEP, 4, SUBMODEL_DEP, SUBMODEL_DEP); addCov(EarthKM2CartStat, NULL, NULL); addCov(EarthKM2Cart);// addlogCov(logEarthKM2CartStat, logEarthKM2Cart, NULL); EARTHMILES2CART = addFurtherCov(EarthMiles2CartStat, ErrCov);// 16 addCov(EarthMiles2Cart);// addlogCov(logEarthMiles2CartStat, logEarthMiles2Cart, NULL); FIRST_PLANE = EARTHKM2GNOMONIC = addFurtherCov(Earth2GnomonicStat, ErrCov);// 16 addCov(Earth2Gnomonic);// addlogCov(logEarth2GnomonicStat, logEarth2Gnomonic, NULL); EARTHMILES2GNOMONIC = CopyModel(">", EARTHKM2GNOMONIC); EARTHKM2ORTHOGRAPHIC = addFurtherCov(EarthKM2OrthogStat, ErrCov);// 18 addCov(EarthKM2Orthog);// addlogCov(logEarthKM2OrthogStat, logEarthKM2Orthog, NULL); EARTHMILES2ORTHOGRAPHIC = addFurtherCov(EarthMiles2OrthogStat, ErrCov);// 19 addCov(EarthMiles2Orthog);// addlogCov(logEarthMiles2OrthogStat, logEarthMiles2Orthog, NULL); LAST_PLANE = EARTHMILES2ORTHOGRAPHIC; LAST_TRAFO = EARTHMILES2ORTHOGRAPHIC; // addFurtherCov(iso2iso_MLE, D_2, DD_2); // 12 // addFurtherCov(spiso2spiso_MLE, D_2, DD_2); // 13 // addFurtherCov(spacetime2iso_MLE, D_2, DD_2); // 14 // addFurtherCov(Stat2iso_MLE, ErrCov); // 15 // addCov(Nonstat2iso_MLE);// // addFurtherCov(Stat2spacetime_MLE, ErrCov);// 16 // int mleGatter = addFurtherCov(Stat2Stat_MLE, ErrCov);// 17 // addCov(Nonstat2Stat_MLE);// // if (mleGatter != S2S + (S2S - ISO2ISO + 1)) { // ERR("mleGatter has the wrong number"); // } MISSING_COV = IncludePrim("missing", OtherType, 0, XONLY, SYMMETRIC, checkMissing, NULL, INFDIM, true, NOT_MONOTONE); make_internal(); NULL_MODEL = IncludePrim("null", UndefinedType, 1, XONLY, ISOTROPIC, checkOK, rangeNullModel, INFDIM, true, NOT_MONOTONE); kappanames("type", INTSXP); addCov(0, NullModel, NullModel, NullModel, NullModel, NULL); RandomShape(INFTY, structOK, initOK, doOK, do_random_ok, false, false, false); make_internal(); addTypeFct(TypeNullModel); // ******************* // **** definite functions **** // ******************* SELECTNR = // to do: replace by parameter in '+', selecting the 'type' or // 'models' IncludeModel("select", TcfType, 1, MAXSUB, 1, NULL, PREVMODELD, PREVMODELI, checkselect, rangeselect, PREF_ALL, true, PARAM_DEP, INFDIM, SUBMODEL_DEP, NOT_MONOTONE); kappanames("subnr", INTSXP); addCov(select, NULL, NULL); addReturns(NULL, NULL, covmatrix_select, iscovmatrix_select, NULL, NULL, NULL, NULL, NULL, NULL); pref_type pplus = {5, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 5, 5}; // CE CO CI TBM Sp di sq Tr av n mpp Hy spf any PLUS = IncludeModel("+", UndefinedType, 1, MAXSUB, 0, NULL, PREVMODELD, PREVMODELI, checkplus, NULL, pplus, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); // Achtung in covmatrix_plus wird SELECT_SUBNR verwendet! nickname("plus"); addCov(plusStat, Dplus, DDplus, NULL, NULL); addCov(plusNonStat); addTBM(NULL, spectralplus); RandomShape(0, structplus, initplus, doplus, false, false, true); addReturns(NULL, NULL, covmatrix_plus, iscovmatrix_plus, NULL, NULL, NULL, NULL, NULL, NULL); addTypeFct(Typeplus); setptwise(pt_submodeldep); pref_type pmal = {5, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any MULT = IncludeModel("*", UndefinedType, 1, MAXSUB, 0, NULL, PREVMODELD, PREVMODELI, checkmal, NULL, pmal, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("mult"); addCov(malStat, Dmal, NULL); addCov(malNonStat); addlogCov(logmalStat, logmalNonStat, NULL); // RandomShape(structplusmal, initmal, domal, NULL); addTypeFct(Typemal); setptwise(pt_submodeldep); pref_type pS= {5, 0, 0, 5, 5, 5, 5, 0, 0, 5, 0, 0, 1, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any DOLLAR = IncludeModel("$", UndefinedType, // to do: tcftype durch einen allgemeinen Type ersetzen, da auch Trend dem "$" folgen kann. Z.Z. nicht moeglich. 1, 1, 5, kappaS, // kappadollar, PREVMODELD, PREVMODELI, checkS, rangeS, pS, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); // do not change Order!! nickname("S"); kappanames("var", REALSXP, "scale", REALSXP, "anisoT", REALSXP, "Aniso", REALSXP, "proj", INTSXP); change_typeof(DAUSER, ShapeType); change_typeof(DSCALE, RandomOrShapeType); change_typeof(DVAR, RandomOrShapeType); subnames("phi"); addTypeFct(TypeS); addCov(Siso, DS, DDS, D3S, D4S, inverseS, nonstatinverseS); // unterscheidung nur wegen der // geschwindigkeit, also Siso ist ein sehr haeufiger Spezialfall von Sstat addCov(Snonstat); addlogCov(logSiso, NULL, nonstat_loginverseS); addLocal(coinitS, ieinitS); addTBM(tbm2S, NULL, spectralS); nablahess(nablaS, hessS); RandomShape(INFTY, structS, initS, doS, true, true, true); addReturns(NULL, NULL, covmatrixS, iscovmatrixS, NULL, NULL, NULL, NULL, NULL, NULL); Taylor(RF_NA, RF_NA, RF_NA, RF_NA); TailTaylor(RF_NA, RF_NA, RF_NA, RF_NA); setptwise(pt_submodeldep); LASTDOLLAR = addFurtherCov(Sstat, DS, DDS); // 20.8.14 aus ErrCov (wieder) // D2 gemacht addCov(Snonstat); addlogCov(logSstat, logSnonstat, NULL); RandomShape(INFTY, structS, initS, doS, true, true, false); // printf("%d\n", currentNrCov); BUG; pref_type pPowS= {5, 0, 0, 5, 5, 5, 5, 0, 0, 5, 0, 0, 1, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any POWER_DOLLAR = IncludeModel("$power", UndefinedType, // to do: tcftype durch einen allgemeinen Type ersetzen, da auch Trend dem "$" folgen kann. Z.Z. nicht moeglich. 1, 1, 3, NULL, // kappadollar, PREVMODELD, PREVMODELI, checkPowS, rangePowS, pPowS, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); // do not change Order!! nickname("Spower"); kappanames("var", REALSXP, "scale", REALSXP, "pow", REALSXP); subnames("phi"); addTypeFct(TypePowS); addCov(PowSstat, NULL, inversePowS); // unterscheidung nur wegen der // geschwindigkeit, also Siso ist ein sehr haeufiger Spezialfall von Sstat addCov(PowSnonstat); addlogCov(logSstat, logSnonstat, NULL); // addLocal(coinitS, ieinitS); RandomShape(INFTY, structPowS, initPowS, doPowS, true, true, true); Taylor(RF_NA, RF_NA, RF_NA, RF_NA); TailTaylor(RF_NA, RF_NA, RF_NA, RF_NA); // at the origin: prespecified distribution // old RandomFields ave1,ave2 IncludeModel("ave", PosDefType, 1, 1, 3, kappa_ave, XONLY, SYMMETRIC, checkave, rangeave, PREF_ALL, false, SCALAR, AveMaxDim, false, NOT_MONOTONE); kappanames("A", REALSXP, "z", REALSXP, "spacetime", INTSXP); addCov(ave, NULL, NULL); RandomShape(structAve, true); pref_type pbcw = {2, 5, 5, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("bcw", VariogramType, 0, 0, 3, XONLY, ISOTROPIC, checkbcw, rangebcw, pbcw, INFDIM, false, NORMAL_MIXTURE); // todo part is even // LAPLACE kappanames("alpha", REALSXP, "beta", REALSXP, "c", REALSXP); addCov(bcw, Dbcw, DDbcw, Inversebcw); addLocal(coinitbcw, ieinitbcw); AddVariant(PosDefType, ISOTROPIC); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); IncludeModel("locstatfbm", PosDefType, 0, 0, 2, XONLY, ISOTROPIC, checklsfbm, rangelsfbm, PREF_ALL, INFDIM, false, MONOTONE); nickname("lsfbm"); kappanames("alpha", REALSXP, "const", REALSXP); addCov(lsfbm, Dlsfbm, DDlsfbm, D3lsfbm, D4lsfbm, Inverselsfbm); Taylor(-1, RF_NA, 0, 0); TailTaylor(-1, RF_NA, 0, 0); pref_type pbessel = {2, 0, 0, 0, 5, 3, 3, 0, 5, 0, 5, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("bessel", PosDefType, 1, XONLY, ISOTROPIC, checkBessel, rangeBessel, pbessel, SCALAR, INFDIM, false, NOT_MONOTONE); kappanames("nu", REALSXP); addCov(Bessel, NULL, NULL); addTBM(initBessel, spectralBessel); IncludeModel("bigneiting", PosDefType, 0, 0, 8, kappa_biGneiting, XONLY, ISOTROPIC, checkbiGneiting, rangebiGneiting, PREF_ALL, false, 2, PARAM_DEP, true, NOT_MONOTONE); addCov(biGneiting, DbiGneiting, DDbiGneiting, NULL, NULL); kappanames("kappa", INTSXP, "mu", REALSXP, "s", REALSXP, "sred12", REALSXP, "gamma", REALSXP, "cdiag", REALSXP, "rhored", REALSXP, "c", REALSXP); change_sortof(GNEITING_S, SCALEPARAM); change_sortof(GNEITING_CDIAG, VARPARAM); change_sortof(GNEITING_C, DONOTRETURNPARAM); change_sortof(GNEITING_MU, CRITICALPARAM); change_sortof(GNEITING_GAMMA, CRITICALPARAM); RandomShape(0, struct_failed, initbiGneiting, do_failed, false, true, false); pref_type pbernoulli = {5, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("bernoulli", TcfType, 1, 1, 3, NULL, PREVMODELD, PREVMODELI, checkbinary, rangebinary, pbernoulli, false, SCALAR, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); kappanames("threshold", REALSXP, "correlation", INTSXP, "centred", INTSXP); addCov(binary, NULL, NULL); IncludeModel("biWM", PosDefType, 0, 0, 8, kappa_biWM, XONLY, ISOTROPIC, checkbiWM2, rangebiWM2, PREF_ALL, false, 2, INFDIM, false, NOT_MONOTONE); nickname("biwm"); addCov(biWM2, biWM2D, biWM2DD, biWM2D3, biWM2D4, ErrInverse); addLocal(coinitbiWM2, NULL); kappanames("nudiag", REALSXP, "nured12", REALSXP, "nu", REALSXP, // or lower triangle "s", REALSXP, // lower triangle definition "cdiag", REALSXP, "rhored", REALSXP, "c", REALSXP, // or lower triangle "notinvnu", INTSXP); change_sortof(BInudiag, CRITICALPARAM ); change_sortof(BInured, CRITICALPARAM ); change_sortof(BInu, DONOTRETURNPARAM); change_sortof(BIc, DONOTRETURNPARAM); change_sortof(BIs, SCALEPARAM ); change_sortof(BIcdiag, VARPARAM); RandomShape(0, struct_failed, initbiWM2, do_failed, false, true, false); // bivariate stable or bivariate exponetial model IncludePrim("bistable", PosDefType, 4, kappa_biStable, XONLY, ISOTROPIC, checkbiStable, rangebiStable, PREF_ALL, 2, 3, false, MONOTONE); kappanames("alpha", REALSXP, "s", REALSXP, // lower triangle definition "cdiag", REALSXP, "rho", REALSXP ); addCov(biStable, DbiStable, DDbiStable, D3biStable, D4biStable, NULL); addLocal(coinitbiStable, NULL); pref_type pbrownresnick = {5, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any BROWNRESNICK = IncludeModel("brownresnick", TcfType, 1, 1, 0, NULL, XONLY, PREVMODELI, checkbrownresnick, NULL , pbrownresnick, false, SCALAR, SUBMODEL_DEP, false, SUBMODEL_DEP); addCov(brownresnick, Dbrownresnick, DDbrownresnick, D3brownresnick, NULL, NULL); RandomShape(0, struct_brownresnick, init_brownresnick, do_brownresnick); // Taylor(0, 0, 0, 0, 0, 0, 0, 0); IncludeModel("br2bg", PosDefType, 1, 1, 0, XONLY, PREVMODELI, check_BR2BG, NULL, PREF_ALL, SUBMODEL_DEP, false, SUBMODEL_DEP); addCov(BR2BG, NULL, NULL); IncludeModel("br2eg", PosDefType, 1, 1, 0, XONLY, PREVMODELI, check_BR2EG, NULL, PREF_ALL, SUBMODEL_DEP, false, SUBMODEL_DEP); addCov(BR2EG, NULL, NULL); pref_type pcauchy= {2, 5, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("cauchy", PosDefType, 1, XONLY, ISOTROPIC, checkCauchy, rangeCauchy, pcauchy, SCALAR, INFDIM, false, NORMAL_MIXTURE); kappanames("gamma", REALSXP); addCov(Cauchy, DCauchy, DDCauchy, InverseCauchy); // addlogCov(logCauchy); addTBM(TBM2Cauchy); addLocal(coinitCauchy, NULL); addGaussMixture(DrawMixCauchy, LogMixDensCauchy); // pref_type pctbm={2, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any // IncludePrim("cauchytbm", PosDefType, 3, XONLY, ISOTROPIC, checkOK, // rangeCauchytbm, pctbm, SCALAR, INFDIM, false); // kappanames("alpha", REALSXP, "beta", REALSXP, "gamma", REALSXP); // addCov(Cauchytbm, DCauchytbm, InverseCauchy); // scale not correct, but // should be an approximation that is good enough IncludePrim("circular", TcfType, 0, XONLY, ISOTROPIC, checkOK, NULL, 2, false, GNEITING_MON); addCov(circular, Dcircular, ScaleOne); RandomShape(structcircular); // IncludePrim("cone", PosDefType, 3, XONLY, ISOTROPIC, checkcone, rangecone); // kappanames("r", REALSXP, "socle", REALSXP, "height", REALSXP); // RandomShape(init_cone, mppget_cone, sd_standard, MPP_POISS); IncludePrim("CDeWijsian", VariogramType, 2, NULL, XONLY, ISOTROPIC, checkdewijsian, rangeDeWijsian, PREF_NOTHING, SCALAR, INFDIM, false, MONOTONE); nickname("cdewijs"); make_internal(); kappanames("alpha", REALSXP, "range", REALSXP); addCov(DeWijsian, NULL, NULL, InverseDeWijsian); // same as RMcovariate, ausser dass RMcovariate interpoliert // und CONSTANT mehrere Saetze von covariaten erlaubt??!! IncludeModel("constant", PosDefType, 0, 0, 1, kappaconstant, XONLY, PREVMODELI, // PREVMODELD, PREVMODELI, //wegen Variogramm berechnung in stat. Fall checkconstant, rangeconstant, PREF_ALL, false, PARAM_DEP, INFDIM, false, SUBMODEL_DEP); kappanames("M", REALSXP); addCov(constant, NULL, NULL); addCov(nonstatconstant); AddVariant(NegDefType, ISOTROPIC); // AddVariant(TcfType, PREVMODELI); // AddVariant(ShapeType, EARTH_ISOTROPIC); // AddVariant(TcfType, EARTH_ISOTROPIC); // AddVariant(ShapeType, SPHERICAL_ISOTROPIC); // AddVariant(TcfType, SPHERICAL_ISOTROPIC); COVARIATE = // intern ok IncludeModel("covariate", ShapeType, 0, 1, 5, kappa_covariate, XONLY, PREVMODELI, checkcovariate, rangecovariate, PREF_NOTHING, INTERN_SHOW, PARAM_DEP, INFDIM-1, false, NOT_MONOTONE); subnames("norm"); kappanames(COVARIATE_C_NAME, LISTOF + REALSXP, COVARIATE_X_NAME, VECSXP, "raw", INTSXP, COVARIATE_ADDNA_NAME, INTSXP, "factor", REALSXP); change_sortof(COVARIATE_X, DONOTVERIFYPARAM); change_sortof(COVARIATE_ADDNA, DONOTRETURNPARAM); change_sortof(COVARIATE_FACTOR, TRENDPARAM); addCov(covariate, NULL, NULL); setptwise(pt_paramdep); AddVariant(TrendType, PREVMODELI); pref_type pfix={0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("fixcov", PosDefType, 0, 1, 3, kappa_fix, // KERNEL, SYMMETRIC, PREVMODELD, PREVMODELI, checkfix, rangefix, pfix, INTERN_SHOW, PARAM_DEP, INFDIM-1, false, NOT_MONOTONE); subnames("norm"); kappanames("M", LISTOF + REALSXP, "x", VECSXP, "raw", INTSXP); change_sortof(COVARIATE_X, DONOTVERIFYPARAM); addCov(fixStat, NULL, NULL); addCov(fix); setptwise(pt_paramdep); pref_type pcox={2, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("coxisham", PosDefType, 1, 1, 3, kappa_cox, XONLY, ZEROSPACEISO, checkcox, rangecox, pcox, false, SCALAR, CoxMaxDim, false, NOT_MONOTONE); kappanames("mu", REALSXP, "D", REALSXP, "beta", REALSXP); addCov(cox, NULL, NULL); addTBM(initcox, spectralcox); nablahess(coxnabla, coxhess); IncludePrim("cubic", TcfType, 0, XONLY, ISOTROPIC, checkOK, NULL, 3, false, MONOTONE); addCov(cubic, Dcubic, ScaleOne); pref_type pcurl= {2, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("curlfree", PosDefType, 1, 1, 1, kappadivcurl, XONLY, SYMMETRIC, checkdivcurl, rangedivcurl, pcurl, false, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("which", INTSXP); addCov(curl, NULL, NULL); pref_type plocal={5, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any CUTOFF = IncludeModel("cutoff", PosDefType, 1, 1,2, NULL, XONLY, ISOTROPIC, check_co, range_co, plocal, false, SUBMODEL_DEP, MAXCEDIM, true, MONOTONE); kappanames("diameter", REALSXP, "a", REALSXP); addCov(co, NULL, NULL); addCallLocal(alternativeparam_co); // warning("siehe Primitive.cc/biWM: cutoff funktioniert nicht bei MLE, vereinheitlichung mit natsc und verbesserung von biWM notwendig"); IncludeModel("dagum", PosDefType, 0, 0, 3, NULL, XONLY, ISOTROPIC, checkdagum, rangedagum, PREF_ALL, false, 1, INFDIM, false, PARAM_DEP); kappanames("beta", REALSXP, "gamma", REALSXP, INTERNAL_PARAM, REALSXP); addCov(dagum, Ddagum, Inversedagum); RandomShape(0, struct_failed, initdagum, do_failed, false, true, false); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); setptwise(pt_posdef); IncludePrim("dampedcosine", PosDefType, 1, XONLY, ISOTROPIC, checkdampedcosine, rangedampedcosine, PARAM_DEP, false, NOT_MONOTONE); nickname("dampedcos"); kappanames("lambda", REALSXP); addCov(dampedcosine, Ddampedcosine, Inversedampedcosine); // addlogCov(logdampedcosine); /* pref_type pderivative= {2, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("derivative", PosDefType, 1, 1, 1, kappamixed, XONLY, PREVMODELD, checkderivative, rangeDerivative, pderivative, true, //false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("partial",INTSXP); addCov(derivative, NULL, NULL); */ pref_type pdewijsian = {2, 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any //old version IncludePrim("DeWijsian", VariogramType, 1, XONLY, ISOTROPIC, checkOK, rangedewijsian, pdewijsian, SCALAR, INFDIM, false, MONOTONE); //copied from cauchy, must be checked // IncludePrim("DeWijsian", VariogramType, 1, XONLY, ISOTROPIC, // checkOK, rangedewijsian, pdewijsian, SCALAR, INFDIM, false, MONOTONE); //IncludePrim("DeWijsian", VariogramType, 1, XONLY, // ISOTROPIC, // checkOK, rangedewijsian, pdewijsian, SCALAR, INFDIM, false, MONOTONE); nickname("dewijsian"); kappanames("alpha", REALSXP); addCov(dewijsian, Ddewijsian, DDdewijsian, D3dewijsian, D4dewijsian, Inversedewijsian); addLocal(coinitdewijsian, NULL); pref_type pdiv= {2, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("divfree", PosDefType, 1, 1, 1, kappadivcurl, XONLY, SYMMETRIC, checkdivcurl, rangedivcurl, pdiv, false, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("which", INTSXP); addCov(diverge, NULL, NULL); // epsC has been for internal reasons only ; essentially // the gencauchy model, except that 1 in the denominator // is replaced by epsilon pref_type pepsC = {2, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("epsC", PosDefType, 0, 0, 3, NULL, XONLY, ISOTROPIC, checkepsC, rangeepsC, pepsC, false, SCALAR, INFDIM, false, NORMAL_MIXTURE); nickname("epscauchy"); kappanames("alpha", REALSXP, "beta", REALSXP, "eps", REALSXP); addCov(epsC, DepsC, DDepsC, NULL, NULL); addlogCov(logepsC); IncludePrim("exponential", TcfType, 0, XONLY, ISOTROPIC, checkexponential, NULL, INFDIM, false, COMPLETELY_MON); nickname("exp"); addCov(0, exponential, Dexponential, DDexponential, Inverseexponential, NULL); addlogCov(logexponential, NULL, nonstatLogInvExp); addLocal(coinitExp, ieinitExp); addHyper(hyperexponential); // numerisches Ergebnis passt nicht ! addGaussMixture(DrawMixExp, LogMixDensExp); addTBM(TBM2exponential, NULL, spectralexponential); RandomShape(1, initexponential, do_exp); Taylor(-1, 1.0, 0.5, 2.0); TailTaylor(1, 0, 1, 1); // operator, replacing any covariance fct C by EXP(C) (componentwise) IncludeModel("Exp", PosDefType, 1, 1, 2, PREVMODELD, PREVMODELI, checkExp, rangeExp, PREF_ALL, SUBMODEL_DEP, false, NOT_MONOTONE); nickname("exponential"); kappanames("n", INTSXP, "standardised", INTSXP); addCov(Exp, DExp, DDExp, NULL, NULL); // setptwise(pt_paramdef); pref_type pextrgauss = {5, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("extremalgauss", TcfType, 1, 1, 0, NULL, XONLY, PREVMODELI, check_extrgauss, NULL, pextrgauss, false, SCALAR, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); nickname("schlather"); addCov(extrgauss, NULL, NULL); IncludePrim("FD", PosDefType, 1, XONLY, ISOTROPIC, checkOK, rangeFD, 1, false, NOT_MONOTONE); nickname("fractdiff"); kappanames("a", REALSXP); addCov(FD, NULL, NULL); // same as RMcovariate, ausser dass RMcovariate interpoliert // und CONSTANT mehrere Saetze von covariaten erlaubt??!! IncludePrim("flatpower", VariogramType, 1, XONLY, ISOTROPIC, checkoesting, rangeoesting, INFDIM, false, BERNSTEIN); // todo BERNSTEIN kappanames("alpha", REALSXP); addCov(2, oesting, Doesting, DDoesting, NULL, NULL); RandomShape(0, initoesting, do_statiso); Taylor(-1, 2, RF_NA, 4, RF_NA, 6); TailTaylor(-1, RF_NA, 0, 0); BROWNIAN = IncludePrim("fractalB", VariogramType, 1, XONLY, ISOTROPIC, checkfractalBrownian, rangefractalBrownian, INFDIM, false, BERNSTEIN); // todo BERNSTEIN nickname("fbm"); kappanames("alpha", REALSXP); addCov(fractalBrownian, DfractalBrownian, DDfractalBrownian, D3fractalBrownian, D4fractalBrownian, InversefractalBrownian); addlogCov(logfractalBrownian); addLocal(NULL, ieinitBrownian); RandomShape(0, initfractalBrownian, do_statiso); Taylor(-1, RF_NA, 0, 0); TailTaylor(-1, RF_NA, 0, 0); IncludePrim("fractgauss", PosDefType, 1, XONLY, ISOTROPIC, checkOK, rangefractGauss, 1, false, NOT_MONOTONE); kappanames("alpha", REALSXP); addCov(fractGauss, NULL, NULL); pref_type pgauss= {2, 0, 0, 5, 5, 5, 5, 5, 0, 0, 5, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any GAUSS = IncludePrim("gauss", PosDefType, 0, XONLY, ISOTROPIC, checkOK, NULL, pgauss, SCALAR, INFDIM, false, NORMAL_MIXTURE); addCov(Gauss, DGauss, DDGauss, D3Gauss, D4Gauss, InverseGauss); addlogCov(logGauss, NULL, nonstatLogInvGauss); addTBM(NULL, spectralGauss); RandomShape(INFTY, struct_Gauss, initGauss, do_Gauss, false, true, false); addGaussMixture(DrawMixGauss, LogMixDensGauss); Taylor(-1.0, 2.0); TailTaylor(1, 0, 1.0, 2.0); IncludePrim("genB", VariogramType, 2, XONLY, ISOTROPIC, checkOK, rangegenBrownian, INFDIM, false, MONOTONE); nickname("genfbm"); kappanames("alpha", REALSXP, "beta", REALSXP); addCov(genBrownian, NULL, NULL, InversegenBrownian); addlogCov(loggenBrownian); pref_type pgenc = {2, 0, 0, 2, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("gencauchy", PosDefType, 2, XONLY, ISOTROPIC, checkgeneralisedCauchy, rangegeneralisedCauchy, pgenc, SCALAR, INFDIM, false, PARAM_DEP); // todo part is even // LAPLACE kappanames("alpha", REALSXP, "beta", REALSXP); addCov(generalisedCauchy, DgeneralisedCauchy, DDgeneralisedCauchy, InversegeneralisedCauchy); addlogCov(loggeneralisedCauchy); addLocal(coinitgenCauchy, ieinitgenCauchy); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); setptwise(pt_posdef); // bivariate stable or bivariate exponnetial model IncludePrim("bicauchy", PosDefType, 4, kappa_biCauchy, XONLY, ISOTROPIC, checkbiCauchy, rangebiCauchy, PREF_ALL, 2, 3, false, MONOTONE); kappanames("alpha", REALSXP, "beta", REALSXP, "s", REALSXP, // lower triangle definition "rho", REALSXP // lower triangl ); addCov(biCauchy, DbiCauchy, DDbiCauchy, D3biCauchy, D4biCauchy, NULL); addLocal(coinitbiCauchy, NULL); IncludePrim("gengneiting", PosDefType, 2, XONLY, ISOTROPIC, checkgenGneiting, rangegenGneiting, INFDIM-1, true, MONOTONE); // GNEITING_MON ?? // not INFDIM, also not normalscale mixture and alpha will be void kappanames("kappa", INTSXP, "mu", REALSXP); addCov(genGneiting, DgenGneiting, DDgenGneiting, //NULL, NULL, ScaleOne, NULL); IncludePrim("gengneiting", PosDefType, 2, XONLY, ISOTROPIC, checkgenGneiting, rangegenGneiting, INFDIM-1, true, MONOTONE); // GNEITING_MON ?? // not INFDIM, also not normalscale mixture and alpha will be void kappanames("kappa", INTSXP, "mu", REALSXP); addCov(genGneiting, DgenGneiting, DDgenGneiting, //NULL, NULL, ScaleOne, NULL); GNEITING_INTERN = IncludeModel("gengneit_intern", PosDefType, 0, 0, 2, NULL, XONLY, ISOTROPIC, checkgenGneiting, rangegenGneiting, PREF_ALL, true, SCALAR, PARAM_DEP, true, MONOTONE); nickname("gengneiting"); kappanames("kappa", INTSXP, "mu", REALSXP); addCov(Gneiting, DGneiting, DDGneiting, ScaleOne); IncludeModel("gneiting", PosDefType, 0, 0, 1, XONLY, ISOTROPIC, checkGneiting, rangeGneiting, PREF_ALL, PARAM_DEP, true, MONOTONE); // GNEITING_MON ?? kappanames("orig", INTSXP); addCov(Gneiting, DGneiting, DDGneiting, ScaleOne); pref_type pfgennsst= { 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("gennsst", PosDefType, 2, 2, 0, KERNEL, PREVMODELI, checkgennsst, NULL, pfgennsst, SUBMODEL_DEP, false, NOT_MONOTONE); addCov(nonstatgennsst); GENNSST_INTERN = // to do: why internal?? IncludeModel("gennsst_intern", PosDefType, // stimmt nicht, aber egal 2, 2, 1, kappa_gennsst_intern, KERNEL, SYMMETRIC, checkgennsst_intern, range_gennsst_intern, pfgennsst, true, SCALAR, SUBMODEL_DEP, false, NOT_MONOTONE); nickname("gennsst"); kappanames("A", REALSXP); addCov(nonstatgennsst_intern); /* pref_type phelmholtz= {2, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("helmholtz", PosDefType, 1, 1, 2, kappamixed, XONLY, SYMMETRIC, checkhelmholtz,rangeHelmholtz, phelmholtz, true, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("component",REALSXP,"Aniso",REALSXP); addCov(helmholtz, NULL, NULL); */ pref_type phyper= {2, 0, 0, 3, 0, 4, 5, 0, 5, 0, 5, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("hyperbolic", PosDefType, 3, XONLY, ISOTROPIC, checkhyperbolic, rangehyperbolic, phyper, SCALAR, INFDIM, false, NORMAL_MIXTURE); kappanames("nu", REALSXP, "lambda", REALSXP, "delta", REALSXP); addCov(hyperbolic, Dhyperbolic, NULL); // InversehyperbolicSq); addlogCov(loghyperbolic); IncludePrim("iacocesare", PosDefType, 3, XONLY, SPACEISOTROPIC, checkOK, rangeIacoCesare, INFDIM, false, NOT_MONOTONE); nickname("iaco"); kappanames("nu", REALSXP, "lambda", REALSXP, "delta", REALSXP); addCov(IacoCesare, NULL, NULL); IncludeModel("identity", UndefinedType, 1, 1, 1, NULL, PREVMODELD, PREVMODELI, checkId, rangeId, PREF_ALL, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("id"); kappanames("vdim", INTSXP); addCov(IdStat, DId, DDId, IdInverse); addCov(IdNonStat); addTBM(TBM2Id, initId, spectralId); addLocal(coinitId, ieinitId); addTypeFct(Typesetparam); IncludePrim("kolmogorov", VariogramType, 0, XONLY, VECTORISOTROPIC, checkKolmogorov, NULL, 3, 3, false, NOT_MONOTONE); addCov(Kolmogorov, NULL, NULL); pref_type plgd1= {2, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("lgd1", PosDefType, 2, NULL, XONLY, ISOTROPIC, checklgd1, rangelgd1, plgd1, SCALAR, PARAM_DEP, false, MONOTONE); nickname("lgd"); kappanames("alpha", REALSXP, "beta", REALSXP); addCov(lgd1, Dlgd1, NULL); // Inverselgd1); // stimmt so nicht, siehe Gneiting 1998, on a alpha-sym multiv. char. fct: // IncludeModel("lp", PosDefType, 1, 1, 1, XONLY, SYMMETRIC, // checklp, rangelp, // (pref_type) {5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5} // // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any // ); // kappanames("p", REALSXP); // addCov(lp, NULL, NULL); IncludeModel("mastein", PosDefType, 1, 1, 2, XONLY, SPACEISOTROPIC, check_MaStein, range_MaStein, PREF_ALL, SUBMODEL_DEP, false, NOT_MONOTONE); kappanames("nu", REALSXP, "delta", REALSXP); addCov(MaStein, NULL, NULL); IncludeModel("ma1", PosDefType, 1, 1, 2, XONLY, SYMMETRIC, checkma1, rangema1, PREF_ALL, SUBMODEL_DEP, false, NOT_MONOTONE); nickname("ma"); kappanames("alpha", REALSXP, "theta", REALSXP); addCov(ma1, NULL, NULL); IncludeModel("ma2", PosDefType, 1, 1, 0, XONLY, SYMMETRIC, checkma2, NULL, PREF_ALL, SUBMODEL_DEP, false, NOT_MONOTONE); nickname("intexp"); addCov(ma2, NULL, NULL); IncludeModel("M", PosDefType, 1, 1, 1, kappaM, PREVMODELD, PREVMODELI, checkM, rangeM, PREF_ALL, false, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); nickname("matrix"); kappanames("M", REALSXP); addCov(Mstat, NULL, NULL); addCov(Mnonstat); add_sortof(sortof_M); IncludeModel("matern", PosDefType, 0, 0, 2, PREVMODELD, PREVMODELI, checkMatern, rangeWM, PREF_ALL, INFDIM, false, SUBMODEL_DEP); kappanames("nu", REALSXP, "notinvnu", INTSXP); change_sortof(WM_NU, CRITICALPARAM); change_typeof(WM_NU, RandomOrShapeType); addCov(Matern, DMatern, DDMatern, D3Matern, D4Matern, InverseMatern); addCov(NonStMatern); addlogCov(logMatern, logNonStMatern, NULL); addTBM(initMatern, spectralMatern); addLocal(coinitWM, ieinitWM); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); setptwise(pt_posdef); // addGaussMixture(DrawMixWM, LogMixDensWM); IncludeModel("mqam", PosDefType, 2, 10, 1, kappamqam, XONLY, SYMMETRIC, checkmqam, rangemqam, PREF_ALL, false, PARAM_DEP, SUBMODEL_DEP, false, NOT_MONOTONE); subnames("phi"); kappanames("theta", REALSXP); change_sortof(QAM_THETA, CRITICALPARAM); addCov(mqam, NULL, NULL); NATSC_INTERN =NATSC_USER = IncludeModel("natsc", TcfType, 1, 1, 0, NULL, XONLY, ISOTROPIC, checknatsc, NULL, PREF_ALL, false, 1, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); // nie einen Parameter ! addCov(natsc, Dnatsc, DDnatsc, Inversenatsc); addLocal(coinitnatsc, ieinitnatsc); addTBM(tbm2natsc, initnatsc, spectralnatsc); setptwise(pt_submodeldep); // NATSC_INTERN = CopyModel("natsc_intern", NATSC_USER); // make_internal(); pref_type pfnsst= { 4, 0, 0, 2, 0, 5, 4, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("nsst", PosDefType, 2, 2, 1, XONLY, SPACEISOTROPIC, checknsst, rangensst, pfnsst, SUBMODEL_DEP, false, NOT_MONOTONE); subnames("phi", "psi"); kappanames("delta", REALSXP); change_sortof(NSST_DELTA, CRITICALPARAM); addCov(nsst, Dnsst, NULL); addTBM(TBM2nsst); setptwise(pt_posdef); // IncludePrim("nsst2", 7, checknsst2, SPACEISOTROPIC, // rangensst2); // addCov(nsst2, Dnsst2, NULL); // addTBM(NULL, NULL /* TBM3nsst2 */); pref_type pfnugget= { 4, 0, 0, 0, 0, 4, 4, 0, 0, 5, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any NUGGET = IncludeModel("nugget", TcfType, 0, 0, 2, NULL, XONLY, ISOTROPIC, check_nugget, range_nugget, pfnugget, false, PREVMODEL_DEP, INFDIM, true, MONOTONE); kappanames("tol", REALSXP, "vdim", INTSXP); change_sortof(NUGGET_TOL, FORBIDDENPARAM); change_sortof(NUGGET_VDIM, FORBIDDENPARAM); addCov(nugget, NULL, Inversenugget); addReturns(NULL, NULL, covmatrix_nugget, iscovmatrix_nugget, NULL, NULL, NULL, NULL, NULL, NULL); AddVariant(TcfType, EARTH_ISOTROPIC); AddVariant(TcfType, SPHERICAL_ISOTROPIC); IncludeModel("parsWM", PosDefType, 0, 0, 1, kappa_parsWM, XONLY, ISOTROPIC, checkparsWM, rangeparsWM, PREF_ALL, false, PARAM_DEP, INFDIM, false, NOT_MONOTONE); nickname("parswm"); addCov(parsWM, parsWMD, NULL); kappanames("nudiag", REALSXP); change_sortof(PARSnudiag, CRITICALPARAM); setptwise(pt_posdef); IncludePrim("penta", PosDefType, 0, XONLY, ISOTROPIC, checkOK, NULL, 3, true, MONOTONE); addCov(penta, Dpenta, ScaleOne); IncludePrim("power", PosDefType, 1, XONLY, ISOTROPIC, checkpower, rangepower, INFDIM-1, true, MONOTONE); nickname("askey"); kappanames("alpha", REALSXP); addCov(power, Dpower, ScaleOne); AddVariant(TcfType, ISOTROPIC); // AddVariant(PosDefType, SPHERICAL_ISOTROPIC); POW = IncludeModel("Pow", PosDefType, 1, 1, 1, PREVMODELD, PREVMODELI, checkPow, rangePow, PREF_ALL, SUBMODEL_DEP, false, NOT_MONOTONE); nickname("power"); addCov(Pow, DPow, DDPow, InversePow); kappanames("alpha", REALSXP); setptwise(pt_posdef); SHAPEPOW = addFurtherCov(shapePow, DshapePow); addCov(shapePow, DshapePow, DDshapePow, InverseShapePow); pref_type pfprod= { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any PROD = IncludeModel("prod", PosDefType, 1, 1, 0, NULL, KERNEL, SYMMETRIC, checkprod, NULL, pfprod, false, SUBMODEL_DEP, INFDIM-1, false, NOT_MONOTONE); addCov(nonstatprod); subnames("phi"); AddVariant(PosDefType, SPHERICAL_SYMMETRIC); AddVariant(PosDefType, EARTH_SYMMETRIC); setptwise(pt_posdef); IncludeModel("qam", PosDefType, 2, MAXSUB, 1, kappaqam, XONLY, ISOTROPIC, checkqam, rangeqam, PREF_ALL, false, SCALAR, SUBMODEL_DEP, false, NOT_MONOTONE); kappanames("theta", REALSXP); subnames("phi"); addCov(qam, NULL, NULL); change_sortof(QAM_THETA, CRITICALPARAM); IncludePrim("qexponential", PosDefType, 1, XONLY, ISOTROPIC, checkOK, rangeqexponential, INFDIM, false, NOT_MONOTONE); nickname("qexp"); kappanames("alpha", REALSXP); addCov(qexponential, Dqexponential, Inverseqexponential); SCATTER = IncludeModel("scatter", PosDefType, 1, 1, 2, NULL, PREVMODELD, PREVMODELI, checkScatter, rangeScatter, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("size", REALSXP, "max", INTSXP); addCov(Scatter, NULL, NULL); IncludeModel("schur", PosDefType, 1, 1, 3, kappaSchur, PREVMODELD, PREVMODELI, checkSchur, rangeSchur, PREF_ALL, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); kappanames("M", REALSXP, "diag", REALSXP, "rhored", REALSXP); addCov(Schurstat, DSchur, D2Schur, D3Schur, D4Schur, NULL); addCov(Schurnonstat); add_sortof(sortof_M); IncludeModel("shift", PosDefType, 1, 1, 1, kappashift, XONLY, SYMMETRIC, checkshift, rangeshift, PREF_ALL, false, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); nickname("delay"); // delayeffect addCov(shift, NULL, NULL); kappanames("s", REALSXP); IncludePrim("spherical", TcfType, 0, NULL, XONLY, ISOTROPIC, checkOK, NULL, 3, true, GNEITING_MON); nickname("spheric"); addCov(spherical, Dspherical, DDspherical, ScaleOne); addTBM(TBM2spherical); RandomShape(1, structspherical, initspherical, dospherical, false, true, false); Taylor(-3.0, 1.0, 0.5, 3.0); IncludePrim("stable", PosDefType, 1, XONLY, ISOTROPIC, checkstable, rangestable, INFDIM, false, PARAM_DEP); kappanames("alpha", REALSXP); addCov(stable, Dstable, DDstable, Inversestable); addlogCov(logstable, NULL, nonstatLogInversestable); addLocal(coinitstable, ieinitstable); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); setptwise(pt_posdef); // SPACEISOTROPIC variant of stable -- used for testing purposes only // IncludePrim("stableX", 1, checkOK, SPACEISOTROPIC, // rangestable); // addCov(stableX, DstableX, Inversestable); // addTBM(NULL, NULL) STEIN = IncludeModel("Stein", PosDefType, 1, 1, 2, NULL, XONLY, ISOTROPIC, check_Stein, range_Stein, plocal, false, SCALAR, MAXCEDIM, true, NOT_MONOTONE); nickname(METHODNAMES[CircEmbedIntrinsic]); kappanames("diameter", REALSXP, "rawR", REALSXP); change_sortof(pLOC_DIAM, FORBIDDENPARAM); change_sortof(pLOC_A, FORBIDDENPARAM); addCov(Stein, NULL, NULL); addCallLocal(alternativeparam_Stein); // RandomShape(struct_ce_approx, init_ce_approx, do_ce_approx); IncludePrim("steinst1", PosDefType, 2, kappaSteinST1, XONLY, SYMMETRIC, checkSteinST1, rangeSteinST1, INFDIM, false, NOT_MONOTONE); nickname("stein"); kappanames("nu", REALSXP, "z", REALSXP); addCov(SteinST1, NULL, NULL); addTBM(initSteinST1, spectralSteinST1); IncludeModel("stp", PosDefType, 1, 2, 3, kappa_stp, KERNEL, SYMMETRIC, checkstp, rangestp, PREF_ALL, false, SCALAR, StpMaxDim, false, NOT_MONOTONE); addCov(stp); kappanames("S", REALSXP, "z", REALSXP, "M", REALSXP); change_typeof(STP_S, ShapeType); RandomShape(structStp, true); subnames("xi", "phi"); // H ueberall wo U-x steht. dort U-H(x) // gedoppelte immer zum Schluss! TBM_OP = // old RandomFields tbm2, tbm3 IncludeModel("tbm", PosDefType, 1, 1, 3, NULL, XONLY, PREVMODELI, checktbmop, rangetbmop, PREF_ALL, false, SUBMODEL_DEP, PARAM_DEP, PARAM_DEP, NOT_MONOTONE); kappanames("fulldim", INTSXP, "reduceddim", INTSXP, "layers", REALSXP); addCov(tbm, NULL, NULL); // Dtbm, NULL); todo // { int i; for (i=0; i<=Nothing; i++) printf("%d %d\n ", i, CovList[TREND].pref[i]); assert(false); } pref_type pfsum= { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludeModel("sum", NegDefType, 0, 1, 0, NULL, KERNEL, SYMMETRIC, checksum, NULL, pfsum, false, SUBMODEL_DEP, INFDIM-1, false, NOT_MONOTONE); addCov(nonstatsum); subnames("phi"); AddVariant(NegDefType, EARTH_SYMMETRIC); // AddVariant(NegDefType, SPHERICAL_COORDS); USER = IncludeModel("U", UndefinedType, 0, 0, 16, kappaUser, PREVMODELD, PREVMODELI, checkUser, rangeUser, PREF_AUX, true,// FREEVARIABLE vorhanden. Muss extra in SpecialRMmodel.R // definiert und nicht ueber generatemodels.R PARAM_DEP, INFDIM, false, // per default. NOT_MONOTONE); nickname("user"); kappanames("type", INTSXP, "domain", INTSXP, "isotropy", INTSXP, "vdim", INTSXP, "beta", REALSXP, "varnames", INTSXP, "fctn", LANGSXP, "fst", LANGSXP, "snd", LANGSXP, "envir", ENVSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP //, "trd", LANGSXP ); // H ueberall wo U-x steht. dort U-H(x) addCov(User, DUser, DDUser, NULL, NULL); addCov(UserNonStat); addTypeFct(TypeUser); VECTOR = IncludeModel("vector", PosDefType, 1, 1, 2, NULL, XONLY, SYMMETRIC, checkvector, rangevector, PREF_ALL, false, PARAM_DEP, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); addCov(vector, NULL, NULL); kappanames("a", REALSXP, "Dspace", INTSXP); addFurtherCov(vectorAniso, NULL); pref_type pwave = {2, 0, 0, 0, 5, 4, 5, 0, 0, 0, 0, 0, 0, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any IncludePrim("wave", PosDefType, 0, XONLY, ISOTROPIC, checkOK, NULL, pwave, SCALAR, 3, false, NOT_MONOTONE); addCov(wave, NULL, Inversewave); addTBM(initwave, spectralwave); IncludeModel("whittle", PosDefType, 0,0, 2, PREVMODELD, PREVMODELI, checkWM, rangeWM, PREF_ALL, INFDIM, false, NORMAL_MIXTURE); kappanames("nu", REALSXP, "notinvnu", INTSXP); change_typeof(WM_NU, RandomOrShapeType); change_sortof(WM_NU, CRITICALPARAM); addCov(Whittle, DWhittle, DDWhittle, D3Whittle, D4Whittle, InverseWhittle); addCov(NonStWhittle); addlogCov(logWhittle, logNonStWhittle, NULL); addTBM(initWhittle, spectralWhittle); addLocal(coinitWM, ieinitWM); addGaussMixture(DrawMixWM, LogMixDensW); AddVariant(TcfType, ISOTROPIC); AddVariant(PosDefType, SPHERICAL_ISOTROPIC); setptwise(pt_posdef); SpherModelsinit( ); // ******************* // **** shape types **** // ******************* IncludeModel("angle", ShapeType, 0, 0, 4, kappa_Angle, XONLY, CARTESIAN_COORD, checkAngle, rangeAngle, PREF_NOTHING, false, PARAM_DEP, INFDIM, false, NOT_MONOTONE); nickname("angle"); addCov(Angle, NULL, NULL, invAngle, NULL); kappanames("angle", REALSXP, "lat.angle", REALSXP, "ratio", REALSXP, "diag", REALSXP); BALL= IncludePrim("ball", ShapeType, 0, NULL, XONLY, ISOTROPIC, checkOK, NULL, PREF_NOTHING, SCALAR, INFDIM-1, true, MONOTONE); addCov(ball, NULL, NULL, Inverseball); RandomShape(INFTY, struct_ball, init_ball, do_ball); Taylor(1.0, 0.0); IncludePrim("EAxxA", ShapeType, 2, kappa_EAxxA, XONLY, CARTESIAN_COORD, checkEAxxA, rangeEAxxA, PREF_NOTHING, PARAM_DEP, EaxxaMaxDim, false, NOT_MONOTONE); nickname("eaxxa"); addCov(EAxxA, NULL, NULL); kappanames("E", REALSXP, "A", REALSXP); addSpecial(minmaxEigenEAxxA); IncludePrim("EtAxxA", ShapeType, 3, kappa_EtAxxA, XONLY, CARTESIAN_COORD, checkEtAxxA, rangeEtAxxA, 3, EaxxaMaxDim, false, NOT_MONOTONE); nickname("etaxxa"); addCov(EtAxxA, NULL, NULL); kappanames("E", REALSXP, "A", REALSXP, "alpha", REALSXP); addSpecial(minmaxEigenEtAxxA); IDCOORD = // ACHTUNG falls internal geaendert, auch in KeyInfo.cc aendern IncludeModel("idcoord", ShapeType, 0, 0, 0, NULL, XONLY, PREVMODELI, checkidcoord, NULL, PREF_NOTHING, true, PARAM_DEP, INFDIM, false, NOT_MONOTONE); addCov(idcoord, NULL, NULL); TRAFO = // IncludeModel("trafo", UndefinedType, 0, 1, 1, NULL, PREVMODELD, PREVMODELI, IncludeModel("trafo", UndefinedType, 0, 1, 1, NULL, PREVMODELD, PREVMODELI, checktrafo, rangetrafo, PREF_ALL, false, PARAM_DEP, INFDIM-1, false, NOT_MONOTONE); kappanames("new", INTSXP); change_typeof(TRAFO_ISO, NN2); // ISONAMES addCov(trafo, NULL, NULL); addCov(nonstattrafo);// addlogCov(logtrafo,lognonstattrafo, NULL); subnames("phi"); addTypeFct(Typetrafo); MULT_INVERSE = IncludeModel("mult_inverse", ShapeType, 1, 1, 0, NULL, PREVMODELD, PREVMODELI, checkmult_inverse, NULL, PREF_NOTHING, true, SCALAR, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); addCov(mult_inverse, NULL, NULL); addCov(mult_inverseNonstat); POLYGON = IncludeModel("polygon", ShapeType, 0, 0, 1, NULL, XONLY, CARTESIAN_COORD, check_polygon, range_polygon, PREF_NOTHING, false, SCALAR, 2, true, MONOTONE); kappanames("lambda", REALSXP); addCov(Polygon, NULL, NULL, Inversepolygon, InversepolygonNonstat); RandomShape(INFTY, struct_polygon, init_polygon, doOK); IncludePrim("rational", ShapeType, 2, kappa_rational, XONLY, CARTESIAN_COORD, checkrational, rangerational, INFDIM, false, NOT_MONOTONE); addCov(rational, NULL, NULL); kappanames("A", REALSXP, "a", REALSXP); addSpecial(minmaxEigenrational); IncludePrim("rotat", ShapeType, 2, kappa_rotat, XONLY, CARTESIAN_COORD, checkrotat, rangerotat, PREF_NOTHING, SCALAR, 3, false, NOT_MONOTONE); addCov(rotat, NULL, NULL); kappanames("speed", REALSXP, "phi", REALSXP); addSpecial(minmaxEigenrotat); IncludePrim("Rotat", ShapeType, 1, kappa_Rotat, XONLY, CARTESIAN_COORD, checkRotat, rangeRotat, PARAM_DEP, 3, false, NOT_MONOTONE); nickname("rotation"); addCov(Rotat, NULL, NULL); kappanames("phi", REALSXP); RANDOMSIGN = IncludeModel("sign", ShapeType, 1, 1, 1, NULL, XONLY, PREVMODELI, check_randomSign, range_randomSign, PREF_NOTHING, false, SCALAR, SUBMODEL_DEP, SUBMODEL_DEP, NOT_MONOTONE); //nickname(""); kappanames("p", REALSXP); addCov(randomSign, NULL, NULL, randomSignInverse, randomSignNonstatInverse); addlogCov(lograndomSign); RandomShape(1, struct_randomSign, init_randomSign, do_randomSign, true, true, false); SETPARAM = IncludeModel("setparam", UndefinedType, 1, 1, 1, NULL, PREVMODELD, PREVMODELI, checksetparam, range_setparam, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("setparam"); kappanames("performDo", INTSXP); addCov(setparamStat, Dsetparam, DDsetparam, D3setparam, D4setparam, Inverse_setparam, NonstatInverse_setparam); addCov(setparamNonStat); addTBM(NULL, spectralsetparam); RandomShape(INFTY, struct_failed, initsetparam, dosetparam, false, false, true); addReturns(NULL, NULL, covmatrix_setparam, iscovmatrix_setparam, NULL, NULL, NULL, NULL, NULL, NULL); addTypeFct(Typesetparam); SHAPEAVE = IncludeModel("shape.ave", ShapeType, 1, 2, 3, kappa_ave, XONLY, CARTESIAN_COORD, check_shapeave, rangeave, PREF_NOTHING, true, SCALAR, INFDIM-1, true, NOT_MONOTONE); kappanames("A", REALSXP, "z", REALSXP, "spacetime", INTSXP); subnames("phi", "gauss"); addlogCov(logshapeave); RandomShape(0, init_shapeave, do_shapeave, true); SHAPESTP = IncludeModel("shape.stp", ShapeType, 1, 4, 3, kappa_stp, KERNEL, CARTESIAN_COORD, check_shapestp, rangestp, PREF_NOTHING, true, SCALAR, StpMaxDim, true, NOT_MONOTONE); kappanames("S", REALSXP, "z", REALSXP, "M", REALSXP); addlogCov(logshapestp); subnames("xi2", "phi", "SXX", "gauss"); // hier gedoppeltes S nicht am Schluss // da auf checkstp zugreifend RandomShape(0, init_shapestp, do_shapestp); STROKORB_MONO = IncludeModel("m2r", ShapeType, 1, 1, 0, NULL, XONLY, ISOTROPIC, checkstrokorb, NULL, PREF_NOTHING, false, SCALAR, 3, SUBMODEL_DEP, SUBMODEL_DEP); addCov(strokorb, NULL, NULL); RandomShape(1, structOK, init_strokorb, do_strokorb, false, false, false); #define balltest !true IncludeModel("m3b", ShapeType, 1, 1, balltest ? 2 : 0, NULL, XONLY, ISOTROPIC, checkstrokorbBall, balltest ? rangestrokorbball : NULL,/*for testing only*/ PREF_NOTHING, false, SCALAR, 3, true, MONOTONE); if (balltest) kappanames("min", REALSXP, "max", REALSXP); addCov(strokorbBallInner, NULL, NULL); RandomShape(1, struct_strokorbBall, init_failed, do_failed, do_random_failed, false, false, false); STROKORB_BALL_INNER = // !! inverse scale gegenueber paper IncludeModel("r3binner", ShapeType, 1, 1, 1, NULL, XONLY, CARTESIAN_COORD, check_strokorbBallInner, range_strokorbBallInner, PREF_AUX, true, 1, 1, true, NOT_MONOTONE); kappanames("dim", INTSXP); addCov(strokorbBallInner, NULL, NULL); RandomShape(1, init_strokorbBallInner, do_strokorbBallInner); /* da wiederum gewichtet und zwar mit b^2 falls b die intensitaet. kann nicht in dichte function g(b) reingezogen werden, da b^2 g(b) nicht integrierbar. Stattdessen darf f (Dichte im Raum) nicht die Gleichverteilung sein, sondern bei grossen b um die zu simulierenden Punkte zusammenschrumpfen. Dabei nimmt man an, dass die Radien ein Vielfaches des mittleren Radius nicht ueberschreiten. Dies ist OK, da ungefaehr exponentielles Abfallen der WK. */ IncludeModel("mps", ShapeType, 1, 1, 0, NULL, XONLY,CARTESIAN_COORD, checkstrokorbPoly, NULL, PREF_AUX, false, SCALAR, 2, true, MONOTONE); addCov(strokorbPoly, NULL, NULL); RandomShape(1, struct_strokorbPoly, init_failed, do_failed, do_random_failed, false, false, false); TRUNCSUPPORT = IncludeModel("truncsupport", ShapeType, 1, 1, 1, NULL, XONLY, PREVMODELI, checktruncsupport, rangetruncsupport, PREF_NOTHING, false, SCALAR, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); kappanames("radius", REALSXP); // neg value == auto addCov(truncsupport, NULL, NULL, truncsupportInverse, StandardInverseNonstat); RandomShape(0, struct_truncsupport, init_truncsupport, do_truncsupport, false, false, false); ////////////////////////////////////////////////// // families of multivariate distribution; used in // ACHTUNG!! addCov muss ganz zum Schluss !! ARCSQRT_DISTR = IncludeModel("arcsqrt", RandomType, 0, 0, 1, NULL, DOMAIN_MISMATCH, ISO_MISMATCH, checkOK, range_arcsqrt, PREF_AUX, true, 1, 1, false, MISMATCH); // to do: nicht mismatch, // sondern monotone im eindimensionalen kappanames("scale", REALSXP); RandomShape(0, structOK, init_arcsqrt, do_arcsqrt); addCov(arcsqrtD, arcsqrtDlog, arcsqrtDinverse, arcsqrtP, NULL, arcsqrtQ, arcsqrtR, NULL); DETERM_DISTR = IncludeModel("determ", RandomType, 0, 0, 1, kappa_determ, DOMAIN_MISMATCH, ISO_MISMATCH, check_determ, range_determ, PREF_AUX, false, SUBMODEL_DEP, INFDIM-1, SUBMODEL_DEP, MISMATCH); kappanames("mean", REALSXP); RandomShape(INFTY, structOK, init_determ, do_determ); addCov(determD, determDlog, determDinverse, determP, determP2sided, determQ, determR, determR2sided); DISTRIBUTION = // FREEVARIABLE vorhanden. Muss extra in SpecialRMmodel.R // definiert und nicht ueber generatemodels.R IncludeModel("distr", RandomType, 0, 0, 16, kappa_distr, DOMAIN_MISMATCH, ISO_MISMATCH, check_distr, range_distr, PREF_AUX, true, PARAM_DEP, INFDIM-1, false, MISMATCH); kappanames("ddistr", LANGSXP, "pdistr", LANGSXP, "qdistr", LANGSXP, "rdistr", LANGSXP, "nrow", INTSXP, "ncol", INTSXP, "envir", ENVSXP, FREEVARIABLE, REALSXP, // wird nie verwendet -- Puffer fuer // einfachen Algorithmus FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP, FREEVARIABLE, REALSXP ); // 7 free ones are remaining ! RandomShape(0, structOK, init_distr, do_distr_do); addCov(distrD, distrDlog, distrDinverse, distrP, distrP2sided, distrQ, distrR, distrR2sided); GAUSS_DISTR = IncludeModel("normal", RandomType, 0, 0, 3, kappa_gauss_distr, DOMAIN_MISMATCH, ISO_MISMATCH, check_gauss_distr, range_gauss_distr, PREF_AUX, false, PARAM_DEP, INFDIM-1, false, MISMATCH); nickname("gauss"); kappanames("mu", REALSXP, "sd", REALSXP, "log", INTSXP); RandomShape(INFTY, structOK, init_gauss_distr, do_gauss_distr); addCov(gaussD, gaussDlog, gaussDinverse, gaussP, gaussP2sided, gaussQ, gaussR, gaussR2sided); SET_DISTR = IncludeModel("setDistr", RandomType, 1, 1, 1, NULL, DOMAIN_MISMATCH, ISO_MISMATCH, check_setParam, range_setParam, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); subnames("to"); kappanames("performDo", INTSXP); RandomShape(INFTY, structOK, init_setParam, do_setParam); addCov(setParamD, setParamDlog, setParamDinverse, setParamP, setParamP2sided, setParamQ, setParamR, setParamR2sided); LOC = IncludeModel("loc", RandomType, 1, 1, 3, kappa_loc, DOMAIN_MISMATCH, ISO_MISMATCH, check_loc, range_loc, PREF_AUX, false, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("mu", REALSXP, "scale", REALSXP, "pow", REALSXP); RandomShape(INFTY, structOK, init_loc, do_loc); addCov(locD, locDlog, locDinverse, locP, locP2sided, locQ, locR, locR2sided); MCMC = IncludeModel("mcmc", RandomType, 1, 1, 6, kappa_mcmc, // ACHTUNG! Model kann auch ueber cov->q uebergeben werden. // dies vereinfacht die Verwendung von zufaelligen // Huetchen, da keine Parameter kopiert werden // muesen, sondern direkt auf das Huetchen zugegriffen // DOMAIN_MISMATCH, ISO_MISMATCH, check_mcmc, range_mcmc, PREF_AUX, false, PARAM_DEP, INFDIM-1, true, MISMATCH); kappanames(distr[RECT_MCMC_N], INTSXP, "sigma", REALSXP, "normed", INTSXP, "maxdensity", REALSXP, "rand.loc", INTSXP, "gibbs", INTSXP); RandomShape(INFTY, structOK, init_mcmc, do_mcmc); addCov(mcmcD, mcmcDlog, mcmcDinverse, mcmcP, mcmcP2sided, mcmcQ, mcmcR, mcmcR2sided); RECTANGULAR = IncludeModel("rectangular", RandomType, 1, 1, 11, NULL, // ACHTUNG! Model kann auch ueber cov->q uebergeben werden. // dies vereinfacht die Verwendung von zufaelligen // Huetchen, da keine Parameter kopiert werden // muesen, sondern direkt auf das Huetchen zugegriffen // DOMAIN_MISMATCH, ISO_MISMATCH, check_rectangular, range_rectangular, PREF_AUX, false, PARAM_DEP, INFDIM-1, true, MISMATCH); kappanames(distr[RECT_SAFETY], REALSXP, distr[RECT_MINSTEPLENGTH], REALSXP, distr[RECT_MAXSTEPS], INTSXP, distr[RECT_PARTS], INTSXP, distr[RECT_MAXIT], INTSXP, distr[RECT_INNERMIN], REALSXP, distr[RECT_OUTERMAX], REALSXP, distr[RECT_MCMC_N], INTSXP, "normed", INTSXP, "approx", INTSXP, "onesided", INTSXP ); RandomShape(INFTY, structOK, init_rectangular, do_rectangular); addCov(rectangularD, rectangularDlog, rectangularDinverse, rectangularP, rectangularP2sided, rectangularQ, rectangularR, rectangularR2sided); SCALESPHERICAL = IncludeModel("spheric", RandomType, 0, 0, 3, NULL, DOMAIN_MISMATCH, ISO_MISMATCH, check_RRspheric, range_RRspheric, PREF_AUX, false, 1, 1, true, MISMATCH); kappanames("spacedim", INTSXP, "balldim", INTSXP, "R", REALSXP); RandomShape(INFTY, structOK, init_RRspheric, do_RRspheric); addCov(sphericD, sphericDlog, sphericDinverse, sphericP, NULL, sphericQ, sphericR, NULL); UNIF = IncludeModel("unif", RandomType, 0, 0, 3, kappa_unif, DOMAIN_MISMATCH, ISO_MISMATCH, check_unif, range_unif, PREF_AUX, false, PARAM_DEP, INFDIM-1, true, MISMATCH); kappanames("min", REALSXP, "max", REALSXP, "normed", INTSXP); RandomShape(INFTY, structOK, init_unif, do_unif); addCov(unifD, unifDlog, unifDinverse, unifP, unifP2sided, unifQ, unifR, unifR2sided); // ----------------------------- // shape + locations // they *take* all very detailed roles like ROLE_SMITH and pass // ROLE_MAXSTABLE to the submodel, in general // storage always pgs_storage !! MCMC_PGS = IncludeModel("MCMC_PGS", PointShapeType, 2, 2, 2, NULL, XONLY, CARTESIAN_COORD, check_mcmc_pgs, range_mcmc_pgs, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("normed", INTSXP, "mcmc_n", INTSXP); subnames("shape", "loc"); addlogCov(logpts_given_shape); RandomShape(SUBMODEL_DEP, struct_mcmc_pgs, init_mcmc_pgs, do_mcmc_pgs, do_random_failed, true, true, false); PTS_GIVEN_SHAPE = IncludeModel("ptsGivenShape", PointShapeType, 2, 2, 5, NULL, XONLY, CARTESIAN_COORD, check_pts_given_shape, range_pts_given_shape, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("density.ratio", REALSXP, // stemming from gauss "flat", INTSXP, "infinitely_small", INTSXP, "normed", INTSXP, "isotropic", INTSXP ); subnames("shape", "loc"); addCov(pts_given_shape, NULL, NULL); addlogCov(logpts_given_shape); RandomShape(SUBMODEL_DEP, struct_pts_given_shape, init_pts_given_shape, do_pts_given_shape, do_random_failed, true, true, false); STANDARD_SHAPE = IncludeModel("standardShape", PointShapeType, 1, 2, 0, NULL, XONLY, CARTESIAN_COORD, check_standard_shape, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); subnames("shape"); addCov(standard_shape, NULL, NULL); addlogCov(logstandard_shape); RandomShape(SUBMODEL_DEP, struct_standard_shape, init_standard_shape, do_standard_shape, do_random_failed, true, true, false); pref_type pmppp = {0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 0, 10, 5}; // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any MPPPLUS = IncludeModel("++", PointShapeType, 1, MAXSUB, 1, kappamppplus, PREVMODELD, PREVMODELI, // CARTESIAN_COORD, checkmppplus, rangempplus, pmppp, false, SUBMODEL_DEP, SUBMODEL_DEP, (ext_bool) SUBMODEL_DEP, MISMATCH); nickname("mppplus"); kappanames("p", REALSXP); addCov(mppplus, NULL, NULL); STATIONARY_SHAPE = IncludeModel("statShape", PointShapeType, 1, 1, 0, NULL, XONLY, CARTESIAN_COORD, check_stationary_shape, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); subnames("shape"); addCov(stationary_shape, NULL, NULL); addlogCov(logstationary_shape); RandomShape(SUBMODEL_DEP, struct_stationary_shape, init_stationary_shape, do_stationary_shape, do_random_failed, true, true, false); COVFCTN = IncludeModel("Cov", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_cov, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("cov"); addCov(Cov, NULL, NULL); RandomShape(struct_cov); COVMATRIX = IncludeModel("CovMatrix", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, //UNREDUCED,ISOTROPIC dependening on whether // distances are givenXONLY, UNREDUCED, check_covmatrix, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("covmatrix"); addCov(CovMatrix, NULL, NULL); RandomShape(struct_cov); IncludeModel("Dummy", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_dummy, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("dummy"); addCov(Dummy, NULL, NULL); RandomShape(struct_dummy); RFGET = IncludeModel("get", InterfaceType, 1, 1, 2, NULL, XONLY, UNREDUCED, check_RFget, range_RFget, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("up", INTSXP, "register", INTSXP); addCov(RFget, NULL, NULL); RandomShape(struct_RFget); IncludeModel("Fctn", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_fctn, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("fctn"); addCov(Fctn, NULL, NULL); RandomShape(structOK); IncludeModel("Distr", InterfaceType, 1, 1, 5, kappa_EvalDistr, XONLY, UNREDUCED, check_EvalDistr, range_EvalDistr, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("distr"); kappanames("x", REALSXP, "q", REALSXP, "p", REALSXP, "n", REALSXP, "dim", INTSXP); addCov(EvalDistr, NULL, NULL); RandomShape(struct_EvalDistr); IncludeModel("Pseudovariogram", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_cov, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("pseudovariogram"); addCov(Pseudovariogram, NULL, NULL); RandomShape(struct_variogram); SIMULATE = IncludeModel("Simulate", InterfaceType, 1, 1, 3, NULL, XONLY, UNREDUCED, check_simulate, range_simulate, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("simulate"); kappanames("checkonly", INTSXP, "setseed", LANGSXP, "env", ENVSXP); addCov(simulate, NULL, NULL); RandomShape(struct_simulate); /* DENSITY = IncludeModel("Density", InterfaceType, 1, 1, 3, NULL, XONLY, UNREDUCED, check_density, range_density, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("density"); kappanames("log", INTSXP, "setseed", LANGSXP, "env", ENVSXP); addCov(density, NULL, NULL); RandomShape(struct_density); */ VARIOGRAM_CALL = IncludeModel("Variogram", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_vario, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); nickname("variogram"); addCov(Variogram, NULL, NULL); RandomShape(struct_variogram); LIKELIHOOD_CALL = IncludeModel("loglikelihood", InterfaceType, 1, 1, 4, kappalikelihood, XONLY, UNREDUCED, check_likelihood, range_likelihood, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("data", LISTOF + REALSXP, "estimate_variance", INTSXP, "betas_separate", INTSXP, "ignore_trend", INTSXP); addCov(likelihood, NULL, NULL); RandomShape(struct_likelihood); LINEARPART_CALL = IncludeModel("linearpart", InterfaceType, 1, 1, 0, NULL, XONLY, UNREDUCED, check_linearpart, NULL, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); addCov(linearpart, NULL, NULL); RandomShape(struct_linearpart); PREDICT_CALL = IncludeModel("predict", InterfaceType, 1, 1, 1, NULL, XONLY, UNREDUCED, check_predict, range_predict, PREF_AUX, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, MISMATCH); kappanames("register", INTSXP); addCov(predict, NULL, NULL); RandomShape(struct_predict); // ---------------------------- // processes // CE CO CI TBM Sp di sq Ma av n mpp Hy spf any DOLLAR_PROC = IncludeModel("$proc", ProcessType, 1, 1, 5, kappaS, // kappadollar, XONLY, UNREDUCED, checkS, rangeS, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); // do not change Order!! nickname("S"); kappanames("var", REALSXP, "scale", REALSXP, "anisoT", REALSXP, "Aniso", REALSXP, "proj", INTSXP); change_typeof(DAUSER, ShapeType); change_typeof(DSCALE, RandomOrShapeType); subnames("phi"); RandomShape(2, structSproc, initSproc, doSproc, true, true, true); addSpecific(DOLLAR); PLUS_PROC = IncludeModel("plusproc", ProcessType, 1, MAXSUB, 0, NULL, XONLY, UNREDUCED, checkplusproc, NULL, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("plus"); RandomShape(2, structplusproc, initplusproc, doplusproc, false, false, true); addSpecific(PLUS); IncludeModel("prodproc", ProcessType, 1, 1, 0, NULL, XONLY, UNREDUCED, checkprodproc, NULL, PREF_ALL, true, PARAM_DEP, INFDIM-1, false, NOT_MONOTONE); nickname("prod"); RandomShape(2, structprodproc, initprodproc, doprodproc, false, false, true); addSpecific(PROD); IncludeModel("trafoproc", ProcessType, 1, 1, 1, NULL, XONLY, UNREDUCED, checktrafoproc, rangetrafo, PREF_ALL, true, PARAM_DEP, INFDIM-1, false, NOT_MONOTONE); nickname("trafo"); kappanames("new", INTSXP); change_typeof(TRAFO_ISO, NN2); // ISONAMES RandomShape(2, structtrafoproc, inittrafoproc, dotrafoproc, false, false, true); addSpecific(TRAFO); MPPPLUS_PROC = IncludeModel("mppplusproc", ProcessType, 1, MAXSUB, 1, kappamppplus, XONLY, UNREDUCED, checkmppplus, rangempplus, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("mppplus"); kappanames("p", REALSXP); RandomShape(2, struct_mppplus, init_mppplus, do_mppplus, true, true, true); // addSpecific(MPPPLUS); MULT_PROC = IncludeModel("multproc", ProcessType, 1, MAXSUB, 1, NULL, XONLY, UNREDUCED, checkmultproc, rangemultproc, PREF_ALL, true, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP, SUBMODEL_DEP); nickname("mult"); kappanames("multicopies", INTSXP); RandomShape(2, structmultproc, initmultproc, domultproc, false, false, true); addSpecific(MULT); AVERAGE_USER = IncludeModel(METHODNAMES[Average], GaussMethodType, 1, 2, 3, kappaGProc, XONLY, UNREDUCED, check_randomcoin, range_randomcoin, PREF_NOTHING, false, SCALAR, MAXMPPDIM, false, MISMATCH); subnames("phi", "shape"); kappanames("boxcox", REALSXP, "intensity", REALSXP, "method", INTSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); // addCov(coin, NULL, NULL, coinInverse); RandomShape(2, struct_extractdollar, init_gaussprocess, do_gaussprocess); AVERAGE_INTERN = CopyModel("averageIntern", AVERAGE_USER); nickname(METHODNAMES[Average]); make_internal(); RandomShape(2, struct_randomcoin, init_randomcoin, dompp, true, true, false); CIRCEMBED = // und die anderen fehlen auch noch !! IncludeModel(METHODNAMES[CircEmbed], GaussMethodType, 1, 1, 13, kappa_ce, XONLY, UNREDUCED, check_ce, range_ce, PREF_NOTHING, false, SUBMODEL_DEP, MAXCEDIM, false, MISMATCH); kappanames("boxcox", REALSXP, CE[CE_FORCE - COMMON_GAUSS - 1], INTSXP, CE[CE_MMIN - COMMON_GAUSS - 1], REALSXP, CE[CE_STRATEGY - COMMON_GAUSS - 1], INTSXP, CE[CE_MAXGB - COMMON_GAUSS - 1], REALSXP, CE[CE_MAXMEM - COMMON_GAUSS - 1], INTSXP, CE[CE_TOLIM - COMMON_GAUSS - 1], REALSXP, CE[CE_TOLRE - COMMON_GAUSS - 1], REALSXP, CE[CE_TRIALS - COMMON_GAUSS - 1], INTSXP, CE[CE_USEPRIMES - COMMON_GAUSS - 1], INTSXP, CE[CE_DEPENDENT - COMMON_GAUSS - 1], INTSXP, CE[CE_APPROXSTEP - COMMON_GAUSS - 1], REALSXP, CE[CE_APPROXMAXGRID - COMMON_GAUSS - 1], INTSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, struct_ce_approx, init_ce_approx, do_ce_approx); CE_CUTOFFPROC_USER = IncludeModel(METHODNAMES[CircEmbedCutoff], GaussMethodType, 1, 1, 15, kappa_localproc, XONLY, UNREDUCED, check_local_proc, range_co_proc, PREF_NOTHING, false, SCALAR, MAXCEDIM, false, MISMATCH); kappanames("boxcox", REALSXP, CE[CE_FORCE - COMMON_GAUSS - 1], INTSXP, CE[CE_MMIN - COMMON_GAUSS - 1], REALSXP, CE[CE_STRATEGY - COMMON_GAUSS - 1], INTSXP, CE[CE_MAXGB - COMMON_GAUSS - 1], REALSXP, CE[CE_MAXMEM - COMMON_GAUSS - 1], INTSXP, CE[CE_TOLIM - COMMON_GAUSS - 1], REALSXP, CE[CE_TOLRE - COMMON_GAUSS - 1], REALSXP, CE[CE_TRIALS - COMMON_GAUSS - 1], INTSXP, CE[CE_USEPRIMES - COMMON_GAUSS - 1], INTSXP, CE[CE_DEPENDENT - COMMON_GAUSS - 1], INTSXP, CE[CE_APPROXSTEP - COMMON_GAUSS - 1], REALSXP, CE[CE_APPROXMAXGRID - COMMON_GAUSS - 1], INTSXP, "diameter", REALSXP, "a", REALSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, struct_extractdollar, init_gaussprocess, do_gaussprocess); CE_CUTOFFPROC_INTERN = CopyModel("cutoffIntern", CE_CUTOFFPROC_USER); make_internal(); RandomShape(2, struct_ce_approx, init_ce_approx, do_ce_approx); nickname(METHODNAMES[CircEmbedCutoff]); CE_INTRINPROC_USER = IncludeModel(METHODNAMES[CircEmbedIntrinsic], GaussMethodType, 1, 1, 15, kappa_localproc, XONLY, UNREDUCED, check_local_proc, range_intrinCE, PREF_NOTHING, false, SCALAR, MAXCEDIM, false, MISMATCH); nickname(METHODNAMES[CircEmbedIntrinsic]); kappanames("boxcox", REALSXP, CE[CE_FORCE - COMMON_GAUSS - 1], INTSXP, CE[CE_MMIN - COMMON_GAUSS - 1], REALSXP, CE[CE_STRATEGY - COMMON_GAUSS - 1], INTSXP, CE[CE_MAXGB - COMMON_GAUSS - 1], REALSXP, CE[CE_MAXMEM - COMMON_GAUSS - 1], INTSXP, CE[CE_TOLIM - COMMON_GAUSS - 1], REALSXP, CE[CE_TOLRE - COMMON_GAUSS - 1], REALSXP, CE[CE_TRIALS - COMMON_GAUSS - 1], INTSXP, CE[CE_USEPRIMES - COMMON_GAUSS - 1], INTSXP, CE[CE_DEPENDENT - COMMON_GAUSS - 1], INTSXP, CE[CE_APPROXSTEP - COMMON_GAUSS - 1], REALSXP, CE[CE_APPROXMAXGRID - COMMON_GAUSS - 1], INTSXP, "diameter",REALSXP, "rawR", REALSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, struct_extractdollar, init_gaussprocess, do_gaussprocess); CE_INTRINPROC_INTERN = CopyModel("intrinsIntern", CE_INTRINPROC_USER); make_internal(); RandomShape(2, struct_ce_approx, init_ce_approx, do_ce_approx); nickname(METHODNAMES[CircEmbedIntrinsic]); DIRECT = IncludeModel(METHODNAMES[Direct], GaussMethodType, 1, 1, 1, kappaGProc, XONLY, UNREDUCED, check_directGauss, range_direct, PREF_NOTHING, false, SUBMODEL_DEP, INFDIM-1, false, MISMATCH); kappanames("boxcox", REALSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, init_directGauss, do_directGauss); HYPERPLANE_USER = IncludeModel(METHODNAMES[Hyperplane], GaussMethodType, 1, 1, 6, kappaGProc, XONLY, UNREDUCED, check_hyperplane, range_hyperplane, PREF_NOTHING, false, SCALAR, 2, false, MISMATCH); kappanames("boxcox", REALSXP, "superpos", INTSXP, "maxlines", INTSXP, "mar_distr", INTSXP, "mar_param", REALSXP, "additive", INTSXP); // addCov(IdStat, NULL, NULL, IdInverse); // addCov(IdNonStat); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, struct_extractdollar, init_gaussprocess, do_gaussprocess); HYPERPLANE_INTERN = CopyModel("hyperIntern", HYPERPLANE_USER, check_hyperplane_intern); make_internal(); nickname(METHODNAMES[ Hyperplane]); RandomShape(2, struct_hyperplane, init_hyperplane, do_hyperplane); // printf("%ld %ld\n", CovList[HYPERPLANE_INTERN].nonstat_cov, // IdNonStat); assert(false); NUGGET_USER = IncludeModel(METHODNAMES[Nugget], GaussMethodType, 1, 1, 3, kappaGProc,XONLY, UNREDUCED, check_nugget_proc, range_nugget_proc, PREF_NOTHING, false, PREVMODEL_DEP, INFDIM, true, MISMATCH); kappanames("boxcox", REALSXP,"tol", REALSXP, "vdim", INTSXP); change_sortof(GAUSS_BOXCOX, ANYPARAM); RandomShape(2, struct_extractdollar, init_gaussprocess, do_gaussprocess); NUGGET_INTERN = CopyModel("nuggetIntern", NUGGET_USER); make_internal(); RandomShape(2, struct_nugget, init_nugget, do_nugget); nickname(METHODNAMES[Nugget]); /* see simu.cc, CMbuild for special treatment of nugget when users choice is given */ /* cf. convert.R, PrepareModel, near end of function */ /* deleted 27.12.08 { int nr = currentNrCov - 1; for (i=0; iTypi[0] == RandomType) { // printf("done = %s %d\n", CovList[nr].nick, nr); continue; } if (nr != NUGGET){ for (int ii=0; iipref[ii] *= C->implemented[ii] == IMPLEMENTED; } C->pref[Nothing] *= (C->cov != ErrCov || C->nonstat_cov != ErrCovNonstat); } } IncludeModel("minus", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkMath, rangeMath, PREF_TREND, false,SCALAR, PREVMODEL_DEP, false, false); kappanames("a", REALSXP, "b", REALSXP, "factor", REALSXP); change_sortof(MATH_FACTOR, TRENDPARAM); addCov(Mathminus, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel("plus", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkMath, rangeMath, PREF_TREND, false,SCALAR, 1, false, false); kappanames("a", REALSXP, "b", REALSXP, "factor", REALSXP); change_sortof(MATH_FACTOR, TRENDPARAM); addCov(Mathplus, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel("div", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkMath, rangeMath, PREF_TREND, false,SCALAR, 1, false, false); kappanames("a", REALSXP, "b", REALSXP, "factor", REALSXP); change_sortof(MATH_FACTOR, TRENDPARAM); addCov(Mathdiv, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel("mult", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkMath, rangeMath, PREF_TREND, false,SCALAR, 1, false, false); kappanames("a", REALSXP, "b", REALSXP, "factor", REALSXP); change_sortof(MATH_FACTOR, TRENDPARAM); addCov(Mathmult, NULL, NULL); AddVariant(TrendType, PREVMODELI); CONST = IncludePrim("const", MathDefinition, 1, NULL, XONLY, PREVMODELI, check_c, rangec, PREF_TREND, SCALAR, PREVMODEL_DEP, false, false); kappanames(CONST_A_NAME, REALSXP); change_sortof(CONST_C, TRENDPARAM); addCov(Mathc, NULL, NULL); AddVariant(TrendType, PREVMODELI); AddVariant(TcfType, PREVMODELI); IncludeModel("p", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkproj, rangeproj, PREF_TREND, false, SCALAR, INFDIM-1, false, false); kappanames("proj", INTSXP, "new", INTSXP, "factor", REALSXP); change_typeof(PROJ_ISO, NN2); change_sortof(PROJ_FACTOR , TRENDPARAM); addCov(proj, NULL, NULL); AddVariant(TrendType, PREVMODELI); BIND = IncludeModel("c", MathDefinition, 0, 0, 11, NULL, XONLY, PREVMODELI, check_bind, rangeMath, PREF_TREND, false,SCALAR, 1, false, false); kappanames("a", REALSXP, "b", REALSXP, "c", REALSXP, "d", REALSXP, "e", REALSXP, "f", REALSXP, "g", REALSXP, "h", REALSXP, "i", REALSXP, "j", REALSXP, "factor", REALSXP); change_sortof(CovList[BIND].kappas - 1, TRENDPARAM); addCov(Mathbind, NULL, NULL); AddVariant(TrendType, PREVMODELI); IncludeModel("is", MathDefinition, 0, 0, 3, NULL, XONLY, PREVMODELI, checkMath, rangeMathIs, PREF_TREND, false, SCALAR, 1, false, false); kappanames("a", REALSXP, "is", INTSXP, "b", REALSXP); change_typeof(IS_IS, NN1); addCov(Mathis, NULL, NULL); AddVariant(TrendType, PREVMODELI); includeStandardMath(); for (i=0; inr; // printf("---> %d %d %d %d\n", cov->nr, DOLLAR, LASTDOLLAR, nr >= DOLLAR && nr <= LASTDOLLAR); return nr >= DOLLAR && nr <= LASTDOLLAR; } bool isDollarProc(cov_model *cov) { assert(cov != NULL); int nr=cov->nr; return nr == DOLLAR_PROC; } bool isAnyDollar(cov_model *cov) { assert(cov != NULL); int nr=cov->nr; return (nr >= DOLLAR && nr <= LASTDOLLAR) || nr == DOLLAR_PROC; } bool isNatsc(cov_model *cov) { assert(cov != NULL); int nr=cov->nr; return nr == NATSC_INTERN || nr == NATSC_USER; } bool isDef(Types type, typusfct iso, cov_model *cov) { int i; cov_fct *C = CovList + cov->nr; if (isUndefined(C)) { assert(CovList[cov->nr].TypeFct != NULL); return CovList[cov->nr].TypeFct(type, cov, 0); } for (i=0; ivariants; i++) { if (iso(C->Typi[i]) && (cov->isoown == ISO_MISMATCH || atleastSpecialised(cov->isoown, C->Isotropy[i]))) return true; } return false; } //if (false) printf("Qu: "#typus" '%s' %d\n", TYPENAMES[type], type == cond); #define Question(typus, cond) \ bool is##typus(Types type) { \ return type == cond; \ } \ \ bool is##typus(cov_model *cov) {return isDef(typus##Type, is##typus, cov);} Question(Tcf, TcfType) Question(PosDef, PosDefType || isTcf(type)) Question(Variogram, VariogramType || isPosDef(type)) Question(NegDef, NegDefType || isVariogram(type)) Question(Process, ProcessType || type == GaussMethodType || type == BrMethodType) Question(GaussMethod, GaussMethodType) Question(PointShape, PointShapeType) Question(Random, RandomType) Question(Shape, ShapeType || isNegDef(type)) Question(Trend, TrendType) Question(Interface, InterfaceType) Question(Undefined, UndefinedType) Question(Other, OtherType) bool isUndefined(cov_fct *C) { //printf("%s cvariants %d\n", C->name, C->variants); bool is = isUndefined(C->Typi[0]); assert(!is || C->variants == 1) ; // for(bool undef=true; int i=0; ivariants; i++) undef &= C->Typi[i] == Undefined; return is; } //////////// bool isGaussProcess(cov_model *cov) { int nr = cov->nr; return nr == GAUSSPROC || isGaussMethod(cov); } bool isBernoulliProcess(cov_model *cov) { int nr = cov->nr; return nr == BINARYPROC; } bool isGaussBasedProcess(cov_model *cov) { int nr = cov->nr; return isGaussProcess(cov) || nr == CHI2PROC || nr == TPROC; } bool isBrownResnickProcess(cov_model *cov) { //PMI(cov); Types type = CovList[cov->nr].Typi[0]; int nr = cov->nr; bool is = type == BrMethodType || nr == BROWNRESNICKPROC; assert(!is || CovList[cov->nr].variants == 1); return is; } bool isBRuserProcess(cov_model *cov) { Types type = CovList[cov->nr].Typi[0]; bool is = type == BrMethodType; assert(!is || CovList[cov->nr].variants == 1); return is; } bool isBRuserProcess(Types type) { return type == BrMethodType; } bool isMaxStable(cov_model *cov) { int nr = cov->nr; return isBrownResnickProcess(cov) || nr == SMITHPROC || nr == SCHLATHERPROC || nr == EXTREMALTPROC; } bool isCov(cov_model *cov) { int nr = cov->nr; return nr == COVFCTN || nr == COVMATRIX ; } bool hasNoRole(cov_model *cov) { int role = cov->role; return role == ROLE_BASE; } bool hasExactMaxStableRole(cov_model *cov) { int role = cov->role; return role == ROLE_MAXSTABLE; } bool hasMaxStableRole(cov_model *cov) { int role = cov->role; return role == ROLE_MAXSTABLE || role == ROLE_BROWNRESNICK || role == ROLE_SMITH || role == ROLE_SCHLATHER; } bool hasPoissonRole(cov_model *cov) { int role = cov->role; return role == ROLE_POISSON_GAUSS || role == ROLE_POISSON; } bool hasAnyShapeRole(cov_model *cov) { return hasMaxStableRole(cov) || hasPoissonRole(cov) || hasDistrRole(cov); } bool hasDistrRole(cov_model *cov) { int role = cov->role; return role == ROLE_DISTR; } int role_of_process(int nr) { return (nr == AVERAGE_USER || nr == AVERAGE_INTERN || nr == RANDOMCOIN_USER) ? ROLE_POISSON : ((nr >= CIRCEMBED && nr <= CE_INTRINPROC_INTERN) || nr == DIRECT || nr == NUGGET || nr == NUGGET_INTERN || nr == SEQUENTIAL || nr == SPECTRAL_PROC_USER || nr == SPECTRAL_PROC_INTERN || nr == TBM_PROC_USER || nr == TBM_PROC_INTERN || nr == GAUSSPROC || nr == TRENDEVAL ) ? ROLE_GAUSS : nr == HYPERPLANE_USER || nr == HYPERPLANE_INTERN ? ROLE_GAUSS : nr == SPECIFIC ? ROLE_GAUSS : ( nr == BRSHIFTED_USER || nr == BRMIXED_USER || nr == BRORIGINAL_USER || nr == BROWNRESNICKPROC) ? ROLE_BROWNRESNICK : nr == BINARYPROC ? ROLE_BERNOULLI : nr == POISSONPROC ? ROLE_POISSON : nr == SCHLATHERPROC || nr == EXTREMALTPROC ? ROLE_SCHLATHER : nr == SMITHPROC ? ROLE_SMITH : ROLE_FAILED; } bool isMonotone(cov_model *cov) { int monotone = cov->monotone; return monotone >= MONOTONE && monotone <= COMPLETELY_MON ; } bool isMonotone(int monotone) { return monotone >= MONOTONE && monotone <= COMPLETELY_MON; } bool isCompletelyMonotone(int monotone) { return monotone == COMPLETELY_MON; } bool isNormalMixture(cov_model *cov) { int monotone = cov->monotone; return monotone == NORMAL_MIXTURE || monotone == COMPLETELY_MON; } bool isNormalMixture(int monotone) { return monotone == NORMAL_MIXTURE || monotone == COMPLETELY_MON; } bool isBernstein(cov_model *cov) { int monotone = cov->monotone; return monotone == BERNSTEIN; } bool isBernstein(int monotone) { return monotone == BERNSTEIN; } bool isGneiting(cov_model *cov) { int monotone = cov->monotone; return monotone == GNEITING_MON || monotone == COMPLETELY_MON; } bool isGneiting(int monotone) { return monotone == GNEITING_MON || monotone == COMPLETELY_MON; } bool is_any(isotropy_type iso, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (iso == C->Isotropy[i]) return true; return false; } bool is_all(isotropy_type iso, cov_fct *C) { int i; for (i=0; i < C->variants; i++) if (iso != C->Isotropy[i]) return false; return true; } bool TrafoOK(cov_model *cov) {// check other things, too, besides gatter ? bool ok = ((cov->gatternr >= FIRST_TRAFO && cov->gatternr <= LASTGATTER && cov->secondarygatternr == MISMATCH) || (cov->gatternr > LASTGATTER && cov->gatternr <= LAST_TRAFO && cov->secondarygatternr >= FIRST_TRAFO && cov->secondarygatternr <= LASTGATTER )) && cov->checked; if (!ok) { PMI(cov->calling); // PRINTF("not: %d <= %d <= %d, %d == %d oder %d < %d <= %d, %d <= %d <= %d UND %d\n", FIRST_TRAFO, cov->gatternr, LASTGATTER, cov->secondarygatternr, MISMATCH, // LASTGATTER, cov->gatternr, LAST_TRAFO, FIRST_TRAFO, cov->secondarygatternr, LASTGATTER, // cov->checked); BUG; } return ok; } bool isRObject(int type) { if (type == CLOSXP) BUG; return type == LANGSXP || type == VECSXP || type == ENVSXP; } bool ParamAllowsRandomness(cov_model *cov, int i) { cov_fct *C = CovList + cov->nr; //printf("%s %d %d\n", NAME(cov), i, C->kappaParamType[i] ); return C->kappaParamType[i] == RandomType || C->kappaParamType[i] == RandomOrShapeType; } bool ParamAllowsShape(cov_model *cov, int i) { cov_fct *C = CovList + cov->nr; //printf("%s %d %d\n", NAME(cov), i, C->kappaParamType[i] ); return C->kappaParamType[i] == ShapeType || C->kappaParamType[i] == RandomOrShapeType; } bool ParamIsTrend(cov_model *cov, int i) { return (SortOf(cov, i, 0, 0) == TRENDPARAM) && isTrend(cov->typus); } RandomFields/src/sequential.cc0000644000176200001440000003276213074763020016105 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de Simulation of a random field by sequential method Copyright (C) 2001 -- 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include //#include #include #include "RF.h" #include "shape_processes.h" #include "Coordinate_systems.h" //#include #define SEQU_BACK (COMMON_GAUSS + 1) #define SEQU_INIT (COMMON_GAUSS + 2) bool debugging = true; int check_sequential(cov_model *cov) { #define nsel 4 cov_model *next=cov->sub[0]; int err, dim = cov->tsdim; // taken[MAX DIM], sequ_param *gp = &(GLOBAL.sequ); location_type *loc = Loc(cov); ROLE_ASSERT(ROLE_GAUSS); if (!loc->grid && !loc->Time) SERR1("'%s' only possible if at least one direction is a grid", NICK(cov)); kdefault(cov, SEQU_BACK, gp->back); kdefault(cov, SEQU_INIT, gp->initial); if ((err = checkkappas(cov, false)) != NOERROR) return err; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if ((err = CHECK(next, dim, dim, PosDefType, XONLY, SymmetricOf(cov->isoown), SUBMODEL_DEP, ROLE_COV)) != NOERROR) return err; if (next->pref[Sequential] == PREF_NONE) return ERRORPREFNONE; setbackward(cov, next); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; if ((err = checkkappas(cov)) != NOERROR) return err; return NOERROR; } void range_sequential(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range) { GAUSS_COMMON_RANGE; range->min[SEQU_BACK] = 0; range->max[SEQU_BACK] = RF_INF; range->pmin[SEQU_BACK] = 0.1; range->pmax[SEQU_BACK] = 10; range->openmin[SEQU_BACK] = true; range->openmax[SEQU_BACK] = true; range->min[SEQU_INIT] = RF_NEGINF; range->max[SEQU_INIT] = RF_INF; range->pmin[SEQU_INIT] = -10; range->pmax[SEQU_INIT] = 10; range->openmin[SEQU_INIT] = false; range->openmax[SEQU_INIT] = true; } // (U1, U2) ~ N(0, S) => // U1 | U2 ~ N(S_{12} S_{22}^{-1} u2, S_11 - S12 S_22^{-1} S_21) // start mit S_22; dann nur zeilenweise + Einschwingen int init_sequential(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ cov_model *next = cov->sub[0]; // cov_fct *C=CovList + next->gatternr; // covfct cf = C->cov; location_type *loc = Loc(cov); if (loc->distances) return ERRORFAILED; int withoutlast, d, endfor, l, err = NOERROR, dim = cov->tsdim, spatialdim = dim - 1, vdim = next->vdim[0], max = GLOBAL.direct.maxvariables, back= P0INT(SEQU_BACK), initial= P0INT(SEQU_INIT); assert(dim == loc->timespacedim); assert(next->vdim[0] == next->vdim[1]); if (initial < 0) initial = back - initial; double //*caniso = loc->caniso, *timecomp = loc->grid ? loc->xgr[spatialdim] : loc->T, *xx = NULL, *G = NULL, *U11 = NULL, *COV21 = NULL, *MuT = NULL, *U22 = NULL, *Inv22 = NULL; double *res0 = NULL; sequ_storage* S = NULL; long i, timelength = loc->grid ? loc->xgr[spatialdim][XLENGTH] : loc->T[XLENGTH], spatialpnts = loc->totalpoints / timelength, totpnts = back * spatialpnts, totpntsSQ = totpnts * totpnts, spatialpntsSQ = spatialpnts * spatialpnts, spatialpntsSQback = totpnts * spatialpnts; bool storing = GLOBAL.internal.stored_init, Time = loc->Time; if (cov->role == ROLE_COV) { return NOERROR; } ROLE_ASSERT_GAUSS; cov->method = Sequential; if (!loc->grid && !Time) GERR("last component must be truely given by a non-trivial grid"); if (CovList[next->nr].implemented[Sequential] != IMPLEMENTED) { err=ERRORNOTDEFINED; goto ErrorHandling; } if (cov->vdim[0] > 1) { err=ERRORNOMULTIVARIATE; goto ErrorHandling; } if (totpnts > max) // (totpnts * vdim > max) GERR6("'%s' valid only if the number of lcoations is less than '%s' (=%d) . Got %d * %ld = %ld.", NICK(cov), direct[DIRECT_MAXVAR_PARAM], max, back, spatialpnts, totpnts); if (timelength <= back) { GERR2("the grid in the last direction is too small; use method '%s' instead of '%s'", CovList[DIRECT].nick, CovList[SEQUENTIAL].nick); } if (back < 1) back = max / spatialpnts; if ((U22 = (double *) MALLOC(sizeof(double) * totpntsSQ))==NULL || (Inv22 = (double *) MALLOC(sizeof(double) * totpntsSQ))==NULL || (COV21 = (double *) MALLOC(sizeof(double) * spatialpntsSQback))==NULL || (U11 = (double *) MALLOC(sizeof(double) * spatialpntsSQ))==NULL || (MuT = (double *) MALLOC(sizeof(double) * spatialpntsSQback))==NULL || (G = (double *) MALLOC(sizeof(double) * totpnts))==NULL || (res0 = (double *) MALLOC(sizeof(double) * vdim * (totpnts + spatialpnts * initial))) ==NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } NEW_STORAGE(sequ); S = cov->Ssequ; /* ************************* */ /* create matrix of explicit */ /* x-coordinates */ /* ************************* */ if (loc->grid) loc->xgr[spatialdim][XLENGTH] = back; else loc->T[XLENGTH] = back; TransformLoc(cov, &xx, false); loc = Loc(cov); assert(loc->caniso == NULL); if (loc->grid) loc->xgr[spatialdim][XLENGTH]=timelength; else loc->T[XLENGTH] = timelength; /* ********************* */ /* matrix creation part */ /* ********************* */ long j, k, k0, k1, k2, segment; int row, f77err; double *y; y = (double*) MALLOC(dim * sizeof(double)); // *** S22 if (PL==PL_SUBDETAILS) { LPRINT("covariance matrix...\n"); } k = 0; for (k0 =i=0; i=PL_STRUCTURE) { LPRINT("Cholesky decomposition of Cov22...\n"); } row=totpnts; // dchdc destroys the input matrix; upper half of U22 contains result! // dpotrf F77_CALL(dpotrf)("Upper", &m, REAL(ans), &m, &i); // assert(false); F77_CALL(dpotrf)("Upper", &row, U22, &row, &f77err); // assert(false); // F77_NAME(dchdc)(U22, &row, &row, G, NULL, &choljob, &f77err); if (f77err!=NOERROR) { if (PL>=PL_ERRORS) { LPRINT("Error code F77_CALL(dpotrf) = %d\n", f77err); } err=ERRORDECOMPOSITION; goto ErrorHandling; } // for (i=0; i=PL_STRUCTURE) { LPRINT("inverse of Cov22...\n"); } MEMCOPY(Inv22, U22, sizeof(double) * totpntsSQ); F77_CALL(dpotri)("Upper", &row, Inv22, &row, &f77err); if (f77err!=NOERROR) { if (PL>=PL_ERRORS) { LPRINT("Error code F77_CALL(dpotri) = %d\n", f77err); } err=ERRORDECOMPOSITION; goto ErrorHandling; } for (k=i=0; i=PL_STRUCTURE) { LPRINT("calculating matrix for the mean...\n"); } l = 0; for (i=0; i=PL_STRUCTURE) { LPRINT("calculating cov matrix...\n"); } l = 0; for (i=0; i=PL_STRUCTURE) { LPRINT("Cholesky decomposition of Cov11...\n"); } row=spatialpnts; // dchdc destroys the input matrix; upper half of U22 contains result! // dpotrf F77_CALL(dpotrf)("Upper", &m, REAL(ans), &m, &i); F77_CALL(dpotrf)("Upper", &row, U11, &row, &f77err); /* for (i=0; i=PL_ERRORS) { LPRINT("U11: Error code F77_CALL(dpotrf) = %d\n", f77err); } err=ERRORDECOMPOSITION; goto ErrorHandling; } err = FieldReturn(cov); ErrorHandling: // and NOERROR... FREE(xx); if (S!=NULL) { S->totpnts = totpnts; S->spatialpnts = spatialpnts; S->back = back; S->initial = initial; S->ntime = timecomp[XLENGTH]; } if (!storing && err!=NOERROR) { FREE(MuT); FREE(U11); FREE(U22); FREE(G); FREE(res0); } else { if (S != NULL) { S->U22=U22; S->U11=U11; S->MuT=MuT; S->G=G; S->res0=res0; //assert(false); } } if (COV21!=NULL) { if (S != NULL && debugging) S->Cov21 = COV21; else UNCONDFREE(COV21); } if (Inv22!=NULL) { if (S != NULL && debugging) S->Inv22 = Inv22; else UNCONDFREE(Inv22); } cov->simu.active = err == NOERROR; //printf("active=%d\n", cov->simu.active); assert(false); return err; } void sequentialpart(double *res, long totpnts, int spatialpnts, int ntime, double *U11, double *MuT, double *G) { double *rp, *oldrp; int n, i, k, j, mutj; rp = res + totpnts; oldrp = res; for (n=0; nsub[0]; sequ_storage *S = cov->Ssequ; assert(S != NULL); int vdim = next->vdim[0]; long i, j, k, totpnts = S->totpnts; double *G,*U22, *U11, *MuT; double *res0, *res = cov->rf; SAVE_GAUSS_TRAFO; assert(res != NULL); assert(S != NULL); // printf("totpnts %ld %d %d\n", totpnts, S->initial, S->spatialpnts); // assert(false); U22 = S->U22; // S22^{1/2} U11 = S->U11; // S11^{1/2} MuT = S->MuT; res0 = S->res0; G = S->G;// only the memory space is of interest (stored to avoid // allocation errors here) // Start for (i=0; ispatialpnts, S->initial, U11, MuT, G); res0 += S->initial * S->spatialpnts; MEMCOPY(res, res0, sizeof(double) * totpnts * vdim); sequentialpart(res, totpnts, S->spatialpnts, S->ntime - S->back, U11, MuT, G); BOXCOX_INVERSE; } RandomFields/src/trend.cc0000644000176200001440000011253313074763020015042 0ustar liggesusers /* Authors Martin Schlather, schlather@math.uni-mannheim.de Copyright (C) 2011 -- 2015 Marco Oesting & Martin Schlather 2015 -- 2017 Martin Schlather Handling of the different possibilities to pass the trend Note: * Never use the below functions directly, but only by the functions indicated in RFsimu.h, since there is no error check (e.g. initialization of RANDOM) * VARIANCE, SCALE are not used here * definitions for the random coin method can be found in MPPFcts.cc * definitions for genuinely anisotropic or nondomain models are in SophisticatedModel.cc; hyper models also in Hypermodel.cc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*Note: the parameter 'polycoeff' is hidden in R; it is a vector consisting of the coefficients of the corresponding trend polynomials: the first choose(polydeg[1]+d,d) components belong to the first polynomial, the next choose(polydeg[2]+d,d) to the second one,... the corresponding monomial functions are of the following order: 1, x, x^2, ..., x^k, y, x y, ... x^(k-1) y, y^2, x y^2..., y^k, z, x z, x^2 z, ...., x^(k-1) z, y z, x y z, x^2 y z, ..., z^k */ #include #include #include #include #include #include #include "RF.h" #include "primitive.h" #include "Operator.h" #include "variogramAndCo.h" ////////////////////////////////////////////////////////////////////// // mixed ////////////////////////////////////////////////////////////////////// #define MIXED_CONSTANT 0 void mixed(double *x, cov_model *cov, double *v) { // bis auf den letzten Schluss alles schon auf bel vdim geschrieben. cov_model *next = cov->sub[0]; location_type *loc = Loc(cov); mixed_storage *s = cov->Smixed; double //distTF, var = 1.0, *covmatrix=NULL; int i, err, // Xnrow, // err=NOERROR, vdim = cov->vdim[0], vdimsq = vdim * vdim; if (cov->vdim[0] != cov->vdim[1]) BUG; if (isNegDef(cov) && cov->nsub == 0) { for (i=0; iq[MIXED_CONSTANT]) { // Xu , u ~ N(0, C) // classical random effect cov_model *sub = next; while (isDollar(sub)) { var *= PARAM0(sub, DVAR); sub=sub->sub[0]; } covmatrix = LPARAM(next, 99999); BUG; // FIX_M); if (LNCOL(MIXED_X) != LPARAMNROW(next, 99999)) { // FIX_M)) { GERR("mixed model: X and covariance matrix M do not match"); } } else { // Xu , u ~ random field // random effect, geostatistical covariance model CovarianceMatrix(cov->key, s->mixedcov); covmatrix = s->mixedcov; } // sub->nr != FIX // ab hier vdim =1 *v = XkCXtl(LP(MIXED_X), covmatrix, LNROW(MIXED_X), LNCOL(MIXED_X), loc->i_row, loc->i_col); *v *= var; return; ErrorHandling: XERR(err); } void mixed_nonstat(double *x, double *y, cov_model *cov, double *v){ NotProgrammedYet(""); if (cov->nsub != 0 && PisNULL(MIXED_X)) { // no X given, but a submodel cov_model *next = cov->sub[0]; NONSTATCOV(x, y, next, v); } else mixed(x, cov, v); } void covmatrix_mixed(cov_model *cov, double *v) { cov_model *sub = cov->sub[0]; if (cov->ncol[MIXED_X] == 0) { // || element < 0) { CovList[sub->nr].covmatrix(sub, v); return; } double *C=NULL; int nz=0, nrow = LNROW(MIXED_X), ncol= LNCOL(MIXED_X), ncol2 = ncol * ncol; C = (double*) MALLOC(sizeof(double) * ncol2); if (C==NULL) { StandardCovMatrix(cov, v); return; } CovList[sub->nr].covmatrix(sub, C); XCXt(LP(MIXED_X), C, v, nrow, ncol); BUG;//todo:?reprogramm XCXt with alloc here ? Loc(cov)->totalpoints = nrow; for (int j=0; jtotalpoints; printf("\nStart mixed C %d ---- check within comment\n", element); // for (k=i=0; ip[element][k++]);// printf("\n");// } printf("\nStart mixed t(v) %d\n", element); // for (k=i=0; isub[0], *sub = next; bool simple = true; location_type *loc=Loc(cov); long i, totalpoints = loc->totalpoints; int *ncol = cov->ncol, *nrow = cov->nrow; listoftype *X = PLIST(MIXED_X); if (cov->q == NULL) QALLOC(1); while (sub != NULL && isDollar(sub) && ((simple = PARAMisNULL(sub, DPROJ) && (PARAMisNULL(sub, DSCALE) || PARAM0(sub, DSCALE) == 1.0) && PARAMisNULL(sub, DANISO)))) sub=sub->sub[0]; BUG; if ((cov->q[MIXED_CONSTANT] = sub != NULL && 9999)) {// sub->nr == FIX)) { //next->delflag = DEL_COV - 6; if (isDollar(next) && next->nrow[DVAR]==0) { //next->delflag = DEL_COV - 6; if (!simple) SERR1("'%s' not allowed together with an anisotropic structrue", NICK(cov)); } int constant_size; for (i=0; inrow[i]; if (ncol[MIXED_X] > 0 && X->ncol[i] != constant_size) { SERR7("%ldth matrix '%s' (%d x %d) and (%d x %d) constant matrix '%s' do not match", i, KNAME(MIXED_X), X->nrow[i], X->ncol[i], constant_size, constant_size, NICK(sub)); } } } else { for (i=0; inrow[i] != X->ncol[i]) SERR3("%ldth matrix is not symmetric (%d x %d)", i+1, X->nrow[i], X->ncol[i]); } } if (false) // test ist wichtig, kollidiert z.Zt. aber mit SetAndGetModelInfo for (i=0; inrow[i] != totalpoints) { //PMI(cov); SERR4("number of rows of entry %ld of '%s' (%d) are different from the number of locations (%ld)", i+1, KNAME(MIXED_X), X->nrow[i], totalpoints); } } return NOERROR; } char iscovmatrix_mixed(cov_model *cov) { int err; // printf("iscov %d %ld\n", cov->qlen, cov->q); if (cov->q == NULL && (err = set_mixed_constant(cov)) != NOERROR) XERR(err); // printf("iscov %d %ld\n", cov->qlen, cov->q); return 2 * (int) (cov->nsub > 0) * (int) (cov->q[MIXED_CONSTANT] || cov->ncol[MIXED_X] > 0); } void kappamixed(int i, cov_model VARIABLE_IS_NOT_USED *cov, int *nr, int *nc){ if (i==MIXED_DIM) *nc = *nr = 1; else if (i==MIXED_BETA || i==MIXED_DIST) { *nc = 1; *nr = SIZE_NOT_DETERMINED; } else if (i==MIXED_X || i==MIXED_COORD) *nc = *nr = SIZE_NOT_DETERMINED; else *nc = *nr = -1; } int checkmixed(cov_model *cov) { // cov_model *sub; //location_type *loc=Loc(cov); int i, err, nkappa = CovList[cov->nr].kappas, nsub = cov->nsub, *ncol = cov->ncol, *nrow = cov->nrow; // taken[MAX DIM], char msg[300]; //printf("%d\n", MIXED_X); listoftype *X = PLIST(MIXED_X); if (!isCartesian(cov->isoown)) return ERRORNOTCARTESIAN; if (cov->nrow[0] * cov->ncol[0] != 1 || cov->nrow[1] * cov->ncol[1] != 1) SERR("currently only constant mean possible"); ROLE_ASSERT(ROLE_GAUSS || cov->role == ROLE_COV); for (i=0; ikappasub[i] != NULL) SERR("parameters may not be random"); if (cov->ncol[i] * cov->nrow[i] > (i < 2)) SERR("current version does not allow for mxied effects as this part of the package is being rewritten."); // SELECT ebenso loeschen?! } cov->vdim[0] = cov->vdim[1] = 1; //falls kein submodel vorhanden (Marco) cov->maxdim=INFDIM; cov->matrix_indep_of_x = true; if (ncol[MIXED_BETA] > 0) { // b is given if (nsub != 0) SERR("b and a covariance model may not be given at the same time"); if (ncol[MIXED_X] == 0) SERR2("if '%s' is given '%s' must be given", KNAME(MIXED_BETA), KNAME(MIXED_X)); for (i=0; incol[i] != nrow[MIXED_BETA]) { SPRINTF(msg, "%dth set: (%d x %d) matrix '%s' and (%d x %d) vector '%s' do not match", i, X->nrow[0], X->ncol[i], KNAME(MIXED_X), nrow[MIXED_BETA], ncol[MIXED_BETA], KNAME(MIXED_BETA)); SERR(msg); } } } else if (nsub == 0) { // only X is given -- then only a deterministic // constant is given if (ncol[MIXED_BETA] == 0) SERR1("if no covariance model is given then '%s' must be given", KNAME(MIXED_BETA)); if (ncol[MIXED_X] != 1) // deterministic effect SERR("X must have one column"); kdefault(cov, MIXED_BETA, 1); } else { // submodel is given cov_model *next = cov->sub[0]; // double var = 1.0; if (cov->tsdim != cov->xdimprev || cov->tsdim != cov->xdimown) return ERRORDIM; if ((err = CHECK(next, cov->tsdim, cov->xdimown, PosDefType, cov->domown, cov->isoown, SUBMODEL_DEP, ROLE_COV)) != NOERROR) { // print("error\n"); return err; } if (cov->q == NULL && (err = set_mixed_constant(cov)) != NOERROR) { return err; } // warning("some checks in model 'mixed' are missing"); // ob X mit C zusammengeht. setbackward(cov, next); } if (cov->vdim[0] > 1) SERR("multivariate version of mixed not programmed yet"); if (PisNULL(MIXED_DIST) xor PisNULL(MIXED_DIM)) SERR2("if '%s' and '%s' must be given at the same time", KNAME(MIXED_DIM), KNAME(MIXED_DIST)); if (PisNULL(MIXED_DIST) xor PisNULL(MIXED_COORD)) SERR2("'%s' and '%s' may not be given together", KNAME(MIXED_DIST), KNAME(MIXED_COORD)); // incorrect. but save !! // cov->semiseparatelast = false; // taken[tsxdim - 1] <= 1; // cov->separatelast = false; // taken[tsxdim - 1] <= 1; ?? return NOERROR; } void rangemixed(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ int i; for (i=MIXED_X; i<=MIXED_COORD; i++) { range->min[i] = RF_NEGINF; range->max[i] = RF_INF; range->pmin[i] = -1e10; range->pmax[i] = 1e10; range->openmin[i] = true; range->openmax[i] = true; } i=MIXED_DIST; range->min[i] = 0; range->max[i] = RF_INF; range->pmin[i] = 1e-10; range->pmax[i] = 1e10; range->openmin[i] = false; range->openmax[i] = true; } int initmixed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S) { int store = GLOBAL.general.set; location_type *loc = Loc(cov); mixed_storage *s; errorloc_type errorloc_save; double *b = P(MIXED_BETA), *coord = P(MIXED_COORD), *dist = P(MIXED_DIST); int Cn = -1, Cdim = -1, err = NOERROR, vdim = cov->vdim[0], dim = coord!=NULL ? cov->ncol[MIXED_COORD] : P0INT(MIXED_DIM); long totalpoints = loc->totalpoints, total = vdim * totalpoints; // listoftype *X = PLIST(MIXED_X); bool distTF; assert(cov->vdim[0] == cov->vdim[1]); return ERRORFAILED; // muss in zerlegt werden in init und struct // und unten struct aufrufen richtig praeparieren. ROLE_ASSERT_GAUSS; // cholesky zerlegung + bereitstellung von b STRCPY(errorloc_save, ERROR_LOC); SPRINTF(ERROR_LOC, "%s%s: ", errorloc_save, "init mixed model"); assert(cov->nr == MIXEDEFFECT); NEW_STORAGE(mixed); s = cov->Smixed; NotProgrammedYet(""); FREE(s->Xb); if (cov->ncol[MIXED_BETA] > 0) { // b is given // X is given, but no covariance model if (cov->nrow[MIXED_X] > 1) { warning("using first element of list X only"); } if ((s->Xb = (double*) MALLOC(sizeof(double) * LNROW(MIXED_X))) == NULL) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } Ax(LP(MIXED_X), b, LNROW(MIXED_X), LNCOL(MIXED_X), s->Xb); } else { // submodel is given NotProgrammedYet(""); //if (cov->q[MIXED_CONSTANT]) ERR("not 'constant'"). cov_model *sub, *next = cov->sub[0]; if ((s->Xb = (double*) MALLOC(sizeof(double) * total)) == 0) { err=ERRORMEMORYALLOCATION; goto ErrorHandling; } if ((distTF = dist!=NULL)) { // Xu , u ~ geostatmodel, u i.a. viel laenger als X (tierzucht) // stehende Vektoren, aneinandergereiht Cn = cov->ncol[MIXED_DIST]; Cn = (int) (0.5 + 0.5 * (1.0 + SQRT(1 + 8.0 * Cn))); Cdim = cov->nrow[MIXED_DIST]; assert(Cdim==1); if ((err = covCpy(&(cov->key), next, dist, NULL, dim, dim, Cn, false /*Time */, false, distTF)) != NOERROR) goto ErrorHandling; } else if (coord != NULL) { // Xu , u ~ geostatmodel, u i.a. viel laenger als X (tierzucht) // stehende Vektoren, aneinandergereiht Cn = cov->ncol[MIXED_COORD]; Cdim = cov->nrow[MIXED_COORD]; if (Cdim > Cn) warning("The dimension of the coordinates is higher than the number of points"); if ((err = covCpy(&(cov->key), next)) != NOERROR) goto ErrorHandling; } else { // Xu , u ~ geostatmodel, X quadratisch Cn = loc->totalpoints; BUG; // C HECK whether cov_list = false is ok if ((err = covCpy(&(cov->key), next, coord, NULL, dim, dim, Cn, false, false, distTF)) != NOERROR) goto ErrorHandling; } if (cov->key->nr != GAUSSPROC) addModel(&(cov->key), GAUSSPROC); cov->key->calling = cov->key; NEW_STORAGE(gen); if ((err = INIT(cov->key, 0, cov->Sgen)) != NOERROR) goto ErrorHandling; int Xnrow, Xncol; Xnrow = Xncol = Cn * sub->vdim[0]; if (loc->i_row==0 && loc->i_col==0) { FREE(s->mixedcov); s->mixedcov = (double*) MALLOC(sizeof(double) * Xnrow * Xnrow); if (s->mixedcov == NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } } } // end of submodel FieldReturn(cov); ErrorHandling: GLOBAL.general.set = store; cov->initialised = err == NOERROR; return err; } static int keepRandomEffect = false; void domixed(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *S){ location_type *loc = Loc(cov); mixed_storage *s = cov->Smixed; double *res = cov->rf; int vdim = cov->vdim[0]; long i, totalpoints = loc->totalpoints, total = vdim * totalpoints; assert(cov->vdim[0] == cov->vdim[1]); if (cov->ncol[MIXED_BETA] > 0) { // b is given // X is given, but no covariance model if (total == LNROW(MIXED_X)) { for (i=0; iXb[i]; } else { assert(LNROW(MIXED_X) == 1); for (i=0; iXb[0]; } } else { // submodel is given cov_model *key = cov->key; if (!keepRandomEffect || !s->initialized) { do_gaussprocess(key, cov->Sgen); } if (PisNULL(MIXED_X)) { double *rf = cov->key->rf; for (i=0; ikey->rf, LNROW(MIXED_X), LNCOL(MIXED_X), res); } } } ////////////////////////////////////////////////////////////////////// // trend ////////////////////////////////////////////////////////////////////// void trend(double *x, cov_model *cov, double *v){ cov_model *musub = cov->kappasub[TREND_MEAN]; int i, vdim = cov->vdim[0], vSq = vdim * vdim; double *mu = P(TREND_MEAN); if (cov->role == ROLE_COV) { BUG; for (i=0; itypus) && !isTrend(cov->typus)) BUG; if (musub != NULL) { FCTN(x, musub, v); } else for (i=0; itsdim; *nc = SIZE_NOT_DETERMINED; break; case TREND_POLY: //polydeg *nr = SIZE_NOT_DETERMINED; *nc = 1; break; case TREND_PARAM_POLY: //polycoeff if(PisNULL(TREND_POLY)) { *nr = -1; } else { *nr = 0; //APMI(cov); for(k=0; k < cov->nrow[TREND_POLY]; k++) { //printf("%d\n", *nr); *nr += binomialcoeff(PINT(TREND_POLY)[k] + cov->tsdim, cov->tsdim); } } *nc = 1; break; case TREND_FCT: //arbitraryfct *nr = 1; *nc = 1; break; case TREND_PARAM_FCT: //fctcoeff *nr = 1; *nc = 1; break; default: *nr = -1; *nc = -1; } } int checktrend(cov_model *cov){ // if (cov->ncol[TREND_LINEAR] > 0 || cov->ncol[TREND_FCT]>0 // || cov->ncol[TREND_PARAM_FCT] > 0) // return(ERRORNOTPROGRAMMED); cov_model *prev = cov->calling, *musub = cov->kappasub[TREND_MEAN]; double *mu = P(TREND_MEAN), *plane = P(TREND_LINEAR); int i, err, nkappa = CovList[cov->nr].kappas, *polydeg = PINT(TREND_POLY), vdim = 0, tsdim= cov->tsdim, basislen = 0; //SEXP Rx, fctbody, envir; if (! ((isCoordinateSystem(cov->isoown) && musub != NULL) || (isIsotropic(cov->isoown) && musub == NULL))) return ERRORFAILED; bool ok = (musub != NULL && isCoordinateSystem(cov->isoown) && prev != NULL && prev->nr == MULT && isTrend(prev->typus)) || // passt das so alles?? (musub == NULL && isIsotropic(cov->isoown) && (prev == NULL || prev->nr == TRENDEVAL || (prev->nr == PLUS && (prev->calling == NULL || isProcess(prev->calling) || isInterface(prev->calling) || isTrend(prev->typus))))) ; if (!ok) SERR("trend model is misused."); ROLE_ASSERT(ROLE_GAUSS || cov->role == ROLE_COV); for (i=0; ikappasub[i] != NULL && (i>0 || isRandom(cov->kappasub[i]))) SERR("parameters may not be random or sub"); } if (musub != NULL) { assert(cov->tsdim == cov->xdimown); if ((err = CHECK(musub, cov->tsdim, cov->xdimown, ShapeType, XONLY, cov->isoown, SUBMODEL_DEP, ROLE_BASE)) != NOERROR) return err; if (isRandom(musub->typus)) NotProgrammedYet("mixed effects"); vdim = musub->vdim[0]; cov->matrix_indep_of_x = false; } else if (mu != NULL) { if (prev != NULL && prev->nr != PLUS && isProcess(prev) && !isInterface(prev) && prev->nr != TRENDEVAL) { cov->typus = ShapeType; } vdim = cov->nrow[TREND_MEAN]; cov->matrix_indep_of_x = true; } else SERR("no trend argument given"); if (plane != NULL) { SERR("'plane' currently not working. Please contact author if needed"); if(vdim>0 && (vdim != cov->ncol[TREND_LINEAR])) { SERR("trend parameters have different multivariate dimensions"); } else vdim = cov->ncol[TREND_LINEAR]; cov->matrix_indep_of_x = false; } if (!PisNULL(TREND_POLY)) { SERR("'poly' currently not working. Please contact author if needed"); if (vdim>0) { if (vdim != cov->nrow[TREND_POLY]) SERR("trend parameters have different multivariate dimensions"); SERR("polynomials and free functions in trend may not be mixed with other trend definitions. Please use a sum of trends."); } vdim = cov->nrow[TREND_POLY]; if (PisNULL(TREND_PARAM_POLY)) { for (i=0; imatrix_indep_of_x = false; } if (!PisNULL(TREND_FCT)) { //brauche hier: construct.fct$vdim cov->matrix_indep_of_x = false; NotProgrammedYet("arbitrary function"); // kdefault(cov, TREND_PARAM_FCT, 1.0); // PROTECT(envir = allocSExp(ENVSXP)); // SET_ENCLOS(envir, R_GlobalEnv); // // PROTECT(fctbody = allocSExp(CLOSXP)); // fctbody = BODY(*((SEXP *) arbitraryfct)); // // PROTECT(Rx = allocVector(REALSXP,xlen)); // for(j=0; j 0) { // if (vdim != vdimproposal) // GERR("trend parameters have different multivariate dimensions"); // GERR("polynomials and free functions in trend may not be mixed with other trend definitions. Please use a sum of trends."); // } // vdim = vdimproposal; } if (vdim <= 0) { vdim = prev->vdim[0]; if (vdim <= 0) SERR("multivariate dimension for trend cannot be determined."); PALLOC(TREND_MEAN, vdim, 1); for(i=0; ivdim[0] = cov->vdim[1] = vdim; cov->isoown = cov->matrix_indep_of_x ? IsotropicOf(cov->isoown) : CoordinateSystemOf(cov->isoown); return NOERROR; } int checktrendproc(cov_model *cov){ return checktrend(cov); } void rangetrend(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ //P(TREND_MEAN]: mu / mean range->min[TREND_MEAN] = RF_NEGINF; range->max[TREND_MEAN] = RF_INF; range->pmin[TREND_MEAN] = -10^10; range->pmax[TREND_MEAN] = 10^10; range->openmin[TREND_MEAN] = true; range->openmax[TREND_MEAN] = true; //P(TREND_LINEAR]: plane range->min[TREND_LINEAR] = RF_NEGINF; range->max[TREND_LINEAR] = RF_INF; range->pmin[TREND_LINEAR] = -10^10; range->pmax[TREND_LINEAR] = 10^10; range->openmin[TREND_LINEAR] = true; range->openmax[TREND_LINEAR] = true; //P(TREND_POLY]: polydeg / polynomial degree range->min[TREND_POLY] = 0; range->max[TREND_POLY] = MAXINT; range->pmin[TREND_POLY] = 0; range->pmax[TREND_POLY] = 10; range->openmin[TREND_POLY] = false; range->openmax[TREND_POLY] = false; //P(TREND_PARAM_POLY]: polycoeff / coefficients of polynomial range->min[TREND_PARAM_POLY] = RF_NEGINF; range->max[TREND_PARAM_POLY] = RF_INF; range->pmin[TREND_PARAM_POLY] = -10^10; range->pmax[TREND_PARAM_POLY] = 10^10; range->openmin[TREND_PARAM_POLY] = true; range->openmax[TREND_PARAM_POLY] = true; //P(TREND_FCT]: arbitraryfct / arbitrary function range->min[TREND_FCT] = RF_NEGINF; range->max[TREND_FCT] = RF_INF; range->pmin[TREND_FCT] = -10^10; range->pmax[TREND_FCT] = 10^10; range->openmin[TREND_FCT] = true; range->openmax[TREND_FCT] = true; //P(TREND_PARAM_FCT]: fctcoeff / coefficient of arbitrary function range->min[TREND_PARAM_FCT] = RF_NEGINF; range->max[TREND_PARAM_FCT] = RF_INF; range->pmin[TREND_PARAM_FCT] = -10^10; range->pmax[TREND_PARAM_FCT] = 10^10; range->openmin[TREND_PARAM_FCT] = true; range->openmax[TREND_PARAM_FCT] = true; } void GetInternalMeanI(cov_model *cov, int vdim, double *mean){ // assuming that mean[i]=0.0 originally for all i int i; if (cov->nr == TREND) { if (cov->ncol[TREND_MEAN]==1) { if (cov->nrow[TREND_MEAN] != vdim || cov->kappasub[TREND_MEAN] != NULL) { for (i=0; inr == CONST && isTrend(cov)) { for (i=0; ixdimown < MAXSIMUDIM) { FCTN(ZERO, cov, mean);//to be improved! to do } else for (i=0; inr == PLUS || cov->nr == TREND) { for (i=0; insub; i++) GetInternalMeanI(cov->sub[i], vdim, mean); } } void GetInternalMean(cov_model *cov, int vdim, double *mean){ int i; for (i=0; i n)) return 0; if(k > n-k) k = n-k; //symmetry for(i=0; itsdim, vdim = cov->vdim[0]; //SEXP fctformals, argnames; if (cov->vdim[0] != cov->vdim[1]) BUG; //assert(false); ROLE_ASSERT_GAUSS; NEW_STORAGE(trend); trend_storage *s = cov->Strend; if(polydeg != NULL) { for(i=0; ix = (double *) MALLOC(sizeof(double) * tsdim))==NULL || (s->xi = (int *) MALLOC(sizeof(int) * tsdim))==NULL || (s->evalplane = (double *) MALLOC(sizeof(double) * vdim))==NULL || (basislen > 0 && (s->powmatrix = (int *) MALLOC(sizeof(int) * basislen * tsdim))==NULL)){ err=ERRORMEMORYALLOCATION; goto ErrorHandling; } if (basislen > 0) poly_basis(cov, S); //generates basis of monomials //each row consists of one basis element //the j-th column consists of the power of the j-th space-time-dimension if (!PisNULL(TREND_FCT)) { //hier werden Argumente von arbitraryfct ueberprueft NotProgrammedYet(""); // fctformals = getAttrib(FORMALS(*((SEXP *) arbitraryfct)), R_NamesSymbol); // nargs = length(fctformals); // PROTECT(argnames = allocVector(STRSXP,1)); // // SET_STRING_ELT(argnames,0,mkChar("y")); // matchind = 0; // for(j=0; j0) { // if((meth->loc->spatialdim < 2) || (meth->loc->xvectorvalued)) // GERR("The variable y does not match to the locations.\n"); // } // // SET_STRING_ELT(argnames,0,mkChar("z")); // matchind = 0; // for(j=0; j0) { // if((meth->loc->spatialdim < 3) || (meth->loc->xvectorvalued)) // GERR("The variable z does not match to the locations.\n") // } // // SET_STRING_ELT(argnames,0,mkChar("T")); // matchind = 0; // for(j=0; j0) { // if (meth->loc->Time == false) // GERR("The variable T may be used for time only.\n") // } // UNPROTECT(1); } err = FieldReturn(cov); return NOERROR; ErrorHandling: return err; } void do_trend(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ location_type *loc = Loc(cov); char errorloc_save[nErro rLoc]; trend_storage *S = cov->Strend; //PMI(cov->calling->calling); assert(S != NULL); double t, *mu = P(TREND_MEAN), // *plane = P(TREND_LINEAR), // *polycoeff = P(TREND_PARAM_POLY), // *fctcoeff = P(TREND_PARAM_FCT), **xgr = loc->xgr, // *x = S->x, // *evalplane = S->evalplane ; int v, w, basislen, startindex, *polydeg = PINT(TREND_POLY), vdim = cov->vdim[0], tsdim = cov->tsdim, spatialdim = loc->spatialdim, *xi = S->xi, *powmatrix = S->powmatrix; //SEXP fctbody, tempres, envir, Rx; long i, j, k, totalpoints = loc->totalpoints, total = totalpoints * vdim; double *res = cov->rf; assert(cov->vdim[0] == cov->vdim[1]); STRCPY(errorloc_save, ERROR_LOC); SPRINTF(ERROR_LOC, "%s%s: ", errorloc_save, "add trend model"); // print("%s\n", ERROR_LOC); if (cov->kappasub[TREND_MEAN] != NULL) { } else if (mu != NULL) { for (k=0; kgrid) { for (w=0; wnrow[TREND_LINEAR], cov->ncol[TREND_LINEAR], evalplane); for(v=0; v=loc->xgr[i][XLENGTH]) { xi[i] = 0; x[i] = xgr[i][XSTART]; if (iTime) { long m, endfor= (long int) loc->xgr[loc->timespacedim-1][XLENGTH], endfor2 = loc->spatialtotalpoints; for(k=m=0, t=loc->T[XSTART]; mT[XSTEP]) { // for(t=loc->T[XSTART], i=0; t < loc->T[XEND]; t += loc->T[XSTEP]) { for(m=0, j=0; m < endfor2; m++) { for(w=0; wx)[j++]; x[spatialdim] = t; xA(x, plane, cov->nrow[TREND_LINEAR], cov->ncol[TREND_LINEAR], evalplane); for(v=0;vx + m, plane, cov->nrow[TREND_LINEAR], cov->ncol[TREND_LINEAR], evalplane); for(v=0;vgrid) { for (w=0; w=xgr[i][XLENGTH]) { xi[i] = 0; x[i] = xgr[i][XSTART]; if (iTime) { for(t=loc->T[XSTART], k=v; kT[XSTEP]) { long endfor = loc->spatialtotalpoints; for(i=0, j=0; ix)[j++]; x[spatialdim] = t; //evaluation of trend polynomial res[k] += evalpoly(x, powmatrix + startindex*tsdim, polycoeff + startindex, basislen, tsdim); } } } else { for(k=v; kgrid) { // for (w=0; w1) // defineVar(install("y"), ScalarReal(x[1]), envir); // if (spatialdim>2) // defineVar(install("z"), ScalarReal(x[2]), envir); // defineVar(install("T"), ScalarReal(x[tsdim-1]), envir); // tempres = eval(fctbody, envir); // for (v=0; v=len[i]) { // xi[i] = 0; // x[i] = xgr[i][XSTART]; // if (iTime) { // int k, // endfor= (int) loc->T[XLENGTH]; // for(k=0, t=loc->T[XSTART], i=0; kT[XSTEP]) { // // for(t=loc->T[XSTART], i=0; t < loc->T[XEND]; t+=loc->T[XSTEP]) { // for(k=0, j=0; k < loc->spatialtotalpoints; k++, i++) { // for(w=0; wx)[j++]; // x[spatialdim] = t; // //evaluation of trend polynomial // for(w=0; w 1) // defineVar(install("y"), ScalarReal(x[1]), envir); // if (spatialdim > 2) // defineVar(install("z"), ScalarReal(x[2]), envir); // if (loc->Time) // defineVar(install("T"), ScalarReal(x[tsdim-1]), envir); // tempres = eval(fctbody, envir); // for (v=0; vx)[k*spatialdim+w]; // for(w=0; w1) // defineVar(install("y"), ScalarReal(x[1]), envir); // if (spatialdim>2) // defineVar(install("z"), ScalarReal(x[2]), envir); // defineVar(install("T"), ScalarReal(x[tsdim-1]), envir); // tempres = eval(fctbody, envir); // for (v=0; vStrend; int basislen=0, powsum, d, i, j, k, v, dim = cov->tsdim, vdim = cov->vdim[0], *powmatrix = S->powmatrix, *dimi=NULL, err=NOERROR; int *polydeg = PINT(TREND_POLY); assert(cov->vdim[0] == cov->vdim[1]); dimi = (int *) MALLOC(dim * sizeof(int)); if (dimi == NULL) { err = ERRORMEMORYALLOCATION; goto ErrorHandling; } for(v=0, j=0; v polydeg[v]) { dimi[i] = 0; if (i < dim-1) { i++; (dimi[i])++; } powsum = 0; for(d=0; drole == ROLE_GAUSS) { NotProgrammedYet(""); //C = covarianzmatrix // b = (X^T C^{-1} X)^{-1} X^top C^{-1} y // Baysiean mit b ~ N(b_0, C_B) : // b = (X^T C^{-1} X + C_b^{-1})^{-1} [X^top C^{-1} y + C_b^{-1} b_0 } else { // deterministic is OK NotProgrammedYet(""); } } */ int checkTrendEval(cov_model *cov) { // auch fuer TrendEval cov_model *next = cov->sub[0]; int err; //dim = Gettimespacedim(cov); if ((err = CHECK(next, cov->tsdim, cov->xdimown, TrendType, XONLY, cov->isoown, SUBMODEL_DEP, ROLE_BASE)) != NOERROR) return err; assert(isTrend(cov->sub[0]->typus)); setbackward(cov, next); cov->vdim[0] = next->vdim[0]; cov->vdim[1] = next->vdim[1]; if (cov->vdim[0] != 1) NotProgrammedYet(""); if ((err = kappaBoxCoxParam(cov, GAUSS_BOXCOX)) != NOERROR) return err; return NOERROR; } int init_TrendEval(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){// auch fuer TrendEval int err; if (cov->vdim[0] != 1) NotProgrammedYet(""); if ((err = check_fctn(cov)) != NOERROR) return err; ROLE_ASSERT_GAUSS; err = FieldReturn(cov); cov->simu.active = err == NOERROR; if (PL>= PL_STRUCTURE) PRINTF("\n'%s' is now initialized.\n", NAME(cov)); return err; } void do_TrendEval(cov_model *cov, gen_storage VARIABLE_IS_NOT_USED *s){ double *res = cov->rf; assert(res != NULL); errorloc_type errorloc_save; STRCPY(errorloc_save, ERROR_LOC); SPRINTF(ERROR_LOC, "%s%s: ", errorloc_save, "add trend model"); Fctn(NULL, cov, res); STRCPY(ERROR_LOC, errorloc_save); BOXCOX_INVERSE; return; } void range_TrendEval(cov_model VARIABLE_IS_NOT_USED *cov, range_type *range){ GAUSS_COMMON_RANGE; } RandomFields/src/empvario.cc0000644000176200001440000003444513074763020015555 0ustar liggesusers/* Authors Martin Schlather, schlather@math.uni-mannheim.de calculation of the empirical variogram Copyright (C) 2002 - 2017 Martin Schlather, This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA. */ #include #include //#include #include "RF.h" // z coordinate run the fastest in values, x the slowest #define TOOLS_DIM 1 #define TOOLS_MEMORYERROR 2 #define TOOLS_XERROR 3 #define TOOLS_BIN_ERROR 4 #define TOOLS_UNKNOWN_CHAR 5 #define TOOLS_METHOD 6 #define METHOD_CROSS 0 #define METHOD_PSEUDO 1 #define METHOD_COVARIANCE 2 #define METHOD_PSEUDOMADOGRAM 3 #define METHOD_CROSSMADOGRAM 4 double EV_TIMES_LESS = 2.0; // 0:always new method; inf:always usual method int EV_SYSTEM_LARGER = 100; // 0:always new method; inf:always usual method int LOW = -1; SEXP empiricalvariogram(SEXP X, SEXP Dim, SEXP Lx, SEXP Values, SEXP Repet, SEXP Grid, SEXP Bin, SEXP Nbin, // note that within the subsequent algorithm // the sd of the Efct ist correctly calculated: // instead for summing up Efct^2 in sd one should // sum up a^2 + b^2 ! // so finally only NAs are returned in this case // use emp SEXP Vdim, SEXP Method) /* x : matrix of coordinates, ### rows define points * dim : dimension, * lx : length of x, y, and z * values : (univariate) data for the points * repet : number of repetitions (the calculated emprical variogram will * be an overall average) * grid : (boolean) if true lx must be 3 [ x==c(start, end, step) ] * bin : specification of the bins * sequence is checked whether it is strictly isotone * nbin : number of bins. i.e. length(bin) - 1 * vdim : dimension of data * method : defined above */ { int dim = INTEGER(Dim)[0], lx = INTEGER(Lx)[0], repet = INTEGER(Repet)[0], grid = INTEGER(Grid)[0], nbin = INTEGER(Nbin)[0], vdim = INTEGER(Vdim)[0], method = INTEGER(Method)[0]; double *x = REAL(X), *values = REAL(Values), *bin = REAL(Bin), *res = NULL, *sumhead = NULL , *sumtail = NULL, n; int totaln = nbin * vdim * vdim; int d, halfnbin, gridpoints[MAXVARIODIM], dimM1, err, low, cur, up, curbin; long segment, totalpointsrepetvdim, totalpointsvdim, totalpoints = NA_INTEGER; double * xx[MAXVARIODIM], // maxdist[MAXVARIODIM],// dd, * BinSq = NULL; SEXP Res; // res contains the variogram, sd and n.bin (res gets returned to function) // first column is of res is the variogram // second column is the sd and the third n.bin (number of data per bin) PROTECT(Res = allocMatrix(REALSXP, totaln, 3)); res = REAL(Res); for(int i=0; i < totaln * 3; res[i++] = 0); if ( dim > MAXVARIODIM) {err = TOOLS_DIM; goto ErrorHandling; } if( vdim == 1) { // set cross to pseudo, if dimension is 1 if(method == METHOD_CROSS) method = METHOD_PSEUDO; if(method == METHOD_CROSSMADOGRAM) method = METHOD_PSEUDOMADOGRAM; } for (int i = segment = 0; i < dim; i++, segment += lx) xx[i] = &(x[segment]); if (xx[0]==NULL) {err=TOOLS_XERROR; goto ErrorHandling; } for (int i=0; i< nbin; i++) { if (bin[i] >= bin[i + 1]) {err = TOOLS_BIN_ERROR; goto ErrorHandling; } } dimM1 = dim - 1; halfnbin = nbin / 2; if ((BinSq = (double * ) MALLOC(sizeof(double) * (nbin + 1)))==NULL) { err = TOOLS_MEMORYERROR; goto ErrorHandling; } if(method == METHOD_COVARIANCE) { if( (sumhead = (double *) CALLOC(totaln, sizeof(double))) == NULL) { err = TOOLS_MEMORYERROR; goto ErrorHandling; } if( (sumtail = (double *) CALLOC(totaln, sizeof(double))) == NULL) { err = TOOLS_MEMORYERROR; goto ErrorHandling; } } for (int i = 0; i <= nbin; i++){ BinSq[i] = bin[i] > 0 ? bin[i] * bin[i] : bin[i]; } //////////////////////////////////// GRID //////////////////////////////////// if (grid) { int d1, d2, head, tail; double p1[MAXVARIODIM], p2[MAXVARIODIM], distSq, dx[MAXVARIODIM]; long indextail[MAXVARIODIM], indexhead[MAXVARIODIM], segmentbase[MAXVARIODIM]; //SegmentbaseTwo[MAXVARIODIM], //SegmentbaseFour[MAXVARIODIM]; // does not work!! : //GetGridSize(x, y, z, dim, &(gridpoints[0]), &(gridpoints[1]), &(gridpoints[2])); // totalpoints = gridpoints[0] * gridpoints[1] * gridpoints[2]; // // instead : // dd = 0.0; totalpoints = 1; for (int i = 0; i <= dimM1; i++) { gridpoints[i] = (int) (xx[i][XLENGTH]); totalpoints *= gridpoints[i]; // maxdist[i] = (gridpoints[i] - 1) * xx[i][XSTEP]; // dd += maxdist[i] * maxdist[i]; } totalpointsvdim = totalpoints * vdim; for (int i = 0; i <= dimM1; i++) { dx[i] = xx[i][XSTEP] * 0.99999999; } totalpointsrepetvdim = totalpointsvdim * repet; segmentbase[0] = 1; // here x runs the fastest; // SegmentbaseTwo[0] = segmentbase[0] << 1; //SegmentbaseFour[0] = segmentbase[0] << 2 ; for (int i = 1; i <= dimM1; i++) { segmentbase[i] = segmentbase[i - 1] * gridpoints[i - 1]; // SegmentbaseTwo[i] = segmentbase[i] << 1; // SegmentbaseFour[i] = segmentbase[i] << 2; } for (int i = 0; i <= dimM1; i++) {indexhead[i] = 0; p1[i] = 0.0; } // loop through all pair of points, except (head, tail) for head=tail, // which is treated separately at the end, if necessary (not relevant for // variogram itself, but for function E and V) #define FOR(DO) \ for (head = 0; headBinSq[0]) && (distSq <= BinSq[nbin])) { \ /* search which bin distSq in */ \ low = 0; up = nbin; /* 21.2.01, * nbin - 1 */ \ cur = halfnbin; \ while (low!=up) { \ if (distSq> BinSq[cur]) {low = cur;} else {up = cur-1;} \ cur = (up + low + 1) / 2; \ } \ for(int row = 0; row < vdim; row++) { \ for(int col = row; col < vdim; col++) { \ for (segment = 0; segment= gridpoints[d2]) { \ indextail[d2] = 0; p2[d2] = 0; \ d2--; \ assert(d2 >= 0); \ indextail[d2]++; \ p2[d2] +=dx[d2]; \ } \ } \ head++; \ if (head= gridpoints[d1]) { \ indexhead[d1] = 0; \ p1[d1] = 0; \ d1--; \ assert(d1 >= 0); \ indexhead[d1]++; \ p1[d1] +=dx[d1]; \ } \ } \ } switch(method){ case(METHOD_PSEUDO): // pseudo variogram FOR(double x2 = values[head + totalpoints * row + segment] - values[tail + totalpoints * col + segment]; x2 *= x2); break; case(METHOD_CROSS): // cross variogram FOR(double x2 = (values[head + totalpoints * row + segment] -values[tail + totalpoints * row + segment]) * (values[head + totalpoints * col + segment]-values[tail + totalpoints * col + segment])); break; case(METHOD_COVARIANCE): FOR(double x2 = (values[head + totalpoints * row + segment] * values[tail + totalpoints * col + segment]); sumhead[curbin] += values[head + totalpoints * row + segment]; sumtail[curbin] += values[tail + totalpoints * col + segment]); break; case(METHOD_PSEUDOMADOGRAM): // pseudo madogram FOR(double x2 = FABS(values[head + totalpoints * row + segment] - values[tail + totalpoints * col + segment])); break; case(METHOD_CROSSMADOGRAM): // cross madogram FOR(double x2 = FABS(values[head + totalpoints * row + segment] -values[tail + totalpoints * row + segment]) * FABS(values[head + totalpoints * col + segment] -values[tail + totalpoints * col + segment]); x2 = SQRT(x2)); break; default: err = TOOLS_METHOD; goto ErrorHandling; } } else { //////////////////////////////////// ARBITRARY ///////////////////////////// totalpoints = lx; totalpointsvdim = totalpoints * vdim; totalpointsrepetvdim = totalpointsvdim * repet; #define FORARB(DO) \ for (int i = 0; iBinSq[0] && distSq<=BinSq[nbin]) { \ low = 0; \ up = nbin; \ cur = halfnbin; \ while (low!=up) { \ if (distSq> BinSq[cur]) low = cur; else up = cur - 1; /* ( * ; * ]*/ \ cur = (up + low + 1) / 2; \ } \ for(int row = 0; row < vdim; row++) { \ for(int col = row; col < vdim; col++) { \ for (segment = 0; segment on the Internet, or as Ben Pfaff, 12167 Airport Rd, DeWitt MI 48820, USA through more mundane means. */ /* This is file avltr.c in libavl. */ /* Martin Schlather: 21 October, 2011, This file has been file avltr.cc in libavl. The #include "avltr.h" has been changed to "avltr_modified.h". Further #include "basic.h" is added, fprint has been replaced by error, exit has been outcommented print has been replaced by Rprint. The above stated GNU General Public License to its full extend is still valid. */ #if HAVE_CONFIG_H #include #endif #if SELF_TEST_XXXXX //#include //#include