steve-the-bayesian / BOOM

A C++ library for Bayesian modeling, mainly through Markov chain Monte Carlo, but with a few other methods supported. BOOM = "Bayesian Object Oriented Modeling". It is also the sound your computer makes when it crashes.
GNU Lesser General Public License v2.1
36 stars 14 forks source link

[bsts 0.9.10] Error in examples: `Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format` #80

Open barracuda156 opened 7 months ago

barracuda156 commented 7 months ago

Any idea which this may fail?

> ### Name: descriptive-plots
> ### Title: Descriptive Plots
> ### Aliases: YearPlot MonthPlot DayPlot
> 
> ### ** Examples
> 
> ## Plot a 'ts' time series.
> data(AirPassengers)
> par(mfrow = c(1,2))
> MonthPlot(AirPassengers)
Error in as.POSIXlt.character(x, tz, ...) : 
  character string is not in a standard unambiguous format
Calls: MonthPlot ... as.POSIXct.default -> as.POSIXct -> as.POSIXlt -> as.POSIXlt.character
Execution halted

Complete log from examples: bsts-Ex.txt

steve-the-bayesian commented 7 months ago

Is this from the update that was pushed to CRAN yesterday?

On Wed, Jan 17, 2024 at 11:43 PM Sergey Fedorov @.***> wrote:

Any idea which this may fail?

Name: descriptive-plots

Title: Descriptive Plots

Aliases: YearPlot MonthPlot DayPlot

** Examples

Plot a 'ts' time series.

data(AirPassengers) par(mfrow = c(1,2)) MonthPlot(AirPassengers) Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format Calls: MonthPlot ... as.POSIXct.default -> as.POSIXct -> as.POSIXlt -> as.POSIXlt.character Execution halted

— Reply to this email directly, view it on GitHub https://github.com/steve-the-bayesian/BOOM/issues/80, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVDVLEADCHVCKNISKPV7DYPDHDHAVCNFSM6AAAAABB7ZS7XWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DONZQGM2TQMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

barracuda156 commented 7 months ago

@steve-the-bayesian We build everything from source, but I took the source tarball from CRAN here.

steve-the-bayesian commented 7 months ago

The failure likely occurs here, which is found in utils.R.

DateToPOSIX <- function(timestamps) {

Convert an object of class Date to class POSIXct without getting bogged

down in timezone calculation.

Calling as.POSIXct on another date/time object (e.g. Date) applies a

timezone correction to the object. This can shift the time marker by

a few

hours, which can have the effect of shifting the day by one unit. If

the

day was the first or last in a month or year, then the month or year

will

be off by one as well.

Coercing the object to the character representation of a Date prevents

this

adjustment from being applied, and leaves the POSIXt return value with

the

intended day, month, and year.

stopifnot(inherits(timestamps, "Date")) return(as.POSIXct(as.character(timestamps), )) }

On Thu, Jan 18, 2024 at 10:58 AM Sergey Fedorov @.***> wrote:

@steve-the-bayesian https://github.com/steve-the-bayesian We build everything from source, but I took the source tarball from CRAN here.

— Reply to this email directly, view it on GitHub https://github.com/steve-the-bayesian/BOOM/issues/80#issuecomment-1899042122, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVDVJZMBE3DLHRJIBAQ73YPFWGZAVCNFSM6AAAAABB7ZS7XWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGA2DEMJSGI . You are receiving this because you were mentioned.Message ID: @.***>