remotePARTS
remotePARTS copied to clipboard
Default values of fitGLS_opt() allow for negative nugget.
Problem
By default, no transformations or limits are placed on the parameters for fitGLS_opt()
. This allows the nugget to be any value that returns a valid likelihood - including negative values. Negative values of the nugget are nonsensical, though.
Solution
The most straight forward solution would be to limit the nugget to be between 0 and 1 by default, since this makes the most sense from the semivariogram perspective. This is easily achieved through the trans
and backtrans
arguments and the logit function.
fitGLS_opt(formula, data, coords,
trans = list(nugget = function(p){log(p/(1-p))}),
backtrans = list(nugget = function(l){1/(1+exp(-l))}),
...
)
Note that this solution is already presented in the examples for the function, but should be implemented by default to prevent nonsensical results.
Running 15min late
Get Outlook for iOShttps://aka.ms/o0ukef
From: Clay Morrow @.> Sent: Monday, November 6, 2023 4:22:47 PM To: morrowcj/remotePARTS @.> Cc: Subscribed @.***> Subject: [morrowcj/remotePARTS] Default values of fitGLS_opt() allow for negative nugget. (Issue #29)
Problem
By default, no transformations or limits are placed on the parameters for fitGLS_opt(). This allows the nugget to be any value that returns a valid likelihood - including negative values. Negative values of the nugget are nonsensical, though.
Solution
The most straight forward solution would be to limit the nugget to be between 0 and 1 by default, since this makes the most sense from the semivariogram perspective. This is easily achieved through the trans and backtrans arguments and the logit function.
fitGLS_opt(formula, data, coords, trans = list(nugget = function(p){log(p/(1-p))}), backtrans = list(nugget = function(l){1/(1+exp(-l))}), ... )
— Reply to this email directly, view it on GitHubhttps://github.com/morrowcj/remotePARTS/issues/29, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYX6LCV3F7TSPHZHHQXKBLYDFPLPAVCNFSM6AAAAAA7AHEIAWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DAMJXGY4TGMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>