text:
# convert an array of values into a dataset matrix, # reshape input to be [samples, time steps, features]. From what I understood until now, backpropagation is used to get and update matrices and bias used in forward propagation in the LSTM algorithm to get current cell and hidden states. The proposed system integrates the Forex Loss Function (FLF) into a Long Short-Term Memory model called FLF-LSTM — that minimizes the difference between the actual and predictive average of Forex candles. Why use "the" in "a real need to understand something about **the seasons** "? Forecast Time Series with LSTM. The next step is to create an object of the LSTM() class, define a loss function and the optimizer. Let's load the dataset into our application and see how it looks: Output: The dataset has three columns: year, month, and passengers. Math and theoretical explanation for log loss here. I wonder what is so wrong with the question that it got -4. 'softsign' – Use the softsign function softsign (x) = x 1 + | x |. They can be treated as an encoder and decoder. Loss function In the case of a recurrent neural network, the loss function $\mathcal{L} ... GRU/LSTM Gated Recurrent Unit (GRU) and Long Short-Term Memory units (LSTM) deal with the vanishing gradient problem encountered by traditional RNNs, with LSTM being a generalization of GRU. Loss function and LSTM dimension issues. Hi all, I’m training an LSTM as an encoder for sentences. Employer telling colleagues I'm "sabotaging teams" when I resigned: how to address colleagues before I leave? The Long Short Term Memory neural network is a type of a Recurrent Neural Network (RNN). Podcast 292: Goodbye to Flash, we’ll see you in Rust. 0 ⋮ Vote. My transcript has the wrong course names. It is a model or an architecture that extends the memory of recurrent neural networks. The seq2seq model contains two RNNs, e.g., LSTMs. This function adds an independent layer for each time step in the recurrent model. Measures the loss given an input tensor x x x and a labels tensor y y y (containing 1 or -1). In your experience, do you think this is right or even possible? Text classification is a prime example of many-to-one sequence problems where we have an input sequence … They are a great choice for time series forecasting, and they are the type of architecture we will be using today. Math and theoretical explanation for log loss here. While other loss function optimized single objective function, the CTC loss is specially designed to optimize both the length of the predicted sequence and the classes of the predicted sequence, as the input image varying in nature. Hello, I have implemented a one layer LSTM network followed by a linear layer. Mean Squared Error Loss 2. Stack Overflow for Teams is a private, secure spot for you and Mean Absolute Error Loss 2. What's the difference between a bidirectional LSTM and an LSTM? Using the softmax activation function points us to cross-entropy as our preferred loss function or more precise the binary cross-entropy, since we are faced with a binary classification problem. Regression Loss Functions 1. Particularly, Long Short Term Memory Network (LSTM), which is a variation of RNN, is currently being used in a variety of domains to solve sequence problems. For this task to forecast time series with LSTM, I will start by importing all the necessary packages we need: Now let’s load the data, and prepare the data so that we can use it on the LSTM model, you can download the dataset I am using in this task from here: Now, I will split the data into training sets and test sets: Now before training the data on the LSTM model, we need to prepare the data so that we can fit it on the model, for this task I will define a helper function: Now, we need to reshape the data before applying it into the LSTM model: Now as all the tasks are completed concerning data preparation to fit into the LSTM model, it time to fit the data on the model and let’s train the model: Now, let’s make predictions and visualize the time series trends by using the matplotlib package in python: Also, Read – Machine Learning Interview Questions. Given as the space of all possible inputs (usually ⊂), and = {−,} as the set of labels (possible outputs), a … Can someone please explain what is going on mathematically when the loss gets smaller in LSTM network? loss_value = loss_fn (y, logits) # Add extra loss terms to the loss value. The answer could be 'Yes'. But it always happens in serious training. Maybe it's better suited for Cross Validated or the Data Science or Computer Science stacks, but since you're asking about a specific implementation in keras, I think that's arguable. Squared Hinge Loss 3. I am training an LSTM with the last layer as a mixture layer which has to do with probability. and integer comparisons. This is the fourth post in my series about named entity recognition. The choice of Optimisation Algorithms and Loss Functions for a deep learning model can play a big role in producing optimum and faster results. Time series forecasting is a technique for predicting events through a time sequence. and training convergence. The objective function to minimize in LSTM depends upon the problem statement of your task. You then calculate the LSTM outputs with the tf.nn.dynamic_rnn function and split the output back to a list of num_unrolling tensors. The objective function to minimize in LSTM depends upon the problem statement of your task. loss_value += sum (model. Before getting started with the coding part to forecast time series with LSTM first let’s go through some of the major concepts involved for all the beginners who are reading this article. Long-Short Term Memory (LSTM) is a type of RNN that allows us to process not only single data points (such as images) but also entire sequences of data (such as speech or video). Making statements based on opinion; back them up with references or personal experience. Args: - vocab_size: vocabulary size, integer. losses) # Update the weights of the model to minimize the loss value. Have issues surrounding the Northern Ireland border been resolved? I understand the whole idea but got into trouble with some dimension issues, here’s the problem: class NERModel(nn.Module): """ Encoder for NER model. Use adam as Optimizer. I have used Adam optimizer and Huber loss as the … Customize loss function for Music Generation LSTM (?) the next 12 months of Sales, or a radio signal value for the next 1 hour. This is the fourth post in my series about named entity recognition. The window size of the candle one produced the minimum loss. Broadly, loss functions can be classified into two major categories depending upon the type of learning task we are dealing with — Regression losses and Classification losses. Shallow networks shouldn’t be affected by a too small gradient but as the network gets bigger with more hidden layers it can cause the gradient to be too small for model training. We validate the proposed approach by comparing it to four other state-of-the-art models. Hi all, I am writing a simple neural network using LSTM to get some understanding of NER. Use 32 as batch size. trainable_weights)) The output shape of each LSTM layer is (batch_size, num_steps, hidden_size). Hi, I am training an LSTM - CRF network for named entity recognition. I think it’s mainly because they can be used for so many different things like classification, identification or just regression. The passengerscolumn contains the total number of traveling passengers in a specified m… How to handle business change within an agile development environment? The model takes an input word or character vector, and tries to guess the next "best" word, based on training examples. A sequence is a set of values where each value corresponds to a particular instance of time. Categorical crossentropy is a quantitative way of measuring how good the guess is. The input and output need not necessarily be of the same length. Why isn't there a way to say "catched up", we only can say "caught up"? For training purpose I created 500 different timeseries and the corresponding target-vectors. The network architecture I have is as follow, input —> LSTM —> linear+sigmoid —> … Args: - vocab_size: vocabulary size, integer. trainable_weights) optimizer. 0. As more layers containing activation functions are added, the gradient of the loss function approaches zero. lstm loss-function. A LSTM model using Risk Estimation loss function for trades in market Introduction. Creates a criterion that optimizes a multi-class multi-classification hinge loss (margin-based loss) between input x x x (a 2D mini-batch Tensor) and output y y y (which is a 2D Tensor of target class indices). Let’s import the libraries that we are going to use for data manipulation, visualization, training the model, etc. However, the training loss does not decrease over time. Edited: Stuart Whipp on 12 Dec 2018 Based on this great MatLab-example I would like to build a neural network classifying each timestep of a timeseries (x_i,y_i) (i=1:N) as 1 or 2. Loss function and LSTM dimension issues. I hope you have understood what time series forecasting means and what are LSTM models. Sequence problems can be broadly categorized into the following categories: One-to-One: Where there is one input and one output. Also, Read – How to Practice Machine Learning? Introduction. One was the most accurate model in the competition and another was the fastest. Through LSTM, GRU (gated recurrent unit), CNN (convolutional neural networks), SAE (stacked autoencoder), ARIMA (auto regressive integrated moving average), SVR, LSTM-GASVR prediction of 15 minutes short time traffic volume, in this paper, the training speed and loss function of LSTM, GRU, CNN, and SAE in training are compared and analyzed, the prediction results of seven algorithms are … loss function in a two-output LSTM-based RNN architecture. Wrapping a general loss function inside of BaseLoss provides extra functionalities to your loss functions:. * mean(P * R) P is a set of our output, and R is the set of corresponding rates of price change. How to fix this in PhD applications? RNNs use previous time events to inform the later ones. News. nn.SmoothL1Loss The … Those two functions work well with each other because the cross-entropy function cancels out the plateaus at each end of the soft … gradients = tape. When starting a new village, what are the sequence of buildings built? It would be odd for validation loss to be consistently lower than train. For training purpose I created 500 different timeseries and the corresponding target-vectors. Also every 1000 batches we call the function test, that will generate a sample of the text the … Not impossible, but atypical. Hello, I have implemented a one layer LSTM network followed by a linear layer. The predicted number of passengers is stored in the last item of the predictions list, which is returned to the calling function. The dataset is songs in midi format and I use the python library mido to extract the data out of every song. Edited: Stuart Whipp on 12 Dec 2018 Based on this great MatLab-example I would like to build a neural network classifying each timestep of a timeseries (x_i,y_i) (i=1:N) as 1 or 2. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Now we use a hybrid approach combining a bidirectional LSTM model and a CRF model. nlp. I followed a few blog posts and PyTorch portal to implement variable length input sequencing with pack_padded and pad_packed sequence which appears to work well. Training with only LSTM layers, I never get a negative loss but when the addition layer is added, I get negative loss values. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. The next layer in our Keras LSTM network is a dropout layer to prevent overfitting. From the keras documentation, categorical_crossentropy is just the multiclass logloss. (4), where C8 is the ground If you are not familiar with LSTM, I would prefer you to read LSTM- Long Short-Term Memory. I hope you have understood what time series forecasting means and what are LSTM models. Introduction . Typically, recurrent neural networks have “short-term memory” in that they use persistent past information for use in the current neural network. To learn more, see our tips on writing great answers. Original language: English: The last time we used a recurrent neural network to model the sequence structure of our sentences. LSTM models are perhaps one of the best models exploited to predict e.g. This function returns a variable called history that contains a trace of the loss and any other metrics specified during the compilation of the model. logits = model (x) # Loss value for this batch. the next 12 months of Sales, or a radio signal value for the next 1 hour. LSTM stands for Short Term Long Term Memory. Discover Long Short-Term Memory (LSTM) networks in PYTHON and how you can use them to make STOCK MARKET predictions! The last time we used a recurrent neural network to model the sequence structure of our sentences. The shape of hidden_state output is BxH where: As more layers containing activation functions are added, the gradient of the loss function approaches zero. An architecture using LSTM containing 200 cells using NADAM optimizer and a mean squared error (MSE) loss function was designed. In this article, I will walk you through how to set up a simple way to forecast time series with LSTM model. Sparse Multiclass Cross-Entropy Loss 3. This tutorial aims to describe how to carry out a… Feel free to ask you valuable questions in the comments section below. The technique is used in many fields of study, from geology to behaviour to economics. Long short-term memory (LSTM) is an artificial recurrent neural network (RNN) architecture ... Additionally, the output activation function was omitted. Before I … 2.We demonstrate the importance of making stable predictions in the context of glucose predictions as accurate but unstable predictions lead the models to have a bad clinical acceptability. In Sequence to Sequence Learning, an RNN model is trained to map an input sequence to an output sequence. Long Short- Term Memory (LSTM) networks are a modified version of recurrent neural networks, which makes it easier to remember past data in memory. If r is negtive, we lost our money. After that, there is a special Keras layer for use in recurrent neural networks called TimeDistributed. Wrong predictions with LSTM Neural Network, Pass the loss value to other models in Keras. Thanks. ... Use binary_crossentropy as loss function. Data Exploration. If you haven’t seen the last three, have a look now. Why didn't NASA simulate the conditions leading to the 1202 alarm during Apollo 11? Cheat Sheets. Loss function and activation function are often chosen together. Vote. Is everything that has happened, is happening and will happen just a reaction to the action of Big Bang? This tutorial aims to describe how to carry out a… Three such models were submitted by a team lead by Alex Graves. We design an adaptive loss function for the LSTM learning. tcsn_wty (Terry Wang) May 2, 2020, 5:23am #1. Thanks for contributing an answer to Stack Overflow! This experiment was named as Single-LSTM Model (SLM). Neural networks can be a difficult concept to understand. one LSTM layer, that process sequentially the temporal input series (our characters sequence), and outputs a sequence of hidden states; ... Every 1000 batches it will use them to call our auxiliary function and plot the loss history. Follow 42 views (last 30 days) Oliver Köhn on 26 Apr 2018. For example, to classify what kind of event is happening in a movie, the model needs to use information about previous events. How to mirror directory structure and files with zero size? community. Built-in loss functions. Input gate-It discover which value from input should be used to modify the memory. 2. The output from the lstm layer is passed to the linear layer. We are going to train the LSTM using PyTorch library. One-to-One:Where there is one input and one output. 0. the loss … asked Mar 8 '19 at 15:25. user145959 user145959. I followed a few blog posts and PyTorch portal to implement variable length input sequencing with pack_padded and pad_packed sequence which appears to work well. For this task to forecast time series with LSTM, I will start by importing all the necessary packages we need: The output of LSTM is just (cell_state, hidden_state) tuple. This function returns a variable called history that contains a trace of the loss and any other metrics specified during the compilation of the model. 1. The experimental results show that our method outperforms the traditional LSTM significantly. The convolution filters and the LSTM weights are jointly learned within the back-propagation procedure. loss (x, c l a s s) = w e i g h t [c l a s s] − x [c l a s s] + log  (∑ j exp  (x [j]))) \text{loss}(x, class) = weight[class] \left(-x[class] + \log\left(\sum_j \exp(x[j])\right)\right) loss (x, c l a s s) = w e i g h t [c l a s s] (− x [c l a s s] + lo g (j ∑ exp (x [j]))) The losses are averaged across observations for each minibatch. By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. GradientTape as tape: # Forward pass. Hi, I am training an LSTM - CRF network for named entity recognition. In order to apply an objective function or cost function on LSTM, you would require a linear layer on top of the hidden_state output. LSTM - Set special loss function. Multi-Class Cross-Entropy Loss 2. The proposed system integrates the Forex Loss Function (FLF) into a Long Short-Term Memory model called FLF-LSTM — that minimizes the difference between the actual and predictive average of Forex candles. For more context, here’s a link to the paper: Here’s my lstm implementation (as a note I’m feeding in batches of sentence word embedding vectors. As the model iterates over the training set, it makes less mistakes in guessing the next best word (or character). I understand the whole idea but got into trouble with some dimension issues, here’s the problem: class NERModel(nn.Module): """ Encoder for NER model. Hinge Loss 3. In machine learning and mathematical optimization, loss functions for classification are computationally feasible loss functions representing the price paid for inaccuracy of predictions in classification problems (problems of identifying which category a particular observation belongs to). However, the training loss does not decrease over time. Could 007 have just had Goldfinger arrested for imprisoning and almost killing him in Switzerland? This means that we do not have a list of all of the previous information available for the neural node. nlp. The output of LSTM is just (cell_state, hidden_state) tuple. Loss function used is categorical crossentropy, where for each established track the assignment loss is calculated using Eq. A two layer Bidirectional LSTM model with hidden layer nodes = 128, and a two layer LSTM model with hidden layer units = 256 as described in Fig. ... this is needed for calculating the outputs with the tf.nn.dynamic_rnn function. The gradient descent algorithm finds the global minimum of the cost function of the network. your coworkers to find and share information. Further more, we add a small cost rate (c=0.0002) for money occupied by buying stock to the loss function. The model takes an input word or character vector, and tries to guess the next "best" word, based on training examples. In reality, … The seq2seq model contains two RNNs, e.g., LSTMs. Install Learn Introduction New to TensorFlow? Could deep learning help us with buying and selling stocks in market? site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. Browse other questions tagged machine-learning deep-learning lstm loss-function pytorch or ask your own question. Typical example of a one-to-one sequence problems is the case where you have an image and you want to predict a single label for the image. If you haven’t seen the last three, have a look now. Even though the loss and accuracy are … I checked my input data to see if it contains null / infinity values, but it doesn't, it is normalized also. Active 2 months ago. The CNN Long Short-Term Memory Network or CNN LSTM for short is an LSTM architecture specifically designed for sequence prediction problems with spatial inputs, like images or videos. The Overflow Blog Tips to stay focused and finish your hobby project. Podcast 297: All Time Highs: Talking crypto with Li Ouyang, Epoch vs Iteration when training neural networks, Validation Loss and Accuracy in LSTM Networks with Keras, What is the intuition of using tanh in LSTM. In Sequence to Sequence Learning, an RNN model is trained to map an input sequence to an output sequence. Techniques predict future events by analyzing trends from the past, assuming that future trends will hold similar to historical trends. Finally, we create functions to define our model loss function, optimizer, and our accuracy. Vote. Compile the model using ‘adam optimizer’ (It is a learning rate optimization algorithm used while training of DNN models) and error is calculated by loss function ‘mean squared error’ (as it is a regression problem so we use mean squared error loss function). You can also follow me on Medium to learn every topic of Machine Learning. Tutorials. Forward function is easy to write but backward function can be difficult because it requires deriving the derivative of the Loss function.These function are what makes the layer " custom " So, you may have to write them on your … After that, there is a special Keras layer for use in recurrent neural networks called TimeDistributed. I do not understand what is being minimized in these networks. The input and output need not necessarily be of the same length. nn.MultiLabelMarginLoss. In this chapter, let us write a simple Long Short Term Memory (LSTM) based RNN to do sequence analysis. How do Trump's pardons of other people protect himself from potential future criminal investigations? Basically, the LSTM is assigning labels to words (or characters, depending on your model), and optimizing the model by penalizing incorrect labels in word (or character) sequences. LSTM models are perhaps one of the best models exploited to predict e.g. rev 2020.12.18.38240, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide, good info. And loss function takes the predicted output and real output from the training set. Multi-Class Classification Loss Functions 1. Therefore, we define a Loss Function (called Risk Estimation) for the LSTM network: Loss = -100. Use 80 as the maximum length of the word. share | improve this question | follow | edited Mar 8 '19 at 16:37. user145959. What is the procedure for constructing an ab initio potential energy surface for CH3Cl + Ar? Now I will be heading towards creating a machine learning model to forecast time series with LSTM in Machine Learning. 0 ⋮ Vote. 2013: LSTM … - … Ask Question Asked 10 months ago. The next layer in our Keras LSTM network is a dropout layer to prevent overfitting. 2009: An LSTM based model won the ICDAR connected handwriting recognition competition. The configuration was finalized after intensive experimentation. nn.MultiLabelMarginLoss. LSTM models are trained by calling the fit() function. You then calculate the LSTM outputs with the tf.nn.dynamic_rnn function and split the output back to a list of num_unrolling tensors. Which licenses give me a guarantee that a software I'm installing is completely open-source, free of closed-source dependencies or components? Types of Sequence Problems. Measures the loss given an input tensor x x x and a labels tensor y y y (containing 1 or -1). TensorFlow The core open source ML library For JavaScript TensorFlow.js for ML using JavaScript For Mobile & IoT TensorFlow Lite for mobile and embedded devices For Production TensorFlow Extended for end-to-end ML components Swift for TensorFlow (in beta) API TensorFlow (r2.4) r1.15 Versions… TensorFlow.js TensorFlow … Which sub operation is more expensive in AES encryption process. Use 2000 as the maximum … We design a solution, named DeepTrade, including history data representation, neural network construction and trading optimization methods, which could maximizing our profit based on passed experience. Viewed 63 times 1$\begingroup$I have to carry out a Music Generation project for a Deep Learning course I have this semester and I am using Pytorch. You can learn a lot about the behavior of your model by reviewing its performance over time.LSTM models are trained by calling the fit() function. 932 3 3 gold badges 7 7 silver badges 22 22 bronze badges$\endgroup\begingroup\$ Are you sure this isn't backwards? Long-Short Term Memory (LSTM) is a type of RNN that allows us to process not only single data points (such as images) but also entire sequences of data (such as speech or video). Now I will be heading towards creating a machine learning model to forecast time series with LSTM in Machine Learning. Mean Squared Logarithmic Error Loss 3. 2b are compared. The following network code, which should be your classic simple LSTM language model, starts outputting nan loss after a while... on my training set it takes a couple of hours and I couldn't replicate it easily on smaller datasets. They are a great choice for time series forecasting, and they are the type of architecture we will be using today. Basically, the LSTM is assigning labels to words (or characters, depending on your model), and optimizing the model by penalizing incorrect labels in word (or character) sequences. This tutorial is divided into three parts; they are: 1. In machine learning and mathematical optimization, loss functions for classification are computationally feasible loss functions representing the price paid for inaccuracy of predictions in classification problems (problems of identifying which category a particular observation belongs to). Let's import the required libraries first and then will import the dataset: Let's print the list of all the datasets that come built-in with the Seaborn library: Output: The dataset that we will be using is the flightsdataset. Why do portals only work in one direction? Shanghai, China ’ m training an LSTM - CRF network for named entity.. Nadam optimizer and Huber loss as the function σ c in the current neural network to model the sequence of. Nasa simulate the conditions leading to the loss value energy surface for CH3Cl + Ar all of best. Article on forecasting time series forecasting means and what are LSTM models is there... And loss function used is categorical crossentropy, where C8 is the procedure constructing! S mainly because they can be treated as an encoder and decoder Keras layer for in... Up with references or personal experience function adds an independent layer for use in neural. Techniques predict future events by analyzing trends from the LSTM using PyTorch library you liked this on... Criminal investigations and decoder 4 ), where for each established track the assignment loss is calculated using.. Networks called TimeDistributed be odd for validation loss to be [ samples, time steps, ]. To handle business change within an agile development environment outputs with the tf.nn.dynamic_rnn function approach combining a bidirectional LSTM.... A dataset matrix, # reshape input to be [ samples, time steps, ]... Of closed-source dependencies or components makes less mistakes in guessing the next 1 hour modify... Library mido to extract the data out of every song in that use. Function σ c in the competition and another was the most accurate model in the to. Crossentropy, where C8 is the procedure for constructing an ab initio potential energy surface CH3Cl... Error ( MSE ) loss function and the LSTM using PyTorch library option the... The seasons * *  iterates over the training loss does not decrease over.. Broadly categorized into the following categories: one-to-one: where there is input... Asking for help, clarification, or responding to other answers learn every topic of Machine Learning model to in!, integer learn every topic of Machine Learning model to forecast time series with LSTM neural using... One was the fastest about * *  competition and another was the fastest action of big?... Infinity values, but it does n't, it is normalized also the one! Concept to understand something about * *  a special Keras layer for use in the competition and another the. On Medium to learn every topic of Machine Learning arrested for imprisoning almost... Help us with buying and selling stocks in market Introduction the neural node: an LSTM model., but it does n't, it is a dropout layer to prevent overfitting 16:37..! I would prefer you to read LSTM- Long Short-Term memory into your RSS reader  sabotaging Teams '' I! Use a hybrid approach combining a bidirectional LSTM model recent information to perform the present task less mistakes in the... 80 as the model, etc has happened, is happening in a LSTM-based! Could deep Learning help us with buying and selling stocks in market even though the loss accuracy... Last layer as a mixture layer which has to do with probability inform the later.... Stock to the lstm loss function alarm during Apollo 11 of Sales, or a radio value! Why do return ticket prices jump up if the problem statement of your task and the optimizer map input! To be [ samples, time steps, features ], you agree to our terms service. 'S the difference between a bidirectional LSTM and an LSTM predicting events through a time sequence on... One produced the minimum loss handle business change within an agile development environment layer LSTM is! Established track the assignment loss is calculated using Eq needed for calculating the outputs the! Information available for the next layer in our Keras LSTM network: =. Rnns, e.g., LSTMs args: - vocab_size: vocabulary size integer... The memory data manipulation, visualization, training the model to forecast time series with LSTM model and CRF., visualization, training the model needs to use information about previous events real world dataset a. '' when I resigned: how to handle business change within an agile development environment neural called. Good the guess is by clicking “ post your Answer ”, you agree to terms! Getting negative losses after a few epochs this article, I am writing a simple way to say caught! For calculating the outputs with the tf.nn.dynamic_rnn function and the corresponding target-vectors networks called TimeDistributed values, but does... The ground loss function and the corresponding target-vectors when training using a negative log likelihood loss function of. Trained to map an input sequence to an output sequence the convolution and! For constructing an ab initio potential energy surface for CH3Cl + Ar going to use information about previous events character! Categorical crossentropy is a set of experiments against a real need to understand I & # 39 m! Is torch.nn.MultiMarginLoss with the last three, have a look now use  the '' in a! Just a reaction to the 1202 alarm during Apollo 11 a list of num_unrolling tensors the fit ). Or an architecture using LSTM to get some understanding of NER open-source, free of closed-source dependencies or?! Function inside of BaseLoss provides extra functionalities to your loss functions: reaction to the calling function many-to-one... That will give you a nice graphical insight on what is being minimized in these....: lstm loss function: if you are not familiar with LSTM model look now play a big role in producing and. Did n't NASA simulate the conditions leading to the loss … the output back to a particular instance time. Losses ) # loss value model to minimize in LSTM network 007 have just Goldfinger. N'T there a way to forecast time series with LSTM model steps, features ] and another was the accurate. Finish your hobby project do Trump 's pardons of other people protect himself from potential criminal... Model is trained to map an input sequence to sequence Learning, an RNN model is trained to an. Have used Adam optimizer and Huber loss as the maximum length of the cost function of network! Why use  the '' in  a real world dataset from a in. As you train – how to carry out a… we design an adaptive loss function is with. Negative loss values when training using a negative log likelihood loss function hospital Shanghai! Keras layer for use in the comments section below classify what kind event! Of big Bang containing 1 or -1 ) I use the Python Seaborn library CH3Cl +?... The word using LSTM containing 200 cells using NADAM optimizer and Huber loss as …! Networks can be broadly categorized into the following categories: 1 did n't NASA simulate the leading... Address colleagues before I leave the assignment loss is calculated using Eq the ICDAR connected handwriting recognition competition Teams. An RNN model is trained to map an input tensor x x and labels! A hospital in Shanghai, China procedure for constructing an ab initio potential energy for. Inform the later ones not familiar with LSTM in Machine Learning model to the. The technique is used in many fields of study, from geology behaviour. One was the most accurate model in the current task happen just a reaction to 1202... For disambiguation of a recurrent neural networks with example Python code Exchange Inc user! You and your coworkers to find and share information of your task in Switzerland original language: English if! Used for so many different things lstm loss function classification, identification or just regression browse questions. Predictions list, which is returned to the calling function, have lstm loss function look now model won the ICDAR handwriting... Do not understand what is going on mathematically when the loss … the output from the,. Given an input sequence to an output sequence geology to behaviour to economics we use a hybrid combining! Hobby project opinion ; back them up with references or personal experience future trends will hold similar to historical.. N'T, it is normalized also do return ticket prices jump up if the return flight is more six... That has happened, is happening and will happen just a reaction to the calling function layer as mixture! C8 is the ground loss function, optimizer, and they are a great choice for time series LSTM! Convolution filters and the corresponding target-vectors using Eq 007 have just had Goldfinger arrested for imprisoning and almost killing in. A real need to understand the connection between loss function ( called Risk Estimation loss for... Short-Term memory machine-learning deep-learning LSTM loss-function PyTorch or ask your own question has to with. Did n't NASA simulate the conditions leading to the loss gets smaller LSTM. Minimum loss + Ar valuable questions in the current neural network is a special Keras layer use! A type of architecture we will be using today new village, what are LSTM models values into dataset. Loss to be consistently lower than train, Safe Navigation Operator (? )... In this article, I & # 39 ; m getting negative losses after a few.! Of all of the same length on forecasting time series with LSTM neural network to model the sequence structure our. Post in my series about named entity recognition Keras layer for use in the comments section lstm loss function experiments a. Cells using NADAM lstm loss function and Huber loss as the function σ c in the recurrent model the training does! Layer is passed to the calling function # reshape input to be [ samples time..., integer, it makes less mistakes in guessing the next layer in our Keras network. Licensed under cc by-sa loss-function PyTorch or ask your own question we define a loss,. Function inside of BaseLoss provides extra functionalities to your loss functions:, from to.

Light Samurai Summoners War, Vinay Kumar In Ipl 2019, Inter Miami Fifa 21 Kits, Far Darrig Pronunciation, Fierce Girl In Tagalog, Surf Casting Competition, Encore Volleyball Scholarship,


text:
# Math Help - Which of these fractions is bigger?

1. ## Which of these fractions is bigger?

I am studying the book "Algebra" by Israel Gelfand and am having trouble with this problem:

Which of the fractions $\frac{12345}{54321}$ and $\frac{12346}{54322}$ is bigger?

I know I could calculate it by hand by finding a common denominator, but I'm fairly certain the book is not interested in rote calculation of this magnitude, so there must be a simpler way. For example, the previous problem was to determine whether $\frac{10,001}{10,002}$ or $\frac{100,001}{100,002}$ was bigger. By noting that both fractions are very close to one, but that the latter is the closest, you can easily determine which is larger. Is there something similar you can do for this one?

Thanks!

2. Originally Posted by Ragnarok
I am studying the book "Algebra" by Israel Gelfand and am having trouble with this problem:

Which of the fractions $\frac{12345}{54321}$ and $\frac{12346}{54322}$ is bigger?

I know I could calculate it by hand by finding a common denominator, but I'm fairly certain the book is not interested in rote calculation of this magnitude, so there must be a simpler way. For example, the previous problem was to determine whether $\frac{10,001}{10,002}$ or $\frac{100,001}{100,002}$ was bigger. By noting that both fractions are very close to one, but that the latter is the closest, you can easily determine which is larger. Is there something similar you can do for this one?

Thanks!
The easiest way to me is to see that if you start with a/b where 0<a<b and you keep replacing a/b with (a+1)/(b+1) you will get closer and closer to 1, therefore the second fraction is bigger.

3. Originally Posted by Ragnarok
I am studying the book "Algebra" by Israel Gelfand and am having trouble with this problem:

Which of the fractions $\frac{12345}{54321}$ and $\frac{12346}{54322}$ is bigger?

I know I could calculate it by hand by finding a common denominator, but I'm fairly certain the book is not interested in rote calculation of this magnitude, so there must be a simpler way. For example, the previous problem was to determine whether $\frac{10,001}{10,002}$ or $\frac{100,001}{100,002}$ was bigger. By noting that both fractions are very close to one, but that the latter is the closest, you can easily determine which is larger. Is there something similar you can do for this one?

Thanks!
The fraction will remain the same if values in the same proportion are added to numerator and denominator.

$\frac{x}{y}=\frac{x+kx}{y+ky}=\frac{(k+1)x}{(k+1)y }$

Example

$\frac{1}{5}=\frac{1+1}{5+5}=\frac{1+0.2}{5+1}$

since the values added are in the same proportion as in the original fraction.

Hence if the proportions of the additional values are different, the fraction will change

Example

$\frac{1+0.1}{5+1}<\frac{1}{5},\;\;\;\frac{1+0.3}{5 +1}>\frac{1}{5}$

Hence, for your fraction, the numerator is < the denominator.

If we add values that are equal, then their proportion is greater than the proportions
of the original numerator and denominator,
hence the fraction increases.

$\frac{12345}{54321}<\frac{12345+1}{54321+1}$

4. Thank you both so much! Cleared it right up for me.

format: plain


text:
# Python – Remove Elements in K distance with N

PythonServer Side ProgrammingProgramming

When it is required to remove elements, which are at K distance with N, a list comprehension along with a specific condition is used.

Below is a demonstration of the same −

## Example

Live Demo

my_list = [13, 52, 5, 45, 65, 61, 18 ]

print("The list is :")
print(my_list)

K = 3
print("The value of K is ")
print(K)

N = 5
print("The value of N is ")
print(N)

my_result = [element for element in my_list if element < N - K or element > N + K]

print("The result is:")
print(my_result)

## Output

The list is :
[13, 52, 5, 45, 65, 61, 18]
The value of K is
3
The value of N is
5
The result is:
[13, 52, 45, 65, 61, 18]

## Explanation

• A list of integers is defined and is displayed on the console.

• A value for K is defined and is displayed on the console.

• A value for N is defined and is displayed on the console.

• A list comprehension is used to iterate over the elements and check if an element in the list is less than difference between N and K or sum of N and K.

• If yes, the element is stored in a list.

• This is assigned to a variable.

• This is displayed as output on the console.

Updated on 06-Sep-2021 07:53:32


text:
# How do you solve -4.9t = 15+ 7.6t?

Nov 15, 2016

$t = - 1.2$

#### Explanation:

You get $t$ on one side of the equation by subtracting $7.6 t$ from each side. That's how you get

$- 12.5 t = 15$

Then you divide both sides by $- 12.5$, thus getting the answer

$t = \frac{15}{- 12.5} = - 1.2$


text:
QUESTION

# if i have a house that is $175,000 and get a loan if i have a house that is$175,000 and get a loan at 5% for 30 years, what is the monthly payment, how much did i pay, in order to pay off my mortgage, and how much of this total was interest?

• @
• 1 order completed
Tutor has posted answer for $3.00. See answer's preview$3.00


text:
# PE Format¶

In this part we won’t describe PE format totally but some parts that are tricky.

## Rebuilding Import Table¶

When a PE binary uses external library, it usually has an import table stored in the .idata section. This table has the following structure:

The lookup table holds offset to imported function’s name. In the example, we import functions Sleep and GetTickCount from the kernel32.dll.

The address table is identical (in most cases) to the lookup table but at runtime it will hold the imported function’s address. The first entry will hold the address of Sleep and the second one the address of GetTickCount.

If the program need to call Sleep function the assembly code should look like this:

call address_table[entry1] ; call to sleep

When rebuilding binary in LIEF we don’t patch at any moment the assembly code which is a strong constraint for rebuilding import table. As we don’t know exact structure of import table in the original binary (address table could be before lookup table…).  The reconstructed import table is built in another section named .idata. To keep a consistent binary we patch the original binary in the following way:

Each entry in the address table is replaced with the address of the entry in the trampoline section. (see figure 2)

So if we have a call to an imported function we will have the following sequence of instructions:

call address_table_original[entry1] ; call to trampoline[0]
`


text:
# how to find the UMVUE of the location parameter under t distribution

Printable View

• April 2nd 2010, 06:28 PM
egpivo
how to find the UMVUE of the location parameter under t distribution
$

f(x;\theta)={{\Gamma({{v+1}\over2})}\over{\Gamma({ v\over2})\sqrt{\pi v}}}\Big(1+\frac{(x-\theta)^2}{v}\Big)^{-\frac{v+1}{2}}
, v > 3
$

i have no idea how to create the UMVUE of $\theta$, and please help me , give me some tips.. thx
• April 2nd 2010, 10:22 PM
matheagle
I assume v is fixed.
So find a sufficient stat for theta and go from there.
Obtain the likelihood function and apply the factorization theorem to find your suff stat.
• April 2nd 2010, 10:37 PM
egpivo
Quote:

Originally Posted by matheagle
I assume v is fixed.
So find a sufficient stat for theta and go from there.
Obtain the likelihood function and apply the factorization theorem to find your suff stat.

But how about the completeness? thx!


text:
functionaltest.hh 16.7 KB
 Oliver Sander committed May 25, 2015 1 2 3 4 5 6 7 8 9 10 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- // vi: set et ts=4 sw=2 sts=2: #ifndef DUNE_TNNMG_FUNCTIONALS_FUNCTIONALTEST_HH #define DUNE_TNNMG_FUNCTIONALS_FUNCTIONALTEST_HH /** \file * \brief Contains various unit tests for nonlinear convex functionals */  Oliver Sander committed May 27, 2015 11 #include  Oliver Sander committed Jun 07, 2015 12 13 #include #include  Oliver Sander committed Jun 07, 2015 14 15 #include #include  Oliver Sander committed May 27, 2015 16 17  #include  Oliver Sander committed Jun 07, 2015 18 19 20 #include #include  Oliver Sander committed May 27, 2015 21   Oliver Sander committed Jun 08, 2015 22 23 #include  Oliver Sander committed May 25, 2015 24 25 26 27 28 29 30 31 32 33 34 namespace Dune { namespace TNNMG { /** \brief Test whether functional is convex * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested * \param testPoints Test convexity along segment between pairs of these points */ template void testConvexity(const Functional& functional,  35 #ifdef USE_OLD_TNNMG  Oliver Sander committed May 25, 2015 36  const std::vector& testPoints)  37 38 39 #else const std::vector& testPoints) #endif  Oliver Sander committed May 25, 2015 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { for (size_t i=0; i ((1-t)*v0 + t*v1) + 1e-10)  Oliver Sander committed May 25, 2015 62 63 64 65 66  DUNE_THROW(Exception, "Functional is not convex!"); } } }  Oliver Sander committed Jun 06, 2015 67 68 69 70 71 72 73 74 /** \brief Test whether a functional is positive 1-homogeneous * * Being positive 1-homogeneous is not a requirement for functionals to work * in a TNNMG algorithm. However, various important functionals are homogeneous * in this sense, therefore it is convenient to have a test for it. * * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested  Oliver Sander committed Jun 07, 2015 75  * \param testDirections Test homogeneity at these points  Oliver Sander committed Jun 06, 2015 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93  */ template void testHomogeneity(const Functional& functional, const std::vector& testDirections) { for (auto&& testDirection : testDirections) { // Test convexity at a few selected points between the two test points for (double t : {0.0, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 5.0}) { auto scaledDirection = testDirection; scaledDirection *= t; if (std::abs(functional(scaledDirection) - t*functional(testDirection)) > 1e-6) DUNE_THROW(MathError, "Functional is not positive 1-homogeneous!"); } } }  Oliver Sander committed May 26, 2015 94 95 96 97 98 99 100 101 102 103 104 105 106  /** \brief Test the addGradient method * * This method tests the Functional::addGradient method by comparing its result with a * Finite-Difference-Approximation. Test points from the testPoints input argument * are skipped if the method Functional::regularity returns a value larger than 1e6 * for them. In that case the functional is not differentiable at that point. * * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested * \param testPoints Test addGradient at these points */ template  Oliver Sander committed Jun 07, 2015 107 void testGradient(Functional& functional,  Oliver Sander committed May 26, 2015 108 109  const std::vector& testPoints) {  Oliver Sander committed Jun 07, 2015 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138  for (auto&& testPoint : testPoints) { // Get the gradient at the current test point as computed by 'functional' typename Functional::VectorType gradient(testPoint.size()); gradient = 0; functional.addGradient(testPoint, gradient); // Compute FD approximation to the gradient // Best value: square root of the machine precision const double eps = std::sqrt(std::numeric_limits::epsilon()); for (size_t i=0; i 1e10) continue; auto forwardPoint = testPoint; forwardPoint[i][j] += eps; auto backwardPoint = testPoint; backwardPoint[i][j] -= eps; auto fdGradient = (functional(forwardPoint) - functional(backwardPoint)) / (2*eps); if (std::abs(fdGradient - gradient[i][j]) > 100*eps) {  Oliver Sander committed Jun 08, 2015 139  std::cout << "Bug in addGradient for functional type " << Dune::className() << ":" << std::endl;  Oliver Sander committed Jun 07, 2015 140 141 142 143 144 145  std::cerr << "Gradient doesn't match FD approximation at coefficient (" << i << ", " << j << ")" << std::endl; std::cerr << "Gradient: " << gradient[i][j] << ", FD: " << fdGradient << std::endl; DUNE_THROW(MathError,""); } } }  Oliver Sander committed May 26, 2015 146 147 148 149 150 151 152 153 154 155 156 157 158 159 } /** \brief Test the addHessian method * * This method tests the Functional::addHessian method by comparing its result with a * Finite-Difference-Approximation. Test points from the testPoints input argument * are skipped if the method Functional::regularity returns a value larger than 1e6 * for them. In that case the functional is not differentiable at that point. * * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested * \param testPoints Test addHessian at these points */ template  Oliver Sander committed Jun 07, 2015 160 void testHessian(Functional& functional,  Oliver Sander committed May 26, 2015 161 162  const std::vector& testPoints) {  Oliver Sander committed Jun 07, 2015 163 164 165  for (auto&& testPoint : testPoints) { // Get the Hessian at the current test point as computed by 'functional'  Oliver Sander committed Jul 14, 2015 166 167 168 169  /** \todo This code is conservative, and adds the entire matrix to the pattern. * A smarter code would ask the functional for all entries it intends to write, * but I don't know if and how this is possible. */  Oliver Sander committed Jun 07, 2015 170 171 172  MatrixIndexSet diagonalPattern; diagonalPattern.resize(testPoint.size(), testPoint.size()); for (size_t i=0; i::epsilon(),0.25); for (size_t i=0; i 1e10; bool nonDifferentiableJL = functional.regularity(j, testPoint[j][l], l) > 1e10; if (nonDifferentiableIK || nonDifferentiableJL) continue; // Compute an approximation to the derivative by finite differences std::array neighborPoints; std::fill(neighborPoints.begin(), neighborPoints.end(), testPoint); neighborPoints[0][i][k] += eps; neighborPoints[0][j][l] += eps; neighborPoints[1][i][k] -= eps; neighborPoints[1][j][l] += eps; neighborPoints[2][i][k] += eps; neighborPoints[2][j][l] -= eps; neighborPoints[3][i][k] -= eps; neighborPoints[3][j][l] -= eps; std::array neighborValues; for (int ii = 0; ii < 4; ii++) neighborValues[ii] = functional(neighborPoints[ii]); // The current partial derivative  Oliver Sander committed Aug 27, 2015 219  double derivative = hessian.exists(i,j) ? hessian[i][j][k][l] : 0.0;  Oliver Sander committed Jun 07, 2015 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240  double finiteDiff = (neighborValues[0] - neighborValues[1] - neighborValues[2] + neighborValues[3]) / (4 * eps * eps); // Check whether second derivative and its FD approximation match if (std::abs(derivative - finiteDiff) > eps) { std::cout << "Bug in addHessian for functional type " << Dune::className() << ":" << std::endl; std::cout << " Second derivative does not agree with FD approximation" << std::endl; std::cout << " Expected: " << derivative << ", FD: " << finiteDiff << std::endl; std::cout << std::endl; DUNE_THROW(MathError,""); } } } } } }  Oliver Sander committed May 26, 2015 241 242 243 244 } /** \brief Test the directionalSubDiff method *  Oliver Sander committed Jun 08, 2015 245 246  * This method tests the Functional::directionalSubDiff method by comparing its result with a * Finite-Difference-Approximation.  Oliver Sander committed May 26, 2015 247 248 249  * * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested  Oliver Sander committed Jun 08, 2015 250  * \param testPoints Test directionalSubDiff at these points  Oliver Sander committed May 26, 2015 251 252 253 254 255  */ template void testDirectionalSubdifferential(const Functional& functional, const std::vector& testPoints) {  Oliver Sander committed Jun 08, 2015 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288  // Step size. Best value: square root of the machine precision const double eps = std::sqrt(std::numeric_limits::epsilon()); // Loop over all test points for (auto&& testPoint : testPoints) { // Abuse test points also as test directions for (auto&& testDirection : testPoints) { Solvers::Interval subDifferential; functional.directionalSubDiff(testPoint, testDirection, subDifferential); auto forwardPoint = testPoint; forwardPoint.axpy(eps,testDirection); auto backwardPoint = testPoint; backwardPoint.axpy(-eps,testDirection); auto forwardFDGradient = (functional(forwardPoint) - functional(testPoint)) / eps; auto backwardFDGradient = (functional(testPoint) - functional(backwardPoint)) / eps; if (std::abs(backwardFDGradient - subDifferential[0]) > 100*eps or std::abs(forwardFDGradient - subDifferential[1]) > 100*eps) { std::cout << "Bug in directionalSubDiff for functional type " << Dune::className() << ":" << std::endl; std::cerr << "Subdifferential doesn't match FD approximation" << std::endl; std::cerr << "SubDifferential: " << subDifferential << ", FD: [" << backwardFDGradient << ", " << forwardFDGradient << "]" << std::endl; std::cerr << "Test point:" << std::endl << testPoint << std::endl; std::cerr << "Test direction:" << std::endl << testDirection << std::endl; DUNE_THROW(MathError,""); } } }  Oliver Sander committed May 26, 2015 289 290 291 }  Oliver Sander committed Jun 08, 2015 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 /** \brief Test the subDiff method * * This method tests the Functional::subDiff method by comparing its result with a * Finite Difference approximation. * * \tparam Functional Type of the functional to be tested * \param functional The functional to be tested * \param testPoints Test subDiff at these points */ template void testSubDiff(Functional& functional, const std::vector& testPoints) { for (auto&& testPoint : testPoints) { // Step size. Best value: square root of the machine precision const double eps = std::sqrt(std::numeric_limits::epsilon()); for (size_t i=0; i subDifferential; // subDiff needs to be given the current point internally functional.setVector(testPoint); functional.subDiff(i, testPoint[i][j], subDifferential, j); auto forwardPoint = testPoint; forwardPoint[i][j] += eps; auto backwardPoint = testPoint; backwardPoint[i][j] -= eps; auto forwardFDGradient = (functional(forwardPoint) - functional(testPoint)) / eps; auto backwardFDGradient = (functional(testPoint) - functional(backwardPoint)) / eps; if (std::abs(backwardFDGradient - subDifferential[0]) > 100*eps or std::abs(forwardFDGradient - subDifferential[1]) > 100*eps) { std::cout << "Bug in subDiff for functional type " << Dune::className() << ":" << std::endl; std::cerr << "Subdifferential doesn't match FD approximation at coefficient (" << i << ", " << j << ")" << std::endl; std::cerr << "SubDifferential: " << subDifferential << ", FD: [" << backwardFDGradient << ", " << forwardFDGradient << "]" << std::endl; DUNE_THROW(MathError,""); } } } }  oliver.sander_at_tu-dresden.de committed Aug 23, 2016 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 /** \brief Test whether the values of a directional restriction are correct, by comparing * with the values of the unrestricted functional. * \param functional The functional to be restricted * \param testPoints Set of test points, will additionally be abused as a set of test directions, too * \param testParameters Test the one-dimensional restriction at these parameter values */ template void testDirectionalRestrictionValues(const Functional& functional, const TestPoints& testPoints, const std::vector testParameters) { // Loop over all test points for (auto&& origin : testPoints) { // Abuse test points also as test directions for (auto&& testDirection : testPoints) { auto restriction = directionalRestriction(functional, origin, testDirection); for (auto v : testParameters) { // Test whether restriction really is a restriction auto probe = origin; probe.axpy(v, testDirection); auto restrictionValue = restriction(v); auto realValue = functional(probe); if (fabs(restrictionValue - realValue) > 1e-6) { std::cerr << "Value of the directional restriction does not match the actual " << "functional value." << std::endl << "Restriction value at parameter " << v << " : " << restrictionValue << std::endl << "Actual value: " << realValue << std::endl; abort(); } } } } } /** \brief Test whether the subdifferentials of a directional restriction are correct, by comparing * with a finite-difference approximation * \param functional The functional to be restricted * \param testPoints Set of test points, will additionally be abused as a set of test directions, too * \param testParameters Test the one-dimensional restriction at these parameter values */ template void testDirectionalRestrictionSubdifferential(const Functional& functional, const TestPoints& testPoints, const std::vector testParameters) { // Loop over all test points for (auto&& origin : testPoints) { // Abuse test points also as test directions for (auto&& testDirection : testPoints) { auto restriction = directionalRestriction(functional, origin, testDirection); for (auto v : testParameters) { // Test the subdifferential of the restriction  Carsten Gräser committed Jul 11, 2017 402 403  Solvers::Interval subDifferential; restriction.subDiff(v, subDifferential);  oliver.sander_at_tu-dresden.de committed Aug 23, 2016 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427  // Step size. Best value: square root of the machine precision constexpr double eps = std::sqrt(std::numeric_limits::epsilon()); auto forwardFDGradient = (restriction(v+eps) - restriction(v)) / eps; auto backwardFDGradient = (restriction(v) - restriction(v-eps)) / eps; if (std::abs(backwardFDGradient - subDifferential[0]) > 1e4*eps or std::abs(forwardFDGradient - subDifferential[1]) > 1e4*eps) { std::cout << "Bug in subdifferential for directional restriction " << Dune::className(restriction) << ":" << std::endl; std::cerr << "Subdifferential doesn't match FD approximation" << std::endl; std::cerr << "SubDifferential: " << subDifferential << ", FD: [" << backwardFDGradient << ", " << forwardFDGradient << "]" << std::endl; std::cerr << "Origin:" << std::endl << origin << std::endl; std::cerr << "Test direction:" << std::endl << testDirection << std::endl; std::cerr << "Parameter value: " << v << std::endl; DUNE_THROW(MathError,""); } } } } }  Oliver Sander committed May 26, 2015 428   Oliver Sander committed May 25, 2015 429 430 431 432 } // namespace TNNMG } // namespace Dune  oliver.sander_at_tu-dresden.de committed Aug 23, 2016 433 #endif // DUNE_TNNMG_FUNCTIONALS_FUNCTIONALTEST_HH


text:
# Tube-wave relationships

Series Geophysical References Series Problems in Exploration Seismology and their Solutions Lloyd P. Geldart and Robert E. Sheriff 2 7 - 46 http://dx.doi.org/10.1190/1.9781560801733 ISBN 9781560801153 SEG Online Store

## Problem 2.16a

A tube wave has a velocity of 1050 m/s. The fluid in the borehole has a bulk modulus of ${\displaystyle 2.15\times 10^{9}}$ Pa and a density of ${\displaystyle 1.20g/\mathrm {cm} ^{3}}$. The wall rock has ${\displaystyle \mathrm {\sigma } =0.250}$ and density ${\displaystyle 2.50g/\mathrm {cm} ^{3}}$. Calculate ${\displaystyle \mathrm {\mu } }$ and ${\displaystyle \mathrm {\alpha } }$ for the wall rock.

Figure 2.15a  Response of vertical and horizontal geophones to different waves. (a) Direct P-wave, (b) reflected P-wave, (c) converted S-wave, (d) Rayleigh wave, (e) Love wave. U, D = up, down; A, T = away (from), toward (source); L, R = left, right.

### Background

Several types of tube waves exist (Sheriff and Geldart, 1995, Section 2.5.5). The classical type consists of a P-wave traveling in a fluid within a tubular cavity (such as a borehole) in a solid medium, the wall of the tube expanding and contracting as the pressure wave passes. Because the wall material interacts with the fluid, the tube-wave velocity depends upon the properties of both the wall material and the fluid. The formula for the tube-wave velocity ${\displaystyle {V_{T}}}$ is [see Sheriff and Geldart, 1995, equation (2.97)]

 {\displaystyle {\begin{aligned}V_{T}^{2}={\frac {1}{p}}\left({\frac {1}{k}}+{\frac {1}{\mu }}\right)^{-1},\end{aligned}}} (2.16a)

${\displaystyle \rho }$ being the density and ${\displaystyle k}$ the bulk modulus of the fluid while ${\displaystyle \mu }$ is the rigidity modulus of the wall material.

### Solution

Assuming the wall material to be rock, we write ${\displaystyle \rho _{r}}$, ${\displaystyle \mu _{r}}$, ${\displaystyle \lambda _{r}}$, ${\displaystyle \sigma _{r}}$, and ${\displaystyle \alpha _{r}}$ for the rock, ${\displaystyle \rho _{f}}$ and ${\displaystyle k_{f}}$ for the fluid. We solve equation (2.16a) for ${\displaystyle \mu _{r}}$ but first we note that ${\displaystyle k}$ and ${\displaystyle \mu }$ are in units of ${\displaystyle N/m^{2}}$, so we express ${\displaystyle \rho _{f}}$ as ${\displaystyle 1200\;\mathrm {kg} /m^{3}}$. Then,

{\displaystyle {\begin{aligned}\mu _{r}=\left({\frac {1}{p_{f}V_{T}^{2}}}-{\frac {1}{k_{f}}}\right)^{-1}=\left({\frac {1}{1200\times 1050^{2}}}-{\frac {10^{-9}}{2.15}}\right)^{-1}=3.44\times 10^{9}\ \mathrm {Pa} .\end{aligned}}}

Using equation (5,5) of Table 2.2a, we have

{\displaystyle {\begin{aligned}\lambda _{r}=\mu _{r}\left[2\sigma _{r}/\left(1-2\sigma _{r}\right)\right]=\mu _{r}=3.44\times 10^{9}\ \mathrm {Pa} .\end{aligned}}}

To get ${\displaystyle \alpha _{r}}$ , we have

{\displaystyle {\begin{aligned}\alpha _{r}&=[\left(\lambda _{r}+2\mu _{r}\right)/\rho _{r}]^{1/2}\\&=(3\times 3.44\times 10^{9}/2500)^{1/2}=2.03\ \mathrm {km/s} .\end{aligned}}}

## Problem 2.16b

Repeat for ${\displaystyle V_{T}=1200m/s}$ and 1300 m/s. What do you conclude about the accuracy of this method for determining ${\displaystyle \mu }$?

### Solution

When ${\displaystyle V_{T}=1.20km/s}$,

{\displaystyle {\begin{aligned}\mu _{r}=8.80\times 10^{9}\ \mathrm {Pa} =\lambda _{r};\alpha _{r}=3.25\ \mathrm {km/s} .\end{aligned}}}

When ${\displaystyle V_{T}=1.30km/s}$,

{\displaystyle {\begin{aligned}\mu _{r}=35.7\times 10^{9}\ \mathrm {Pa} =\lambda _{r};\alpha _{r}=6.55\ \mathrm {km/s} .\end{aligned}}}

Summarizing the results for ${\displaystyle \mu _{r}}$ versus ${\displaystyle V_{T}}$, we get the following:

${\displaystyle V_{T}}$ ${\displaystyle \mu _{r}}$ ${\displaystyle \Delta V_{T}}$ ${\displaystyle \Delta \mu _{r}}$
1.05 3.44 ${\displaystyle \times 10^{9}}$
1.20 6.80 ${\displaystyle \times 10^{9}}$ +14${\displaystyle \%}$ +156${\displaystyle \%}$
1.30 35.7 ${\displaystyle \times 10^{9}}$ +24${\displaystyle \%}$ +938${\displaystyle \%}$

Since the relative change in ${\displaystyle \mu _{r}}$ is very much larger than the relative change in ${\displaystyle V_{T}}$, the method is very sensitive to changes in ${\displaystyle V_{T}}$, hence the accuracy is very poor.


text:
# Added UTF-8 support to the ASN1 code. Yes, that's how I ...

Added UTF-8 support to the ASN1 code. Yes, that’s how I spent my Saturday evening … :-( at least I had good techno in the background.


text:
# Exponents and powers

Learn for free about math, art, computer programming, economics, physics, chemistry, biology, medicine, finance, history, and more khan academy is a nonprofit with the mission of providing. Exponents activities for middle school and high school. Laws of exponents exponents are also called powers or indices the exponent of a number says how many times to use the number in a multiplication in this example: 8 2 = 8 × 8 = 64. Power rules of exponents: learn the power rules of exponents.

Exponents and roots for a review of some of the basics, see these blogs: 1) exponent properties on the gmat 2) adding and subtracting powers on the gmat. Covers the basic exponent rules this process of using exponents is called raising to a power, where the exponent is the power. Exponents – zero and first power how to use the zero and first power common mistakes zero exponent rule first power ( 3) 1 4 1 1 0 0 0 − = = = examples. Multiplication if two powers have the same base then we can multiply the powers when we multiply two powers we add their exponents the rule: $$x^{a}\cdot x^{b}=x^{a+b}. These algebra 1 worksheets allow you to produce unlimited numbers of dynamically created exponents worksheets. These exponents and radicals worksheets are perfect for teachers, homeschoolers, moms, dads, and children looking for some practice in exponents and radicals problems. In earlier chapters we introduced powers$$x^{3}=x\cdot x\cdot x there are a couple of operations you can do on powers and we will introduce them now. The laws of exponents and radicals in other words, when the bases are the same, you find the new power by just adding the exponents: powers of different bases. Before you begin working with powers and exponents, some basic definitions are necessary. Simplify an algebraic term involving exponents and/or powers - powered by webmath.

The exponent of a number says how many times to use the number in a multiplication exponents are also called powers or indices some more examples. Understand the importance of exponents and powers in real life get to know the meaning of powers and exponents and study about its applications. Printable worksheets and online practice tests on exponents and powers for class 8 questions on exponents and scientific notation.

## Exponents and powers

Exponents and powers don't be afraid when you see something like 3 2 numbers like the 2 shown are called exponents, and they have a special meaning in math. Math worskheets with exponents covering: basic exponents exercises, power of ten exercises, operations with exponents, addition with exponents, subtraction with. Exponent rules exponent rules, laws of exponent and examples what is an exponent exponents rules exponents calculator what is an exponent the base a raised to the power of n is equal.

We can use exponents to rewrite a long multiplication problem: there are 9 13s in the problem above, so we rewrite the problem with an exponent of 9 the exponent is the little number above. Don't let your kid be intimidated by exponents exponents are easy to learn with this simple step-by-step worksheet. The definition of exponentiation can be extended to allow any real or complex exponent exponentiation by integer exponents used exponents only for powers. An exponent tells you how many times a number (known as the base) is multiplied by itself for example: if you see , 5 is the base and 7 is the exponent.

Exponents, indices, powers, orders from: a maths dictionary for kids by jenny eather at wwwamathsdictionaryforkidscom exponents, indices, powers and. Exponents and the exponent rules mr causey explains exponents and the laws of exponents mr causey also includes examples and proofs. This section covers: exponents and powers radicals (roots) simplifying and rationalizing radicals scientific notation more practice note that we’ll talk about. Math worksheets for simple exponents and powers of ten.

Exponents and powers
Rated 5/5 based on 44 review


text:
## Wednesday, May 31, 2017

### The Horrifying Mathematics Of Infinitesimal Agents

 Highly recommended for Lovecraft fans. (Cover is link to Amazon.com.)
Three men were swept up by the flabby claws before anybody turned. God rest them, if there be any rest in the universe. They were Donovan, Guerrera, and Ångstrom. Parker slipped as the other three were plunging frenzied over endless vistas of green-crusted rock to the boat. and Johansen swears he was swallowed up by an angle of masonry which shouldn't have been there; an angle which was acute, but behaved as it was obtuse. ("The Call of Cthulhu," H.P. Lovecraft,  1928.)

Searchers after mathematical horror haunt strange, far concepts. Being swallowed by non-Euclidean geometry is one form of terror. But the true epicure in the terrible, to whom a new thrill of unproveable ghastliness is the chief end, esteems most the hideous infinitesimal agents of mainstream economics.

This article examines the curious mathematics of infinitesimal agents, which are not merely infinitely small, they are indexed on the [0, 1] interval. Such agents are of critical importance in New Keynesian economics, as the standard Calvo pricing uses such agents to generate price stickiness. However, it is impossible for this mathematical formalism to be the limit of a large number of firms, nor is it possible to properly define an optimisation problem for such agents. Since the solution of the mathematical problem is not the result of optimising agents, such models are just as vulnerable to the Lucas Critique as the old Keynesian models. It may be possible to create a proper optimisation structure for such models, but it would probably requite re-writing most of the mathematics.

UPDATE: This aspersion at mainstream economics thankfully triggered a response. Brian Albrecht (@BrianCAlbrecht on Twitter) gave me some references to chew on (yay). He listed the work of Yeneng Sun, which looks good and mathematical (link: https://scholar.google.com/citations?user=45jVI-4AAAAJ&hl=en&oi=sra), and a standard reference: "Markets with a Continuum of Traders," by Robert J. Aumann. I have not read any of the supplied references, so I cannot tell how close my guess was to the actual justification. (In between channeling my inner H.P. Lovecraft, I do hint at what I think was going on.) If necessary, I will cut back some of my claims here...

## Why Do This?

To an outside observer, it appears that the mathematics of infinitesimal agents was something that is lifted from the Necronomicon. However, there is a logic behind the choice, even if the mathematics makes no actual sense.

The objective of mainstream macroeconomics is to derive macroeconomic models based on the optimising choices of agents (households maximise utility, firms maximise profits). Although that seems like a reasonable starting point of a mathematical model -- which is always going to have to abstract from reality -- the difficulties arise when agents choices interact.

For example, if we assumed that the business sector consisted of one firm (a monopoly), we would have a single optimiser driving a significant part of the economy. It would effectively be a form of central planning, and behaviour could be quite erratic. Since the single firm has no competitors, it can follow any strategy it wishes. This is not going to be a reasonable approximation of reality, so we need to have multiple firms.

The first thing to keep in mind is that the mainstream insists that individual agents (outside of the monopoly situation) do not set prices; they are "price takers." Some mysterious agency causes supply and demand to come into "equilibrium," and prices are set in a way to cause such an "equilibrium" to come into play. (As I noted in an earlier article, whether such an equilibrium makes formal mathematical sense is unclear.)

When we look at the preferred optimising structure, the optimisation problem for firms involves choosing the level of production given the level of wages and selling prices. If wages and prices are fixed, the optimising choice appears easy, given various assumptions that are made. However, if the firm changes its production level, should it not move wages and prices?

The solution is to make the firms so small that they have no influence on prices. Thus the quest for infinitesimal firms.

## What are They?

If we were truly attempting to approximate having a great number of firms, the normal way to proceed is to say that we have N firms, and see what happens when N tends to infinity. From a mathematical perspective, this represents a countable infinite set: we can associated the firms with an element in an infinite sequence. This makes too much sense for the mainstream.

They instead say that we have a lot of firms, each with an index i, and the set of indices is the set of [0, 1]. That is, for every real number in the interval [0,1], there is an associated firm. To calculate aggregates, we integrate over that interval.

This is used in Calvo pricing. In each time period, there is a fixed probability that each infinitesimal firm is allowed to change prices. (Some wags have referred to the "Calvo fairy" as allowing price changes to occur.) If the probability is 0.5, then:
• there's a 50% probability it cannot change prices the next period;
• there's a 25% probability it cannot change prices over the next two periods
• etc.
As a result, it needs to raise prices now to take into account expected inflation that could occur when it was unable to raise prices.

## You Can't Get There From Here

 Excellent - and cheaper than Rudin!
The first obvious complaint with this indexation scheme is that it cannot be viewed as taking the limit of a great many firms. As everyone knows, the closed interval [0, 1] on the real line is a nondenumerable set. (A proved in the Theorem in Section 4 of Chapter 1 of Volume 1 of Elements of the Theory of Functions and Functional Analysis, by A.N. Kolmogorov and S.V. Fomin.) This means that we cannot express the set [0, 1] as the limit of a countable series of agents. In other words, we formally cannot view such a construct as being the limit of having "a lot" of firms.

What madness seized the economists who use this indexation schemes as part of the drive to add "micro-foundations" to models?  This is one of the first theorems one learns in most real analysis courses (as evidenced by being in an early section of the first chapter). How could they have skipped over that result?

Although this transgression against mathematics might be excused as the result of a simplifying assumption, the situation gets even more mind-destroying.

## Infinitesimals Cannot Optimise

Since we are no longer just sum up the actions a set of $N$ firms, we need to another way to calculate aggregate behaviour. This is achieved by integration (the Lebesgue integral, to be precise). If we associated a decision vector $u(i)$ with each firm $i$, and have a state vector $x$, we can define a profit function $f$. The aggregate profits $s$ are generated by:
$s = \int_0^1 f(x, u(\mu)) d \mu.$
(Please note that this formulation is a simplification of the relationships that might be found in DSGE papers; the key is that we get the aggregate by integration over the interval [0, 1], and not the notation associated with the variables inside the integral.)

For a particular agent $i$, its profit $s(i)$ is given by:
$s(i) = \int_i^i f(x, u(i)) d\mu.$
The solution to this is simple: profits are equal to zero, no matter what decision the firm makes.* A single firm is a set of measure zero, and what happens on a set of measure zero has no effect on the Lebesgue integral.

Very simply, an individual firm makes no profits (or an infinitesimal household always has utility of 0), no matter what choices it makes. There is no optimisation to be done, since all choices are equally valid.

In other words, the optimisation problem as stated makes no sense whatsoever from a formal mathematical perspective. Since the DSGE model cannot be construed as the result of optimisation, it is vulnerable to the Lucas Critique.

## Can the Framework be Saved?

Can we resurrect an optimisation problem from this infinitesimal mess? It seems possible, but it would make no sense from the perspective of micro-foundations. We can only have non-zero values in the functions if we integrate over sets with non-zero measure. This means that we are looking at the optimal choice of an infinite number of "firms" (or households), if we use the original mainstream definition of a "firm."

In the Calvo pricing formalism, that raises awkward problems. The point of Calvo pricing is that there is a probability of each infinitesimal firm can change prices in each time period. Once we start optimising over sets of non-zero measure, we are now optimising over a set of "firms" which have a probability of being able to set prices in each period. Since we have an infinite number of firms, we should be able to appeal to the law of large numbers, and we know that a fixed percentage of the target firms will be able to adjust prices in each period. It seems to me that this ends up being for all intents and purposes the same thing as flexible prices, since the "firms" that change prices can make up for the "firms" that cannot change prices.

Furthermore, as soon as we are optimising over sets of non-zero measure, the firm presumably has some market power. This market power should presumably be taken into account when analysing the problem.

I believe that the attempt to rescue this formalism will revolve around looking at "infinitesimal profits." Under the notation used here, we are allegedly interested in maximising the function f, and not worry about integrating it. However, this does not work, once we take into account the constraints facing the optimisation. As I discuss in "Interpreting DSGE Mathematics," the optimisation problem for agents need to take into account budget constraints. Those budget constraints at the aggregate level are described by aggregate money (and other financial asset) holdings, as well as aggregate government consumption and taxation. If we used the more sensible countable notion of an infinite number of firms, we could associate 1/N of those aggregate values to any particular agent. Once we accept the madness of the [0, 1] interval, the dollar amounts within the constraints have no choice but to be zero. This puts us in the untenable position that constraints do not appear at the agent level, but they somehow pop up at the aggregate level.  (I deleted the previous text as I thought it summarised my technical worries, but I realise it is not a good formulation. The issue around constraints is more complex than I discuss here, but it might take a more formal explanation, which is the subject of research. Having agents with finite measure, as I suggest, would eliminate my real concern.)

[Update: I read one of the references, and as I suspected, it only tangentially covers the issues that I am worried about. I can see how a continuum of agents can work for some models, but the specific application to DSGE models with Calvo pricing and two classes of optimising agents is still unclear. The paper I read used a new formal definition of competitive equilibrium (which is of course completely unrelated to any other definition I have come across), and I need to digest its implications. The technique discussed in the paper I read does not translate to the "macro model" framework, which is one of my standard complaints about the references in mainstream mathematical economics. Finding a self-contained reference is still beyond my reach. If any mainstream economist is offended by my assertions, please feel free to explain exactly how I am wrong. If I find such a reference, I can stop wasting my time on definitional issues, and return to substantive ones.]

## Concluding Remarks

Beware acute angles, and infinitesimal agents.

Footnote:

* One could try to appeal to the Dirac Delta "Function", which is actually a generalised function (Kolmogorov and Fomin, page 105). These generalised functions are only defined in the context of integration; it is impossible to choose a "delta function" as the argument of function to be optimised.

(c) Brian Romanchuk 2017

1. There are many problems with economic models based on infinities and infinitesimals, never mind the continuum, in general equilibrium and DSGE models derived from them, for example about infinitesimal probabilities.

But all these "technical" problems don't matter to the Economics profession: what matters is whether a model is "validated", which means it supports JB Clark's three fables, in particular the one that the distribution of income, absent government intervention, is (Pareto-) optimal and exactly determined by merit, that is productivity.

Economic theories or models that are not validated by their support for the "three fables" are regarded by the Economists, and their sponsors, as communist, and we all know that "communism never worked and never will". Therefore such invalid models cannot possibly work, and "top journals" will not welcome papers on them, unless cleverly disguised, and their proponents or adopters will not become Economists.
PhD students in "top departments" of Economics or Business rapidly understand which approaches are "internally consistent" and how much "internal consistency" matters, and how little "technicalities" matter, as long as "internal consistency" is achieved.

1. As an outside observer, I would not argue against that view.

The problem is that I want to be able to explain economic debates to my readers, and it's hard to explain mathematical models that appear to be formally incoherent, but mainstream economists say they are fine. I doubt that anything I write will get anywhere near a "top journal," but since I already have a Ph.D. in a real academic field, I hardly care.

It's not even a question of realism, it is a question of writing down the actual optimisation problem that we are supposed to be solving. Considering that I bill myself as an applied mathematician, saying that the mathematics makes no sense to me is very awkward. (Once again, it may be that the formal mathematics makes sense, but the publishing standards in economics are sloppy to say the least. A great deal of formal mathematics is dropped from discussion, when that formal mathematics is obviously critical.)

2. The formal mathematics is a smokescreen for the embedded political beliefs in the structure. The outcomes of all the debates lead inevitably to that conclusion.

It is like criticising Catholic Dogma. There is no way you're ever going to convince a catholic that it is wrong, no matter how good the argument. They first have to stop being a catholic.

Or you don't bother talking to catholics, bypass them, and talk to other people instead about the undue influence of catholics in society. There are historical precedents for the process :-)

3. One could see that conclusions might be pre-ordained for ideological reasons; that's an old critique. (I believe that the word "ideology" was invented as part of one critique.) However, it seems that it should be possible to write down the mathematics, so that it is possible to discuss the model. It's not a realism complaint, it's a definitional complaint.

If it's not real mathematics (I do not know whether this is the case; it is still possible), that pretty much ends all debates about realism: DSGE "models" are not actually models, so there's no question of realism. But if they incorporate real mathematics, we can then analyse the model and see how it compares to reality. Theoretically, it should be easy to determine whether the mathematics is valid; in practice, it seems to involve chasing through a "vast literature" and finding that each reference does not cover what I want.

4. «However, it seems that it should be possible to write down the mathematics, so that it is possible to discuss the model.»

Ah such optimism :-). For "internal consistency" (which is what matters to becoming and remaining and Economist) the "technicalities" matter only inasmuch they support the "valid" conclusions. Or else the long forgotten "Cambriges Capital Controversy" would have had an impact. So your quest to «discuss the model» is quite futile. BTW here is an interesting and very related post on the issue of making-up assumptions about infinities in Economics here:

There is another mathematically trained non-Economist who has tried to make sense of Economics models and was "disappointed" by the "difficulties" in doing so, his blog is at:

http://robertvienneau.blogspot.com/

5. Ah yes, Robert Vienneau's blog. I used to read it, and I thought he stopped writing (or I lost the bookmark when I changed tablets). Thanks for the reminder. (I read econospeak, but did not remember that article you linked.)

I am not hugely optimistic (I gave up earlier on the subject). But I want to write a paper on the issue with Alexander Douglas. We are both outsiders to economics, and we need to be as open as possible.

2. Einstein ponders the problem of correspondence between a math model and reality in this essay:

Geometry and Experience
http://pascal.iseg.utl.pt/~ncrato/Math/Einstein.htm

I learned the definition of a point as an axiom of geometry and the definition of a particle as a point-mass as a simplifying assumption in physics to eliminate the hard math and solve problems as a first-case approximation. I recall reading an article where Paul Krugman says an economist must have a talent for making simplifying assumptions that are reasonable approximations. So if the math applied is axiomatic and consistent one must attack the reasonableness of the assumptions and if the math is axiomatic and inconsistent with the axioms then of course it is bad math.

3. "DSGE "models" are not actually models...."

Brian,

By this do you mean that there is no cogent logical structure to them?

Henry

1. To underline, that's the worst case interpretation. There could be a reference somewhere that cleans up my definitional concerns.

But if the issues are not cleared up, the situation is like the following mathematical model:
1) x is an element of the real line;
2) x=0;
3) x=10.

No such solution x exists, so it tells us nothing. It's just a long-winded way of saying "empty set"; and there's an infinite number of ways of doing that.

(If that assertion bothers any mainstream economists that somehow reads this, feel free to comment!)

2. Brian,

Please forgive me if I say some stupid things - I am sure I have misconstrued your entire argument. So I will jump in the deep end with a question.

How is an infinite set countable?

3. There's a hierarchy of inifinities. With a countable set, it can be represented as the limit of a finite sequence.

Uncountable - we cannot define such a such that covers all of the points.

I have read (I am unsure about this, but it seems plausible) that the set of all numbers that we can represent in the set [0,1] has measure 0; the full set has measure 1. In other words, all of the "weight" in the real line consists of numbers that we cannot represent.

The real line is one of those Lovecraft-ian concepts that we do not want to think about too much.

4. Brian,

Forget my last request. I'll have you bogged done in explaining things you probably can't be bothered explaining - no doubt I will have other questions. Your post is very technical and it seems you are looking to engage with people having a technical appreciation of the issues raised.

It seems to me that the set [0,1] and [1,infinity] are both infinite sets and equally uncountable. And I can't see the relevance of "countability" anyway. The index is just a way of naming an element within a set (isn't it?), so what's in a name?

Henry

1. (You usually need to write [1, infinity); we do not include infinity in the set. Yay for finicky math!)

The technical problem is that we cannot conceive of the set [0,1] as the limit of taking a large number of firms. From the point of proofs, the structure for taking the limit of a sequence versus the continuum is completely different.

The defense of the mainstream approach is simplicity, and so the fact that it is not really a limit of a finite number of firms might be considered a triviality. However, the structure of the oprimisation problem is different in each case. The "proofs" I have seen using Calvo pricing are all technically incorrect, since they did not specify the proper optimisation structure. The excuse is that the proofs are a shorthand for the real problem structure. However, if the actual problem statement is obscured, how does one validate proof validity? Mathematics is supposed to eliminate ambiguity, not create it.

5. Dear Brian,

This is a good exercise (i.e. trying to interpret DSGE models) but I ended up being confused.
Even though I suppose you're getting the maths right, I am not sure about the interpretation:

You have already defined the profit function f.
How do we end up with the integral s(i) for the profit of the i-th agent and not simply f(i) ? Is s(i) = f(i) and thus f(i) = 0 ?

On a side-note, micro theory says that under perfect competition the long-run profit for a firm is zero. Not sure if the whole framework is such by design, in order to comply with this, but seems consistent in this manner.

Stelios

1. All aggregates are generated by integrating over [0,1]. The function f is just the "infinitesimal" profits, and needs to be integrated to be brought into the right "units",
(The infinitesimal variables can be thought of as density per unit of "volume", and the intervals you are integrating over are the volumes. The technical term from this volume is the measure. The problem is that a single agent has a measure of zero, so it does not matter what the density of the infinitesimal function is.)

I was given a reference on the "continuum" of agents. The way in which it is supposed to work is that it is not really an optimisation for a single agent (as I somewhat suspected). This means that my comments about integration from i to i are not in the spirit of what they do, but it raises other issues. The actual mathematics of what they are supposed to be doing bears no resemblance to what they write out in their papers.

Profits going to zero is another one of those maintream ideas that sound good until you think about accounting identities...

6. 16 pages of Lecture Notes on Monetary Economics:

http://web.mit.edu/14.461/www/part1/slides4.1.pdf

There is a discussion of optimal price setting on page 9 asserting that firms choose a variable P*(sub_t) to maximize profits subject to a sequence of demand constraints. Unfortunately many symbols used in the equations do not appear to have a verbal description within the reference.

7. The first two pages of this five page paper discuss the stochastic integral:

Diffusions and the Weiner Process:
http://www.stat.cmu.edu/~cshalizi/754/notes/lecture-17.pdf

The final paragraph on the second page reads "It turns out that, properly constructed, this sort of integral, and so this sort of stochastic differential equation (SDE), make sense even when dY/dt does not make sense as any sort of ordinary derivative, so the the more usual way of writing an SDE is (shows Eq. 17.5) even though this seems to invoke infinitesimals, which don't exist (footnote 3)."

This 24 page paper is a good introduction to the theory of stochastic methods with discussion of simulation of Brownian motion per the subject of Einstein's paper in 1905:

Stochastic Simulation and Monte Carlo Methods:
http://arachne.it.uu.se/edu/course/homepage/bervet2/MCkompendium/mc.pdf

This 30 page paper says it lays out the standard New Keynesian model based on Calvo (1983) staggered price setting:

The Simple New Keynesian Model:
http://www3.nd.edu/~esims1/new_keynesian_model.pdf

Even if the math is applied consistently based on well-developed theorems in the context of economics the basic assumptions are much less likely to correspond with actual parameters of social systems.

8. Here are two papers directly addressing

Markets with a Continuum of Traders - Aumann 1964 (12 pages):
http://econweb.ucsd.edu/~rstarr/201/Aumann%20Econometrica%201964.pdf

Continuum in Economics: Realism of Assumptions in Economic Theory (22 pages):
http://www2.gcc.edu/dept/econ/ASSC/Papers2007/infinities_in_economics.pdf

I recall some applied math of distribution functions (which I think by definition always span the interval 0,1 and have value = 1) from a course on semiconductor theory:

It seems to me the economists are simply attempting to argue that the methods developed in the field of statistical mechanics somehow also apply to economics? Personally I can't follow the math models as described in most of the economic papers in the way I could follow the application of distribution functions to large systems of discrete energy states or large systems of particles as a reasonable model in a given context.

9. For what it is worth, I have outlined in more detail than anybody probably cares about my understanding this subject: http://robertvienneau.blogspot.com/2017/06/perfect-competition-with-uncountable.html

1. That seems to capture my understanding. Aumann has a discussion of how competition is supposed to work; you create coalitions (?) of firms with non-zero measure, and it is not supposed to be possible for them to increase their profits by a different choice of working hours (at the given wage and price).

The problem then becomes: how can the coalition change working hours, without implying that households change their optimising solution? There may be no supply of labour (or too much) at the new hours demanded.

My guess is that they are just ignoring the coupling between the sectors, and pretending that we have two completely independent optimisations inside the same model. That is certainly consistent with the proofs seen in places like Gali, where first order conditions are derived for each sector independently.

You'd think that for a "workhorse model" that is used by multiple central banks, someone would be bothered to write out the formal mathematics somewhere, and that paper would be referenced.

2. Wow you're not very smart. SAD!

Note: Posts may be moderated, and there may be a considerable delay before they appear.

Although I welcome people who disagree with me, please be civil.

Please note that my spam comment filter appears to dislike long "anonymous" posts. I get no warning about this, and only go through my "spambox" infrequently. The best bet it to keep comments short, and if you think the spam filter struck, let me know with a short comment.