Default values of fitGLS_opt() allow for negative nugget.
Opened this issue · 1 comments
morrowcj commented
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.
arives commented
Running 15min late
Get Outlook for iOS<https://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 GitHub<#29>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACYX6LCV3F7TSPHZHHQXKBLYDFPLPAVCNFSM6AAAAAA7AHEIAWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DAMJXGY4TGMQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>