Package cgraph. March 11, 2019

Size: px
Start display at page:

Download "Package cgraph. March 11, 2019"

Transcription

1 Type Package Title Computational Graphs Version Author Maintainer URL Package cgraph March 11, 2019 BugReports Allows to create, evaluate, and differentiate computational graphs in R. A computational graph is a graph representation of a multivariate function decomposed by its (elementary) operations. Nodes in the graph represent arrays while edges represent dependencies among the arrays. An advantage of epressing a function as a computational graph is that this enables to differentiate the function by automatic differentiation. The 'cgraph' package supports various operations including basic arithmetic, trigonometry operations, and linear algebra operations. It differentiates computational graphs by reverse automatic differentiation. The fleible architecture of the package makes it applicable to solve a variety of problems including local sensitivity analysis, gradient-based optimization, and machine learning. License Apache License 2.0 Encoding UTF-8 LazyData true Suggests testthat Roygen NeedsCompilation yes Repository CRAN Date/Publication :42:46 UTC R topics documented: cg_abs cg_acos

2 2 R topics documented: cg_acosh cg_add cg_asin cg_asinh cg_as_double cg_as_numeric cg_atan cg_atanh cg_colsums cg_constant cg_cos cg_cosh cg_crossprod cg_div cg_ep cg_function cg_graph cg_graph_gradients cg_graph_run cg_input cg_linear cg_ln cg_log cg_log cg_matmul cg_ma cg_mean cg_min cg_mul cg_neg cg_operator cg_parameter cg_pma cg_pmin cg_pos cg_pow cg_prod cg_rowsums cg_session_graph cg_session_set_graph cg_sigmoid cg_sin cg_sinh cg_sqrt cg_sub cg_sum cg_t cg_tan

3 cg_abs 3 cg_tanh cg_tcrossprod Inde 40 cg_abs Absolute Calculate abs(). cg_abs(, = NULL) character scalar, of the operation (optional). abs cg_acos Inverse Cosine Calculate acos(). cg_acos(, = NULL) character scalar, of the operation (optional).

4 4 cg_acosh acos cg_acosh Inverse Hyperbolic Cosine Calculate acosh(). cg_acosh(, = NULL) character scalar, of the operation (optional). acosh

5 cg_add 5 cg_add Add Calculate + y. cg_add(, y, = NULL) y character scalar, of the operation (optional). add cg_asin Inverse Sine Calculate asin(). cg_asin(, = NULL) character scalar, of the operation (optional).

6 6 cg_asinh asin cg_asinh Inverse Hyperbolic Sine Calculate asinh(). cg_asinh(, = NULL) character scalar, of the operation (optional). asinh

7 cg_as_double 7 cg_as_double Coerce to a Numeric Vector Coerce to a one-dimensional numeric vector. cg_as_double(, = NULL) either a cg_node object or a numeric matri or array. character scalar, of the operation (optional). This function is identical to cg_as_numeric. as.double cg_as_numeric Coerce to a Numeric Vector Coerce to a one-dimensional numeric vector. cg_as_numeric(, = NULL) either a cg_node object or a numeric matri or array. character scalar, of the operation (optional).

8 8 cg_atan This function is identical to cg_as_double. as.numeric cg_atan Inverse Tangent Calculate atan(). cg_atan(, = NULL) character scalar, of the operation (optional). atan

9 cg_atanh 9 cg_atanh Inverse Hyperbolic Tangent Calculate atanh(). cg_atanh(, = NULL) character scalar, of the operation (optional). atanh cg_colsums Col Sums Calculate colsums(). cg_colsums(, = NULL) either a cg_node object or a numeric matri or array. character scalar, of the operation (optional).

10 10 cg_constant Function colsums is called without changing the default value of argument na.rm and dims. colsums cg_constant Add Constant Add a constant node to the active graph. cg_constant(value, = NULL) value numeric vector or array, value of the node. character scalar, of the node (optional). In case argument is missing, the node is added to the graph under an automatically generated. cg_node object. Constant nodes are ignored when differentiating a graph.

11 cg_cos 11 Eamples # Initialize a computational graph <- cg_graph() # Add a constant with value 1 and 'a' to the graph. a <- cg_constant(1, = "a") cg_cos Cosine Calculate cos(). cg_cos(, = NULL) character scalar, of the operation (optional). cos

12 12 cg_crossprod cg_cosh Hyperbolic Cosine Calculate cosh(). cg_cosh(, = NULL) character scalar, of the operation (optional). cosh cg_crossprod Matri Crossproduct Calculate crossprod(, y). cg_crossprod(, y = NULL, = NULL) y either a cg_node object or a numeric matri. either a cg_node object or a numeric matri (optional). character scalar, of the operation (optional).

13 cg_div 13 crossprod cg_div Divide Calculate / y. cg_div(, y, = NULL) y character scalar, of the operation (optional). divide

14 14 cg_function cg_ep Eponential Function Calculate ep(). cg_ep(, = NULL) character scalar, of the operation (optional). ep cg_function Create function Initialize a new function that can be used by operators in a graph. cg_function(def, grads = list()) def grads function, the definition of the function. list of functions, the gradient functions with respect to each input (optional).

15 cg_graph 15 cg_function object. If the function consumes any inputs, then the gradient function with respect to these inputs must be provided to argument grads. These gradients must be a function of each input s gradient and take as arguments the inputs of the function including argument val and grad. These latter two arguments evaluate to the value of the function and its gradient respectively at run-time. Eamples #' # Create a custom negation function f <- cg_function( def = function() -, grads = list(function(, val, grad) -grad) ) cg_graph Computational Graph Initialize a computational graph cg_graph() cg_graph object. The graph is automatically set to be the active graph.

16 16 cg_graph_gradients Eamples # Initialize a computational graph <- cg_graph() cg_graph_gradients Calculate Gradients Differentiate a graph with respect to a given target node by reverse automatic differentiation. cg_graph_gradients(graph, target, values = new.env(), inde = 1) graph target values inde cg_graph object, graph that is differentiated. cg_node object, node in the graph that is differentiated. d list or environment, values that are subsituted for the input nodes in the graph. numeric scalar, inde of the target node that is differentiated. Defaults to the first element. environment, the gradients of all ancestors of the node (including the target node itself) with respect to the target node. All nodes required to compute the target node must have a value, or their value must be able to be computed at run-time. The values of the nodes can be obtained by first evaluating function cg_graph_run. The values obtained by this function for the nodes can then be supplied to argument values. Currently, the cgraph package can only differentiate scalar target nodes. In case the value of target node is a vector or an array, argument inde can be used to specify which element of the vector or array is differentiated. The gradients of all ancestors of the node are returned. The gradients have the same shape as the values of the nodes.

17 cg_graph_run 17 Eamples # Initialize a computational graph <- cg_graph() # Add some parameters a <- cg_parameter(2, = "a") b <- cg_parameter(4, = "b") # Perform some operations on the parameters c <- cg_sin(a) + cg_cos(b) - cg_tan(a) # Differentiate the graph with respect to c grads <- cg_graph_gradients(, c, cg_graph_run(, c)) # Retrieve the gradient of c with respect to a grads$a cg_graph_run Evaluate the Graph Evaluate a given target node in a graph. cg_graph_run(graph, target, values = new.env()) graph target values cg_graph object, graph that is evaluated. cg_node object, node in the graph that is evaluated. d list or environment, values that are subsituted for the input nodes in the graph. environment, the value of the node including the value of all ancestors of the node in the graph. All nodes required to compute the target node must have a value or their value must be able to be computed at run-time. Argument values can be used to substitute values for input nodes that do not have a value. Only those nodes needed to compute the node are evaluated and their values are returned.

18 18 cg_input Eamples # Initialize a computational graph <- cg_graph() # Add an input a <- cg_input( = "a") # Square the input (i.e. b = a^2) b <- cg_pow(a, 2, = "b") # Evaluate b at a = 2 values <- cg_graph_run(, b, list(a = 2)) # Retrieve the value of b values$b cg_input Add Input Add an input node to the active graph. cg_input( = NULL) character scalar, of the node (optional). In case argument is missing, the node is added to the graph under an automatically generated. cg_node object. Inputs cannot be assigned a fied value but behave as placeholders. s can be assigned to inputs when evaluating or differentiating a graph (see cg_graph_run and cg_graph_gradients for more details).

19 cg_linear 19 Eamples # Initialize a computational graph <- cg_graph() # Add a parameter with 'a' to the graph. a <- cg_input( = "a") cg_linear Linear Transformation Calculate %*% y + c(z). cg_linear(, y, z, = NULL) y z either a cg_node object or a numeric matri. either a cg_node object or a numeric matri. either a cg_node object or a numeric vector. character scalar, of the operation (optional). This function is equivalent to cg_matmul(, y) + cg_as_numeric(z).

20 20 cg_log10 cg_ln Natural Logarithm Calculate log(). cg_ln(, = NULL) character scalar, of the operation (optional). log cg_log10 Logarithm Base 10 Calculate log10(). cg_log10(, = NULL) character scalar, of the operation (optional).

21 cg_log2 21 log10 cg_log2 Logarithm Base 2 Calculate log2(). cg_log2(, = NULL) character scalar, of the operation (optional). log2

22 22 cg_ma cg_matmul Matri Multiplication Calculate %*% y. cg_matmul(, y, = NULL) y either a cg_node object or a numeric matri. either a cg_node object or a numeric matri. character scalar, of the operation (optional). matmult cg_ma Maima Calculate ma(). cg_ma(, = NULL) character scalar, of the operation (optional).

23 cg_mean 23 Function ma is called without changing the default value of argument na.rm. ma cg_mean Arithmetic Mean Calculate mean(). cg_mean(, = NULL) character scalar, of the operation (optional). Function mean is called without changing the default value of argument trim and na.rm. mean

24 24 cg_mul cg_min Minima Calculate min(). cg_min(, = NULL) character scalar, of the operation (optional). Function min is called without changing the default value of argument na.rm. min cg_mul Multiply Calculate * y. cg_mul(, y, = NULL)

25 cg_neg 25 y character scalar, of the operation (optional). multiply cg_neg Negative Calculate -. cg_neg(, = NULL) character scalar, of the operation (optional). negative

26 26 cg_operator cg_operator Add Operator Add an operation node to the active graph. cg_operator(fun, inputs, = NULL) fun inputs cg_function object, function evaluated by the node. list, the nodes that are consumed by the operation. character scalar, of the node (optional). In case argument is missing, the node is added to the graph under an automatically generated. cg_node object. Any objects that are supplied to argument inputs that are not cg_node objects are implicitly converted to cg_constant objects. Eamples # Initialize a computational graph <- cg_graph() # Create a custom negation function f <- cg_function( def = function() -, grads = list(function(, val, grad) -grad) ) # Add a an operator with the negation function to the graph. a <- cg_operator(f, list(10), = "a")

27 cg_parameter 27 cg_parameter Add Parameter Add a parameter node to the active graph. cg_parameter(value, = NULL) value numeric vector or array, value of the node. character scalar, of the node (optional). In case argument is missing, the node is added to the graph under an automatically generated. cg_node object. Parameters are assumed to be subject to some optimization process. change over time. Hence, their value might Eamples # Initialize a computational graph <- cg_graph() # Add a parameter with value 1 and 'a' to the graph. a <- cg_parameter(1, = "a")

28 28 cg_pmin cg_pma Parallel Maima Calculate pma(, y). cg_pma(, y, = NULL) y character scalar, of the operation (optional). Function pma is called without changing the default value of argument na.rm. pma cg_pmin Parallel Minima Calculate pmin(, y). cg_pmin(, y, = NULL)

29 cg_pos 29 y character scalar, of the operation (optional). Function pmin is called without changing the default value of argument na.rm. pmin cg_pos Positive Calculate. cg_pos(, = NULL) character scalar, of the operation (optional). positive

30 30 cg_prod cg_pow Power Calculate ^ y. cg_pow(, y, = NULL) y character scalar, of the operation (optional). power cg_prod Product of Vector Elements Calculate prod(). cg_prod(, = NULL) character scalar, of the operation (optional).

31 cg_rowsums 31 In contrast to the base prod function, this function only accepts a single argument. Function prod is called changing the default value of argument na.rm. prod cg_rowsums Row Sums Calculate rowsums(). cg_rowsums(, = NULL) either a cg_node object or a numeric matri or array. character scalar, of the operation (optional). Function rowsums is called without changing the default value of argument na.rm and dims. rowsums

32 32 cg_session_set_graph cg_session_graph Get Active Graph Get the graph that is currently active. cg_session_graph() cg_graph object, the graph that is currently active. Eamples # Initialize a computational graph <- cg_graph() # Retrieve the graph from the session cg_session_graph() cg_session_set_graph Change Active Graph Set a graph to be the active graph. cg_session_set_graph(graph) graph cg_graph object, the graph that is activated. none.

33 cg_sigmoid 33 Any nodes that are created are automatically added to the active graph. This also applies to operations that are created by overloaded S3 functions that do not follow the cg_<> naming convention (such as primitive infli functions + and - ). Only one graph can be active at a time. The active graph can be changed by calling this function on another cg_graph object. Eamples # Initialize a computational graph <- cg_graph() # Initialize another computational graph. It becomes the active graph. y <- cg_graph() # Set to be the active graph cg_session_set_graph() cg_sigmoid Sigmoid Calculate 1 / (1 + ep(-)). cg_sigmoid(, = NULL) character scalar, of the operation (optional).

34 34 cg_sinh cg_sin Sine Calculate sin(). cg_sin(, = NULL) character scalar, of the operation (optional). sin cg_sinh Hyperbolic Sine Calculate sinh(). cg_sinh(, = NULL) character scalar, of the operation (optional).

35 cg_sqrt 35 sinh cg_sqrt Square Root Calculate sqrt(). cg_sqrt(, = NULL) character scalar, of the operation (optional). sqrt

36 36 cg_sum cg_sub Subtract Calculate - y. cg_sub(, y, = NULL) y character scalar, of the operation (optional). subtract cg_sum Sum of Vector Elements Calculate sum(). cg_sum(, = NULL) character scalar, of the operation (optional).

37 cg_t 37 In contrast to the base sum function, this function only accepts a single argument. Function sum is called without changing the default value of argument na.rm. sum cg_t Matri Transpose Perform t(). cg_t(, = NULL) either a cg_node object or a numeric matri. character scalar, of the operation (optional). t

38 38 cg_tanh cg_tan Tangent Calculate tan(). cg_tan(, = NULL) character scalar, of the operation (optional). tan cg_tanh Hyperbolic Tangent Calculate tanh(). cg_tanh(, = NULL) character scalar, of the operation (optional).

39 cg_tcrossprod 39 tanh cg_tcrossprod Transpose Matri Crossproduct Calculate tcrossprod(, y). cg_tcrossprod(, y = NULL, = NULL) y either a cg_node object or a numeric matri. either a cg_node object or a numeric matri (optional). character scalar, of the operation (optional). tcrossprod

40 Inde abs, 3 acos, 4 acosh, 4 add, 5 as.double, 7 as.numeric, 8 asin, 6 asinh, 6 atan, 8 atanh, 9 cg_abs, 3 cg_acos, 3 cg_acosh, 4 cg_add, 5 cg_as_double, 7 cg_as_numeric, 7 cg_asin, 5 cg_asinh, 6 cg_atan, 8 cg_atanh, 9 cg_colsums, 9 cg_constant, 10 cg_cos, 11 cg_cosh, 12 cg_crossprod, 12 cg_div, 13 cg_ep, 14 cg_function, 14 cg_graph, 15 cg_graph_gradients, 16, 18 cg_graph_run, 16, 17, 18 cg_input, 18 cg_linear, 19 cg_ln, 20 cg_log10, 20 cg_log2, 21 cg_matmul, 22 cg_ma, 22 cg_mean, 23 cg_min, 24 cg_mul, 24 cg_neg, 25 cg_operator, 26 cg_parameter, 27 cg_pma, 28 cg_pmin, 28 cg_pos, 29 cg_pow, 30 cg_prod, 30 cg_rowsums, 31 cg_session_graph, 32 cg_session_set_graph, 32 cg_sigmoid, 33 cg_sin, 34 cg_sinh, 34 cg_sqrt, 35 cg_sub, 36 cg_sum, 36 cg_t, 37 cg_tan, 38 cg_tanh, 38 cg_tcrossprod, 39 colsums, 10 cos, 11 cosh, 12 crossprod, 13 divide, 13 ep, 14 log, 20 log10, 21 log2, 21 matmult, 22 ma, 23 mean, 23 min, 24 40

41 INDEX 41 multiply, 25 negative, 25 pma, 28 pmin, 29 positive, 29 power, 30 prod, 31 rowsums, 31 sin, 34 sinh, 35 sqrt, 35 subtract, 36 sum, 37 t, 37 tan, 38 tanh, 39 tcrossprod, 39

Package slam. February 15, 2013

Package slam. February 15, 2013 Package slam February 15, 2013 Version 0.1-28 Title Sparse Lightweight Arrays and Matrices Data structures and algorithms for sparse arrays and matrices, based on inde arrays and simple triplet representations,

More information

Arithmetic and Logic Blocks

Arithmetic and Logic Blocks Arithmetic and Logic Blocks The Addition Block The block performs addition and subtractions on its inputs. This block can add or subtract scalar, vector, or matrix inputs. We can specify the operation

More information

Package slam. December 1, 2016

Package slam. December 1, 2016 Version 0.1-40 Title Sparse Lightweight Arrays and Matrices Package slam December 1, 2016 Data structures and algorithms for sparse arrays and matrices, based on inde arrays and simple triplet representations,

More information

Package Brobdingnag. R topics documented: March 19, 2018

Package Brobdingnag. R topics documented: March 19, 2018 Type Package Title Very Large Numbers in R Version 1.2-5 Date 2018-03-19 Author Depends R (>= 2.13.0), methods Package Brobdingnag March 19, 2018 Maintainer Handles very large

More information

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Package spark. July 21, 2017

Package spark. July 21, 2017 Title 'Sparklines' in the 'R' Terminal Version 2.0.0 Author Gábor Csárdi Package spark July 21, 2017 Maintainer Gábor Csárdi A 'sparkline' is a line chart, without axes and labels.

More information

Built-in Types of Data

Built-in Types of Data Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

More information

Package narray. January 28, 2018

Package narray. January 28, 2018 Package narray January 28, 2018 Title Subset- And Name-Aware Array Utility Functions Version 0.4.0 Author Michael Schubert Maintainer Michael Schubert Stacking

More information

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below.

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below. What is MATLAB? MATLAB (short for MATrix LABoratory) is a language for technical computing, developed by The Mathworks, Inc. (A matrix is a rectangular array or table of usually numerical values.) MATLAB

More information

Subprograms. FORTRAN 77 Chapter 5. Subprograms. Subprograms. Subprograms. Function Subprograms 1/5/2014. Satish Chandra.

Subprograms. FORTRAN 77 Chapter 5. Subprograms. Subprograms. Subprograms. Function Subprograms 1/5/2014. Satish Chandra. FORTRAN 77 Chapter 5 Satish Chandra satish0402@gmail.com When a programs is more than a few hundred lines long, it gets hard to follow. Fortran codes that solve real research problems often have tens of

More information

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS 1 6 3 Matlab 3.1 Fundamentals Matlab. The name Matlab stands for matrix laboratory. Main principle. Matlab works with rectangular

More information

Single row numeric functions

Single row numeric functions Single row numeric functions Oracle provides a lot of standard numeric functions for single rows. Here is a list of all the single row numeric functions (in version 10.2). Function Description ABS(n) ABS

More information

A. Matrix-wise and element-wise operations

A. Matrix-wise and element-wise operations USC GSBME MATLAB CLASS Reviewing previous session Second session A. Matrix-wise and element-wise operations A.1. Matrix-wise operations So far we learned how to define variables and how to extract data

More information

MATLAB Constants, Variables & Expression. 9/12/2015 By: Nafees Ahmed

MATLAB Constants, Variables & Expression. 9/12/2015 By: Nafees Ahmed MATLAB Constants, Variables & Expression Introduction MATLAB can be used as a powerful programming language. It do have IF, WHILE, FOR lops similar to other programming languages. It has its own vocabulary

More information

Mentor Graphics Predefined Packages

Mentor Graphics Predefined Packages Mentor Graphics Predefined Packages Mentor Graphics has created packages that define various types and subprograms that make it possible to write and simulate a VHDL model within the Mentor Graphics environment.

More information

General MATLAB Information 1

General MATLAB Information 1 Introduction to MATLAB General MATLAB Information 1 Once you initiate the MATLAB software, you will see the MATLAB logo appear and then the MATLAB prompt >>. The prompt >> indicates that MATLAB is awaiting

More information

Computational Physics

Computational Physics Computational Physics Python Programming Basics Prof. Paul Eugenio Department of Physics Florida State University Jan 17, 2019 http://hadron.physics.fsu.edu/~eugenio/comphy/ Announcements Exercise 0 due

More information

Package kdtools. April 26, 2018

Package kdtools. April 26, 2018 Type Package Package kdtools April 26, 2018 Title Tools for Working with Multidimensional Data Version 0.3.1 Provides various tools for working with multidimensional data in R and C++, including etremely

More information

Matlab Workshop I. Niloufer Mackey and Lixin Shen

Matlab Workshop I. Niloufer Mackey and Lixin Shen Matlab Workshop I Niloufer Mackey and Lixin Shen Western Michigan University/ Syracuse University Email: nil.mackey@wmich.edu, lshen03@syr.edu@wmich.edu p.1/13 What is Matlab? Matlab is a commercial Matrix

More information

Ebooks Chemical Engineering

Ebooks Chemical Engineering Uploaded by: Ebooks Chemical Engineering https://www.facebook.com/pages/ebooks-chemical-engineering/238197077030 For More Books, softwares & tutorials Related to Chemical Engineering Join Us @facebook:

More information

A Guide to Using Some Basic MATLAB Functions

A Guide to Using Some Basic MATLAB Functions A Guide to Using Some Basic MATLAB Functions UNC Charlotte Robert W. Cox This document provides a brief overview of some of the essential MATLAB functionality. More thorough descriptions are available

More information

Introduction to Scientific and Engineering Computing, BIL108E. Karaman

Introduction to Scientific and Engineering Computing, BIL108E. Karaman USING MATLAB INTRODUCTION TO SCIENTIFIC & ENGINEERING COMPUTING BIL 108E, CRN24023 To start from Windows, Double click the Matlab icon. To start from UNIX, Dr. S. Gökhan type matlab at the shell prompt.

More information

Introduction to GNU-Octave

Introduction to GNU-Octave Introduction to GNU-Octave Dr. K.R. Chowdhary, Professor & Campus Director, JIETCOE JIET College of Engineering Email: kr.chowdhary@jietjodhpur.ac.in Web-Page: http://www.krchowdhary.com July 11, 2016

More information

SPIR-V Extended Instructions for GLSL

SPIR-V Extended Instructions for GLSL SPIR-V Etended Instructions for GLSL John Kessenich, Google Version 1.00, Revision 7 August 8, 2018 SPIR-V Etended Instructions for GLSL Copyright 2014-2018 The Khronos Group Inc. All Rights Reserved.

More information

The Graphing Calculator

The Graphing Calculator Chapter 23 The Graphing Calculator To display the calculator, select Graphing Calculator from the Window menu. The calculator is displayed in front of the other windows. Resize or re-position the Graphing

More information

Script started on Thu 25 Aug :00:40 PM CDT

Script started on Thu 25 Aug :00:40 PM CDT Script started on Thu 25 Aug 2016 02:00:40 PM CDT < M A T L A B (R) > Copyright 1984-2014 The MathWorks, Inc. R2014a (8.3.0.532) 64-bit (glnxa64) February 11, 2014 To get started, type one of these: helpwin,

More information

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Appendix A Glossary of Matlab Commands Mathematical Operations + Addition. Type help plus

More information

How to Design Programs Languages

How to Design Programs Languages How to Design Programs Languages Version 4.1 August 12, 2008 The languages documented in this manual are provided by DrScheme to be used with the How to Design Programs book. 1 Contents 1 Beginning Student

More information

Basic types and definitions. Chapter 3 of Thompson

Basic types and definitions. Chapter 3 of Thompson Basic types and definitions Chapter 3 of Thompson Booleans [named after logician George Boole] Boolean values True and False are the result of tests are two numbers equal is one smaller than the other

More information

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano MATLAB Lesson I Chiara Lelli Politecnico di Milano October 2, 2012 MATLAB MATLAB (MATrix LABoratory) is an interactive software system for: scientific computing statistical analysis vector and matrix computations

More information

Introduction to Matlab. Matlab variable types. Matlab variable types. Matlab variable types. Notes. Eugeniy E. Mikhailov. Lecture 02. Notes.

Introduction to Matlab. Matlab variable types. Matlab variable types. Matlab variable types. Notes. Eugeniy E. Mikhailov. Lecture 02. Notes. Introduction to Matlab Eugeniy E. Mikhailov The College of William & Mary Lecture 02 Eugeniy Mikhailov (W&M) Practical Computing Lecture 02 1 / 26 Matlab variable types Eugeniy Mikhailov (W&M) Practical

More information

GRAPH 4.4. Megha K. Raman APRIL 22, 2015

GRAPH 4.4. Megha K. Raman APRIL 22, 2015 GRAPH 4.4 By Megha K. Raman APRIL 22, 2015 1. Preface... 4 2. Introduction:... 4 3. Plotting a function... 5 Sample funtions:... 9 List of Functions:... 10 Constants:... 10 Operators:... 11 Functions:...

More information

Package FastImputation

Package FastImputation Type Package Package FastImputation March 12, 2017 Title Learn from Training Data then Quickly Fill in Missing Data Version 2.0 Date 2017-03-11 Author Stephen R. Haptonstahl Maintainer TrainFastImputation()

More information

x = 12 x = 12 1x = 16

x = 12 x = 12 1x = 16 2.2 - The Inverse of a Matrix We've seen how to add matrices, multiply them by scalars, subtract them, and multiply one matrix by another. The question naturally arises: Can we divide one matrix by another?

More information

Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning

Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning What is Algebra? An expression is a combination of numbers and operations that leads to a numerical

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how

More information

Excel Tool: Calculations with Data Sets

Excel Tool: Calculations with Data Sets Excel Tool: Calculations with Data Sets The best thing about Excel for the scientist is that it makes it very easy to work with data sets. In this assignment, we learn how to do basic calculations that

More information

Package softclassval

Package softclassval Type Package Title Soft Classification Performance Measures Package softclassval May 28, 2016 An extension of sensitivity, specificity, positive and negative predictive value to continuous predicted and

More information

A General Introduction to Matlab

A General Introduction to Matlab Master Degree Course in ELECTRONICS ENGINEERING http://www.dii.unimore.it/~lbiagiotti/systemscontroltheory.html A General Introduction to Matlab e-mail: luigi.biagiotti@unimore.it http://www.dii.unimore.it/~lbiagiotti

More information

Introduction to MATLAB

Introduction to MATLAB Outlines September 9, 2004 Outlines Part I: Review of Previous Lecture Part II: Part III: Writing MATLAB Functions Review of Previous Lecture Outlines Part I: Review of Previous Lecture Part II: Part III:

More information

Description/History Objects/Language Description Commonly Used Basic Functions. More Specific Functionality Further Resources

Description/History Objects/Language Description Commonly Used Basic Functions. More Specific Functionality Further Resources R Outline Description/History Objects/Language Description Commonly Used Basic Functions Basic Stats and distributions I/O Plotting Programming More Specific Functionality Further Resources www.r-project.org

More information

MEI Desmos Tasks for AS Pure

MEI Desmos Tasks for AS Pure Task 1: Coordinate Geometry Intersection of a line and a curve 1. Add a quadratic curve, e.g. y = x² 4x + 1 2. Add a line, e.g. y = x 3 3. Select the points of intersection of the line and the curve. What

More information

Introduction to Engineering gii

Introduction to Engineering gii 25.108 Introduction to Engineering gii Dr. Jay Weitzen Lecture Notes I: Introduction to Matlab from Gilat Book MATLAB - Lecture # 1 Starting with MATLAB / Chapter 1 Topics Covered: 1. Introduction. 2.

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Eugeniy E. Mikhailov The College of William & Mary Lecture 02 Eugeniy Mikhailov (W&M) Practical Computing Lecture 02 1 / 27 Matlab variable types Eugeniy Mikhailov (W&M) Practical

More information

Introduction to MATLAB

Introduction to MATLAB Outlines January 30, 2008 Outlines Part I: Part II: Writing MATLAB Functions Starting MATLAB Exiting MATLAB Getting Help Command Window Workspace Command History Current Directory Selector Real Values

More information

The Straight Line. m is undefined. Use. Show that mab

The Straight Line. m is undefined. Use. Show that mab The Straight Line What is the gradient of a horizontal line? What is the equation of a horizontal line? So the equation of the x-axis is? What is the gradient of a vertical line? What is the equation of

More information

Welcome. Please Sign-In

Welcome. Please Sign-In Welcome Please Sign-In Day 1 Session 1 Self-Evaluation Topics to be covered: Equations Systems of Equations Solving Inequalities Absolute Value Equations Equations Equations An equation says two things

More information

PIV Programming. Today s Contents: 1. Matlab Programming 2. An example of PIV in Matlab code 3. EDPIV 4. PIV plugin for ImageJ 5.

PIV Programming. Today s Contents: 1. Matlab Programming 2. An example of PIV in Matlab code 3. EDPIV 4. PIV plugin for ImageJ 5. PIV Programming Last Class: 1. Introduction of μpiv 2. Considerations of Microscopy in μpiv 3. Depth of Correlation 4. Physics of Particles in Micro PIV 5. Measurement Errors 6. Special Processing Methods

More information

Introduction to MATLAB for CSE390

Introduction to MATLAB for CSE390 Introduction Introduction to MATLAB for CSE390 Professor Vijay Kumar Praveen Srinivasan University of Pennsylvania MATLAB is an interactive program designed for scientific computations, visualization and

More information

Package graphframes. June 21, 2018

Package graphframes. June 21, 2018 Type Package Title Interface for 'GraphFrames' Version 0.1.1 Package graphframes June 21, 2018 Maintainer Kevin Kuo A 'sparklyr' etension that provides

More information

Chapter 1 MATLAB Preliminaries

Chapter 1 MATLAB Preliminaries Chapter 1 MATLAB Preliminaries 1.1 INTRODUCTION MATLAB (Matrix Laboratory) is a high-level technical computing environment developed by The Mathworks, Inc. for mathematical, scientific, and engineering

More information

Package diagis. January 25, 2018

Package diagis. January 25, 2018 Type Package Package diagis January 25, 2018 Title Diagnostic Plot and Multivariate Summary Statistics of Weighted Samples from Importance Sampling Version 0.1.3-1 Date 2018-01-25 Author Jouni Helske Maintainer

More information

Statistical Data Analysis: Python Tutorial

Statistical Data Analysis: Python Tutorial 1 October 4, 2017 Statistical Data Analysis: Python Tutorial Dr A. J. Bevan, Contents 1 Getting started 1 2 Basic calculations 2 3 More advanced calculations 4 4 Data sets 5 4.1 CSV file input.............................................

More information

Package sankey. R topics documented: October 22, 2017

Package sankey. R topics documented: October 22, 2017 Package sankey October 22, 2017 Title Illustrate the Flow of Information or Material Version 1.0.2 Author Gábor Csárdi, January Weiner Maintainer Gábor Csárdi Description Plots

More information

Package fastdummies. January 8, 2018

Package fastdummies. January 8, 2018 Type Package Package fastdummies January 8, 2018 Title Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables Version 1.0.0 Description Creates dummy columns from columns that have

More information

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0 Type Package Title Power Analysis for AB Testing Version 0.1.0 Package pwrab June 6, 2017 Maintainer William Cha Power analysis for AB testing. The calculations are based

More information

Consider this m file that creates a file that you can load data into called rain.txt

Consider this m file that creates a file that you can load data into called rain.txt SAVING AND IMPORTING DATA FROM A DATA FILES AND PROCESSING AS A ONE DIMENSIONAL ARRAY If we save data in a file sequentially than we can call it back sequentially into a row vector. Consider this m file

More information

Package msda. February 20, 2015

Package msda. February 20, 2015 Title Multi-Class Sparse Discriminant Analysis Version 1.0.2 Date 2014-09-26 Package msda February 20, 2015 Author Maintainer Yi Yang Depends Matri, MASS Efficient procedures for computing

More information

EXCEL HINTS. Navigation Nomenclature (for this class)

EXCEL HINTS. Navigation Nomenclature (for this class) EXCEL HINTS D. J. Dal Bello, revised July 2006 The purpose of this handout is to provide an introduction to, and hints on, using Microsoft Excel. Experimenting with Excel (or any computer program) is the

More information

ArcGIS Enterprise Building Raster Analytics Workflows. Mike Muller, Jie Zhang

ArcGIS Enterprise Building Raster Analytics Workflows. Mike Muller, Jie Zhang ArcGIS Enterprise Building Raster Analytics Workflows Mike Muller, Jie Zhang Introduction and Context Raster Analytics What is Raster Analytics? The ArcGIS way to create and execute spatial analysis models

More information

Simple Animations. Today s Topics. Reading Assignment

Simple Animations. Today s Topics. Reading Assignment Today s Topics Simple Animations Simple animations Buffered graphics Animations in Haskell Complex animations Lifting primitives to animations Behaviors Type classes, animations, and Behaviors Time translation

More information

TS Calc 1.6 User Guide

TS Calc 1.6 User Guide ! TS Calc 1.6 User Guide We Make Software - TensionSoftware.com TS Calc 2009-2018 Tension Software all rights reserved Every effort has been made to ensure that the information in this manual is accurate.

More information

Curriculum Map: Mathematics

Curriculum Map: Mathematics Curriculum Map: Mathematics Course: Honors Advanced Precalculus and Trigonometry Grade(s): 11-12 Unit 1: Functions and Their Graphs This chapter will develop a more complete, thorough understanding of

More information

Package catenary. May 4, 2018

Package catenary. May 4, 2018 Type Package Title Fits a Catenary to Given Points Version 1.1.2 Date 2018-05-04 Package catenary May 4, 2018 Gives methods to create a catenary object and then plot it and get properties of it. Can construct

More information

Package ECctmc. May 1, 2018

Package ECctmc. May 1, 2018 Type Package Package ECctmc May 1, 2018 Title Simulation from Endpoint-Conditioned Continuous Time Markov Chains Version 0.2.5 Date 2018-04-30 URL https://github.com/fintzij/ecctmc BugReports https://github.com/fintzij/ecctmc/issues

More information

Introduction to Programming and 4Algorithms Abstract Types. Uwe R. Zimmer - The Australian National University

Introduction to Programming and 4Algorithms Abstract Types. Uwe R. Zimmer - The Australian National University Introduction to Programming and 4Algorithms 2015 Uwe R. Zimmer - The Australian National University [ Thompson2011 ] Thompson, Simon Haskell - The craft of functional programming Addison Wesley, third

More information

Package nsprcomp. August 29, 2016

Package nsprcomp. August 29, 2016 Version 0.5 Date 2014-02-03 Title Non-Negative and Sparse PCA Package nsprcomp August 29, 2016 Description This package implements two methods for performing a constrained principal component analysis

More information

Package tidyimpute. March 5, 2018

Package tidyimpute. March 5, 2018 Title Imputation the Tidyverse Way Version 0.1.0 Date 2018-02-01 Package tidyimpute March 5, 2018 URL https://github.com/decisionpatterns/tidyimpute Functions and methods for imputing missing values (NA)

More information

Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Macro Programming Reference Guide. Copyright 2005 Scott Martinez Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions

More information

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y.

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y. 2 Second Derivatives As we have seen, a function f (x, y) of two variables has four different partial derivatives: (x, y), (x, y), f yx (x, y), (x, y) It is convenient to gather all four of these into

More information

TABLE OF CONTENTS CHAPTER 1 LIMIT AND CONTINUITY... 26

TABLE OF CONTENTS CHAPTER 1 LIMIT AND CONTINUITY... 26 TABLE OF CONTENTS CHAPTER LIMIT AND CONTINUITY... LECTURE 0- BASIC ALGEBRAIC EXPRESSIONS AND SOLVING EQUATIONS... LECTURE 0- INTRODUCTION TO FUNCTIONS... 9 LECTURE 0- EXPONENTIAL AND LOGARITHMIC FUNCTIONS...

More information

Package LaF. November 20, 2017

Package LaF. November 20, 2017 Type Package Title Fast Access to Large ASCII Files Version 0.8.0 Date 2017-11-16 Author Jan van der Laan Package LaF November 20, 2017 Maintainer Jan van der Laan Methods

More information

# Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4). use Math::Trig ':pi';

# Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4). use Math::Trig ':pi'; NAME Math::Trig - trigonometric functions SYNOPSIS use Math::Trig; $x = tan(0.9); $y = acos(3.7); $z = asin(2.4); $halfpi = pi/2; $rad = deg2rad(120); # Import constants pi2, pip2, pip4 (2*pi, pi/2, pi/4).

More information

Marmara University Faculty of Engineering Mechanical Engineering Department Lab7

Marmara University Faculty of Engineering Mechanical Engineering Department Lab7 Marmara University Faculty of Engineering Mechanical Engineering Department Lab7 1. Write a function FC.m that accepts temperature in degrees F and computes the corresponding value in degrees C. The relation

More information

Package float. August 6, 2018

Package float. August 6, 2018 Type Package Title 32-Bit Floats Version 0.2-0 Package float August 6, 2018 R comes with a suite of utilities for linear algebra with ``numeric'' (double precision) vectors/matrices. However, sometimes

More information

Automating Distributed Raster Analysis using the Image Server REST API. Jie Zhang Zikang Zhou Demo Theater 2 - Oasis 1

Automating Distributed Raster Analysis using the Image Server REST API. Jie Zhang Zikang Zhou Demo Theater 2 - Oasis 1 Automating Distributed Raster Analysis using the Image Server REST API Jie Zhang Zikang Zhou Demo Theater 2 - Oasis 1 What is Distributed Raster Analysis? From 10.5, ArcGIS has a new way to create and

More information

Computer Programming in MATLAB

Computer Programming in MATLAB Computer Programming in MATLAB Prof. Dr. İrfan KAYMAZ Atatürk University Engineering Faculty Department of Mechanical Engineering What is a computer??? Computer is a device that computes, especially a

More information

Package roperators. September 28, 2018

Package roperators. September 28, 2018 Type Package Package roperators September 28, 2018 Title Additional Operators to Help you Write Cleaner R Code Version 1.1.0 Maintainer Ben Wiseman Provides string arithmetic,

More information

Pre-Calculus 11: Final Review

Pre-Calculus 11: Final Review Pre-Calculus 11 Name: Block: FORMULAS Sequences and Series Pre-Calculus 11: Final Review Arithmetic: = + 1 = + or = 2 + 1 Geometric: = = or = Infinite geometric: = Trigonometry sin= cos= tan= Sine Law:

More information

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers

POLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers POLYMATH VERSION 4.1 Provides System Printing from Windows 3.X, 95, 98 and NT USER-FRIENDLY NUMERICAL ANALYSIS PROGRAMS - SIMULTANEOUS DIFFERENTIAL EQUATIONS - SIMULTANEOUS ALGEBRAIC EQUATIONS - SIMULTANEOUS

More information

Package crossword.r. January 19, 2018

Package crossword.r. January 19, 2018 Date 2018-01-13 Type Package Title Generating s from Word Lists Version 0.3.5 Author Peter Meissner Package crossword.r January 19, 2018 Maintainer Peter Meissner Generate crosswords

More information

2.2 Limit of a Function and Limit Laws

2.2 Limit of a Function and Limit Laws Limit of a Function and Limit Laws Section Notes Page Let s look at the graph y What is y()? That s right, its undefined, but what if we wanted to find the y value the graph is approaching as we get close

More information

Computing Fundamentals

Computing Fundamentals Computing Fundamentals Salvatore Filippone salvatore.filippone@uniroma2.it 2012 2013 (salvatore.filippone@uniroma2.it) Computing Fundamentals 2012 2013 1 / 18 Octave basics Octave/Matlab: f p r i n t f

More information

MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences. Introductory remarks

MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences. Introductory remarks MATLAB Workshop Dr. M. T. Mustafa Department of Mathematical Sciences Introductory remarks MATLAB: a product of mathworks www.mathworks.com MATrix LABoratory What can we do (in or ) with MATLAB o Use like

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical descriptions of geometric changes,

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Computer Graphics Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical

More information

Package stapler. November 27, 2017

Package stapler. November 27, 2017 Version 0.6.3 Package stapler November 27, 2017 Title Simultaneous Truth and Performance Level Estimation An implementation of Simultaneous Truth and Performance Level Estimation (STAPLE) .

More information

Package zip. R topics documented: March 11, Title Cross-Platform 'zip' Compression Version 2.0.1

Package zip. R topics documented: March 11, Title Cross-Platform 'zip' Compression Version 2.0.1 Title Cross-Platform 'zip' Compression Version 2.0.1 Package zip March 11, 2019 Author Gábor Csárdi, Kuba Podgórski, Rich Geldreich Maintainer Gábor Csárdi Cross-Platform 'zip'

More information

(5) ifit/math: «One Class to do some Math» God damn it! Just compute it! ifit workshop NBI Jan 2012 Math - 1

(5) ifit/math: «One Class to do some Math» God damn it! Just compute it! ifit workshop NBI Jan 2012 Math - 1 (5) ifit/math: «One Class to do some Math» God damn it! Just compute it! ifit workshop NBI Jan 2012 Math - 1 Math: perform mathematical operations seamlessly As we have seen there is a unique,

More information

An introduction to R WS 2013/2014

An introduction to R WS 2013/2014 An introduction to R WS 2013/2014 Dr. Noémie Becker (AG Metzler) Dr. Sonja Grath (AG Parsch) Special thanks to: Dr. Martin Hutzenthaler (previously AG Metzler, now University of Frankfurt) course development,

More information

5-2 Verifying Trigonometric Identities

5-2 Verifying Trigonometric Identities Verify each identity 1 (sec 1) cos = sin sec (1 cos ) = tan 3 sin sin cos 3 = sin 4 csc cos cot = sin 4 5 = cot Page 1 4 5 = cot 6 tan θ csc tan = cot 7 = cot 8 + = csc Page 8 = csc + 9 + tan = sec 10

More information

Functions and Inverses ID1050 Quantitative & Qualitative Reasoning

Functions and Inverses ID1050 Quantitative & Qualitative Reasoning Functions and Inverses ID1050 Quantitative & Qualitative Reasoning Function and Inverse Function Gun Analogy Functions take a number, perform an operation on it, and return another number. The inverse

More information

Package sessioninfo. June 21, 2017

Package sessioninfo. June 21, 2017 Title R Session Information Version 1.0.0 Package sessioninfo June 21, 2017 Author Gábor Csárdi, R core, Hadley Wickham, Winston Chang, Robert M Flight, Kirill Müller Maintainer Gábor Csárdi

More information

List of NEW Maths content

List of NEW Maths content List of NEW Maths content Our brand new Maths content for the new Maths GCSE (9-1) consists of 212 chapters broken up into 37 titles and 4 topic areas (Algebra, Geometry & Measures, Number and Statistics).

More information

A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING TABLE OF CONTENTS

A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING TABLE OF CONTENTS A GUIDE FOR USING MATLAB IN COMPUTER SCIENCE AND COMPUTER ENGINEERING MARC THOMAS AND CHRISTOPHER PASCUA TABLE OF CONTENTS 1. Language Usage and Matlab Interface 1 2. Matlab Global Syntax and Semantic

More information

SCAD Soft. Slope. User manual. Stability analysis of slopes. Version 1.5

SCAD Soft. Slope. User manual. Stability analysis of slopes. Version 1.5 SCAD Soft Slope Stability analysis of slopes Version 1.5 User manual UDC 539.3+624.014 Developed by M.A. Perelmuter, V.G. Fedorovsky «Slope». Stability analysis of slopes. USER MANUAL. Version 1.5. The

More information

MEI GeoGebra Tasks for AS Pure

MEI GeoGebra Tasks for AS Pure Task 1: Coordinate Geometry Intersection of a line and a curve 1. Add a quadratic curve, e.g. y = x 2 4x + 1 2. Add a line, e.g. y = x 3 3. Use the Intersect tool to find the points of intersection of

More information

I. This material refers to mathematical methods designed for facilitating calculations in matrix

I. This material refers to mathematical methods designed for facilitating calculations in matrix A FEW CONSIDERATIONS REGARDING MATRICES operations. I. This material refers to mathematical methods designed for facilitating calculations in matri In this case, we know the operations of multiplying two

More information

Section 4.1: Maximum and Minimum Values

Section 4.1: Maximum and Minimum Values Section 4.: Maimum and Minimum Values In this chapter, we shall consider further applications of the derivative. The main application we shall consider is using derivatives to sketch accurate graphs of

More information

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava' Type Package Title 'Java' Data Exchange for 'R' and 'rjava' Package jdx January 9, 2018 Description Simplifies and extends data exchange between 'R' and 'Java'. Version 0.1.0 License GPL (>= 2 BSD_3_clause

More information