Code Monkey home page Code Monkey logo

documentation's Introduction

Contributors Forks Stargazers Issues MS-PL License LinkedIn


Logo

Lisp-Stat

An environment for statistical computing
Explore the docs »

Report Bug · Request Feature · Reference Manual

Table of Contents

  1. About the Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Resources
  6. Contributing
  7. License
  8. Contact

About the Project

Lisp-Stat provides support for vectorized mathematical operations, and a comprehensive set of statistical methods that are implemented using the latest numerical algorithms. In addition, Common Lisp provides a dynamic programming environment (REPL), an excellent object-oriented facility (CLOS) and meta-object protocol (MOP).

Lisp-Stat is fully functional today, and most of the XLISP-STAT libraries can be ported with the aid of a compatibility package XLS-compat. This gives Lisp-Stat a leg up on ecosystem development.

Built With

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

An ANSI Common Lisp implementation. Developed and tested with SBCL and CCL.

Note: CCL is in poor condition these days, and we no can longer support it due to some serious problem with numerical accuracy. See issue 390 for just one of the problems. A shame, because it's a great environment to work in.

Installation

Lisp-Stat is composed of several systems that are designed to be independently useful. So you can, for example, use select to obtain selections from two dimensional arrays without bringing in all of Lisp-Stat.

The easy way

Quicklisp has many dependencies, and the easiest way to load it is with a package manager, such as Quicklisp or CLPM. The install is a one-liner:

(clpm-client:sync :sources "clpi") ;sources may vary
(ql:quickload :lisp-stat)

From source

To make the system accessible to ASDF (a build facility, similar to make in the C world), clone the repository in a directory ASDF knows about. By default the common-lisp directory in your home directory is known. Create this if it doesn't already exist and then:

  1. Clone the repositories
cd ~/common-lisp && \
git clone https://github.com/Lisp-Stat/data-frame.git && \
git clone https://github.com/Lisp-Stat/dfio.git && \
git clone https://github.com/Lisp-Stat/special-functions.git && \
git clone https://github.com/Lisp-Stat/numerical-utilities.git && \
git clone https://github.com/Lisp-Stat/array-operations.git && \
git clone https://github.com/Lisp-Stat/documentation.git && \
git clone https://github.com/Lisp-Stat/distributions.git && \
git clone https://github.com/Lisp-Stat/plot.git && \
git clone https://github.com/Lisp-Stat/select.git && \
git clone https://github.com/Lisp-Stat/cephes.cl.git && \
git clone https://github.com/Symbolics/alexandria-plus && \
git clone https://github.com/Lisp-Stat/statistics.git && \
git clone https://github.com/Lisp-Stat/lla.git && \
git clone https://github.com/Lisp-Stat/smoothers && \
git clone https://github.com/Lisp-Stat/lisp-stat.git
  1. Reset the ASDF source-registry to find the new system (from the REPL)
    (asdf:clear-source-registry)
  2. Load the system
    (asdf:load-system :lisp-stat)

If you have installed the slime ASDF extensions, you can invoke this with a comma (',') from the slime REPL.

You'll need to use Quicklisp, CLPM or manually obtain the remaining third-party dependencies.

Running Tests

To run the lisp-stat tests, evaluate this form: (asdf:test-system :lisp-stat)

Usage

Create a data frame from a file named sg-weather.csv on the local disk:

(defparameter *df*
	(read-csv #P"LS:DATA;sg-weather.csv"))

For more examples, please refer to the Documentation.

Roadmap

See the open issues for a list of proposed features (and known issues).

Resources

This system is part of the Lisp-Stat project; that should be your first stop for information. Also see the community page for more information.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Please see CONTRIBUTING for details on the code of conduct, and the process for submitting pull requests.

License

Distributed under the MS-PL License. See LICENSE for more information.

Contact

Project Link: https://github.com/lisp-stat/lisp-stat

documentation's People

Contributors

braised-babbage avatar deining avatar dependabot[bot] avatar snunez1 avatar symbolics avatar

Watchers

 avatar  avatar  avatar  avatar

documentation's Issues

Error when loading `vega-lite` example data sets

Edit: Part (2) of this issue is also found at Lisp-Stat/plot#19 (comment). The first part occurs after loading cl-date-time-parser in SBCL on Ubuntu 22.04.

(1) When I load the vega-lite data sets using

(vega:load-vega-examples)

I get the following error:

Could not REQUIRE CL-DATE-TIME-PARSER: circularity detected. Please check your configuration
`
However, the examples appear to have loaded.

(2) Also, before I installed cl-date-time-parser in quicklisp, I was getting an error message similar to:

Do not know how to REQUIRE CL-DATE-TIME-PARSER

Crash evaluating (plot:plot-from-file (vglt:save-plot 'cars-strip-plot))

On Ubuntu with sbcl 2.1.6 and only Firefox installed (not chrome),

(plot:plot-from-file (vglt:save-plot 'cars-strip-plot))

crashes with the complaint that:

The value
"--user-data-dir=/home/eric/.cache/plot/chrome-data-G1245 --window-size=800,600 --app=/home/eric/.cache/plot/cars-strip-plot.html"

is not of type
LIST

The issue appears to be that sbcl's defun prepare-args expects a list of strings to which it applies #'every. It is being handed a dotted pair instead:

    ARGS = ("chrome" . "--user-data-dir=/home/eric/.cache/plot/chrome-data-G1245 --window-size=800,600 --app=/home/eric/.cache/plot/cars-strip-plot.html")

I can get around it with using this instead of what's in the lisp-stat documentation:

  (plot:plot-from-file (vglt:save-plot 'cars-strip-plot) :browser :default)
                                                         ^^^^^^^^^^^^^^^^^

Otherwise I had to modify sbcl's #'run-program to call prepare-args on (list progname args) rather than on (cons progname args). This doesn't seem right at all, so I just mention it and defer to better programmers. Thanks!

defdf giving unbound variable

I was just going through the examples in the documentation and here:

(defdf iris (read-csv "https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/datasets/iris.csv") "Edgar Anderson's Iris Data")

gives the error "variable IRIS is unbound [condition of type UNBOUND-VARIABLE]"

Great work!

This is no issue at all! Only wanted to say THANK YOU!

Christoph

Working with data,accessing columns by name

CL-USER> (in-package :ls-user)
#<PACKAGE "LS-USER">
LS-USER> (asdf:load-system :lisp-stat)
T
LS-USER> (defdf mtcars
(read-csv rdata:mtcars))
COMMON-LISP:WARNING: Missing column name was filled in
MTCARS
LS-USER> (defparameter mtcars-small (select mtcars (range 0 5) t))
MTCARS-SMALL
LS-USER> (columns mtcars-small 'mpg)
Key MPG not found, valid keys are #(X1 MPG CYL DISP HP DRAT WT QSEC VS AM GEAR CARB). [Condition of type KEY-NOT-FOUND]
LS-USER> mtcars$mpg
The variable MTCARS$MPG is unbound. [Condition of type UNBOUND-VARIABLE]
;; yet i can still access the keys
LS-USER> (keys mtcars)
#(MTCARS:X1 MTCARS:MPG MTCARS:CYL MTCARS:DISP MTCARS:HP MTCARS:DRAT MTCARS:WT MTCARS:QSEC MTCARS:VS MTCARS:AM MTCARS:GEAR MTCARS:CARB)
LS-USER>

View page source is broken

When clicking on the 'view page source' button, it does not go to the correct github page. Config issue? Docsy seems to be looking for a branch named main, and the docs are on master.

`plot-from-file` passes faulty args to uiop:launch-program because of back-quote comma-splice (,@)

This is on CentOS 7,

LS> (lisp-implementation-type)
"SBCL"
LS> (lisp-implementation-version)
"2.0.7"

It is related to a previously submitted Issue.

Running:
LS> (plot:plot-from-file #P"/tmp/plot/cars-scatter-plot.html" :browser :default)

ends up in the debugger:

The value
  "/tmp/plot/cars-scatter-plot.html"
is not of type
  LIST
   [Condition of type TYPE-ERROR]

I can fix that if, in plot/plot.lisp by removing the @ from the back-quote. Here is the offending code:

(defun plot-from-file (filespec &key (browser *default-browser-command*) (browser-options *default-browser-options*))
  "Open plot specification FILESPEC"
  (let ((plot-file (namestring (truename filespec))))
    #+windows (setf plot-file (concatenate 'string "file:///" plot-file))
    (uiop:launch-program
     `(,(alexandria:assoc-value plot:*browser-commands* browser)
                         ;; Remove the `@' for uiop:launch-program & sp-ext:run-program to execute property
			 ,@(case browser  
			     (:chrome (if (assoc "app" browser-options :test 'string=)
					              (setf (cdr (assoc "app" browser-options :test 'string=)) plot-file))
			      (encode-chrome-options browser-options))
			     (:default plot-file)))
		 :ignore-error-status t)))

I created a minimal example to illustrate the effects of the ,@:

LS> (let ((browser :default))
      `(abc ,@(case browser (:chrome nil) (:default t))))
(ABC . T)

Update basic tutorial

The basic tutorial has fallen behind the Lisp-Stat project and needs to be updated. In addition to the need for a def/defdf explanation pointed out by @rieser, there are several sections in the documentation that are commented out (you only see this in the documentation source repo because Hugo removes comments from deployed documentation).

Essentially the basic tutorial is the XLisp-Stat tutorial, updated for (Common) Lisp-Stat. At the time of conversion, Lisp-Stat lacked much of the functionality mentioned in the tutorial, so it was commented out. Lisp-Stat has now closed that gap, but the basic tutorial has not kept up.

This would be a good first issue for someone that wants to learn statistics or common lisp.

Originally reported issue:
It would be good to introduce defdf somewhere in the Data Frame tutorial. While reading that section, I tried experimenting with my own .csv files, for instance, with (read-csv my-csv-file-stream) \\ (def results *), using what has been introduced so far, and it does give me back a DATA-FRAME object, and I can do a lot of manipulations on it. However, if I try to access results:my-key, I get an error, which is extremely confusing. On the other hand, if I use defdf instead of def, as indicated in the Manual (but not the Tutorial), then results:my-key works as expected.

An alternative, of course, would be to extend def to handle data frames properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.