[R-br] Função likfit (geoR)

Rodrigo Sant'Ana rodrigo.gringo em gmail.com
Domingo Julho 1 20:46:08 BRT 2012


Caros,

 estou tentando ajustar um modelo geoestatístico aos meus dados com
auxilio da função likfit, presente no pacote geoR, porém a mesma esta
ajustando os parâmetros do modelo muito
longe (fora) da distribuição observada no variograma dos dados.
Achando que poderia ser alguma influência dos valores iniciais, rodei
um ajuste com base na minimização dos quadrados,
que ajustou bem os parâmetros a distribuição dos dados. Utilizei os
valores do ajuste por minimos quadrados como valores iniciais da
função de verossimilhança, e ainda sim não ajustou bem!

Gostaria da ajuda de vocês para tentar entender o que esta
acontecendo. Outro possível resposta que pensei, seria a transformação
dos meus dados, pois os mesmos possuem uma certa assimetria. Mas a
dúvida que me resultaria, se eu utiliza-se uma transformação de
box-cox, como retornaria os valores ao seu normal após a modelagem e
predição!


[]'s

CMR

temp <- structure(list(x = c(-42.2225631308, -41.4000579262, -41.8113105285,
-42.7386448278, -41.2145910664, -43.101514771, -41.2629737255,
-43.2869816308, -41.803246752, -42.569305521, -41.9322671762,
-42.9966856763, -43.0128132293, -42.7708999338, -41.7790554224,
-44.2949536952, -43.4563209376, -43.4805122672, -42.8757290285,
-44.1901246005, -43.5692138089, -44.2143159301, -44.5449307672,
-44.7465251801, -43.5530862558, -44.4884843316, -43.9885301877,
-43.6014689149, -44.1901246005, -44.7949078392, -45.3996910778,
-44.8029716157, -45.0932675703, -45.5287115021, -46.0044743165,
-45.762561021, -46.6576402142, -46.7060228733, -45.6980508089,
-46.3108978241, -46.6011937786, -45.5125839491, -46.6657039908,
-46.9882550514, -45.8512625627, -46.1254309642, -46.1496222938,
-46.1576860703, -47.1979132408, -46.7624693089, -47.1495305817,
-47.0043826044, -47.1575943582, -47.6414209491, -47.9397806802,
-47.7623775969, -47.7543138203, -47.0043826044, -47.1172754756,
-47.7946327029, -47.076956593, -47.0850203696, -47.7139949378,
-47.1092116991, -47.5365918544, -47.1817856877, -48.0446097749,
-47.1656581347, -47.9720357863, -48.1494388696, -48.1494388696,
-47.9397806802, -48.1575026461, -48.907433862, -49.0364542863,
-48.3832883885, -47.9478444567, -49.0041991802, -48.9800078507,
-48.9558165211, -47.9881633393, -48.1575026461, -48.9880716272,
-48.4558623772, -49.7380028431, -49.7057477371, -49.9315334795,
-50.0605539037, -50.0928090098, -50.3831049643, -50.1250641159,
-50.1089365628, -50.3185947522, -50.2944034227, -50.4798702825,
-50.9959519795, -50.8346764492, -51.6652454303, -51.7055643129,
-51.7297556424), y = c(-23.2774714209, -23.3025323734, -23.4194834851,
-23.4278371359, -23.4445444376, -23.4445444376, -23.4696053901,
-23.4863126917, -23.5030199934, -23.5030199934, -23.5531418984,
-23.6951539626, -23.7035076134, -23.7703368201, -23.8037514234,
-23.8455196776, -23.8872879318, -23.8956415826, -23.9039952335,
-23.9123488843, -23.9457634876, -24.1044828535, -24.129543806,
-24.1713120602, -24.1963730127, -24.2047266635, -24.2464949177,
-24.279909521, -24.2966168227, -24.9231406353, -24.9565552386,
-25.0651526995, -25.2238720653, -25.641554607, -25.6582619087,
-25.7334447662, -25.7668593696, -25.8086276237, -25.8169812746,
-25.8336885762, -25.8503958779, -25.8587495287, -26.0007615929,
-26.0258225454, -26.2346638163, -26.3265539755, -26.3766758805,
-26.4685660397, -26.5270415955, -26.7442365172, -26.9113095339,
-26.9280168356, -27.0449679472, -27.1786263606, -27.663138109,
-27.6798454107, -27.863625729, -27.913747634, -27.913747634,
-28.0641133491, -28.0808206507, -28.1977717624, -28.2980155724,
-28.523564145, -28.5319177958, -28.5820397008, -28.6405152566,
-28.6488689075, -29.1584416084, -29.3004536726, -29.4591730384,
-29.5260022451, -29.6680143093, -29.8267336752, -30.1274651052,
-30.2026479627, -30.2277089152, -30.2444162169, -30.3947819319,
-30.4114892336, -30.4699647894, -30.4699647894, -30.5284403453,
-30.6537451078, -31.1215495545, -31.3805127304, -31.4222809846,
-31.4389882862, -31.7647806688, -31.8733781296, -31.9986828921,
-32.0905730513, -32.2743533697, -32.3495362272, -32.8925235314,
-33.519047344, -33.6527057574, -34.0119127433, -34.1455711566,
-34.3042905225), biomass = c(83.0961332806, 50.7211614516, 87.2964904063,
94.9368757858, 43.9927789353, 77.2411555034, 48.3943067415, 70.9457447384,
93.3226415451, 111.558449875, 105.120137803, 121.774317746, 121.984738595,
134.194524295, 92.3472981727, 74.0563409989, 118.991685107, 118.913371773,
137.446764012, 95.1474633741, 121.714698897, 134.59315967, 101.797584806,
74.9284080818, 137.771352549, 124.913721538, 160.875499767, 138.782910412,
168.972311629, 120.529672382, 43.8330352522, 111.603138446, 82.6283167931,
102.710993825, 129.466779012, 137.200989394, 71.9554182061, 70.8317598018,
142.071147662, 151.190668965, 99.8896044376, 115.837487832, 118.971176291,
51.6652301103, 193.282510478, 250.005205316, 253.408049368, 250.625852379,
67.7379862984, 216.506386439, 124.554150793, 163.227533825, 137.090380572,
50.1620052836, 28.8243753442, 58.1501629663, 67.1120039497, 177.207650243,
189.334832544, 65.2785306408, 182.688259577, 177.288638618, 90.8691963808,
145.065202159, 127.324867544, 142.685381792, 64.4063001299, 131.548465882,
156.065568878, 169.403052205, 205.245173124, 228.321987613, 242.44647784,
40.1581317266, 43.3583613984, 197.084041126, 214.893149963, 54.8643340973,
66.3804698828, 70.0325520737, 163.330903327, 179.736007179, 70.2135583494,
123.133087815, 53.2497546853, 63.4470098487, 65.9584005227, 62.0232097497,
77.2506169312, 61.9183653079, 82.7548476928, 83.9715064102, 87.0964042733,
91.4666549661, 119.213889345, 86.1920719644, 89.9531669855, 55.7705625113,
52.9182431297, 47.4292707838)), .Names = c("x", "y", "biomass"
), row.names = c(NA, -100L), class = "data.frame")

bor <- structure(list(coords.x1 = c(-52.0676766304347, -52.0039483695653,
-51.956152173913, -51.7968315217391, -51.6853070652174, -51.6853070652174,
-51.5419184782609, -51.4144619565217, -51.2710733695652, -51.1914130434782,
-51.0002282608695, -50.8090434782609, -50.7134510869565, -50.6178586956521,
-50.5541304347826, -50.5541304347826, -50.5700624999999, -50.4744701086956,
-50.4585380434783, -50.410741847826, -50.4426059782608, -50.4426059782608,
-50.4585380434783, -50.3310815217391, -50.2195570652173, -50.0283722826087,
-49.8531195652174, -49.6619347826086, -49.47075, -49.3751576086956,
-49.2636331521738, -49.1202445652174, -48.9768559782608, -48.8971956521739,
-48.8334673913043, -48.7060108695651, -48.6422826086957, -48.658214673913,
-48.4670298913043, -48.3077092391304, -48.1643206521739, -48.0368641304347,
-48.0687282608695, -48.0209320652174, -48.0368641304347, -47.9890679347826,
-47.9253396739131, -47.8297472826087, -47.7341548913043, -47.7341548913043,
-47.6066983695652, -47.4951739130435, -47.4633097826087, -47.4473777173913,
-47.3039891304348, -47.2083967391304, -47.0331440217391, -46.9216195652173,
-46.7304347826087, -46.5073858695652, -46.2524728260869, -45.9816277173912,
-45.7426467391305, -45.4558695652173, -45.2965489130434, -45.1212961956522,
-44.9619755434783, -44.8504510869565, -44.7070624999999, -44.5955380434783,
-44.4202853260869, -44.0857119565217, -43.894527173913, -43.6555461956522,
-43.3847010869565, -43.0341956521739, -42.795214673913, -42.6040298913043,
-42.4128451086956, -42.221660326087, -42.0464076086956, -41.9348831521739,
-41.7436983695652, -41.4728532608696, -41.2976005434782, -41.1542119565217,
-41.0108233695652, -41.0426875, -41.1542119565217, -41.2816684782609,
-41.329464673913, -41.4887853260869, -41.6640380434783, -41.8233586956522,
-41.9986114130435, -42.2535244565217, -42.4447092391304, -42.5243695652173,
-42.7792826086957, -42.9704673913043, -43.3050407608695, -43.4802934782608,
-43.6396141304347, -43.8626630434782, -44.1016440217391, -44.2928288043478,
-44.4840135869565, -44.627402173913, -44.7548586956522, -44.8982472826086,
-45.0097717391304, -45.1372282608695, -45.2646847826086, -45.3602771739131,
-45.4558695652173, -45.5992581521739, -45.5514619565217, -45.5992581521739,
-45.7426467391305, -45.9816277173912, -46.1728125, -46.3162010869565,
-46.5073858695652, -46.7145027173913, -46.8419592391304, -46.9375516304348,
-46.9375516304348, -47.0331440217391, -47.0331440217391, -47.0012798913043,
-46.9056875, -46.8578913043478, -46.8419592391304, -46.9056875,
-46.985347826087, -47.0650081521739, -47.2243288043478, -47.4155135869565,
-47.6066983695652, -47.7341548913043, -47.7819510869565, -47.8297472826087,
-47.7819510869565, -47.8138152173913, -47.8616114130435, -47.9253396739131,
-47.9253396739131, -48.0687282608695, -48.291777173913, -48.4829619565218,
-48.7219429347826, -48.8175353260869, -48.9927880434782, -49.1680407608695,
-49.3114293478261, -49.5344782608695, -49.6778668478261, -49.7734592391304,
-49.9487119565217, -50.0921005434783, -50.1398967391304, -50.2673532608696,
-50.2832853260869, -50.2832853260869, -50.3151494565217, -50.3629456521739,
-50.5541304347826, -50.6815869565217, -50.8727717391304, -51.0002282608695,
-51.2073451086957, -51.3029375, -51.3348016304348, -51.4463260869564,
-51.3507336956521, -51.4941222826087, -51.5737826086956, -51.6215788043478,
-51.7808994565218, -51.9083559782608, -52.0676766304347), coords.x2 =
c(-34.511214673913,
-34.3200298913043, -34.2244375, -34.1607092391304, -34.0651168478261,
-33.9217282608695, -33.7464755434783, -33.6349510869565, -33.5074945652174,
-33.3800380434783, -33.2685135869565, -33.0932608695652, -33.1410570652174,
-33.0613967391304, -32.9020760869565, -32.7427554347826, -32.5675027173913,
-32.471910326087, -32.2647934782608, -32.0736086956522, -31.8824239130434,
-31.7390353260869, -31.5956467391304, -31.372597826087, -31.1495489130434,
-30.9583641304347, -30.7193831521739, -30.5600625, -30.4644701086957,
-30.2732853260869, -30.0980326086956, -29.9865081521739, -29.7953233695652,
-29.6041385869565, -29.4288858695652, -29.3332934782608, -29.1739728260869,
-29.0305842391305, -28.8393994565217, -28.648214673913, -28.4092336956522,
-28.281777173913, -28.1224565217391, -28.0268641304347, -27.8834755434783,
-27.7082228260869, -27.5966983695652, -27.3895815217391, -27.2302608695651,
-27.0709402173912, -26.9275516304348, -26.7363668478261, -26.6248423913044,
-26.5133179347825, -26.3858614130435, -26.1946766304347, -25.9875597826087,
-25.8441711956521, -25.7007826086956, -25.5573940217391, -25.3662092391304,
-25.2387527173913, -25.1272282608695, -24.9997717391304, -24.8563831521739,
-24.6651983695652, -24.4580815217391, -24.250964673913, -24.1394402173913,
-24.0597798913043, -23.8845271739131, -23.7570706521739, -23.6614782608695,
-23.5340217391304, -23.4384293478261, -23.3428369565217, -23.2950407608695,
-23.2153804347826, -23.1675842391305, -23.1038559782609, -23.0560597826087,
-23.0560597826087, -23.1038559782609, -23.2153804347826, -23.2153804347826,
-23.2153804347826, -23.1994483695652, -23.3109728260869, -23.4702934782608,
-23.5658858695652, -23.6774103260869, -23.8048668478261, -23.8207989130435,
-23.8207989130435, -23.7730027173913, -23.7730027173913, -23.7730027173913,
-23.8685951086956, -23.9641875, -24.0597798913043, -24.2031684782609,
-24.2828288043478, -24.3465570652173, -24.4262173913044, -24.5377418478261,
-24.7129945652174, -24.8404510869565, -24.9519755434783, -25.143160326087,
-25.3343451086956, -25.509597826087, -25.7007826086956, -25.796375,
-25.8760353260869, -25.8441711956521, -25.9716277173912, -26.0353559782608,
-26.1309483695651, -26.1787445652174, -26.5133179347825, -26.8000951086956,
-27.0072119565218, -27.1346684782609, -27.182464673913, -27.2461929347825,
-27.3417853260869, -27.4214456521739, -27.4851739130435, -27.5807663043478,
-27.7560190217391, -27.915339673913, -28.0905923913044, -28.2499130434783,
-28.3933016304348, -28.5844864130434, -28.7119429347826, -28.7119429347826,
-28.807535326087, -28.9031277173913, -29.0943124999999, -29.3014293478261,
-29.4766820652174, -29.7475271739131, -29.9865081521739, -30.2254891304348,
-30.3688777173912, -30.5122663043478, -30.5122663043478, -30.6078586956521,
-30.6875190217391, -30.7353152173913, -30.7353152173913, -30.7831114130435,
-30.9105679347826, -31.0380244565217, -31.2292092391304, -31.4044619565217,
-31.6115788043478, -31.8346277173912, -32.1054728260869, -32.3125896739131,
-32.4878423913044, -32.6949592391304, -32.8861440217391, -33.125125,
-33.3003777173913, -33.4915624999999, -33.6030869565217, -33.6827472826087,
-33.6986793478261, -33.7942717391304, -33.7942717391304, -33.9057961956522,
-33.9057961956522, -34.0173206521739, -34.0969809782609, -34.1607092391304,
-34.2881657608695, -34.4474864130434, -34.4793505434782, -34.511214673913
)), .Names = c("coords.x1", "coords.x2"), class = "data.frame",
row.names = c(NA,
-181L))

dados.geo <- list()
dados.geo$coords <- cbind(temp$long, temp$lat)
dados.geo$data <- temp$biomass
dados.geo$borders <- bor
class(dados.geo) <- "geodata"

plot(dados.geo, lowess = TRUE)

vario.exp <- variog(dados.geo, uvec = seq(0, 15, l = 100),
                    estimator.type = "classical", max.dist = 15)

## Máxima verossimilhança - Não está convergindo corretamente!!!
mod.exp <- likfit(dados.geo, ini.cov.pars = c(2354, 1.5), cov.model =
               "exp", trend = "cte", fix.nugget = FALSE, nugget
               = 0.1, lik.method = "ML")

## Minimos quadrados - OK!
mod.exp <- variofit(vario.exp, ini = c(3000, 0.3), fix.nugget = FALSE,
                    nugget = 0.1, cov.model = "exp", max.dist = 10)

_______________
Rodrigo Sant'Ana
Oceanógrafo


Mais detalhes sobre a lista de discussão R-br